Image-Data
Compression
Your
application can use a series of ICCompress
Determine the compression
format to use for a specified input format.
Prepare the
compressor.
Compress the
data.
End
compression.
Your
application can increase control over the compression process by using the ICCompress
A compressor
receives data in one format, compresses the data, and returns a compressed
version of the data using a specified format. The typical input format
specifies DIBs using the BITMAPINFO
Note To minimize
image and audio degradation during playback, avoid compressing an AVI file more
than once. Combine uncompressed pieces of video in your editing system and then
compress the final product.
Compressor and Compression Format Selection
If you want
to compress data and your application requires a specific output format, send
the ICM_COMPRESS_QUERY
If the output
format is not important to your application, you need only find a compressor
that can handle the input format. To determine if a compressor can handle the
input format, you can send ICM_COMPRESS_QUERY, specifying NULL for the lParam
parameter. This message does not return the output format to your application.
Your application can determine the buffer size needed for the data specifying
the compression format by sending the ICM_COMPRESS_GET_FORMAT
If you want
to determine the largest buffer that the compressor could require for
compression, send the ICM_COMPRESS_GET_SIZE1_LTB6N function to allocate a buffer for
subsequent image compressions.
Compressor Initialization
After
your application selects a compressor that can handle the input and output
formats it needs, you can initialize the compressor by using the ICM_COMPRESS_BEGIN
Data Compression
You
can use the ICCompress
Your
application can use the ICCOMPRESS_KEYFRAME flag to make the frame compressed
by ICCompress a key frame.
When
VCM returns control to your application after compressing a frame, VCM stores
the compressed data in the structures referenced by the lpbiOutput and lpData
parameters. If your application needs to move the compressed data, it can find
its size in the biSizeImage member of the BITMAPINFO
Note Your
application must allocate the structures and buffers that store the
uncompressed and compressed data. If the compressor supports temporal
compression, your application must also allocate a structure and buffer to hold
the format and data for the previous frame of information.
Ending Compression
After
your application has compressed the data, it can use the ICCompressEnd