Jump to content

Smacker video

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 198.160.96.25 (talk) at 21:36, 6 May 2013 (External links). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Smacker
File:Smacker video.jpg
Filename extension
.smk
Internet media typevideo/vnd.radgamettools.smacker
Type codeSmk2
Developed byRAD Game Tools
Type of formatVideo codec
Container forSmacker

Smacker video is a video file format (with the .SMK file extension) developed by RAD Game Tools, and primarily used for full-motion video in video games.[1] Smacker uses an adaptive 8-bit RGB palette. RAD's format for video at higher color depths is Bink Video. The Smacker format specifies a container format, a video compression format, and an audio compression format.[2] Since its release in 1994, Smacker has been used in over 2300 games. Notably, Blizzard used this format for the cinematic videos seen in its games Warcraft II, StarCraft and Diablo I.[3] The format has been reverse engineered and implemented in libavcodec.[4]

Technical Details

File Format (container)

Smacker defines its own container format.[2] A Smacker file can contain a Smacker video track and up to seven audio tracks.[2] Each audio track can have either one channel (mono) or two channels (stereo) with a bit depth of either 8-bit or 16-bit. Three different audio formats are supported. Uncompressed audio can be stored as raw PCM samples.[2] Compressed audio can be stored in the Smacker audio format or, in newer versions of Smacker, the Bink Audio format.[2]

Video

Smacker video supports 256 colors, and includes transparency support.[2] While being a palette-based format, which is inherently limited to having not more than 256 colors in each frame, Smacker videos may still contain more colors in total due to "palette rotation" whereby the palette is updated on a per-frame basis.[2] This usually results in SMK files that look better if the source video has more than 256 colors. The compression rate of Smacker can reach 1:12, but at the loss of quality (pixelation).[citation needed]

In Smacker video, a frame is split into 4×4 blocks in raster-scan order.[2] Each block can be coded in one of six coding modes: skip, fill, mono, and three full modes.[2] Each mode can be signaled for multiple blocks in a run-length encoding scheme.[2] In skip mode, the current block is copied from the previous frame in a conditional replenishment fashion.[2] In fill mode, the current block is filled with a single color.[2] In mono mode, the palette is locally reduced from 256 colors to two colors.[2] Both colors are written to the bitstream and one bit per pixel is used to indicate which of the two color a pixel should be.[2] The mono mode can be interpreted as vector quantization, where a three-dimensional vector with the components red, green, and blue is quantized using codebook with four entries. Version 2 of the Smacker format specifies one full mode, the other two were added in version 4.[2] In the original full mode, 16 colors are transmitted, one for each pixel, equivalent to raw uncompressed PCM.[2] The two full modes added in version 4 use 4 and 8 colors in a block, respectively.[2] In the 4-color mode, the 4×4 block is split into four 2×2 blocks, each of which is filled with a solid color.[2] In the 8-color mode, the 4×4 block is split into eight 1×2 blocks, each of which is filled with a solid color.[2]

Further compression is achieved by entropy coding using Huffman coding of the various bitstream elements that result from the process above.[2] There are four separate Huffman tables with 16-bit entries: one for mode decision, run-length, and fill color in fill color mode, one for the color indices in mono mode, one for the bitmap in mono mode, and one for all data in the full mode.[2] Each table is adaptive and transmitted once per file in the header.[2] The Huffman tables in the header are themselves compressed: the 16 bit values in the leaves of the code tree are split into a high byte and a low byte, each beach is compressed by a Huffman table that is also contained in the header.[2]

Audio

Smacker audio is one of the audio formats that can be used in the Smacker container.[2] For compression, Differential pulse code modulation (DPCM) is used.[2] The difference between two successive samples is compressed using Huffman coding.[2] The Huffman tables are adapted once per audio frame.[2]

See also

References

  1. ^ "Smacker video Technology". RAD Game Tools. Retrieved 4 May 2013.
  2. ^ a b c d e f g h i j k l m n o p q r s t u v w x y z aa "Smacker". MultimediaWiki. 11 April 2007. Retrieved 4 April 2013.
  3. ^ Ladislav Zezula (2010). "MPQ Archives - Overview". Retrieved 4 May 2013.
  4. ^ "FFmpeg Documentation". FFmpeg. Retrieved 4 April 2013.