summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-03-04 02:26:20 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-03-04 02:26:20 +0000
commit5a6b9443ed6136416363c64566f8374a7d084b17 (patch)
treefd03a97adf2b3fe92f122a81dbef1d833071d672 /libavcodec/mpegvideo.c
parent36264d3586eeab83bdae759792a2d5d2f3e263c2 (diff)
dummy support for mpeg2 non linear quant
Originally committed as revision 8215 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 89e333a040..9d7a0a70cc 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1015,6 +1015,7 @@ int MPV_encode_init(AVCodecContext *avctx)
s->loop_filter= !!(s->flags & CODEC_FLAG_LOOP_FILTER);
s->alternate_scan= !!(s->flags & CODEC_FLAG_ALT_SCAN);
s->intra_vlc_format= !!(s->flags2 & CODEC_FLAG2_INTRA_VLC);
+ s->q_scale_type= !!(s->flags2 & CODEC_FLAG2_NON_LINEAR_QUANT);
if(avctx->rc_max_rate && !avctx->rc_buffer_size){
av_log(avctx, AV_LOG_ERROR, "a vbv buffer size is needed, for encoding with a maximum bitrate\n");
@@ -1115,6 +1116,17 @@ int MPV_encode_init(AVCodecContext *avctx)
}
}
+ if(s->q_scale_type == 1){
+ if(s->codec_id != CODEC_ID_MPEG2VIDEO){
+ av_log(avctx, AV_LOG_ERROR, "non linear quant is only available for mpeg2\n");
+ return -1;
+ }
+ if(avctx->qmax > 12){
+ av_log(avctx, AV_LOG_ERROR, "non linear quant only supports qmax <= 12 currently\n");
+ return -1;
+ }
+ }
+
if(s->avctx->thread_count > 1 && s->codec_id != CODEC_ID_MPEG4
&& s->codec_id != CODEC_ID_MPEG1VIDEO && s->codec_id != CODEC_ID_MPEG2VIDEO
&& (s->codec_id != CODEC_ID_H263P || !(s->flags & CODEC_FLAG_H263P_SLICE_STRUCT))){