comparison motion_est.c @ 2075:aae3b4e66560 libavcodec

chroma me fix
author michael
date Fri, 11 Jun 2004 21:12:46 +0000
parents c200977cdf78
children 3378d0677903
comparison
equal deleted inserted replaced
2074:2faafe7a3db6 2075:aae3b4e66560
236 case FF_CMP_BIT: 236 case FF_CMP_BIT:
237 return 1; 237 return 1;
238 } 238 }
239 } 239 }
240 240
241 static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h){
242 return 0;
243 }
244
245 static void zero_hpel(uint8_t *a, const uint8_t *b, int stride, int h){
246 }
247
241 void ff_init_me(MpegEncContext *s){ 248 void ff_init_me(MpegEncContext *s){
242 MotionEstContext * const c= &s->me; 249 MotionEstContext * const c= &s->me;
243 c->avctx= s->avctx; 250 c->avctx= s->avctx;
244 251
245 ff_set_cmp(&s->dsp, s->dsp.me_pre_cmp, c->avctx->me_pre_cmp); 252 ff_set_cmp(&s->dsp, s->dsp.me_pre_cmp, c->avctx->me_pre_cmp);
264 && c->avctx-> me_cmp == FF_CMP_SAD 271 && c->avctx-> me_cmp == FF_CMP_SAD
265 && c->avctx-> mb_cmp == FF_CMP_SAD) 272 && c->avctx-> mb_cmp == FF_CMP_SAD)
266 c->sub_motion_search= sad_hpel_motion_search; // 2050 vs. 2450 cycles 273 c->sub_motion_search= sad_hpel_motion_search; // 2050 vs. 2450 cycles
267 else 274 else
268 c->sub_motion_search= hpel_motion_search; 275 c->sub_motion_search= hpel_motion_search;
269 c->hpel_avg= s->dsp.avg_pixels_tab; 276 }
270 if(s->no_rounding) c->hpel_put= s->dsp.put_no_rnd_pixels_tab; 277 c->hpel_avg= s->dsp.avg_pixels_tab;
271 else c->hpel_put= s->dsp.put_pixels_tab; 278 if(s->no_rounding) c->hpel_put= s->dsp.put_no_rnd_pixels_tab;
272 } 279 else c->hpel_put= s->dsp.put_pixels_tab;
280
273 if(s->linesize){ 281 if(s->linesize){
274 c->stride = s->linesize; 282 c->stride = s->linesize;
275 c->uvstride= s->uvlinesize; 283 c->uvstride= s->uvlinesize;
276 }else{ 284 }else{
277 c->stride = 16*s->mb_width + 32; 285 c->stride = 16*s->mb_width + 32;
278 c->uvstride= 8*s->mb_width + 16; 286 c->uvstride= 8*s->mb_width + 16;
279 } 287 }
288
289 // 8x8 fullpel search would need a 4x4 chroma compare, which we dont have yet, and even if we had the motion estimation code doesnt expect it
290 if((c->avctx->me_cmp&FF_CMP_CHROMA) && !s->dsp.me_cmp[2]){
291 s->dsp.me_cmp[2]= zero_cmp;
292 }
293 if((c->avctx->me_sub_cmp&FF_CMP_CHROMA) && !s->dsp.me_sub_cmp[2]){
294 s->dsp.me_sub_cmp[2]= zero_cmp;
295 }
296 c->hpel_put[2][0]= c->hpel_put[2][1]=
297 c->hpel_put[2][2]= c->hpel_put[2][3]= zero_hpel;
280 298
281 c->temp= c->scratchpad; 299 c->temp= c->scratchpad;
282 } 300 }
283 301
284 #if 0 302 #if 0