fi.helsinki.cs.ohtu.mpeg2.util
Class StartCode

java.lang.Object
  extended by fi.helsinki.cs.ohtu.mpeg2.util.StartCode

public class StartCode
extends java.lang.Object

Represents a MPEG start code. Start codes are well-defined bit sequences that uniquely identify structures in the bitstream. Their purpose is to aid seeking, as they can be used to find the next desired structure, such as a group of pictures.


Field Summary
private  int encodedValue
           
static StartCode EXTENSION
          An extension not included in those specified in the MPEG-1 standard begins.
static StartCode GROUP_HEADER
          The header for a group of pictures begins.
static StartCode PACK
          The header for a program stream pack begins.
static StartCode PICTURE
          A picture header begins.
static StartCode PS_END
          A program stream ends.
static StartCode PS_SYSTEM_HEADER
          The header for a program stream system header begins.
static StartCode SEQUENCE_END
          A video sequence ends.
static StartCode SEQUENCE_ERROR
          An uncorrectable error has been detected.
static StartCode SEQUENCE_HEADER
          The header of a video sequence begins.
static StartCode USER_DATA
          User-defined data begins.
 
Constructor Summary
private StartCode(int encodedValue)
           
 
Method Summary
 boolean equals(java.lang.Object a)
          
 int hashCode()
          
static StartCode slice(int verticalPosition)
          A slice header begins.
 void writeTo(BitOutputStream stream)
          Writes the header to a bit stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PICTURE

public static final StartCode PICTURE
A picture header begins.


USER_DATA

public static final StartCode USER_DATA
User-defined data begins.


SEQUENCE_HEADER

public static final StartCode SEQUENCE_HEADER
The header of a video sequence begins.


SEQUENCE_ERROR

public static final StartCode SEQUENCE_ERROR
An uncorrectable error has been detected.


EXTENSION

public static final StartCode EXTENSION
An extension not included in those specified in the MPEG-1 standard begins.


SEQUENCE_END

public static final StartCode SEQUENCE_END
A video sequence ends.


GROUP_HEADER

public static final StartCode GROUP_HEADER
The header for a group of pictures begins.


PS_END

public static final StartCode PS_END
A program stream ends.


PACK

public static final StartCode PACK
The header for a program stream pack begins.


PS_SYSTEM_HEADER

public static final StartCode PS_SYSTEM_HEADER
The header for a program stream system header begins.


encodedValue

private int encodedValue
Constructor Detail

StartCode

private StartCode(int encodedValue)
Method Detail

slice

public static StartCode slice(int verticalPosition)
A slice header begins. All or part of the slices vertical position is encoded in the start code.

Parameters:
verticalPosition - The vertical position for the slice's start code.
Returns:
A StartCode instance corresponding to the given vertical position.

writeTo

public void writeTo(BitOutputStream stream)
             throws java.io.IOException
Writes the header to a bit stream.

Parameters:
stream - The stream to write to.
Throws:
java.io.IOException - Propagated from the stream write.

equals

public boolean equals(java.lang.Object a)

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()