Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ICCompress(3mms) — Multimedia Services 2.4B

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ICCompressBegin(3mms)

ICCompressEnd(3mms)

ICCompressGetSize(3mms)

ICGetInfo(3mms)

ICCompress(3mms)  —  Subroutines

 
 
 
 
 

Name

 
ICCompress --- Compress a single video image
 
 

Syntax

 
 
 

 #include <mme/mme_api.h>
 DWORD ICCompress(HIC hic,
                 DWORD dwflags,
                 LPBITMAPINFOHEADER lpbiOutput,
                 LPVOID lpdata,
                 LPBITMAPINFOHEADER lpbiInput,
                 LPVOID lpBits,
                 LPDWORD lpckid,
                 LPDWORD lpdwFlags,
                 LONG lFrameNum,
                 DWORD dwFrameSize,
                 DWORD dwQuality,
                 LPBITMAPINFOHEADER lpbiPrev,
                 LPVOID lpPrev);
 

 
 
 

Arguments

 
HIC hic
Specifies a handle to a compressor.

 
DWORD dwFlags
Specifies flags for compression. The following flag is defined:
 
 
 

ICM_COMPRESS_KEYFRAME
 
 
Indicates that the compressor should make this frame a key frame.
 
 

 
LPBITMAPINFOHEADER lpbiOutput
Specifies a pointer to a BITMAPINFOHEADER data structure holding the output format. 

 
The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICCompress function. 
 
See the mmeAllocMem(3mms) reference page for more information about allocating memory for data structures. 

 
LPVOID lpData
Specifies a pointer to the output data buffer. The data buffer must be allocated with the mmeAllocBuffer function before being passed to the ICCompress function. 
 
See the mmeAllocBuffer(3mms) reference page for more information about allocating memory for data buffers

 
LPBITMAPINFOHEADER lpbiInput
Specifies a pointer to a BITMAPINFOHEADER data structure containing the input format. 

 
The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICCompress function. 
 
See the mmeAllocMem(3mms) reference page for more information about allocating memory for data structures. 

 
LPVOID lpBits
Specifies a pointer to the input data buffer. The data buffer must be allocated with the mmeAllocBuffer function before being passed to the ICCompress function. 
 
See the mmeAllocBuffer(3mms) reference page for more information about allocating memory for data buffers. 

 
LPDWORD lpckid
Specifies a pointer to a DWORD used to hold a chunk ID for data in the AVI file. This argument is filled in by the compressor. The lpckid argument must be allocated with the mmeAllocMem function before being passed to the ICCompress function. 
 
See the mmeAllocMem(3mms) reference page for more information about allocating memory for the lpckid argument. 

 
LPDWORD lpdwFlags
Specifies a pointer to a DWORD holding the return flags used in the AVI index. This argument is filled in by the compressor. The following flag is defined:
 
 
 

AVIIF_KEYFRAME
 
 
Indicates that this frame is a key frame.
 

 
The lpdwFlags argument must be allocated with the mmeAllocMem function before being passed to the ICCompress function. 
 
See the mmeAllocMem(3mms) reference page for more information about allocating memory for the lpdwFlags argument. 

 
LONG lFrameNum
Specifies the frame number.

 
DWORD dwFrameSize
Specifies the requested frame size in bytes. If set to zero, the compressor chooses the frame size.

 
DWORD dwQuality
Specifies the requested quality value for the frame. This value ranges from 0 to 10000. The value 10000 denotes the best quality. See the Multimedia Services for Digital UNIX Programmer’s Guide, Chapter 7, for information about quality settings and see Appendix B for restrictions. 

 
LPBITMAPINFOHEADER lpbiPrev
Specifies a pointer to a BITMAPINFOHEADER data structure holding the previous frame’s format. 

 
The BITMAPINFOHEADER data structure must be allocated with the mmeAllocMem function before being passed to the ICCompress function. 
 
See the mmeAllocMem(3mms) reference page for more information about allocating memory for data structures. 

 
LPVOID lpPrev
Specifies a pointer to the previous frame’s data buffer. The data buffer must be allocated with the mmeAllocBuffer function before being passed to the ICCompress function. 
 
See the mmeAllocBuffer(3mms) reference page for more information about allocating memory for data buffers. 
 
 
 
 

Description

 
The ICCompress function compresses a single video image. See the Multimedia Services for Digital UNIX Programmer’s Guide, Section 7.8, for information about controlling the amount of compression in the Software Indeo CODEC. 

 
The size of the data buffer pointed to by the lpData argument must be large enough to hold the compressed frame. Use the ICCompressGetSize function to obtain the size of this buffer. 

 
Set the dwFrameSize argument to a requested frame size only if the compressor returns the VIDCF_CRUNCH flag in response to a call to the ICGetInfo function. Without the VIDCF_CRUNCH flag, set the parameter to zero. 

 
Set the dwQuality argument to a quality value only if the compressor returns the VIDCF_QUALITY flag in response to a call to the ICGetInfo function. Without the VIDCF_QUALITY flag, set the parameter to zero. 

 
The lpbiPrev and lpPrev arguments are relevant only when using temporal compression (the dwFlags field in the ICOPEN data structure is VIDCF_TEMPORAL). Otherwise, they can be set to NULL. 

 
If changes are made to any of the fields in the BITMAPINFOHEADER data structures passed to this function, call the ICCompressEnd function followed by the ICCompressBegin function to reconfigure the compression device. 
 
Some video devices may check compression parameters, detect a change, and reconfigure themselves. In these cases, the ICCompress function can return error codes associated with the ICCompressEnd and ICCompressBegin 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 compressor is not open, or the compressor is not open for compression.  T} ICERR_BADFORMAT@T{ The lpbiOutput and lpbiInput arguments are not acceptable formats.  T} ICERR_BADPARAM@T{ The lpbiOutput or lpbiInput, or lpData or lpBits arguments are NULL; or the hardware cannot be properly set up for the operation.  T}

 
 
 

See Also

 
 
 
 
 
ICCompressBegin(3mms), ICCompressEnd(3mms), ICCompressGetSize(3mms), ICGetInfo(3mms)
 
 
 
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026