aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-09-24 15:07:44 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-09-24 15:07:44 +0000
commit9e4c69485b8eb17aa5db0734160420277a8fc1b7 (patch)
tree12af774e8a05c747dd3bcb31d68fc483c75a5e90 /libavcodec/mpegvideo.c
parentd87c0267e3a69886ae0a3c43e0adc9705056e8eb (diff)
downloadffmpeg-9e4c69485b8eb17aa5db0734160420277a8fc1b7.tar.gz
adaptive quantization for h263
Originally committed as revision 969 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 4b2b0ad6fd..cf72bb4359 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2190,12 +2190,19 @@ static void encode_picture(MpegEncContext *s, int picture_number)
else
s->frame_qscale = ff_rate_estimate_qscale(s);
- if(s->adaptive_quant && s->codec_id==CODEC_ID_MPEG4)
- ff_clean_mpeg4_qscales(s);
-
- if(s->adaptive_quant)
+ if(s->adaptive_quant){
+ switch(s->codec_id){
+ case CODEC_ID_MPEG4:
+ ff_clean_mpeg4_qscales(s);
+ break;
+ case CODEC_ID_H263:
+ case CODEC_ID_H263P:
+ ff_clean_h263_qscales(s);
+ break;
+ }
+
s->qscale= s->qscale_table[0];
- else
+ }else
s->qscale= (int)(s->frame_qscale + 0.5);
if (s->out_format == FMT_MJPEG) {