1 #ifndef _P263_HUFFMAN_H_
2 #define _P263_HUFFMAN_H_
4 #include <VLIB/video_huffman.h>
12 /// Macroblock type & Coded Block Pattern for Chrominance (MCBPC)
14 #define VLC_MCBPC_IPICTURES_NUM 9
15 #define VLC_MCBPC_IPICTURES_MAX_LENGTH 9
17 #define CBPC_CB(mcbpc) (((mcbpc).cbpc) & 1)
18 #define CBPC_CR(mcbpc) (((mcbpc).cbpc) & 2)
20 extern huffman_code_t vlc_mcbpc_ipictures[VLC_MCBPC_IPICTURES_NUM];
21 extern huffman_tree_t* vlc_mcbpc_ipictures_tree;
23 typedef struct _p263_mcbpc_t {
28 extern p263_mcbpc_t mcbpc_ipictures[VLC_MCBPC_IPICTURES_NUM];
31 /// Coded Block Pattern for luminance (CBPY)
33 #define VLC_CBPY_STANDARD_NUM 16
34 #define VLC_CBPY_STANDARD_MAX_LENGTH 6
36 extern huffman_code_t vlc_cbpy_standard[VLC_CBPY_STANDARD_NUM];
37 extern huffman_tree_t* vlc_cbpy_standard_tree;
39 #define CBPY_MAKE( i12, i34 ) (((i34) << 2) | (i12))
41 #define CBPY_INTRA_Y0(cpby) ((((cbpy).intra) >> 0) & 1)
42 #define CBPY_INTRA_Y1(cpby) ((((cbpy).intra) >> 1) & 1)
43 #define CBPY_INTRA_Y2(cpby) ((((cbpy).intra) >> 2) & 1)
44 #define CBPY_INTRA_Y3(cpby) ((((cbpy).intra) >> 3) & 1)
46 #define CBPY_INTER_Y0(cpby) ((((cbpy).inter) >> 0) & 1)
47 #define CBPY_INTER_Y1(cpby) ((((cbpy).inter) >> 1) & 1)
48 #define CBPY_INTER_Y2(cpby) ((((cbpy).inter) >> 2) & 1)
49 #define CBPY_INTER_Y3(cpby) ((((cbpy).inter) >> 3) & 1)
51 typedef struct _p263_cbpy_t {
56 extern p263_cbpy_t cbpy_standard[VLC_CBPY_STANDARD_NUM - 1];
59 /// Transform Coefficient (TCOEF)
61 #define VLC_TCOEFF_NUM 103
62 #define VLC_TCOEFF_MAX_LENGTH 12
63 #define VLC_TCOEFF_ESCAPE 2
65 extern huffman_code_t vlc_tcoeff[VLC_TCOEFF_NUM];
66 extern huffman_tree_t* vlc_tcoeff_tree;
68 typedef struct _p263_tcoeff_t {
74 extern p263_tcoeff_t tcoeff[VLC_TCOEFF_NUM];
77 /// VLC table for Motion Vector Data (MVD)
79 #define MVD_VLC_NUM 64
80 #define MVD_VLC_MAX_LENGTH 13
82 extern huffman_code_t mvd_vlc[MVD_VLC_NUM];
83 extern huffman_tree_t* mvd_vlc_tree;
85 typedef struct _p263_mvd_t {
90 extern p263_mvd_t mvd[MVD_VLC_NUM];
92 #endif // _P263_HUFFMAN_H_