ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Fri Sep 18 00:35:28 2015 +0200| [bf9464027ba28f726ae6fff5754879ae098e5471] | committer: Michael Niedermayer
avcodec/mpeg12dec: Move non_linear_qscale to mpegvideodata This will be used in the next commit Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf9464027ba28f726ae6fff5754879ae098e5471 --- libavcodec/mpeg12dec.c | 9 +-------- libavcodec/mpegvideodata.c | 7 +++++++ libavcodec/mpegvideodata.h | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 0731605..5d916d1 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -96,13 +96,6 @@ static const uint32_t btype2mb_type[11] = { MB_TYPE_QUANT | MB_TYPE_L0L1 | MB_TYPE_CBP, }; -static const uint8_t non_linear_qscale[32] = { - 0, 1, 2, 3, 4, 5, 6, 7, - 8, 10, 12, 14, 16, 18, 20, 22, - 24, 28, 32, 36, 40, 44, 48, 52, - 56, 64, 72, 80, 88, 96, 104, 112, -}; - /* as H.263, but only 17 codes */ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred) { @@ -719,7 +712,7 @@ static inline int get_qscale(MpegEncContext *s) { int qscale = get_bits(&s->gb, 5); if (s->q_scale_type) - return non_linear_qscale[qscale]; + return ff_mpeg2_non_linear_qscale[qscale]; else return qscale << 1; } diff --git a/libavcodec/mpegvideodata.c b/libavcodec/mpegvideodata.c index 5c0c9c5..5f1d8f7 100644 --- a/libavcodec/mpegvideodata.c +++ b/libavcodec/mpegvideodata.c @@ -24,6 +24,13 @@ const uint8_t ff_default_chroma_qscale_table[32] = { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; +const uint8_t ff_mpeg2_non_linear_qscale[32] = { + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 10, 12, 14, 16, 18, 20, 22, + 24, 28, 32, 36, 40, 44, 48, 52, + 56, 64, 72, 80, 88, 96, 104, 112, +}; + const uint8_t ff_mpeg1_dc_scale_table[128] = { // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, diff --git a/libavcodec/mpegvideodata.h b/libavcodec/mpegvideodata.h index ebb9bbf..14f4806 100644 --- a/libavcodec/mpegvideodata.h +++ b/libavcodec/mpegvideodata.h @@ -28,6 +28,8 @@ extern const uint8_t ff_alternate_vertical_scan[64]; extern const uint8_t ff_mpeg1_dc_scale_table[128]; extern const uint8_t * const ff_mpeg2_dc_scale_table[4]; +extern const uint8_t ff_mpeg2_non_linear_qscale[32]; + extern const uint8_t ff_default_chroma_qscale_table[32]; #endif /* AVCODEC_MPEGVIDEODATA_H */ _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog