Contents

Smacker defines its own container format.[2] A Smacker file can contain a Smacker video track and up to seven audio tracks. Each audio track can have either one channel (mono) or two channels (stereo) with a bit depth of either 8-bit or 16-bit. The audio can either be uncompressed PCM, compressed in the Smacker Audio format, or, in newer versions of Smacker, compressed in the Bink Audio format.[2]

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. Each mode can be signaled for multiple blocks in a run-length encoding scheme. In skip mode, the current block is copied from the previous frame in a conditional replenishment fashion. In fill mode, the current block is filled with a single color. In mono mode, the palette is locally reduced from 256 colors to two colors. Both colors are written to the bitstream and one bit per pixel is used to indicate which of the two colors 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 an adaptive codebook with two entries. There are three full modes, one was specified in version 2 of the Smacker format, while 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. 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. 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, each 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. Each table is adaptive and transmitted once per file in the header. 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 byte is compressed using a Huffman table that is also contained in the header.[2]

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