From 412781db417c8c3fccf122b08bd1a1e34292e4df Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Tue, 9 Mar 2021 10:42:40 +0200 Subject: [PATCH] [scalinglist] Fix quant-generic --- src/strategies/generic/quant-generic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/strategies/generic/quant-generic.c b/src/strategies/generic/quant-generic.c index e8cd3d29..f9393d9c 100644 --- a/src/strategies/generic/quant-generic.c +++ b/src/strategies/generic/quant-generic.c @@ -43,10 +43,10 @@ void kvz_quant_generic(const encoder_state_t * const state, coeff_t *coef, coeff const uint32_t * const scan = kvz_g_sig_last_scan[scan_idx][log2_block_size - 1]; int32_t qp_scaled = kvz_get_scaled_qp(type, state->qp, (encoder->bitdepth - 8) * 6); - uint32_t log2_tr_width = kvz_math_floor_log2(height) + 2; - uint32_t log2_tr_height = kvz_math_floor_log2(width) + 2; + uint32_t log2_tr_width = kvz_math_floor_log2(height); + uint32_t log2_tr_height = kvz_math_floor_log2(width); const int32_t scalinglist_type = (block_type == CU_INTRA ? 0 : 3) + (int8_t)("\0\3\1\2"[type]); - const int32_t *quant_coeff = encoder->scaling_list.quant_coeff[log2_tr_width - 2][log2_tr_height - 2][scalinglist_type][qp_scaled % 6]; + const int32_t *quant_coeff = encoder->scaling_list.quant_coeff[log2_tr_width][log2_tr_height][scalinglist_type][qp_scaled % 6]; const int32_t transform_shift = MAX_TR_DYNAMIC_RANGE - encoder->bitdepth - ((log2_tr_height + log2_tr_width) >> 1); //!< Represents scaling through forward transform const int32_t q_bits = QUANT_SHIFT + qp_scaled / 6 + transform_shift; const int32_t add = ((state->frame->slicetype == KVZ_SLICE_I) ? 171 : 85) << (q_bits - 9);