diff motion_est.c @ 954:13aec7e50c52 libavcodec

qpel in mmx2/3dnow qpel refinement quality parameter
author michaelni
date Sun, 05 Jan 2003 15:57:10 +0000
parents f348d302a51e
children dd421045b4ce
line wrap: on
line diff
--- a/motion_est.c	Fri Jan 03 23:21:52 2003 +0000
+++ b/motion_est.c	Sun Jan 05 15:57:10 2003 +0000
@@ -311,6 +311,7 @@
 }
 
 void ff_init_me(MpegEncContext *s){
+    set_cmp(s, s->dsp.me_pre_cmp, s->avctx->me_pre_cmp);
     set_cmp(s, s->dsp.me_cmp, s->avctx->me_cmp);
     set_cmp(s, s->dsp.me_sub_cmp, s->avctx->me_sub_cmp);
     set_cmp(s, s->dsp.mb_cmp, s->avctx->mb_cmp);
@@ -336,6 +337,12 @@
         s->me.motion_search[0]= simple_epzs_motion_search;
         s->me.motion_search[1]= simple_epzs_motion_search4;
     }
+    
+    if(s->avctx->me_pre_cmp&FF_CMP_CHROMA){
+        s->me.pre_motion_search= simple_chroma_epzs_motion_search;
+    }else{
+        s->me.pre_motion_search= simple_epzs_motion_search;
+    }
 }
       
 static int pix_dev(UINT8 * pix, int line_size, int mean)
@@ -1037,7 +1044,7 @@
     
     assert(s->quarter_sample==0 || s->quarter_sample==1);
 
-    s->me.penalty_factor    = get_penalty_factor(s, s->avctx->me_cmp);
+    s->me.pre_penalty_factor    = get_penalty_factor(s, s->avctx->me_pre_cmp);
 
     get_limits(s, &range, &xmin, &ymin, &xmax, &ymax, s->f_code);
     rel_xmin= xmin - mb_x*16;
@@ -1072,8 +1079,8 @@
         pred_x = P_MEDIAN[0];
         pred_y = P_MEDIAN[1];
     }
-    dmin = s->me.motion_search[0](s, 0, &mx, &my, P, pred_x, pred_y, rel_xmin, rel_ymin, rel_xmax, rel_ymax, 
-                                  &s->last_picture, s->p_mv_table, (1<<16)>>shift, mv_penalty);
+    dmin = s->me.pre_motion_search(s, 0, &mx, &my, P, pred_x, pred_y, rel_xmin, rel_ymin, rel_xmax, rel_ymax, 
+                                   &s->last_picture, s->p_mv_table, (1<<16)>>shift, mv_penalty);
 
     s->p_mv_table[xy][0] = mx<<shift;
     s->p_mv_table[xy][1] = my<<shift;