Description of the TechSmith Screen Capture Codec (TSCC) by Mike Melanson (mike at multimedia.cx) and Konstantin Shishkov (cannonball at bw-team.com) v1.0: September 23, 2004 ======================================================================= NOTE: The information in this document is now maintained in Wiki format at: http://wiki.multimedia.cx/index.php?title=TechSmith_Screen_Capture_Codec ======================================================================= Copyright (c) 2004 Mike Melanson & Konstantin Shishkov Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Contents -------- * Introduction * Algorithm * References * ChangeLog * GNU Free Documentation License Introduction ------------ The TechSmith Screen Capture Codec (henceforth TSCC) is designed primarily for video sequences that have a lot of constant pixel runs and do not change much from frame to frame. AVI files using TSCC often depict tutorials for using computer desktop applications where the only interframe change is a mouse cursor moving around the screen. Algorithm --------- TSCC combines run length encoding (RLE) with standard zlib compression. The algorithm can operate in 24-bit RGB, 16-bit RGB, and palettized 8-bit RGB modes. In the 8-bit mode, the RGB palette information should be transported by the container format (typically AVI). To decode a chunk of TSCC data first run it through the standard, free zlib decompression library functions. See the References section for more information about using the zlib API. After decompressing the chunk using zlib, the data is sent through a run length decoding algorithm. Run length encoding/decoding operates by shortening runs of the same number. For example, the sequence: 8 8 8 8 8 4 4 4 is conceptually encoded as: (5, 8), (3, 4) This indicates that a run of 5 '8' numbers is followed by a run of 3 '4' numbers. A TSCC frame is decoded from bottom -> top. The algorithm for TSCC RLE decoding is essentially identical to Microsoft's RLE algorithm, though it is slightly modified for higher bit depths. The full decoding algorithm operates as follows: get next byte in stream (b0) if b0 is 0 get next byte in stream (b1) if b1 is 0 this line is finished, move to decoding the next line else if b1 is 1 frame decode is finished else if b1 is 2 position change get next byte in stream (p1) get next byte in stream (p2) skip (p2) lines from current line skip (p1) pixels from current pixel else copy (b1) 1-, 2-, or 3-byte pixels from stream to output if the data is 8-bit and the copy length (b1) is odd, advance the stream pointer by 1 as it is padded (just like MS RLE) else (b0 is not 0) emit a run of pixels into the output by getting the next 1-, 2-, or 3-byte pixel from the stream and placing the same pixel into the output (b0) times References ---------- TechSmith, creators of the TSCC codec: http://techsmith.com/ TSCC Video for Windows Decoding DLL, tsccvid.dll zlib home page: http://www.gzip.org/zlib/ ChangeLog --------- v1.0: September 23, 2004 - initial release GNU Free Documentation License ------------------------------ see http://www.gnu.org/licenses/fdl.html