[isp] Fix some asserts to allow log2_dim 1 block sizes. Fix coefficient group scan order for small dimensions.

This commit is contained in:
siivonek 2022-09-16 10:37:51 +03:00
parent 19106bfced
commit c46abbdaa1
3 changed files with 11 additions and 3 deletions

View file

@ -1248,7 +1248,8 @@ void uvg_intra_build_reference_inner(
const int cu_x = cu_loc->x;
const int cu_y = cu_loc->y;
assert((log2_width >= 2 && log2_width <= 5) && (log2_height >= 2 && log2_height <= 5));
// Log2_dim 1 is possible with ISP blocks
assert((log2_width >= 1 && log2_width <= 5) && (log2_height >= 1 && log2_height <= 5));
refs->filtered_initialized = false;
uvg_pixel * __restrict out_left_ref = &refs->ref.left[0];

View file

@ -66,7 +66,8 @@ static void uvg_angular_pred_generic(
const int log2_width = uvg_g_convert_to_log2[width];
const int log2_height = uvg_g_convert_to_log2[height];
assert((log2_width >= 2 && log2_width <= 5) && (log2_height >= 2 && log2_height <= 5));
// Log2_dim 1 is possible with ISP blocks
assert((log2_width >= 1 && log2_width <= 5) && (log2_height >= 1 && log2_height <= 5));
assert(intra_mode >= 2 && intra_mode <= 66);
static const int16_t modedisp2sampledisp[32] = { 0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 23, 26, 29, 32, 35, 39, 45, 51, 57, 64, 73, 86, 102, 128, 171, 256, 341, 512, 1024 };

View file

@ -2615,6 +2615,12 @@ 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 {
return g_scan_order[scan_group][log2_w - 2][log2_h - 2];
if (log2_w == 1 || log2_h == 1) {
// Just return array containing [0, 15] in order
return g_scan_order[scan_group][0][4];
}
else {
return g_scan_order[scan_group][log2_w - 2][log2_h - 2];
}
}
}