Compression and Decompression Reference for QuickTime

Framework
Frameworks/QuickTime.framework
Declared in
IOMacOSTypes.h
ImageCompression.h
MacTypes.h
OSUtils.h

Overview

QuickTime compression and decompression APIs help applications compress and decompress movie data.

Functions by Task

Aligning Windows

Applying Matrix Transformations

Changing Sequence-Compression Parameters

Changing Sequence-Decompression Parameters

Constraining Compressed Data

Controlling Hardware Scaling

Creating an Effect Sample Description

Creating File Previews

Getting Information About Compressed Data

Getting Information About Compressor Components

Image Compression Manager Utility Functions

Image Transcoder Support

Making Thumbnail Pictures

Managing Matrices

Obtaining a Graphics Importer Instance

Working With Graphics Devices and Graphics Worlds

Working With Image Descriptions

Working With Pictures and PICT Files

Working With Pixel Maps

Working With Sequences

Working With the StdPix Function

Working With Video Fields

Supporting Functions

Functions

Callbacks

Data Types

CodecComponent

Represents a type used by the Compression and Decompression API.

typedef Component CodecComponent;
Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
ImageCompression.h

CodecNameSpecList

Contains a list of CodecNameSpec structures.

struct CodecNameSpecList {
   short            count;
   CodecNameSpec    list[1];
};
Fields
count

Indicates the number of compressor name structures contained in the list array that follows.

list

Contains an array of compressor name structures. Each structure corresponds to one compressor component or type that meets the selection criteria your application specifies when it calls GetCodecNameList.

Discussion

See also DisposeCodecNameList and GetCodecNameList.

Declared In
ImageCompression.h

CodecNameSpecListPtr

Represents a type used by the Compression and Decompression API.

typedef CodecNameSpecList * CodecNameSpecListPtr;
Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
ImageCompression.h

ConstStrFileNameParam

Represents a type used by the Compression and Decompression API.

typedef ConstStr255Param ConstStrFileNameParam;
Availability
  • Available in OS X v10.0 and later.
Declared In
MacTypes.h

DataRateParams

Communicates information to compressors that can constrain compressed data to a specific data rate.

struct DataRateParams {
   long      dataRate;
   long      dataOverrun;
   long      frameDuration;
   long      keyFrameRate;
   CodecQ    minSpatialQuality;
   CodecQ    minTemporalQuality;
};
Fields
dataRate

Specifies the bytes per second to which the data rate must be constrained.

dataOverrun

Indicates the current number of bytes above or below the desired data rate. A value of 0 means that the data rate is being met exactly. If your application doesn't know the data overrun, it should set this field to 0.

frameDuration

Specifies the duration of the current frame in milliseconds.

keyFrameRate

Indicates the frequency of key frames. This frequency is normally identical to the key frame rate passed to the CompressSequenceBegin.

minSpatialQuality

A constant (see below) that specifies the minimum spatial quality the compressor should use to meet the requested data rate. See these constants:

  • codecMinQuality

  • codecLowQuality

  • codecNormalQuality

  • codecHighQuality

  • codecMaxQuality

  • codecLosslessQuality

minTemporalQuality

A constant (see below) that specifies the minimum temporal quality the compressor should use to meet the requested data rate.

Discussion

The CodecQ data type defines a field that identifies the quality characteristics of a given image or sequence. Note that individual components may not implement all the quality levels shown here. In addition, components may implement other quality levels in the range from codecMinQuality to codecMaxQuality. Relative quality should scale within the defined value range. Values above codecLosslessQuality are reserved for use by individual components.

See also GetCSequenceDataRateParams and SetCSequenceDataRateParams.

Declared In
ImageCompression.h

DataRateParamsPtr

Represents a type used by the Compression and Decompression API.

typedef DataRateParams * DataRateParamsPtr;
Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
ImageCompression.h

DecompressorComponent

Represents a type used by the Compression and Decompression API.

