ICDecompress(3mms) — Subroutines
Name
ICDecompress --- Decompress a single video frame
Syntax
#include <mme/mme_api.h>
MMRESULT ICDecompress(HIC hic,
DWORD dwFlags,
LPBITMAPINFOHEADER lpbiFormat,
LPVOID lpData,
LPBITMAPINFOHEADER lpbi,
LPVOID lpBits);
Arguments
HIC hic
Specifies a handle to a decompressor.
DWORD dwFlags
Specifies flags for decompression. The following flags are defined:
ICDECOMPRESS_HURRYUP
Indicates that the decompressor should try to decompress at a faster rate. When an application uses this flag, it should not draw the decompressed data.
NULL
Indicates that the decompressor will decompress at normal rate.
LPBITMAPINFOHEADER lpbiFormat
Specifies a pointer to a BITMAPINFOHEADER data structure containing the format of the compressed data.
The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompress function.
See the mmeAllocMem(3mms) reference page for more information about allocating memory for data structures.
LPVOID lpData
Specifies a pointer to the input data. The data buffer must be allocated with the mmeAllocBuffer function before being passed to the ICDecompress function.
See the mmeAllocBuffer(3mms) reference page for more information about allocating memory for data buffers.
LPBITMAPINFOHEADER lpbi
Specifies a pointer to a BITMAPINFOHEADER data structure containing the output format.
The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICDecompress function.
See the mmeAllocMem(3mms) reference page for more information about allocating memory for data structures.
LPVOID lpBits
Specifies a pointer to a data buffer for the decompressed data. The data buffer must be allocated with the mmeAllocBuffer function before being passed to the ICDecompress function.
See the mmeAllocBuffer(3mms) reference page for more information about allocating memory for data buffers.
Description
The ICDecompress function decompresses a single video frame.
The lpBits argument must point to a buffer large enough to hold the decompressed data. Applications can calculate the size of this buffer using information returned from the ICDecompressGetFormat function. However, if an application requires the X image or YUV image format, it must calculate the buffer size using one of the following formulas:
Format Bits/Pixel Formula
BICOMP_DECXIMAGEDIB 8 PAD(width) ∗ height ∗ 1
BICOMP_DECXIMAGEDIB 24 PAD(width) ∗ height ∗ 4
BICOMP_DECYUVDIB 16 PAD(width) ∗ height ∗ 2
where PAD is:
#define PAD(size) (((size) + 3) & ~0x3)
X images must be padded to 4 bytes on each scanline.
The performance of the Alpha AXP workstation’s built-in HX display and any other HX (also called SFB) graphics controller is improved if X images are aligned on 8-byte boundaries and have a scanline width that is a multiple of 8.
The biSizeImage field in the lpbiFormat argument may change for each call to the ICDecompress function to reflect different sizes of compressed data buffers. To change any other fields in either the lpbiFormat or lpbi arguments, the decompression device must be reconfigured by calling the ICDecompressEnd function, followed by the ICDecompressBegin function.
Some video devices may check decompression parameters, detect a change, and reconfigure themselves. In these cases, the ICDecompress function can return error codes associated with the ICDecompressEnd and ICDecompressBegin functions.
Extensions
None.
Return Values
Returns ICERR_OK if the function is successful; otherwise, it returns one of the following error codes:
ICERR_BADHANDLE@T{ The hic argument is invalid, the decompressor is not open, or the decompressor is not open for decompression. T} ICERR_BADFORMAT@T{ The lpbiFormat and lpbi arguments are not acceptable formats. T} ICERR_BADIMAGESIZE@T{ The specified image size is invalid. T} ICERR_BADPARAM@T{ The lpbiFormat or lpbi, or lpData or lpBits arguments are NULL; or the hardware cannot be properly set up for the operation. T}
See Also
ICDecompressBegin(3mms), ICDecompressEnd(3mms), ICDecompressGetFormat(3mms)