avcodec/mpeg12dec: Move non_linear_qscale to mpegvideodata

This will be used in the next commit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/151/head
Michael Niedermayer 9 years ago
parent 2d35757814
commit bf9464027b
  1. 9
      libavcodec/mpeg12dec.c
  2. 7
      libavcodec/mpegvideodata.c
  3. 2
      libavcodec/mpegvideodata.h

@ -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;
}

@ -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,

@ -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 */

Loading…
Cancel
Save