HOME

TheInfoList



OR:

Apple Video 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 computer hardware or software component 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 o ...
) developed by
Apple Inc. Apple Inc. is an American multinational corporation and technology company headquartered in Cupertino, California, in Silicon Valley. It is best known for its consumer electronics, software, and services. Founded in 1976 as Apple Comput ...
and first released as part of QuickTime 1.0 in 1991. The codec is also known as QuickTime Video, by its FourCC RPZA and the name Road Pizza. (The codename "Road Pizza" is a reference to the idea that "when you run over an animal, you're basically compressing it on the freeway".) When used in the AVI
container A container is any receptacle or enclosure for holding a product used in storage, packaging, and transportation, including shipping. Things kept inside of a container are protected on several sides by being inside of its structure. The term ...
, the FourCC AZPR is also used. The bit-stream format of Apple Video has been reverse-engineered and a decoder has been implemented in the projects XAnim and Libavcodec.


Technical Details

The codec operates on 4×4 blocks of pixels in the RGB colorspace. Each frame is segmented into 4×4 blocks in raster-scan order. Each block is coded in one of four coding modes: skip, single color, four color, or 16 color. Colors are represented by 16 bits with a bit-depth of 5 bit for each of the three components red, green, and blue, a format known as RGB555. 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 International Organization for Standardization, ISO and International Electrotechnical Commission, IEC that sets standards for media coding, includ ...
-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 ...
and perform coding in a transform domain. As a tradeoff, the compression performance of Apple Video is lower.


Skip mode

The skip mode realizes conditional replenishment. 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 (consecutive occurrences of the same data value) are stored as a single occurrence of that data value and a count of its consecutive occurrences, rather th ...
scheme, enabling a high compression ratio in static areas of the picture.


Single color mode

In single color mode, all pixels in a block are decoded in the same color. This can be interpreted as a palette with a single color.


Four color mode

In four color mode, each pixel in a block is decoded as one of four colors which are specified in a palette. To select one of the four entries, 2 bits per pixel are written to the bit-stream. The same palette is used for a run of length between one and 32 blocks. Of the four colors, two are explicitly written to the bit-stream, while the other two are calculated at the decoder by
linear interpolation In mathematics, linear interpolation is a method of curve fitting using linear polynomials to construct new data points within the range of a discrete set of known data points. Linear interpolation between two known points If the two known po ...
in the RGB colorspace using the following equations: ::\mathrm = \frac * \mathrm +\frac * \mathrm \approx \frac * \mathrm +\frac * \mathrm ::\mathrm = \frac * \mathrm +\frac * \mathrm \approx \frac * \mathrm +\frac * \mathrm where color0 and color3 are the two colors which are written in the bit-stream. The four colors can be interpreted as lying equidistantly spaced on a line segment in the three-dimensional vector space with the three components red, green, and blue. The end-points of this line are written in the bit-stream. A similar color-interpolation scheme is used in S3 Texture Compression. 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. Developed in the early 1980s by Robert M. Gray, it was ori ...
, a three-dimensional vector with the components red, green, and blue is quantized using a codebook with four entries.


16 color mode

In 16-color mode, the color of each pixel in a block is explicitly written in the bit-stream. This mode is lossless and equivalent to raw
PCM Pulse-code modulation (PCM) is a method used to Digital signal (signal processing), digitally represent analog signals. It is the standard form of digital audio in computers, compact discs, digital telephony and other digital audio application ...
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 computer data storage, memory and Hard disk drive, file storage, while speeding up display refresh and file transfers. It ...
*
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 ...
* Block truncation coding, a similar coding technique for grayscale content * Color Cell Compression, a similar coding technique for color content, based on block truncation coding * Microsoft Video 1, a codec based on a similar design * QuickTime Graphics, a codec based on a similar design * Smacker video, a codec based on a similar design * S3 Texture Compression, a texture compression format based on a similar design


References


External links


Apple Video decoder - FFmpeg
{{Compression formats Video codecs Lossy compression algorithms
Video Video is an Electronics, electronic medium for the recording, copying, playback, broadcasting, and display of moving picture, moving image, visual Media (communication), media. Video was first developed for mechanical television systems, whi ...