00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 # ifndef LIBMAD_HUFFMAN_H
00023 # define LIBMAD_HUFFMAN_H
00024
00025 union huffquad {
00026 struct {
00027 unsigned short final : 1;
00028 unsigned short bits : 3;
00029 unsigned short offset : 12;
00030 } ptr;
00031 struct {
00032 unsigned short final : 1;
00033 unsigned short hlen : 3;
00034 unsigned short v : 1;
00035 unsigned short w : 1;
00036 unsigned short x : 1;
00037 unsigned short y : 1;
00038 } value;
00039 unsigned short final : 1;
00040 };
00041
00042 union huffpair {
00043 struct {
00044 unsigned short final : 1;
00045 unsigned short bits : 3;
00046 unsigned short offset : 12;
00047 } ptr;
00048 struct {
00049 unsigned short final : 1;
00050 unsigned short hlen : 3;
00051 unsigned short x : 4;
00052 unsigned short y : 4;
00053 } value;
00054 unsigned short final : 1;
00055 };
00056
00057 struct hufftable {
00058 union huffpair const *table;
00059 unsigned short linbits;
00060 unsigned short startbits;
00061 };
00062
00063 extern union huffquad const *const mad_huff_quad_table[2];
00064 extern struct hufftable const mad_huff_pair_table[32];
00065
00066 # endif