aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-18 00:35:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-18 02:52:54 +0200
commitbf9464027ba28f726ae6fff5754879ae098e5471 (patch)
tree10d40ffca27d9cbfa2e72cd07834cffd888e937a
parent2d35757814ec0beae8be26f3af641cdbd91f2200 (diff)
downloadffmpeg-bf9464027ba28f726ae6fff5754879ae098e5471.tar.gz
avcodec/mpeg12dec: Move non_linear_qscale to mpegvideodata
This will be used in the next commit Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mpeg12dec.c9
-rw-r--r--libavcodec/mpegvideodata.c7
-rw-r--r--libavcodec/mpegvideodata.h2
3 files changed, 10 insertions, 8 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 0731605788..5d916d12ef 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 5c0c9c52b9..5f1d8f7c00 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 ebb9bbf1c5..14f4806d66 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 */