summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-09-13 12:37:39 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-09-13 12:37:39 +0000
commitc08a01a6b99de41bd54f00152b850d90d810755a (patch)
tree08e76f1a1718ba2b4c40d0b4b213c69dbc115b30 /libavcodec/motion_est_template.c
parent49e5dcbce5f9e08ec375fd54c413148beb81f1d7 (diff)
pre_cmp fix
Originally committed as revision 3458 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est_template.c')
-rw-r--r--libavcodec/motion_est_template.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c
index 6a0509f810..567202149e 100644
--- a/libavcodec/motion_est_template.c
+++ b/libavcodec/motion_est_template.c
@@ -855,7 +855,7 @@ static always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx
int best[2]={0, 0};
int d, dmin;
int map_generation;
- const int penalty_factor= c->penalty_factor;
+ int penalty_factor;
const int ref_mv_stride= s->mb_stride; //pass as arg FIXME
const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride; //add to last_mv beforepassing FIXME
me_cmp_func cmpf, chroma_cmpf;
@@ -863,8 +863,15 @@ static always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx
LOAD_COMMON
LOAD_COMMON2
- cmpf= s->dsp.me_cmp[size];
- chroma_cmpf= s->dsp.me_cmp[size+1];
+ if(c->pre_pass){
+ penalty_factor= c->pre_penalty_factor;
+ cmpf= s->dsp.me_pre_cmp[size];
+ chroma_cmpf= s->dsp.me_pre_cmp[size+1];
+ }else{
+ penalty_factor= c->penalty_factor;
+ cmpf= s->dsp.me_cmp[size];
+ chroma_cmpf= s->dsp.me_cmp[size+1];
+ }
map_generation= update_map_generation(c);