comparison cavs.h @ 8796:c6dd98bff427 libavcodec

introduce a macroblock index to avoid a few x*width+y calculations
author stefang
date Tue, 10 Feb 2009 22:38:02 +0000
parents 7798afcf0b24
children 9a793cb05a85
comparison
equal deleted inserted replaced
8795:e18df4791658 8796:c6dd98bff427
164 int pic_structure; 164 int pic_structure;
165 int skip_mode_flag; ///< select between skip_count or one skip_flag per MB 165 int skip_mode_flag; ///< select between skip_count or one skip_flag per MB
166 int loop_filter_disable; 166 int loop_filter_disable;
167 int alpha_offset, beta_offset; 167 int alpha_offset, beta_offset;
168 int ref_flag; 168 int ref_flag;
169 int mbx, mby; ///< macroblock coordinates 169 int mbx, mby, mbidx; ///< macroblock coordinates
170 int flags; ///< availability flags of neighbouring macroblocks 170 int flags; ///< availability flags of neighbouring macroblocks
171 int stc; ///< last start code 171 int stc; ///< last start code
172 uint8_t *cy, *cu, *cv; ///< current MB sample pointers 172 uint8_t *cy, *cu, *cv; ///< current MB sample pointers
173 int left_qp; 173 int left_qp;
174 uint8_t *top_qp; 174 uint8_t *top_qp;
210 uint8_t topleft_border_y, topleft_border_u, topleft_border_v; 210 uint8_t topleft_border_y, topleft_border_u, topleft_border_v;
211 211
212 void (*intra_pred_l[8])(uint8_t *d,uint8_t *top,uint8_t *left,int stride); 212 void (*intra_pred_l[8])(uint8_t *d,uint8_t *top,uint8_t *left,int stride);
213 void (*intra_pred_c[7])(uint8_t *d,uint8_t *top,uint8_t *left,int stride); 213 void (*intra_pred_c[7])(uint8_t *d,uint8_t *top,uint8_t *left,int stride);
214 uint8_t *col_type_base; 214 uint8_t *col_type_base;
215 uint8_t *col_type;
216 215
217 /* scaling factors for MV prediction */ 216 /* scaling factors for MV prediction */
218 int sym_factor; ///< for scaling in symmetrical B block 217 int sym_factor; ///< for scaling in symmetrical B block
219 int direct_den[2]; ///< for scaling in direct B block 218 int direct_den[2]; ///< for scaling in direct B block
220 int scale_den[2]; ///< for scaling neighbouring MVs 219 int scale_den[2]; ///< for scaling neighbouring MVs
270 h->mv[MV_FWD_X0] = ff_cavs_intra_mv; 269 h->mv[MV_FWD_X0] = ff_cavs_intra_mv;
271 set_mvs(&h->mv[MV_FWD_X0], BLK_16X16); 270 set_mvs(&h->mv[MV_FWD_X0], BLK_16X16);
272 h->mv[MV_BWD_X0] = ff_cavs_intra_mv; 271 h->mv[MV_BWD_X0] = ff_cavs_intra_mv;
273 set_mvs(&h->mv[MV_BWD_X0], BLK_16X16); 272 set_mvs(&h->mv[MV_BWD_X0], BLK_16X16);
274 if(h->pic_type != FF_B_TYPE) 273 if(h->pic_type != FF_B_TYPE)
275 *h->col_type = I_8X8; 274 h->col_type_base[h->mbidx] = I_8X8;
276 } 275 }
277 276
278 static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf, 277 static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf,
279 DCTELEM *dst, int mul, int shift, int coeff_num) { 278 DCTELEM *dst, int mul, int shift, int coeff_num) {
280 int round = 1 << (shift - 1); 279 int round = 1 << (shift - 1);