QuickTime Graphics is a
lossy
In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size ...
video compression and decompression algorithm (
codec
A codec is a device or computer program that encodes or decodes a data stream or signal. ''Codec'' is a portmanteau of coder/decoder.
In electronic communications, an endec is a device that acts as both an encoder and a decoder on a signal or ...
) developed by
Apple Inc.
Apple Inc. is an American multinational technology company headquartered in Cupertino, California, United States. Apple is the largest technology company by revenue (totaling in 2021) and, as of June 2022, is the world's biggest company ...
and first released as part of
QuickTime 1.x in the early 1990s.
The codec is also known by the name Apple Graphics and its
FourCC
A FourCC ("four-character code") is a sequence of four bytes (typically ASCII) used to uniquely identify data formats. It originated from the OSType or ResType metadata system used in classic Mac OS and was adopted for the Amiga/Electronic Arts I ...
SMC.
[ The codec operates on 8-bit palettized ]RGB
The RGB color model is an additive color model in which the red, green and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three additiv ...
data.[ The bit-stream format of QuickTime Graphics has been reverse-engineered and a decoder has been implemented in the projects XAnim and ]libavcodec
libavcodec is a free and open-source library of codecs for encoding and decoding video and audio data.
libavcodec is an integral part of many open-source multimedia applications and frameworks. The popular MPV, xine and VLC media players u ...
.[
]
Technical Details
The input video that the codec operates on is in an 8-bit palettized RGB
The RGB color model is an additive color model in which the red, green and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three additiv ...
colorspace. Compression is achieved by conditional replenishment
Conditional (if then) may refer to:
*Causal conditional, if X then Y, where X is a cause of Y
*Conditional probability, the probability of an event A given that another event B has occurred
*Conditional proof, in logic: a proof that asserts a co ...
and by reducing the palette from 256 colors to a per-4×4 block adaptive palette of 1-16 colors. Because Apple Video operates in the image domain without motion compensation, decoding is much faster than MPEG
The Moving Picture Experts Group (MPEG) is an alliance of working groups established jointly by ISO and IEC that sets standards for media coding, including compression coding of audio, video, graphics, and genomic data; and transmission and fi ...
-style codecs which use motion compensation
Motion compensation in computing, is an algorithmic technique used to predict a frame in a video, given the previous and/or future frames by accounting for motion of the camera and/or objects in the video. It is employed in the encoding of video d ...
and perform coding in a transform domain. As a tradeoff, the compression performance of Apple Graphics is lower. The decoding complexity is approximately 50% that of the QuickTime Animation codec.
Each frame is segmented into 4×4 blocks in raster-scan order. Each block can be coded in one of the following coding modes: skip mode, single color, 2-, 4-, and 8 color palette modes, two repeat modes, and PCM.
Skip mode
The skip mode realizes conditional replenishment
Conditional (if then) may refer to:
*Causal conditional, if X then Y, where X is a cause of Y
*Conditional probability, the probability of an event A given that another event B has occurred
*Conditional proof, in logic: a proof that asserts a co ...
. If a block is coded in skip mode, the content of the block at same location in the previous frame is copied to the current frame.[ Runs of skip blocks are coded in a ]run-length encoding
Run-length encoding (RLE) is a form of lossless data compression in which ''runs'' of data (sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original ...
scheme, enabling a high compression ratio in static areas of the picture.[
]
Single color
In single color mode, the entire 4×4 block is painted with a single color.[ This mode can also be considered as a 1-color palette mode.
]
Palette (2, 4, or 8-color) modes
In the palette modes, each 4×4 block is coded with a 2, 4, or 8-color palette.[ To select one of the colors from the palette, 1, 2, or 3 bits per pixel are used, respectively. The palette can be written to the bitstream either explicitly or as a reference to an entry in the palette cache.][ The palette cache is a set of three circular buffers which store the 256 most recently used palettes, one each for of the 2, 4, and 8-color modes.][
Interpreted as ]vector quantization
Vector quantization (VQ) is a classical quantization technique from signal processing that allows the modeling of probability density functions by the distribution of prototype vectors. It was originally used for data compression. It works by di ...
, three-dimensional vectors with components red, green, and blue are quantized using a forward adaptive codebook with between 1 and 8 entries.
Repeat modes
There are two different repeat modes.[ In the single block repeat mode, the previous block is repeated a specified number of times.][ In the two block repeat mode, the previous two blocks are repeated a specified number of times.][
]
PCM (16 color) mode
In 16-color mode, the color of each pixel in a block is explicitly written to the bit-stream.[ This mode is lossless and equivalent to raw ]PCM
Pulse-code modulation (PCM) is a method used to digitally represent sampled analog signals. It is the standard form of digital audio in computers, compact discs, digital telephony and other digital audio applications. In a PCM stream, the a ...
without any compression.
See also
* Indexed color
In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers. It is a form of vector quantization comp ...
* Color quantization
In computer graphics, color quantization or color image quantization is quantization applied to color spaces; it is a process that reduces the number of distinct colors used in an image, usually with the intention that the new image should be as v ...
* Block truncation coding Block Truncation Coding (BTC) is a type of lossy image compression technique for greyscale images. It divides the original images into blocks and then uses a quantizer to reduce the number of grey levels in each block whilst maintaining the same m ...
, a similar coding technique for grayscale content
* Color Cell Compression
Color Cell Compression is a lossy image compression algorithm developed by Campbell et al., in 1986, which can be considered an early forerunner of modern texture compression algorithms, such as S3 Texture Compression and Adaptive Scalable Text ...
, a similar coding technique for color content, based on block truncation coding
* Apple Video, a codec based on a similar design
* Microsoft Video 1
Microsoft Video 1 or MS-CRAM is an early lossy video compression and decompression algorithm (codec) that was released with version 1.0 of Microsoft's Video for Windows in November 1992. It is based on MotiVE, a vector quantization codec which Mi ...
, a codec based on a similar design
* Smacker video, a codec based on a similar design
* S3 Texture Compression S3 Texture Compression (S3TC) (sometimes also called DXTn, DXTC, or BCn) is a group of related lossy compression, lossy texture compression algorithms originally developed by Iourcha et al. of S3 Graphics, S3 Graphics, Ltd. for use in their Savage 3 ...
, a texture compression format based on a similar design
References
External links
QuickTime Graphics decoder - FFmpeg
{{Compression formats
Graphics
Graphics () are visual images or designs on some surface, such as a wall, canvas, screen, paper, or stone, to inform, illustrate, or entertain. In contemporary usage, it includes a pictorial representation of data, as in design and manufacture, ...
Lossy compression algorithms
Video codecs