edu.umd.cfar.lamp.mpeg1.video
Class GroupOfPicturesIndex

java.lang.Object
  extended byedu.umd.cfar.lamp.mpeg1.video.GroupOfPicturesIndex

public class GroupOfPicturesIndex
extends java.lang.Object

Indexes within a Group of Pictures.


Constructor Summary
GroupOfPicturesIndex()
           
 
Method Summary
 void addPicture(long startPosition, long dataSize, byte type, int displayOrder)
          Adds a GroupOfPicturesIndexElement, which represents one picture (frame) in the Group of Pictures, to the index.
 java.util.Vector getElementsInCodingOrder()
           
 java.util.Vector getElementsInDisplayOrder()
           
 int getLastIOrPPicture()
           
 int getLastIOrPPicture(int n)
           
 long getPositionOfPicture(int n)
           
 long getPositionOfPictureInCodingOrder(int n)
           
 byte getTypeOfPicture(int n)
           
 byte getTypeOfPictureInCodingOrder(int n)
          Returns the type of the (0-based) frame in coding order.
 int mapCodingOrderToDisplayOrder(int codingOrder)
          Maps a (0-based) frame in coding order to a (0-based) frame in display order.
 int mapDisplayOrderToCodingOrder(int displayOrder)
          Maps a (0-based) frame in dislay order to a (0-based) frame in coding order.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupOfPicturesIndex

public GroupOfPicturesIndex()
Method Detail

addPicture

public void addPicture(long startPosition,
                       long dataSize,
                       byte type,
                       int displayOrder)
Adds a GroupOfPicturesIndexElement, which represents one picture (frame) in the Group of Pictures, to the index.

Parameters:
startPosition - the start position
dataSize - the data length
type -
displayOrder -

getPositionOfPicture

public long getPositionOfPicture(int n)
                          throws FrameNotFoundException
Parameters:
n - the frame
Returns:
the byte position (in the video stream) of the (zero-based) nth picture (frame) in this Group Of Pictures (in display order).
Throws:
FrameNotFoundException

getLastIOrPPicture

public int getLastIOrPPicture(int n)
                       throws FrameNotFoundException
Throws:
FrameNotFoundException

getLastIOrPPicture

public int getLastIOrPPicture()
                       throws FrameNotFoundException
Throws:
FrameNotFoundException

getPositionOfPictureInCodingOrder

public long getPositionOfPictureInCodingOrder(int n)
                                       throws FrameNotFoundException
Throws:
FrameNotFoundException

getElementsInDisplayOrder

public java.util.Vector getElementsInDisplayOrder()
Returns:
a Vector of GroupOfPicturesIndexElements in display order.

getElementsInCodingOrder

public java.util.Vector getElementsInCodingOrder()
Returns:
a Vector of GroupOfPicturesIndexElements in coding order.

mapDisplayOrderToCodingOrder

public int mapDisplayOrderToCodingOrder(int displayOrder)
                                 throws FrameNotFoundException
Maps a (0-based) frame in dislay order to a (0-based) frame in coding order.

Parameters:
displayOrder -
Returns:
Throws:
FrameNotFoundException

mapCodingOrderToDisplayOrder

public int mapCodingOrderToDisplayOrder(int codingOrder)
                                 throws FrameNotFoundException
Maps a (0-based) frame in coding order to a (0-based) frame in display order.

Parameters:
codingOrder -
Returns:
Throws:
FrameNotFoundException

getTypeOfPictureInCodingOrder

public byte getTypeOfPictureInCodingOrder(int n)
                                   throws FrameNotFoundException
Returns the type of the (0-based) frame in coding order.

Parameters:
n -
Returns:
Throws:
FrameNotFoundException

getTypeOfPicture

public byte getTypeOfPicture(int n)
                      throws FrameNotFoundException
Throws:
FrameNotFoundException

toString

public java.lang.String toString()