Apple Video is a lossy video compression and decompression algorithm (codec) developed by Apple Inc. 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, the FourCC AZPR is also used.
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-style codecs which use motion compensation and perform coding in a transform domain. As a tradeoff, the compression performance of Apple Video is lower.
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 scheme, enabling a high compression ratio in static areas of the picture.
Single color mode
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 the RGB colorspace using the following equations:
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.
16 color mode
- Indexed color
- Color quantization
- 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
- Guillermo A. Ortiz (Summer 1991). "QuickTime 1.0: "You oughta be in pictures"" (PDF). Apple Computer. Retrieved 14 April 2013.
- "FFmpeg Documentation". FFmpeg. Retrieved 4 April 2013.
- "Apple RPZA". MultimediaWiki. 11 December 2008. Retrieved 4 April 2013.
- "CHM Live: The Origins of QuickTime". Computer History Museum.
- Mark Podlipec (10 December 1997). "xanim.18.104.22.168.2 README". XAnim. Archived from the original on 28 December 2015. Retrieved 4 April 2013.