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

UMSVideoDecoder

The UMSVideoDecoder is a base class. Specific video decoder implementations inherit their interface from this class. Currently, the particular decoders in the class are the UMSJPEGVideoDecoder, UMSH261VideoDecoder, UMSH263VideoDecoder, UMSUMVideoDecoder, UMSIndeoVideoDecoder, UMSIndeo3VideoDecoder, and UMSRTV2VideoDecoder objects. These objects support JPEG/MJPEG, H.261, H.263, Ultimotion Matinee, Indeo 2.1, Indeo 3.1/3.2, and RTV 2.0/2.1 video. Codec developers are able to add new decoders to this class.

The UMSVideoDecoder object allows an application to be unaware of the particular decoder it is calling. The application can create a specific decoder either directly by the standard ObjectNameNew method or automatically using a configuration file and methods in the UMSVideoDecoderMClass metaclass.

Each real decoder implements the interface methods according to some common behavioral rules and the requirements of its core algorithms. Therefore, the basic behavior of UMSVideoDecoder methods is independent of the particular decoder; beyond that, the specific decoders share a common set of return codes and behave in a predictable fashion. Each decoder has its own algorithm-specific error traps. Also, different decoders can support different image formats, quality levels, and so forth. The returned parameters and error codes should allow the application to call methods in a codec-independent fashion.

The UMSVideoDecoder interface allows a decoder to support three useful functions beyond the usual decoder setup and decompression methods. First, it allows the decoder to implement different quality levels in its output frames; this allows a tradeoff between output quality and frame rate beyond the usual frame-skipping. Second, the interface allows for arbitrary resizing of the output frames. Third, an application can query a decoder for a list of the formats that the decoder supports.

The UMSVideoDecoder class is descended from the UMSNegotiatorSource class. Basically, the methods from the UMSVideoDecoder class that set and query image formats map to "generic" methods in the UMSNegotiatorSource class. The UMSNegotiatorSource and UMSNegotiatorSink classes provide a "generic" interface for connecting objects that produce data ("source" objects) and objects that consume data ("sink" objects).

Note: The UMSVideoDecoder class replaces the decoder objects in Ultimedia Services 1.0. The Ultimedia Services 1.0 decoder objects are still available but should not be used for further development.

To learn more about using the UMSVideoDecoder, see:

For introductory information, see Programming with Video Codec Objects.

Decoding Frames with the UMSVideoDecoder Object

To decode frames using the UMSVideoDecoder object, do the following:

  1. Create the particular decoder object and its associated filereader or collaboration (network connection) object.
  2. Open the input file or set up the network connection.
  3. Set the format of the output frames with the set_image_format method.
  4. If the image format is RGB8Dither, call set_colormap_attributes to set the dithering/colormap parameters, and then call get_colormap to get the decoder's colormap. Insert this colormap into the colormap for the output window.
  5. Set the native dimensions of the decompressed frames with the set_image_size method.
  6. Optionally, call the set_display_size method to set the size of the frames at the output of the decoder.
  7. Allocate memory for the compressed and decompressed frames, and insert them into SOM sequence structures. Optionally, use the get_max_output_buffer_size method to get the size of the output buffer.
  8. Optionally, call set_output_quality to set the quality of the output frames.
  9. Get each compressed frame and decompress it with the decompress_frame method.

When the video is finished, close the input file or network connection, free the input and output buffers and SOM sequence structures, and destroy the decoder and filereader or collaboration objects with _somFree.

Decoder Options and Defaults

The decoder options and defaults are as follows:

UMSH261VideoDecoder

Supported formats:

Frame Sizes:

Colormap Parameters:

Resizing:

Output Quality:

Defaults:

image format IF_RGB8Dither
colormap size 224
colormap base index 32
frame width x height 352 x 288
output quality 0

UMSH263VideoDecoder

Supported formats:

Frame Sizes:

Colormap Parameters:

IF_RGB8Dither size = 224
base index = 32
Mono size = 64
base index arbitrary

Resizing:

Output Quality: 2 levels of quality in resizing of IF_RGB8Dither

Defaults:

image format IF_RGB8Dither
colormap size 224
colormap base index 32
frame width x height 76 x 144
output quality 0

UMSIndeoVideoDecoder

Supported formats:

Colormap Parameters:

IF_RGB8Dither size = 64, 128, 256;
base index arbitrary

Resizing: arbitrary resizing of RGB formats; fast 1x2, 2x1, 2x2

Output Quality: 3 quality levels

Defaults:

image format IF_RGB8Dither
colormap size 128
colormap base index 128
frame width x height 320 x 240
output quality 0

UMSIndeo3VideoDecoder

Supported formats:

Colormap Parameters:

IF_RGB8Dither size = 128, 256; base index arbitrary

Resizing:

Output Quality

Defaults

image format IF_RGB8Dither
colormap size 128
colormap base index 128
frame width x height 320 x 240
output quality 0

UMSJPEGVideoDecoder

Supported formats:

Colormap Parameters:

IF_RGB8Dither size = 64, 128, 256; base index arbitrary
IF_RGB8Dither size = 224; base index = 32

Resizing: arbitrary resizing of RGB except for IF_RGB8Dither with colormap size = 224

Output Quality: one quality level

Defaults:

image format IF_RGB8Dither
colormap size 224
colormap base index 32
frame width x height 0 x 0
output quality 100

UMSRTV2VideoDecoder

Supported formats:

Colormap Parameters: IF_RGB8Dither size = 64, 128, 256; base index arbitrary

Resizing: arbitrary resizing of RGB formats; fast 1x2, 2x1, 2x2

Output Quality: 3 quality levels

Defaults:

image format IF_RGB8Dither
colormap size 128
colormap base index 128
frame width x height 256 x 240
output quality 100

UMSUMVideoDecoder

Supported formats:

Colormap Parameters: IF_RGB8Dither size = 64, 128, 256; base index arbitrary

Resizing: arbitrary resizing of RGB formats

Output Quality: one quality level

Defaults:

image format IF_RGB8Dither
colormap size 128
colormap base index 128
frame width x height 0 x 0
output quality 100

Tips for Using the UMSVideoDecoder

The following tips provide important information for using the UMSVideoDecoder:

For introductory information, see Programming with Video Codec Objects.


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