From bb9ac4f03b654b3ba6dcecaad3646705bbb0c2f9 Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Wed, 9 Oct 2013 16:59:12 +0300 Subject: [PATCH] Fixed quant to select table according to block type --- src/transform.c | 4 ++-- src/transform.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transform.c b/src/transform.c index a87aeb09..c0ec2d0f 100644 --- a/src/transform.c +++ b/src/transform.c @@ -756,7 +756,7 @@ void itransform2d(int16_t *block,int16_t *coeff, int8_t block_size, int32_t mode * */ void quant(encoder_control *encoder, int16_t *coef, int16_t *q_coef, int32_t width, - int32_t height, uint32_t *ac_sum, int8_t type, int8_t scan_idx ) + int32_t height, uint32_t *ac_sum, int8_t type, int8_t scan_idx, int8_t block_type ) { int8_t use_rdo_q_for_transform_skip = 0; uint32_t log2_block_size = g_convert_to_bit[ width ] + 2; @@ -786,7 +786,7 @@ void quant(encoder_control *encoder, int16_t *coef, int16_t *q_coef, int32_t wid int32_t n; uint32_t dir = 0; uint32_t log2_tr_size = g_convert_to_bit[ width ] + 2; - int32_t scalinglist_type = 3 + (int8_t)("\0\3\1\2"[type]); + int32_t scalinglist_type = (block_type == CU_INTRA ? 1 : 3) + (int8_t)("\0\3\1\2"[type]); int32_t *quant_coeff = g_quant_coeff[log2_tr_size-2][scalinglist_type][qp_scaled%6]; diff --git a/src/transform.h b/src/transform.h index c856d506..e11fe58c 100644 --- a/src/transform.h +++ b/src/transform.h @@ -23,7 +23,7 @@ extern const uint8_t g_chroma_scale[58]; void quant(encoder_control *encoder, int16_t *coef, int16_t *q_coef, int32_t width, - int32_t height, uint32_t *ac_sum, int8_t type, int8_t scan_idx ); + int32_t height, uint32_t *ac_sum, int8_t type, int8_t scan_idx, int8_t block_type); void dequant(encoder_control *encoder, int16_t *q_coef, int16_t *coef, int32_t width, int32_t height,int8_t type); void transform2d(int16_t *block,int16_t *coeff, int8_t block_size, int32_t mode);