|
FFmpeg
|
id Quake II Cin Video Decoder by Dr. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "avcodec.h"#include "internal.h"#include "libavutil/internal.h"Classes | |
| struct | hnode |
| struct | IdcinContext |
Macros | |
| #define | HUFFMAN_TABLE_SIZE 64 * 1024 |
| #define | HUF_TOKENS 256 |
| #define | PALETTE_COUNT 256 |
Typedefs | |
| typedef struct hnode | hnode |
| typedef struct IdcinContext | IdcinContext |
Variables | |
| AVCodec | ff_idcin_decoder |
id Quake II Cin Video Decoder by Dr.
Tim Ferguson For more information about the id CIN format, visit: http://www.csse.monash.edu.au/~timf/
This video decoder outputs PAL8 colorspace data. Interacting with this decoder is a little involved. During initialization, the demuxer must transmit the 65536-byte Huffman table(s) to the decoder via extradata. Then, whenever a palette change is encountered while demuxing the file, the demuxer must use the same extradata space to transmit an AVPaletteControl structure.
id CIN video is purely Huffman-coded, intraframe-only codec. It achieves a little more compression by exploiting the fact that adjacent pixels tend to be similar.
Note that this decoder could use libavcodec's optimized VLC facilities rather than naive, tree-based Huffman decoding. However, there are 256 Huffman tables. Plus, the VLC bit coding order is right -> left instead or left -> right, so all of the bits would have to be reversed. Further, the original Quake II implementation likely used a similar naive decoding algorithm and it worked fine on much lower spec machines.
| AVCodec ff_idcin_decoder |
1.8.12