Browse code

pre_cmp fix

Originally committed as revision 3458 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2004/09/13 21:37:39
Showing 1 changed files
... ...
@@ -855,7 +855,7 @@ static always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx
855 855
     int best[2]={0, 0};
856 856
     int d, dmin;
857 857
     int map_generation;
858
-    const int penalty_factor= c->penalty_factor;
858
+    int penalty_factor;
859 859
     const int ref_mv_stride= s->mb_stride; //pass as arg  FIXME
860 860
     const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride; //add to last_mv beforepassing FIXME
861 861
     me_cmp_func cmpf, chroma_cmpf;
... ...
@@ -863,8 +863,15 @@ static always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx
863 863
     LOAD_COMMON
864 864
     LOAD_COMMON2
865 865
     
866
-    cmpf= s->dsp.me_cmp[size];
867
-    chroma_cmpf= s->dsp.me_cmp[size+1];
866
+    if(c->pre_pass){
867
+        penalty_factor= c->pre_penalty_factor;
868
+        cmpf= s->dsp.me_pre_cmp[size];
869
+        chroma_cmpf= s->dsp.me_pre_cmp[size+1];
870
+    }else{
871
+        penalty_factor= c->penalty_factor;
872
+        cmpf= s->dsp.me_cmp[size];
873
+        chroma_cmpf= s->dsp.me_cmp[size+1];
874
+    }
868 875
     
869 876
     map_generation= update_map_generation(c);
870 877