typedef Component DecompressorComponent;
Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
ImageCompression.h

FixedRect

Defines the size and location of a rectangle in fixed-point numbers.

struct FixedRect {
   Fixed    left;
   Fixed    top;
   Fixed    right;
   Fixed    bottom;
};
Fields
left

The x coordinate of the upper-left corner of the rectangle.

top

The y coordinate of the upper-left corner of the rectangle.

right

The x coordinate of the lower-right corner of the rectangle.

bottom

The y coordinate of the lower-right corner of the rectangle.

Discussion

See also TransformFixedRect.

Declared In
ImageCompression.h

Fract

Represents a type used by the Compression and Decompression API.

typedef long Fract;
Availability
  • Available in OS X v10.0 and later.
Declared In
IOMacOSTypes.h

ICMPixelFormatInfo

Defines a pixel format.

struct ICMPixelFormatInfo {
   long             size;
   unsigned long    formatFlags;
   short            bitsPerPixel[14];
};
Fields
size

The size of this structure. This quantity isn't necessarily equal to sizeof(ICMPixelFormatInfo) because it is dependent on whether the pixel format is chunky or planar, and, if planar, the number of components (see below).

formatFlags

A constant (see below) indicating the pixel format. See these constants:

  • kICMPixelFormatIsPlanarMask

  • kICMPixelFormatIsIndexed

  • kICMPixelFormatIsSupportedByQD

bitsPerPixel

An array that defines the number of bits for each component. The element bitsPerPixel[0] contains the number of bits for the first component, bitsPerPixel[1] the number of bits for the second component, etc. The meaning of this parameter depends on the format flag (see below).

Discussion

You can represent a format that has from 1 to 14 discrete components using this data structure. For ARGB, there are 4 components. RGB without an alpha channel has 3 components. A component count of 15 is reserved for future expansion.

See also ICMGetPixelFormatInfo and ICMSetPixelFormatInfo.

Declared In
ImageCompression.h

ICMPixelFormatInfoPtr

Represents a type used by the Compression and Decompression API.

typedef ICMPixelFormatInfo * ICMPixelFormatInfoPtr;
Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
ImageCompression.h

ImageFieldSequence

Represents a type used by the Compression and Decompression API.

typedef long ImageFieldSequence;
Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
ImageCompression.h

ImageSequenceDataSource

Represents a type used by the Compression and Decompression API.

typedef long ImageSequenceDataSource;
Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
ImageCompression.h

ImageTranscodeSequence

Represents a type used by the Compression and Decompression API.

typedef long ImageTranscodeSequence;
Availability
  • Available in OS X v10.0 and later.
  • Not available to 64-bit applications.
Declared In
ImageCompression.h

OpenCPicParams

Specifies resolutions when creating images.

struct OpenCPicParams {
   Rect     srcRect;
   Fixed    hRes;
   Fixed    vRes;
   short    version;
   short    reserved1;
   long     reserved2;
};
Fields
srcRect

The optimal bounding rectangle for the resolution indicated by the hRes and vRes fields. To display a picture at a resolution other than that specified in the the hRes and vRes fields, your application should compute an appropriate destination rectangle by scaling the image's width and height by the destination resolution divided by the source resolution.

hRes

The best horizontal resolution for the picture. A value of 0x0048000 specifies a horizontal resolution of 72 dpi.

vRes

The best vertical resolution for the picture. A value of 0x0048000 specifies a vertical resolution of 72 dpi.

version

Always set this field to -2.

reserved1

Reserved; set to 0.

reserved2

Reserved; set to 0.

Discussion

See also GetPictureFileHeader.

Declared In
ImageCompression.h

QHdr

A Windows queue header structure.

struct QHdr {
   short       qFlags;
   short       pad;
   long        MutexID;
   QElemPtr    qHead;
   QElemPtr    qTail;
};
Fields
qFlags

Undocumented

