fi.helsinki.cs.ohtu.mpeg2.video
Class PictureHeader

java.lang.Object
  extended by fi.helsinki.cs.ohtu.mpeg2.video.PictureHeader

public class PictureHeader
extends java.lang.Object

Represents the baseline picture header. In MPEG-2 usage, this will be always followed by a PictureCodingExtensionHeader. Most of the actual header's fields don't make sense in MPEG-2 either, so they are not presented in the API.


Nested Class Summary
static class PictureHeader.CodingType
          Represents the allowed values for the coding type field.
 
Field Summary
(package private)  PictureHeader.CodingType codingType
           
(package private)  UnsignedIntegerField temporalReference
           
(package private)  UnsignedIntegerField vbvDelay
           
 
Constructor Summary
PictureHeader(int temporalReference, PictureHeader.CodingType codingType, int vbvDelay)
          Constructs a new instance.
 
Method Summary
 PictureHeader.CodingType getCodingType()
          Gets the picture coding type.
 long getTemporalReference()
          Gets the temporal reference.
 long getVBVDelay()
          Gets the video buffering verifier delay.
 void setCodingType(PictureHeader.CodingType codingType)
          Sets the picture coding type.
 void setTemporalReference(int temporalReference)
          Sets the temporal reference.
 void setVBVDelay(int vbvDelay)
          Sets the video buffering verifier delay.
 void writeTo(BitOutputStream stream)
          Writes the header to a bit stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

temporalReference

UnsignedIntegerField temporalReference

codingType

PictureHeader.CodingType codingType

vbvDelay

UnsignedIntegerField vbvDelay
Constructor Detail

PictureHeader

public PictureHeader(int temporalReference,
                     PictureHeader.CodingType codingType,
                     int vbvDelay)
Constructs a new instance.

Parameters:
temporalReference - Initial value for the temporal reference. Must fit into 10 bits.
codingType - Initial value for the coding type.
vbvDelay - Initial value for the video buffering verifier delay. Must fit into 16 bits.
Method Detail

getTemporalReference

public long getTemporalReference()
Gets the temporal reference.

Returns:
The reference. Only the lowest 10 bits will be meaningful.

setTemporalReference

public void setTemporalReference(int temporalReference)
Sets the temporal reference.

Parameters:
temporalReference - The new reference. Must fit into 10 bits.

getCodingType

public PictureHeader.CodingType getCodingType()
Gets the picture coding type.

Returns:
The type.

setCodingType

public void setCodingType(PictureHeader.CodingType codingType)
Sets the picture coding type.

Parameters:
codingType - The new type.

getVBVDelay

public long getVBVDelay()
Gets the video buffering verifier delay.

Returns:
The delay. Only the lowest 16 bits will be meaningful.

setVBVDelay

public void setVBVDelay(int vbvDelay)
Sets the video buffering verifier delay.

Parameters:
vbvDelay - The new delay. Must fit into 16 bits.

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.