1 #ifndef _P263_HUFFMAN_H_
2 #define _P263_HUFFMAN_H_
4 #include <VLIB/video_huffman.h>
7 /// Macroblock type & Coded Block Pattern for Chrominance (MCBPC)
9 #define VLC_MCBPC_IPICTURES_NUM 9
10 #define VLC_MCBPC_IPICTURES_MAX_LENGTH 9
12 #define CBPC_CB(mcbpc) (((mcbpc).cbpc) & 1)
13 #define CBPC_CR(mcbpc) (((mcbpc).cbpc) & 2)
15 extern huffman_code_t vlc_mcbpc_ipictures[VLC_MCBPC_IPICTURES_NUM];
16 extern huffman_tree_t* vlc_mcbpc_ipictures_tree;
18 typedef struct _p263_mcbpc_t {
23 extern p263_mcbpc_t mcbpc_ipictures[VLC_MCBPC_IPICTURES_NUM];
26 /// Coded Block Pattern for luminance (CBPY)
28 #define VLC_CBPY_STANDARD_NUM 16
29 #define VLC_CBPY_STANDARD_MAX_LENGTH 6
31 extern huffman_code_t vlc_cbpy_standard[VLC_CBPY_STANDARD_NUM];
32 extern huffman_tree_t* vlc_cbpy_standard_tree;
34 #define CBPY_MAKE( i12, i34 ) (((i34) << 2) | (i12))
36 #define CBPY_INTRA_Y0(cpby) ((((cbpy).intra) >> 0) & 1)
37 #define CBPY_INTRA_Y1(cpby) ((((cbpy).intra) >> 1) & 1)
38 #define CBPY_INTRA_Y2(cpby) ((((cbpy).intra) >> 2) & 1)
39 #define CBPY_INTRA_Y3(cpby) ((((cbpy).intra) >> 3) & 1)
41 #define CBPY_INTER_Y0(cpby) ((((cbpy).inter) >> 0) & 1)
42 #define CBPY_INTER_Y1(cpby) ((((cbpy).inter) >> 1) & 1)
43 #define CBPY_INTER_Y2(cpby) ((((cbpy).inter) >> 2) & 1)
44 #define CBPY_INTER_Y3(cpby) ((((cbpy).inter) >> 3) & 1)
46 typedef struct _p263_cbpy_t {
51 extern p263_cbpy_t cbpy_standard[VLC_CBPY_STANDARD_NUM - 1];
54 /// Transform Coefficient (TCOEF)
56 #define VLC_TCOEFF_NUM 103
57 #define VLC_TCOEFF_MAX_LENGTH 12
58 #define VLC_TCOEFF_ESCAPE 2
60 extern huffman_code_t vlc_tcoeff[VLC_TCOEFF_NUM];
61 extern huffman_tree_t* vlc_tcoeff_tree;
63 typedef struct _p263_tcoeff_t {
69 extern p263_tcoeff_t tcoeff[VLC_TCOEFF_NUM];
72 /// VLC table for Motion Vector Data (MVD)
74 #define MVD_VLC_NUM 64
75 #define MVD_VLC_MAX_LENGTH 13
77 extern huffman_code_t mvd_vlc[MVD_VLC_NUM];
78 extern huffman_tree_t* mvd_vlc_tree;
80 typedef struct _p263_mvd_t {
85 extern p263_mvd_t mvd[MVD_VLC_NUM];
87 #endif // _P263_HUFFMAN_H_