pad

Unused.

MutexID

Undocumented

qHead

Undocumented

qTail

Undocumented

Discussion

See also CDSequenceSetSourceDataQueue, Dequeue, Enqueue, InitializeQHdr, and TerminateQHdr.

Declared In
ImageCompression.h

QHdrPtr

Represents a type used by the Compression and Decompression API.

typedef QHdr * QHdrPtr;
Availability
  • Available in OS X v10.0 and later.
Declared In
OSUtils.h

Constants

StdPix Values

Constants passed to StdPix.

enum {
   callStdBits                   = 1,
   callOldBits                   = 2,
   noDefaultOpcodes              = 4
};
Declared In
ImageCompression.h

DSequence Flags

Constants that represent <codeVoice>DSequence</codeVoice> flags.

enum {
   codecDSequenceDisableOverlaySurface = (1L << 5),
   codecDSequenceSingleField     = (1L << 6),
   codecDSequenceBidirectionalPrediction = (1L << 7),
   codecDSequenceFlushInsteadOfDirtying = (1L << 8),
   codecDSequenceEnableSubPixelPositioning = (1L << 9),
   codecDSequenceDeinterlaceFields = (1L << 10)
};
Declared In
ImageCompression.h

FCompressImage Values

Constants passed to FCompressImage.

enum {
   codecFlagUseImageBuffer       = (1L << 0), /* decompress*/
   codecFlagUseScreenBuffer      = (1L << 1), /* decompress*/
   codecFlagUpdatePrevious       = (1L << 2), /* compress*/
   codecFlagNoScreenUpdate       = (1L << 3), /* decompress*/
   codecFlagWasCompressed        = (1L << 4), /* compress*/
   codecFlagDontOffscreen        = (1L << 5), /* decompress*/
   codecFlagUpdatePreviousComp   = (1L << 6), /* compress*/
   codecFlagForceKeyFrame        = (1L << 7), /* compress*/
   codecFlagOnlyScreenUpdate     = (1L << 8), /* decompress*/
   codecFlagLiveGrab             = (1L << 9), /* compress*/
   codecFlagDiffFrame            = (1L << 9), /* decompress*/
   codecFlagDontUseNewImageBuffer = (1L << 10), /* decompress*/
   codecFlagInterlaceUpdate      = (1L << 11), /* decompress*/
   codecFlagCatchUpDiff          = (1L << 12), /* decompress*/
   codecFlagSupportDisable       = (1L << 13), /* decompress*/
   codecFlagReenable             = (1L << 14) /* decompress*/
};
Constants
codecFlagUpdatePrevious

Controls whether your compressor updates the previous image during compression. This flag is only used with sequences that are being temporally compressed. If this flag is set to 1, your compressor should copy the current frame into the previous frame buffer at the end of the frame-compression sequence. Use the source image.

Available in OS X v10.0 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

codecFlagWasCompressed

Indicates to your compressor that the image to be compressed has been compressed before. This information may be useful to compressors that can compensate for the image degradation that may otherwise result from repeated compression and decompression of the same image. This flag is set to 1 to indicate that the image was previously compressed. This flag is set to 0 if the image was not previously compressed.

Available in OS X v10.0 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

codecFlagUpdatePreviousComp

Controls whether your compressor updates the previous image buffer with the compressed image. This flag is only used with temporal compression. If this flag is set to 1, your compressor should update the previous frame buffer at the end of the frame-compression sequence, allowing your compressor to perform frame differencing against the compression results. Use the image that results from the compression operation. If this flag is set to 0, your compressor should not modify the previous frame buffer during compression.

Available in OS X v10.0 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

codecFlagLiveGrab

Indicates whether the current sequence results from grabbing live video. When working with live video, your compressor should operate as quickly as possible and disable any additional processing, such as compensation for previously compressed data. This flag is set to 1 when you are compressing from a live video source.

Available in OS X v10.0 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

