aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-18 00:37:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-18 02:52:57 +0200
commit58fe57d5a05ad8d15c320b2bd163debbc412bdd3 (patch)
tree53f93217e69f6b7cbed9922908c34cec43b8c909 /libavcodec/mpegvideo.c
parentbf9464027ba28f726ae6fff5754879ae098e5471 (diff)
downloadffmpeg-58fe57d5a05ad8d15c320b2bd163debbc412bdd3.tar.gz
avcodec/mpeg12enc: Basic support for encoding non even QPs for -non_linear_quant 1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 7c0e9c43e5..96634ec7b5 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -114,7 +114,8 @@ static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
int i, level, nCoeffs;
const uint16_t *quant_matrix;
- qscale <<= 1;
+ if (s->q_scale_type) qscale = ff_mpeg2_non_linear_qscale[qscale];
+ else qscale <<= 1;
if(s->alternate_scan) nCoeffs= 63;
else nCoeffs= s->block_last_index[n];
@@ -144,7 +145,8 @@ static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
const uint16_t *quant_matrix;
int sum=-1;
- qscale <<= 1;
+ if (s->q_scale_type) qscale = ff_mpeg2_non_linear_qscale[qscale];
+ else qscale <<= 1;
if(s->alternate_scan) nCoeffs= 63;
else nCoeffs= s->block_last_index[n];
@@ -177,7 +179,8 @@ static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
const uint16_t *quant_matrix;
int sum=-1;
- qscale <<= 1;
+ if (s->q_scale_type) qscale = ff_mpeg2_non_linear_qscale[qscale];
+ else qscale <<= 1;
if(s->alternate_scan) nCoeffs= 63;
else nCoeffs= s->block_last_index[n];