Video data in the bit stream is encoded with Variable Length Code (VLC) tables so that the shortest codes correspond to the most frequent values and the longer codes correspond to the less frequent values. Tables for each video standard contain specific possible codes and their values.
VLC decoding functions can work with two types of tables:
Code | Value 1 | Value 2 |
---|---|---|
0001 1 | 1 | 0 |
0011 | 1 | 1 |
011 | 1 | 2 |
1 | 2 | 0 |
010 | 2 | 2 |
0010 | 3 | 2 |
0001 0 | 4 | 1 |
Video data VLC-decoding starts with memory allocation and table initialization. Then the decoding proper should be made and the allocated memory must be released.
One-to-One Correspondence | One-to-Two Correspondence | Short Description |
---|---|---|
Allocates memory and initializes structure that is used for decoding. | ||
Decodes one code using specified table. | ||
Frees memory allocated for VLC table. |
For using ippiVCHuffmanInitAlloc_32s and ippiVCHuffmanInitAllocRL_32s functions, the source table should have the following structure:
static Ipp32s Table[]= { max_bits, // The maximum length of code total_subt, // The total number of all subtables sub_sz1, // The sizes of subtables. Their sum must sub_sz2, // be equal to the maximum length of codes ..., // max_bits and their number should be // equal to total_subt. N1, // The number of 1-bit codes Code1, Value11, [Value21] // Code2, Value12, [Value22] // The 1-bit codes ..., // N2, // The number of 2-bit codes Code1, Value11, [Value21] // Code2, Value12, [Value22] // The 2-bit codes ..., // Nm, // The number of max_bits, -bit codes Code1, Value11, [Value21] // Code2, Value12, [Value22] // max_bits codes ..., // -1 // The significant value to indicate the // end of table };
Notes:
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.