fi.helsinki.cs.ohtu.mpeg2.video
Enum PictureCodingExtensionHeader.FrameStructure

java.lang.Object
  extended by java.lang.Enum<PictureCodingExtensionHeader.FrameStructure>
      extended by fi.helsinki.cs.ohtu.mpeg2.video.PictureCodingExtensionHeader.FrameStructure
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<PictureCodingExtensionHeader.FrameStructure>
Enclosing class:
PictureCodingExtensionHeader

public static enum PictureCodingExtensionHeader.FrameStructure
extends java.lang.Enum<PictureCodingExtensionHeader.FrameStructure>

Represents the allowed combinations of values for the picture structure, top field first, repeat first field and progressive frame fields. Together, they specify how the picture specified by this header should be mapped to output fields or frames.

All three of the flags must be zero for field pictures. This is enforced by only providing those combinations as valid enumerators. For frame pictures, the flags' interpretation varies according to whether the enclosing video sequences progressive sequence flag is set or not.

If the progressive sequence flag is unset, the top field first flag specifies whether the top field or the bottom field of the decoded frame should be the first field output by the decoding process. The repeat first field flag specifies whether after outputting the two fields additionally the first field (top or bottom) should be output again. Therefore, either two or three fields can be output from a single frame picture.

If the progressive sequence flag, on the other hand, is set, the flags determine whether the frame is output one, two or three times. If the repeat first field flag is unset, the frame is output one time. If it is set, the number of frames output depends on the top field first flag. If the top field first flag is unset, two frames are output. If it is set, three frames are output. Therefore, one to three decoded frames with identical picture content can be output from a single frame picture.

For progressive sequences, value FrameBottomFirstNoRepeat can't be used. This would correspond to zero decoded frames output for the frame picture in question, so it wouldn't make much sense either. This constraint can't be enforced in the scope of the PictureCodingExtensionHeader class, however.

The progressive frame flag (NOTE: distinct from the progressive sequence flag) specifies whether the two successively output fields (from the previous process) belong to the same point in time (1) or are separated by a field interval (0). This flag is only applicable to the frame picture case. Also, non-progressive frames can't repeat. Only combinations respecting these constraints are available as valid enumerators.


Enum Constant Summary
BOTTOM
          Bottom field picture in an interlaced frame.
FRAME_BOTTOM_FIRST_NO_REPEAT
          Frame picture with all three of the flags unset.
FRAME_BOTTOM_FIRST_NO_REPEAT_PROGRESSIVE
          Frame picture with both of the top field first and the repeat first field flags unset but progressive set.
FRAME_BOTTOM_FIRST_REPEAT
          Frame picture with the top field first flag unset but the repeat first field flag set.
FRAME_TOP_FIRST_NO_REPEAT
          Picture with the top field first flag set but the repeat first field and progressive flags unset.
FRAME_TOP_FIRST_NO_REPEAT_PROGRESSIVE
          Picture with the top field first and progressive flags set but the repeat first field flag unset.
FRAME_TOP_FIRST_REPEAT
          Frame picture with both the top field first and the repeat first field flags set.
TOP
          Top field picture in an interlaced frame.
 
Field Summary
private  UnsignedIntegerField pictureStructure
           
private  boolean progressive
           
private  boolean repeatFirstField
           
private  boolean topFieldFirst
           
 
Method Summary
(package private)  boolean canSpecifyChromaFormat420()
           
(package private)  boolean canSpecifyFramePredictionAndDCT()
           
static PictureCodingExtensionHeader.FrameStructure valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static PictureCodingExtensionHeader.FrameStructure[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 void writePictureStructureTo(BitOutputStream stream)
          Writes the picture structure field to a bit stream.
 void writeProgressiveTo(BitOutputStream stream)
          Writes the progressive frame flag to a bit stream.
 void writeRFFTo(BitOutputStream stream)
          Writes the repeat first field flag to a bit stream.
 void writeTFFTo(BitOutputStream stream)
          Writes the top field first flag to a bit stream.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TOP

public static final PictureCodingExtensionHeader.FrameStructure TOP
Top field picture in an interlaced frame. Implies that all three of the flags are unset.


BOTTOM

public static final PictureCodingExtensionHeader.FrameStructure BOTTOM
Bottom field picture in an interlaced frame. Implies that all three of the flags are unset.


FRAME_BOTTOM_FIRST_NO_REPEAT

public static final PictureCodingExtensionHeader.FrameStructure FRAME_BOTTOM_FIRST_NO_REPEAT
Frame picture with all three of the flags unset.


FRAME_TOP_FIRST_NO_REPEAT

public static final PictureCodingExtensionHeader.FrameStructure FRAME_TOP_FIRST_NO_REPEAT
Picture with the top field first flag set but the repeat first field and progressive flags unset.


FRAME_BOTTOM_FIRST_NO_REPEAT_PROGRESSIVE

public static final PictureCodingExtensionHeader.FrameStructure FRAME_BOTTOM_FIRST_NO_REPEAT_PROGRESSIVE
Frame picture with both of the top field first and the repeat first field flags unset but progressive set.


FRAME_TOP_FIRST_NO_REPEAT_PROGRESSIVE

public static final PictureCodingExtensionHeader.FrameStructure FRAME_TOP_FIRST_NO_REPEAT_PROGRESSIVE
Picture with the top field first and progressive flags set but the repeat first field flag unset.


FRAME_BOTTOM_FIRST_REPEAT

public static final PictureCodingExtensionHeader.FrameStructure FRAME_BOTTOM_FIRST_REPEAT
Frame picture with the top field first flag unset but the repeat first field flag set. Implies that the progressive frame flag is set.


FRAME_TOP_FIRST_REPEAT

public static final PictureCodingExtensionHeader.FrameStructure FRAME_TOP_FIRST_REPEAT
Frame picture with both the top field first and the repeat first field flags set. Implies that the progressive frame flag is set.

Field Detail

pictureStructure

private UnsignedIntegerField pictureStructure

topFieldFirst

private boolean topFieldFirst

repeatFirstField

private boolean repeatFirstField

progressive

private boolean progressive
Method Detail

values

public static PictureCodingExtensionHeader.FrameStructure[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PictureCodingExtensionHeader.FrameStructure c : PictureCodingExtensionHeader.FrameStructure.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PictureCodingExtensionHeader.FrameStructure valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

writePictureStructureTo

public void writePictureStructureTo(BitOutputStream stream)
                             throws java.io.IOException
Writes the picture structure field to a bit stream.

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

writeTFFTo

public void writeTFFTo(BitOutputStream stream)
                throws java.io.IOException
Writes the top field first flag to a bit stream.

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

writeProgressiveTo

public void writeProgressiveTo(BitOutputStream stream)
                        throws java.io.IOException
Writes the progressive frame flag to a bit stream.

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

writeRFFTo

public void writeRFFTo(BitOutputStream stream)
                throws java.io.IOException
Writes the repeat first field flag to a bit stream.

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

canSpecifyFramePredictionAndDCT

boolean canSpecifyFramePredictionAndDCT()

canSpecifyChromaFormat420

boolean canSpecifyChromaFormat420()