1 /*****************************************************************************
2 * vpar_blocks.h : video parser blocks management
4 *****************************************************************************
5 *****************************************************************************
16 *****************************************************************************/
18 /*****************************************************************************
20 *****************************************************************************/
21 typedef void (*f_parse_mb_t)( struct vpar_thread_s*, int *, int, int,
22 boolean_t, int, int, int, boolean_t);
24 /*****************************************************************************
25 * macroblock_t : information on a macroblock
26 *****************************************************************************/
27 typedef struct macroblock_s
29 int i_mb_type; /* macroblock type */
30 int i_coded_block_pattern;
31 int i_chroma_nb_blocks; /* nb of bks for a chr comp */
32 picture_t * p_picture;
34 /* IDCT information */
35 dctelem_t ppi_blocks[12][64]; /* blocks */
36 f_idct_t pf_idct[12]; /* sparse IDCT or not ? */
37 int pi_sparse_pos[12];
39 /* Motion compensation information */
40 f_motion_t pf_motion; /* function to use for motion comp */
41 picture_t * p_backward;
42 picture_t * p_forward;
43 int ppi_field_select[2][2];
44 int pppi_motion_vectors[2][2][2];
49 int i_l_stride; /* number of yuv_data_t to
50 * ignore when changing line */
51 int i_c_stride; /* idem, for chroma */
52 boolean_t b_P_second; /* Second field of a P picture ?
53 * (used to determine the predicting
55 boolean_t b_motion_field; /* Field we are predicting
56 * (top field or bottom field) */
58 /* AddBlock information */
59 yuv_data_t * p_data[12]; /* pointer to the position
60 * in the final picture */
61 int i_addb_l_stride, i_addb_c_stride;
62 /* nb of coeffs to jump when changing lines */
65 /*****************************************************************************
66 * macroblock_parsing_t : parser context descriptor #3
67 *****************************************************************************/
70 int i_motion_type, i_mv_count, i_mv_format;
71 boolean_t b_dmv, b_dct_type;
73 int i_l_x, i_l_y, i_c_x, i_c_y;
74 } macroblock_parsing_t;
76 /*****************************************************************************
77 * lookup_t : entry type for lookup tables *
78 *****************************************************************************/
80 typedef struct lookup_s
86 /******************************************************************************
87 * ac_lookup_t : special entry type for lookup tables about ac coefficients
88 *****************************************************************************/
90 typedef struct dct_lookup_s
97 /*****************************************************************************
99 *****************************************************************************/
100 /* Macroblock types */
103 #define MB_MOTION_BACKWARD 4
104 #define MB_MOTION_FORWARD 8
108 #define MOTION_FIELD 1
109 #define MOTION_FRAME 2
110 #define MOTION_16X8 2
113 /* Macroblock Address Increment types */
114 #define MB_ADDRINC_ESCAPE 8
115 #define MB_ADDRINC_STUFFING 15
117 /* Error constant for lookup tables */
118 #define MB_ERROR (-1)
121 #define SCAN_ZIGZAG 0
124 /* Constant for block decoding */
126 #define DCT_ESCAPE 65
128 /*****************************************************************************
130 *****************************************************************************/
131 extern int pi_default_intra_quant[];
132 extern int pi_default_nonintra_quant[];
133 extern u8 pi_scan[2][64];
135 /*****************************************************************************
137 *****************************************************************************/
138 void vpar_InitCrop( struct vpar_thread_s* p_vpar );
139 void vpar_InitMbAddrInc( struct vpar_thread_s * p_vpar );
140 void vpar_InitPMBType( struct vpar_thread_s * p_vpar );
141 void vpar_InitBMBType( struct vpar_thread_s * p_vpar );
142 void vpar_InitCodedPattern( struct vpar_thread_s * p_vpar );
143 void vpar_InitDCTTables( struct vpar_thread_s * p_vpar );
144 void vpar_ParseMacroblockGENERIC( struct vpar_thread_s* p_vpar, int * pi_mb_address,
145 int i_mb_previous, int i_mb_base,
146 boolean_t b_mpeg2, int i_coding_type,
147 int i_chroma_format, int i_structure,
148 boolean_t b_second_field );
149 void vpar_ParseMacroblock2I420F0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
150 int i_mb_previous, int i_mb_base,
151 boolean_t b_mpeg2, int i_coding_type,
152 int i_chroma_format, int i_structure,
153 boolean_t b_second_field );
154 void vpar_ParseMacroblock2P420F0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
155 int i_mb_previous, int i_mb_base,
156 boolean_t b_mpeg2, int i_coding_type,
157 int i_chroma_format, int i_structure,
158 boolean_t b_second_field );
159 void vpar_ParseMacroblock2B420F0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
160 int i_mb_previous, int i_mb_base,
161 boolean_t b_mpeg2, int i_coding_type,
162 int i_chroma_format, int i_structure,
163 boolean_t b_second_field );
164 void vpar_ParseMacroblock2I420T0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
165 int i_mb_previous, int i_mb_base,
166 boolean_t b_mpeg2, int i_coding_type,
167 int i_chroma_format, int i_structure,
168 boolean_t b_second_field );
169 void vpar_ParseMacroblock2P420T0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
170 int i_mb_previous, int i_mb_base,
171 boolean_t b_mpeg2, int i_coding_type,
172 int i_chroma_format, int i_structure,
173 boolean_t b_second_field );
174 void vpar_ParseMacroblock2B420T0( struct vpar_thread_s* p_vpar, int * pi_mb_address,
175 int i_mb_previous, int i_mb_base,
176 boolean_t b_mpeg2, int i_coding_type,
177 int i_chroma_format, int i_structure,
178 boolean_t b_second_field );
179 void vpar_ParseMacroblock2I420B1( struct vpar_thread_s* p_vpar, int * pi_mb_address,
180 int i_mb_previous, int i_mb_base,
181 boolean_t b_mpeg2, int i_coding_type,
182 int i_chroma_format, int i_structure,
183 boolean_t b_second_field );
184 void vpar_ParseMacroblock2P420B1( struct vpar_thread_s* p_vpar, int * pi_mb_address,
185 int i_mb_previous, int i_mb_base,
186 boolean_t b_mpeg2, int i_coding_type,
187 int i_chroma_format, int i_structure,
188 boolean_t b_second_field );
189 void vpar_ParseMacroblock2B420B1( struct vpar_thread_s* p_vpar, int * pi_mb_address,
190 int i_mb_previous, int i_mb_base,
191 boolean_t b_mpeg2, int i_coding_type,
192 int i_chroma_format, int i_structure,
193 boolean_t b_second_field );