1 /*****************************************************************************
2 * vpar_blocks.h : video parser blocks management
4 *****************************************************************************
5 *****************************************************************************
16 *****************************************************************************/
18 /*****************************************************************************
19 * macroblock_t : information on a macroblock
20 *****************************************************************************/
21 typedef struct macroblock_s
23 picture_t * p_picture;
25 int i_l_x, i_l_y; /* position of macroblock (lum) */
26 int i_c_x, i_c_y; /* position of macroblock (chroma) */
27 int i_chroma_nb_blocks; /* nb of bks for a chr comp */
28 int i_l_stride; /* number of data_t to ignore
29 * when changing lines */
30 int i_c_stride; /* idem, for chroma */
32 /* IDCT information */
33 elem_t ppi_blocks[12][64]; /* blocks */
34 f_idct_t pf_idct[12]; /* sparse IDCT or not ? */
35 int pi_sparse_pos[12];
37 /* Motion compensation information */
38 f_motion_t pf_motion; /* function to use for motion comp */
39 f_chroma_motion_t pf_chroma_motion;
40 picture_t * p_backward;
41 picture_t * p_forward;
42 int ppi_field_select[2][2];
43 int pppi_motion_vectors[2][2][2];
46 /* AddBlock information */
47 f_addb_t pf_addb[12]; /* pointer to the Add function */
48 data_t p_data[12]; /* pointer to the position
49 * in the final picture */
50 int i_addb_l_stride, i_addb_c_stride;
53 /*****************************************************************************
54 * macroblock_parsing_t : parser context descriptor #3
55 *****************************************************************************/
58 int i_mb_type, i_motion_type, i_mv_count, i_mv_format;
60 /* AddressIncrement information */
64 int i_coded_block_pattern;
67 int i_l_x, i_l_y, i_c_x, i_c_y;
68 } macroblock_parsing_t;
70 /*****************************************************************************
71 * lookup_t : entry type for lookup tables *
72 *****************************************************************************/
74 typedef struct lookup_s
80 /******************************************************************************
81 * ac_lookup_t : special entry type for lookup tables about ac coefficients
82 *****************************************************************************/
84 typedef struct dct_lookup_s
91 /*****************************************************************************
93 *****************************************************************************/
94 /* Macroblock types */
97 #define MB_MOTION_BACKWARD 4
98 #define MB_MOTION_FORWARD 8
102 #define MOTION_FIELD 1
103 #define MOTION_FRAME 2
104 #define MOTION_16X8 2
107 /* Macroblock Address Increment types */
108 #define MB_ADDRINC_ESCAPE 8
109 #define MB_ADDRINC_STUFFING 15
111 /* Error constant for lookup tables */
112 #define MB_ERROR (-1)
115 #define SCAN_ZIGZAG 0
118 /* Constant for block decoding */
120 #define DCT_ESCAPE 65
122 /*****************************************************************************
124 *****************************************************************************/
125 extern int * pi_default_intra_quant;
126 extern int * pi_default_nonintra_quant;
127 extern u8 pi_scan[2][64];
129 /*****************************************************************************
131 *****************************************************************************/
132 void vpar_InitCrop( struct vpar_thread_s* p_vpar );
133 int vpar_CodedPattern420( struct vpar_thread_s* p_vpar );
134 int vpar_CodedPattern422( struct vpar_thread_s* p_vpar );
135 int vpar_CodedPattern444( struct vpar_thread_s* p_vpar );
136 int vpar_IMBType( struct vpar_thread_s* p_vpar );
137 int vpar_PMBType( struct vpar_thread_s* p_vpar );
138 int vpar_BMBType( struct vpar_thread_s* p_vpar );
139 int vpar_DMBType( struct vpar_thread_s* p_vpar );