[isp] Fix chroma width error when writing cu loc. Remove redundant IPS mode checks.

This commit is contained in:
siivonek 2022-08-24 15:40:14 +03:00 committed by Marko Viitanen
parent b53308f258
commit 39f30563c5
3 changed files with 11 additions and 7 deletions

View file

@ -1355,12 +1355,16 @@ void uvg_encode_coding_tree(
const cu_array_t* used_array = tree_type != UVG_CHROMA_T ? frame->cu_array : frame->chroma_cu_array;
const cu_info_t *cur_cu = uvg_cu_array_at_const(used_array, x, y);
const int cu_width = tree_type != UVG_CHROMA_T ? LCU_WIDTH >> depth : LCU_WIDTH_C >> depth;
const int cu_height = cu_width; // TODO: height for non-square blocks
const int width = LCU_WIDTH >> depth;
const int height = width; // TODO: height for non-square blocks
cu_loc_t cu_loc;
uvg_cu_loc_ctor(&cu_loc, x, y, width, height);
const int cu_width = tree_type != UVG_CHROMA_T ? cu_loc.width : cu_loc.chroma_width;
const int cu_height = tree_type != UVG_CHROMA_T ? cu_loc.height : cu_loc.chroma_height;
const int half_cu = cu_width >> 1;
cu_loc_t cu_loc;
uvg_cu_loc_ctor(&cu_loc, x, y, cu_width, cu_height);
const cu_info_t *left_cu = NULL;
if (x > 0) {

View file

@ -1695,7 +1695,7 @@ void uvg_intra_recon_cu(
// ISP split is done horizontally or vertically depending on ISP mode, 2 or 4 times depending on block dimensions.
// Small blocks are split only twice.
int split_type = search_data->pred_cu.intra.isp_mode;
int split_limit = split_type == ISP_MODE_NO_ISP ? 1 : uvg_get_isp_split_num(width, height, split_type);
int split_limit = uvg_get_isp_split_num(width, height, split_type);
for (int i = 0; i < split_limit; ++i) {
cu_loc_t loc;

View file

@ -387,7 +387,7 @@ double uvg_cu_rd_cost_luma(const encoder_state_t *const state,
}
else {
int split_type = pred_cu->intra.isp_mode;
int split_limit = split_type == ISP_MODE_NO_ISP ? 1 : uvg_get_isp_split_num(width, height, split_type);
int split_limit = uvg_get_isp_split_num(width, height, split_type);
for (int i = 0; i < split_limit; ++i) {
cu_loc_t loc;
@ -626,7 +626,7 @@ static double cu_rd_cost_tr_split_accurate(
}
else {
int split_type = pred_cu->intra.isp_mode;
int split_limit = split_type == ISP_MODE_NO_ISP ? 1 : uvg_get_isp_split_num(width, height, split_type);
int split_limit = uvg_get_isp_split_num(width, height, split_type);
for (int i = 0; i < split_limit; ++i) {
cu_loc_t loc;