diff options
-rw-r--r-- | libmpeg2/header.c | 2 | ||||
-rw-r--r-- | libmpeg2/mpeg2_internal.h | 1 | ||||
-rw-r--r-- | libmpeg2/slice.c | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/libmpeg2/header.c b/libmpeg2/header.c index fb2288433f..e351af5a6f 100644 --- a/libmpeg2/header.c +++ b/libmpeg2/header.c @@ -803,7 +803,7 @@ static void prescale (mpeg2dec_t * mpeg2dec, int index) mpeg2dec->scaled[index] = mpeg2dec->q_scale_type; for (i = 0; i < 32; i++) { k = mpeg2dec->q_scale_type ? non_linear_scale[i] : (i << 1); - decoder->quantizer_scale = k; + decoder->quantizer_scales[i] = k; for (j = 0; j < 64; j++) decoder->quantizer_prescale[index][i][j] = k * mpeg2dec->quantizer_matrix[index][j]; diff --git a/libmpeg2/mpeg2_internal.h b/libmpeg2/mpeg2_internal.h index 0a4ca73f55..cdc7ee1e0c 100644 --- a/libmpeg2/mpeg2_internal.h +++ b/libmpeg2/mpeg2_internal.h @@ -146,6 +146,7 @@ struct mpeg2_decoder_s { int mpeg1; /* for MPlayer: */ + int quantizer_scales[32]; int quantizer_scale; char* quant_store; int quant_stride; diff --git a/libmpeg2/slice.c b/libmpeg2/slice.c index 35d99b6a5c..a58487f57c 100644 --- a/libmpeg2/slice.c +++ b/libmpeg2/slice.c @@ -142,6 +142,7 @@ static inline void get_quantizer_scale (mpeg2_decoder_t * const decoder) quantizer_scale_code = UBITS (bit_buf, 5); DUMPBITS (bit_buf, bits, 5); + decoder->quantizer_scale = decoder->quantizer_scales[quantizer_scale_code]; decoder->quantizer_matrix[0] = decoder->quantizer_prescale[0][quantizer_scale_code]; |