1 /*****************************************************************************
2 * vpar_blocks.h : video parser blocks management
4 *****************************************************************************
5 *****************************************************************************
16 *****************************************************************************/
18 /*****************************************************************************
19 * macroblock_t : information on a macroblock passed to the video_decoder
21 *****************************************************************************/
22 typedef struct macroblock_s
24 picture_t * p_picture; /* current frame in progress */
26 int i_mb_type; /* macroblock type */
27 int i_coded_block_pattern;
28 /* which blocks are coded ? */
29 int i_chroma_nb_blocks; /* number of blocks for
30 * chroma components */
32 /* IDCT information */
33 dctelem_t ppi_blocks[12][64]; /* blocks */
34 f_idct_t pf_idct[12]; /* sparse IDCT or not ? */
35 int pi_sparse_pos[12]; /* position of the
38 /* Motion compensation information */
39 f_motion_t pf_motion; /* function to use for motion comp */
40 picture_t * p_backward; /* backward reference frame */
41 picture_t * p_forward; /* forward reference frame */
42 int ppi_field_select[2][2]; /* field to use to
44 int pppi_motion_vectors[2][2][2]; /* motion vectors */
45 int ppi_dmv[2][2]; /* differential motion vectors */
46 /* coordinates of the block in the picture */
50 int i_l_stride; /* number of yuv_data_t to
51 * ignore when changing line */
52 int i_c_stride; /* idem, for chroma */
53 boolean_t b_P_second; /* Second field of a P picture ?
54 * (used to determine the predicting
56 boolean_t b_motion_field; /* Field we are predicting
57 * (top field or bottom field) */
59 /* AddBlock information */
60 yuv_data_t * p_data[12]; /* pointer to the position
61 * in the final picture */
62 int i_addb_l_stride, i_addb_c_stride;
63 /* nb of coeffs to jump when changing lines */
66 /*****************************************************************************
67 * macroblock_parsing_t : macroblock context & predictors
68 *****************************************************************************/
71 unsigned char i_quantizer_scale; /* scale of the quantization
73 int pi_dc_dct_pred[3]; /* ISO/IEC 13818-2 7.2.1 */
74 int pppi_pmv[2][2][2]; /* Motion vect predictors, 7.6.3 */
76 /* Context used to optimize block parsing */
77 int i_motion_type, i_mv_count, i_mv_format;
78 boolean_t b_dmv, b_dct_type;
80 /* Coordinates of the upper-left pixel of the macroblock, in lum and
82 int i_l_x, i_l_y, i_c_x, i_c_y;
83 } macroblock_parsing_t;
85 /*****************************************************************************
86 * lookup_t : entry type for lookup tables *
87 *****************************************************************************/
88 typedef struct lookup_s
94 /******************************************************************************
95 * ac_lookup_t : special entry type for lookup tables about ac coefficients
96 *****************************************************************************/
97 typedef struct dct_lookup_s
104 /*****************************************************************************
106 *****************************************************************************/
107 /* Macroblock types */
110 #define MB_MOTION_BACKWARD 4
111 #define MB_MOTION_FORWARD 8
115 #define MOTION_FIELD 1
116 #define MOTION_FRAME 2
117 #define MOTION_16X8 2
120 /* Macroblock Address Increment types */
121 #define MB_ADDRINC_ESCAPE 8
122 #define MB_ADDRINC_STUFFING 15
124 /* Error constant for lookup tables */
125 #define MB_ERROR (-1)
128 #define SCAN_ZIGZAG 0
131 /* Constant for block decoding */
133 #define DCT_ESCAPE 65
135 /*****************************************************************************
137 *****************************************************************************/
138 extern int pi_default_intra_quant[];
139 extern int pi_default_nonintra_quant[];
140 extern u8 pi_scan[2][64];
142 /*****************************************************************************
144 *****************************************************************************/
145 void vpar_InitCrop( struct vpar_thread_s* p_vpar );
146 void vpar_InitMbAddrInc( struct vpar_thread_s * p_vpar );
147 void vpar_InitPMBType( struct vpar_thread_s * p_vpar );
148 void vpar_InitBMBType( struct vpar_thread_s * p_vpar );
149 void vpar_InitCodedPattern( struct vpar_thread_s * p_vpar );
150 void vpar_InitDCTTables( struct vpar_thread_s * p_vpar );
151 void vpar_PictureDataGENERIC( struct vpar_thread_s * p_vpar, int i_mb_base );
152 #if (VPAR_OPTIM_LEVEL > 0)
153 void vpar_PictureData2I420F0( struct vpar_thread_s * p_vpar, int i_mb_base );
154 void vpar_PictureData2P420F0( struct vpar_thread_s * p_vpar, int i_mb_base );
155 void vpar_PictureData2B420F0( struct vpar_thread_s * p_vpar, int i_mb_base );
157 #if (VPAR_OPTIM_LEVEL > 1)
158 void vpar_PictureData2I420TZ( struct vpar_thread_s * p_vpar, int i_mb_base );
159 void vpar_PictureData2P420TZ( struct vpar_thread_s * p_vpar, int i_mb_base );
160 void vpar_PictureData2B420TZ( struct vpar_thread_s * p_vpar, int i_mb_base );
161 void vpar_PictureData2I420BZ( struct vpar_thread_s * p_vpar, int i_mb_base );
162 void vpar_PictureData2P420BZ( struct vpar_thread_s * p_vpar, int i_mb_base );
163 void vpar_PictureData2B420BZ( struct vpar_thread_s * p_vpar, int i_mb_base );