[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

UMSH261VideoDecoder Object

The UMSH261VideoDecoder object decodes H.261 compressed video frames to various output formats. It overrides all methods from the UMSVideoDecoder base class, and adds one new method. The output formats it supports are the YUV420Plane, YUV422, RGB8Dither, and Mono formats.

For the RGB8Dither format, the only colormap size supported is 224, with a colormap index of 32. In other words, the colormap should be loaded in the upper 224 entries of a 256-entry X colormap. For the Mono format, the object supports all colormap sizes from 64 to 256. A requested colormap size below 64 will be clipped to 64; for a given size, all legal colormap indices are supported. The get_colormap method returns the correct colormap for either the RGB8Dither or the Mono format. Note that, for the Mono format, the object does not actually dither the decompressed Y component to get the output image, but just uses a colormap to change the range of values in a linear fashion.

The object supports resizing of the output frames. It can resize RGB8Dither and Mono output frames by a factor of 2; resizing of YUV420Plane or YUV422 output is not supported. For the RGB8Dither format, there are two quality levels available for the resizing; this is the only instance in which the set_output_quality method has an effect.

H.261 supports two native frame sizes: the CIF (Common Intermediate Format) size of 352x288 and the QCIF (quarter-CIF) size of 176x144. Because of the way the UMSVideoDecoder interface works, you must determine the correct frame size and set it before decoding the first frame.

The object does not support the "extra" modes that can be requested in the header of a H.261 frame, such as split-screen or the high-resolution, still-image mode. The H.261 document itself recommends JPEG for sending still images; Ultimedia Services includes a JPEG codec.

Also, while H.261 supports variable frame rates from about 7.5 fps to about 30 fps, the UMSH261VideoDecoder object does not "clock" the decoding of frames; it just decodes the next frame whenever the decompress_frame method is called.

The object adds just one method to the UMSVideoDecoder interface, the get_last_frame_type method. This method determines whether the last decoded frame was an I-frame or a P-frame. This information is not encoded in the headers of the compressed frames, and requires a little computation by the decoder. You should call the method just after a call to the decompress_frame method.

To learn more about the UMSH261VideoDecoder object, see:

For introductory information, see Video Codec Objects.

Enumeration Lists

To avoid name collision on defines, integer values have been captured as enumeration lists. The set of valid values from an enumerated list can vary with the application. The detailed method descriptions describe the valid or possible values for the specific use.

enum FrameType {
   IFrame,
   PFrame } 

Method Descriptions

The following method is implemented in this class, but is not part of the UMSVideoDecoder base class.

UMSVideoDecoder_ReturnCode get_last_frame_type(inout FrameType frame_type)

Description:

This method queries the frame type of the last decoded H.261 frame. It should be called just after a call to the decompress_frame method. If the decompress_frame method has not been called, or if the previous call to it failed, then the get_last_frame_type method will return Failure. If successful, the method will specify whether the last decoded frame was an intra frame (I-frame) or a predicted frame (P-frame).

Arguments:
inout FrameType frame_type A pointer to the variable to hold the frame type.
Return Values:

Success

Failure

InvalidArgument

For introductory information, see Video Codec Objects.


[ Previous | Next | Contents | Glossary | Home | Search ]