From 64c5cfb1270773e001ba02a664970318dce52dcd Mon Sep 17 00:00:00 2001 From: siivonek Date: Tue, 10 May 2022 10:38:26 +0300 Subject: [PATCH] [lfnst] Fix error in scan table selection. --- src/tables.c | 2 +- src/transform.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tables.c b/src/tables.c index 176ebc03..422fd714 100644 --- a/src/tables.c +++ b/src/tables.c @@ -5,7 +5,7 @@ #if LCU_WIDTH!=64 #error "LCU_WIDTH!=64" #endif - +// 4 8 16 32 64 const int8_t uvg_g_convert_to_bit[LCU_WIDTH + 1] = {-1, -1, -1, -1, 0, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4}; const uint32_t uvg_g_log2_sbb_size[7 + 1][7 + 1][2] = diff --git a/src/transform.c b/src/transform.c index 7da33742..80daa1ba 100644 --- a/src/transform.c +++ b/src/transform.c @@ -285,7 +285,7 @@ void kvz_fwd_lfnst(const cu_info_t* const cur_cu, const uint32_t log2_block_size = kvz_g_convert_to_bit[width] + 2; assert(log2_block_size != -1 && "LFNST: invalid block width."); const bool whge3 = width >= 8 && height >= 8; - const uint32_t* scan = whge3 ? kvz_coef_top_left_diag_scan_8x8[log2_block_size - 1] : kvz_g_sig_last_scan[SCAN_DIAG][log2_block_size - 1]; + const uint32_t* scan = whge3 ? kvz_coef_top_left_diag_scan_8x8[log2_block_size] : kvz_g_sig_last_scan[SCAN_DIAG][log2_block_size - 1]; if (is_cclm_mode) { intra_mode = cur_cu->intra.mode; @@ -415,7 +415,7 @@ void kvz_inv_lfnst(const cu_info_t *cur_cu, if (lfnst_index && !mts_skip && (is_separate_tree ? true : color == COLOR_Y)) { const uint32_t log2_block_size = kvz_g_convert_to_bit[width] + 2; const bool whge3 = width >= 8 && height >= 8; - const uint32_t* scan = whge3 ? kvz_coef_top_left_diag_scan_8x8[log2_block_size - 1] : kvz_g_sig_last_scan[SCAN_DIAG][log2_block_size - 1]; + const uint32_t* scan = whge3 ? kvz_coef_top_left_diag_scan_8x8[log2_block_size] : kvz_g_sig_last_scan[SCAN_DIAG][log2_block_size - 1]; if (is_cclm_mode) { intra_mode = cur_cu->intra.mode;