summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-08-27 09:57:36 +0200
committerAnton Khirnov <anton@khirnov.net>2011-08-31 13:21:59 +0200
commit88262ca87df1054209ef6db255b521e412fd78fc (patch)
tree65624e7716e57ba6873c470380c3a5dd8f1cca31 /libavcodec/mpegvideo_enc.c
parent2c5e1efc093084f1cb4e55b8c06c267801828965 (diff)
mpeg2enc: add 'non_linear_quant' private option
Deprecate CODEC_FLAG2_NON_LINEAR_QUANT
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 42fd6609c9..1f8f9f49d6 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -338,8 +338,8 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
s->alternate_scan= !!(s->flags & CODEC_FLAG_ALT_SCAN);
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
s->intra_vlc_format= !!(s->flags2 & CODEC_FLAG2_INTRA_VLC);
-#endif
s->q_scale_type= !!(s->flags2 & CODEC_FLAG2_NON_LINEAR_QUANT);
+#endif
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");
@@ -463,10 +463,12 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
}
if(s->q_scale_type == 1){
+#if FF_API_MPEGVIDEO_GLOBAL_OPTS
if(s->codec_id != CODEC_ID_MPEG2VIDEO){
av_log(avctx, AV_LOG_ERROR, "non linear quant is only available for mpeg2\n");
return -1;
}
+#endif
if(avctx->qmax > 12){
av_log(avctx, AV_LOG_ERROR, "non linear quant only supports qmax <= 12 currently\n");
return -1;