Cinepak is alossyvideo codec[1] developed by Peter Barrett atSuperMac Technologies, and released in 1991 with the Video Spigot, and then in 1992 as part of Apple Computer'sQuickTime video suite. One of the first video compression tools to achievefull motion video onCD-ROM,[2] it was designed to encode 320×240 resolution video at 1× (150kbyte/s)CD-ROM transfer rates. The original name of this codec wasCompact Video,[3] which is why itsFourCC identifier isCVID. The codec was ported toMicrosoft Windows in 1993. It was also used onfourth- andfifth-generation game consoles, such as theAtari Jaguar CD,[4]Sega CD,Sega Saturn, and3DO.[2]libavcodec includes a Cinepak decoder and an encoder, both licensed under the terms of theLGPL.
It was the primary video codec of early versions ofQuickTime and MicrosoftVideo for Windows, but was later superseded bySorenson Video, IntelIndeo, and most recentlyMPEG-4 Part 2 andH.264/MPEG-4 AVC.[5][6] However, movies compressed with Cinepak are generally still playable in most media players.
Cinepak is based onvector quantization, which is a significantly different algorithm from thediscrete cosine transform (DCT) algorithm used by most current codecs (in particular theMPEG family, as well asJPEG). This permitted implementation on relatively slow CPUs (video encoded in Cinepak will usually play fine even on a 25 MHzMotorola 68030, consoles like the Sega CD usually used even slower CPUs, e.g. a 12.5 MHz 68000), but tended to result in blocky artifacting at lowbitrates, which explained the criticism leveled at theFMV-based video games.
The vectors that are quantized in Cinepak are 2×2 pixel blocks. A block can consist of 4 luminance values (grayscale) or of 4 luminance and 2 chrominance values (4:2:0 chroma subsampling).[7][8] The quantized blocks are stored in two codebooks, named V1 and V4, each with up to 256 entries. The vectors in the V1 codebook represent downscaled 4×4 pixel blocks, while those in the V4 codebook represent 2×2 pixel blocks.
For processing, Cinepak divides a video into key (intra-coded) images and inter-coded images.[7] In key images the codebooks are transmitted from scratch, while in inter-coded images codebook entries are selectively updated.[7] Each image is further divided into a number of horizontal bands. The codebooks can be updated on a per-band basis. Each band is divided into 4×4 pixel blocks.[7][8] Each block can be coded either from the V1 or from the V4 codebook.[7][8] When coding from the V1 codebook, one codebook index per 4×4 block is written to the bitstream, and the corresponding 2×2 codebook entry isupscaled to 4×4 pixels.[7][8] When coding from the V4 codebook, four codebook indices per 4×4 block are written to the bitstream, one for each 2×2 subblock.[7][8] Alternatively to coding from the V1 or the V4 codebook, a 4×4 block in an inter-coded image can be skipped. A skipped block is copied unchanged from the previous frame in aconditional replenishment fashion.[7][8] The data rate can be controlled by adjusting the rate of key frames and by adjusting the permitted error in each block.