codecFlagDiffFrame

Decompress.

Available in OS X v10.0 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

codecFlagSupportDisable

Decompress.

Available in OS X v10.0 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

Declared In
ImageCompression.h

Color Modes

Constants that represent color modes.

enum {
   defaultDither                 = 0,
   forceDither                   = 1,
   suppressDither                = 2,
   useColorMatching              = 4
};
enum {
   graphicsModeStraightAlpha     = 256,
   graphicsModePreWhiteAlpha     = 257,
   graphicsModePreBlackAlpha     = 258,
   graphicsModeComposition       = 259,
   graphicsModeStraightAlphaBlend = 260,
   graphicsModePreMulColorAlpha  = 261,
   graphicsModePerComponentAlpha = 272
};
enum {
   kQTTIFFUserDataPrefix         = 0x74690000, /* Added to some tag values in TIFF IFDs to generate user data codes.  (0x7469 is 'ti'.) */
   /* For example,
   YCbCrPositioning is tag x0213,
   so its user data code is 0x74690213. */
   kQTTIFFExifUserDataPrefix     = 0x65780000, /* Added to tag values in Exif IFDs to generate user data codes.  (0x6578 is 'ex'.) */
   /* For example,
   DateTimeOriginal is tag x9003,
   so its user data code is 0x65789003. */
   kQTTIFFExifGPSUserDataPrefix  = 0x67700000, /* Added to tag values in Exif GPS IFDs to generate user data codes.  (0x6770 is 'gp'.) */
   /* For example,
   GPSAltitude is tag x0006,
   so its user data code is 0x6770006. */
   kQTAlphaMode                  = 'almo', /* UInt32; eg,
   graphicsModeStraightAlpha or graphicsModePreBlackAlpha */
   kQTAlphaModePreMulColor       = 'almp', /* RGBColor; used if kQTAlphaMode is graphicsModePreMulColorAlpha */
   kUserDataIPTC                 = 'iptc'
};
Constants
kQTTIFFUserDataPrefix

Added to some tag values in TIFF IFDs to generate user data codes. (0x7469 is 'ti'.).

Available in OS X v10.1 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

kQTTIFFExifUserDataPrefix

Added to tag values in Exif IFDs to generate user data codes. (0x6578 is 'ex'.).

Available in OS X v10.1 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

kQTTIFFExifGPSUserDataPrefix

Added to tag values in Exif GPS IFDs to generate user data codes. (0x6770 is 'gp'.).

Available in OS X v10.1 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

kQTAlphaMode

UInt32; for example, graphicsModeStraightAlpha or graphicsModePreBlackAlpha.

Available in OS X v10.1 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

kQTAlphaModePreMulColor

RGBColor; used if kQTAlphaMode is graphicsModePreMulColorAlpha.

Available in OS X v10.1 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

Declared In
ImageCompression.h

GetGraphicsImporterForFileWithFlags Values

Constants passed to GetGraphicsImporterForFileWithFlags.

enum {
   kDontUseValidateToFindGraphicsImporter = 1L << 0
};
Declared In
ImageCompression.h

QTSetPixMapPtrRequestedGammaLevel Values

Constants passed to QTSetPixMapPtrRequestedGammaLevel.

enum {
   kQTUsePlatformDefaultGammaLevel = 0,  /* When decompressing into this PixMap,
   gamma-correct to the platform's standard gamma. */
   kQTUseSourceGammaLevel        = -1L,  /* When decompressing into this PixMap,
   don't perform gamma-correction. */
   kQTCCIR601VideoGammaLevel     = 0x00023333 /* 2.2,
   standard television video gamma.*/
};
Constants
kQTCCIR601VideoGammaLevel

Gamma 2.2, for ITU-R BT.601 based video.

Available in OS X v10.0 and later.

Not available to 64-bit applications.

Declared in ImageCompression.h.

Declared In
ImageCompression.h