diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-08-26 22:26:18 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-08-26 22:26:18 +0000 |
commit | 2d5e962b06bbdb6b2f1252435020e569189839d1 (patch) | |
tree | 30ca2e6bcf831f0cb75e558e6ec1505c1bb5d36d /libavcodec | |
parent | 47017dd870e6284d76a60cf0d065fc32a55803b1 (diff) | |
download | ffmpeg-2d5e962b06bbdb6b2f1252435020e569189839d1.tar.gz |
100l (forget to reset me.skip for b frames)
Originally committed as revision 2170 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/motion_est.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index 17a5b1f79c..a533b1bf95 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -28,6 +28,7 @@ #include <stdlib.h> #include <stdio.h> +#include <limits.h> #include "avcodec.h" #include "dsputil.h" #include "mpegvideo.h" @@ -1494,20 +1495,27 @@ void ff_estimate_b_frame_motion(MpegEncContext * s, int fmin, bmin, dmin, fbmin; int type=0; - dmin= direct_search(s, mb_x, mb_y); + s->me.skip=0; + if (s->codec_id == CODEC_ID_MPEG4) + dmin= direct_search(s, mb_x, mb_y); + else + dmin= INT_MAX; + s->me.skip=0; fmin= ff_estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, &s->last_picture, s->f_code) + 3*penalty_factor; + + s->me.skip=0; bmin= ff_estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, &s->next_picture, s->b_code) + 2*penalty_factor; //printf(" %d %d ", s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1]); + s->me.skip=0; fbmin= bidir_refine(s, mb_x, mb_y) + penalty_factor; //printf("%d %d %d %d\n", dmin, fmin, bmin, fbmin); { int score= fmin; type = MB_TYPE_FORWARD; - // RAL: No MB_TYPE_DIRECT in MPEG-1 video (only MPEG-4) - if (s->codec_id == CODEC_ID_MPEG4 && dmin <= score){ + if (dmin <= score){ score = dmin; type = MB_TYPE_DIRECT; } |