diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-01-05 15:57:10 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-01-05 15:57:10 +0000 |
commit | 826f429ae9990632a04b06bd375afa54ffe54b76 (patch) | |
tree | dce2b6a89402130f5e3c6a9426063a47991f285b /libavcodec/motion_est.c | |
parent | 70ac76c0eb13d74d2001e83d7803f3dc0299f86a (diff) | |
download | ffmpeg-826f429ae9990632a04b06bd375afa54ffe54b76.tar.gz |
qpel in mmx2/3dnow
qpel refinement quality parameter
Originally committed as revision 1393 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r-- | libavcodec/motion_est.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index dcc31a4a1a..da565eb95d 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -311,6 +311,7 @@ static inline int get_penalty_factor(MpegEncContext *s, int type){ } 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 @@ void ff_init_me(MpegEncContext *s){ 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 @@ int ff_pre_estimate_p_frame_motion(MpegEncContext * s, 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 @@ int ff_pre_estimate_p_frame_motion(MpegEncContext * s, 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; |