diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-02-14 03:49:43 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-02-14 03:49:43 +0000 |
commit | fafbc7c8c8605ee25c9616ae19fec2eacd79d28f (patch) | |
tree | 4956b3228e03566b54852960c13869b1151ae8ba /libavcodec | |
parent | 3a1fa44759687a8612cf1b96acd65bb5ea73ce0f (diff) | |
download | ffmpeg-fafbc7c8c8605ee25c9616ae19fec2eacd79d28f.tar.gz |
mpeg4 b frame + adaptive quantization assertion failure fix
Originally committed as revision 2779 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 824640c7c4..f0cd28c73d 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -3412,13 +3412,20 @@ static void encode_mb(MpegEncContext *s, int motion_x, int motion_y) if(!(s->flags&CODEC_FLAG_QP_RD)){ s->dquant= s->qscale - last_qp; - if(s->out_format==FMT_H263) + if(s->out_format==FMT_H263){ s->dquant= clip(s->dquant, -2, 2); //FIXME RD - if(s->codec_id==CODEC_ID_MPEG4){ - if(!s->mb_intra){ - if((s->mv_dir&MV_DIRECT) || s->mv_type==MV_TYPE_8X8) - s->dquant=0; + if(s->codec_id==CODEC_ID_MPEG4){ + if(!s->mb_intra){ + if(s->pict_type == B_TYPE){ + if(s->dquant&1) + s->dquant= (s->dquant/2)*2; + if(s->mv_dir&MV_DIRECT) + s->dquant= 0; + } + if(s->mv_type==MV_TYPE_8X8) + s->dquant=0; + } } } } @@ -3969,6 +3976,7 @@ static int mb_var_thread(AVCodecContext *c, void *arg){ s->mb_var_sum_temp += varc; } } + return 0; } static void write_slice_end(MpegEncContext *s){ |