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

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

public class VideoIndex
extends java.lang.Object

Indexes the Groups of Pictures within a Video Sequence.


Field Summary
static int MAGIC_NUMBER
           
 
Constructor Summary
VideoIndex(VideoDecoder videoDecoder)
           
 
Method Summary
 void addGroupOfPictures(long startPosition, int numPictures, int sequenceHeader)
           
 void addSequenceHeader(SequenceHeader sequenceHeader)
           
 void complete()
           
 int getBitRate()
           
 void getFirstSequenceHeader()
           
 int getFrameHeight()
           
 float getFrameRate()
           
 int getFrameWidth()
           
 int getGroupOfPicturesNumberForFrame(int frame)
          Gets the group of pictures for the given frame
 edu.umd.cfar.lamp.mpeg1.video.IndexerState getIndexerState()
           
 int[][] getIntraQuantizerMatrix(int frame)
           
 int getLastIOrPFrame(int n)
           
 int getLastSequenceHeader()
           
 int getMbWidth(int frame)
           
 int[][] getNonIntraQuantizerMatrix(int frame)
           
 int getNumFrames()
           
 byte getPictureCodingTypeOfFrame(int n)
           
 PelAspectRatio getPixelAspectRatio()
           
 long getPositionOfFrame(int n)
           
 SequenceHeader getSequenceHeader(int frame)
           
 int getStartFrame(int groupOfPicturesNumber)
           
 long getStartPosition(int groupOfPicturesNumber)
           
 VideoDecoder getVideoDecoder()
           
 VideoSource getVideoSource()
           
 void index()
           
 boolean indexed()
           
 void readIndex(java.io.DataInput in)
           
 java.lang.String toString()
           
 void writeIndex(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAGIC_NUMBER

public static int MAGIC_NUMBER
Constructor Detail

VideoIndex

public VideoIndex(VideoDecoder videoDecoder)
Method Detail

getLastSequenceHeader

public int getLastSequenceHeader()

writeIndex

public void writeIndex(java.io.DataOutput out)
                throws java.io.IOException,
                       MpegException
Throws:
java.io.IOException
MpegException

readIndex

public void readIndex(java.io.DataInput in)
               throws java.io.IOException,
                      MpegException
Throws:
java.io.IOException
MpegException

complete

public void complete()

getVideoDecoder

public VideoDecoder getVideoDecoder()

getVideoSource

public VideoSource getVideoSource()

getIndexerState

public edu.umd.cfar.lamp.mpeg1.video.IndexerState getIndexerState()

getMbWidth

public int getMbWidth(int frame)
               throws java.io.IOException,
                      MpegException
Throws:
java.io.IOException
MpegException

getIntraQuantizerMatrix

public int[][] getIntraQuantizerMatrix(int frame)
                                throws java.io.IOException,
                                       MpegException
Throws:
java.io.IOException
MpegException

getNonIntraQuantizerMatrix

public int[][] getNonIntraQuantizerMatrix(int frame)
                                   throws java.io.IOException,
                                          MpegException
Throws:
java.io.IOException
MpegException

index

public void index()
           throws java.io.IOException,
                  MpegException
Throws:
java.io.IOException
MpegException

indexed

public boolean indexed()

getFirstSequenceHeader

public void getFirstSequenceHeader()
                            throws java.io.IOException,
                                   MpegException
Throws:
java.io.IOException
MpegException

getSequenceHeader

public SequenceHeader getSequenceHeader(int frame)
                                 throws java.io.IOException,
                                        MpegException
Throws:
java.io.IOException
MpegException

addSequenceHeader

public void addSequenceHeader(SequenceHeader sequenceHeader)
                       throws java.io.IOException,
                              MpegException
Throws:
java.io.IOException
MpegException

addGroupOfPictures

public void addGroupOfPictures(long startPosition,
                               int numPictures,
                               int sequenceHeader)
                        throws java.io.IOException,
                               MpegException
Throws:
java.io.IOException
MpegException

getFrameWidth

public int getFrameWidth()
                  throws java.io.IOException,
                         MpegException
Throws:
java.io.IOException
MpegException

getFrameHeight

public int getFrameHeight()
                   throws java.io.IOException,
                          MpegException
Throws:
java.io.IOException
MpegException

getBitRate

public int getBitRate()
               throws java.io.IOException,
                      MpegException
Throws:
java.io.IOException
MpegException

getPixelAspectRatio

public PelAspectRatio getPixelAspectRatio()
                                   throws java.io.IOException,
                                          MpegException
Throws:
java.io.IOException
MpegException

getFrameRate

public float getFrameRate()
                   throws java.io.IOException,
                          MpegException
Throws:
java.io.IOException
MpegException

getGroupOfPicturesNumberForFrame

public int getGroupOfPicturesNumberForFrame(int frame)
                                     throws FrameNotFoundException
Gets the group of pictures for the given frame

Parameters:
frame - the frame
Returns:
0-based number of the Group Of Pictures containing the given (0-based) frame.
Throws:
FrameNotFoundException

getStartPosition

public long getStartPosition(int groupOfPicturesNumber)

getStartFrame

public int getStartFrame(int groupOfPicturesNumber)

getNumFrames

public int getNumFrames()

getPositionOfFrame

public long getPositionOfFrame(int n)
                        throws java.io.IOException,
                               MpegException
Throws:
java.io.IOException
MpegException

getLastIOrPFrame

public int getLastIOrPFrame(int n)
                     throws java.io.IOException,
                            MpegException
Throws:
java.io.IOException
MpegException

getPictureCodingTypeOfFrame

public byte getPictureCodingTypeOfFrame(int n)
                                 throws java.io.IOException,
                                        MpegException
Throws:
java.io.IOException
MpegException

toString

public java.lang.String toString()