Image-Data Decompression

Your application uses a series of ICDecompressEx1MSSLQD functions to control the decompressor. The functions can help you perform the following tasks:

    Select a decompressor.

    Prepare the decompressor.

    Decompress the data.

    End decompression.

 

Your application handles decompression similarly to the way it handles compression, except that the input format is a compressed format and the output format is a displayable format. The input format for decompression is usually obtained from the stream header. After determining the input format, your application can use the ICLocate11FA8SY or ICOpenDVKIQD functions to find a decompressor that can handle it.

The ICDecompressEx1MSSLQD functions and macros are a superset of the ICDecompressVY6_HF function group and provide more capabilities. The functionality of ICDecompressEx, ICDecompressExBegin7.R0CL, ICDecompressExEnd8I4GAA, and ICDecompressExQuery7L78LW replaces that of the ICDecompress, ICDecompressBegin8ELI.K, ICDecompressEnd5OSW3L, and ICDecompressQuery8U1GEV functions. Use the ICDecompressEx functions and macros in place of the ICDecompress equivalents.

Decompressor and Decompression Format Selection

If you want to decompress data and your application requires a specific output format, you can use the ICDecompressExQuery7L78LW function to query the decompressor to determine if it supports the input and output formats.

If the output format is not important in your application, you need only find a decompressor that can handle the input format. To determine if a decompressor can handle the input format, use ICDecompressExQuery and specify NULL for the lpbiDst parameter. Your application can determine the buffer size needed for the data specifying the decompression format by sending the ICM_DECOMPRESS_GET_FORMAT_LAFBU message (or use the ICDecompressGetFormatSize5KXW0K macro). You can also send ICM_DECOMPRESS_GET_FORMAT (or the ICDecompressGetFormat15ALS4Y macro) to retrieve the format data. The decompressor returns its suggested format in a BITMAPINFO.2PXNH structure. This format typically preserves the most information during decompression. Your application should ensure that the decompressor returns successfully before it decompresses the information.

Because your application allocates the memory required for decompression, it needs to determine the maximum memory the decompressor can require for the output format. The ICM_DECOMPRESS_GET_FORMAT message obtains the number of bytes the decompressor uses for the default format.

If your application defines its own format by using ICDecompressExQuery7L78LW, it must also obtain a palette for the bitmap; ICDecompressExQuery does not provide palette definitions. (Most applications use standard formats and do not need to obtain a palette.) Your application can obtain the palette by sending the ICM_DECOMPRESS_GET_PALETTEW669X9 message (or use the ICDecompressGetPalette1MJEBTJ macro).

Decompressor Initialization

After your application selects a decompressor that can handle the input and output formats it needs, you can initialize the decompressor by using the ICDecompressExBegin7.R0CL function. This function requires the decompressor handle and the input and output formats.

Data Decompression

You can use the ICDecompressEx1MSSLQD function to decompress a frame. Your application must use this function repeatedly until all the frames in a sequence are decompressed.

If your video stream lags behind other components (such as audio) during playback, your application can specify the ICDECOMPRESS_HURRYUP flag to speed decompression. To do this, a decompressor might extract only the information it needs to decompress the next frame and not fully decompress the current frame. Therefore, your application should not try to draw the decompressed data when it uses this flag.

After your application has decompressed the data, it can send the ICM_DECOMPRESSEX_END9KXA5O message (or use the ICDecompressExEnd8I4GAA macro) to notify the decompressor that it has finished. If you want to restart decompression after using this function, your application must reinitialize the decompressor by using ICDecompressExBegin7.R0CL.