From 926ed7e14571a0eea9ed6f93b7ddf303666ef6c3 Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Thu, 15 Dec 2022 11:25:12 +0200 Subject: [PATCH] [rdoq] partly fix rdoq for 16x1 and 1x16 --- src/rdo.c | 2 +- src/tables.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rdo.c b/src/rdo.c index 6122269d..67605c4e 100644 --- a/src/rdo.c +++ b/src/rdo.c @@ -1461,7 +1461,7 @@ void uvg_rdoq( const uint32_t cg_size = 16; const int32_t shift = 4 >> 1; - const uint32_t num_blk_side = width >> shift; + const uint32_t num_blk_side = MAX(width >> shift, 1); double cost_coeffgroup_sig[ 64 ]; uint32_t sig_coeffgroup_flag[ 64 ]; diff --git a/src/tables.c b/src/tables.c index dec6f020..c98ecf79 100644 --- a/src/tables.c +++ b/src/tables.c @@ -2615,7 +2615,7 @@ const uint32_t* const uvg_get_scan_order_table(int scan_group, int scan_type, in return g_scan_order[scan_group][log2_w][log2_h]; } else { - if (log2_w == 1 || log2_h == 1) { + if (log2_w <= 1 || log2_h <= 1) { // Just return array containing [0, 15] in order return g_scan_order[scan_group][0][4]; }