[isp] Add lfnst asserts. Fix error in MTS search. Fix chroma lfnst index when no coefficients present.

This commit is contained in:
siivonek 2022-09-26 14:44:51 +03:00
parent 6975febccf
commit bd2e588a22
3 changed files with 10 additions and 5 deletions

View file

@ -230,6 +230,12 @@ static bool encode_lfnst_idx(
return true;
}
else {
if(depth != 4 || color == COLOR_Y) {
assert(pred_cu->lfnst_idx == 0);
}
if(depth == 4 && color != COLOR_Y) {
assert(pred_cu->cr_lfnst_idx == 0);
}
return false;
}
}

View file

@ -343,9 +343,7 @@ static double search_intra_trdepth(
const int max_tb_size = TR_MAX_WIDTH;
// LFNST search params
int max_lfnst_idx = width > max_tb_size || height > max_tb_size ?
0 :
2;
int max_lfnst_idx = width > max_tb_size || height > max_tb_size ? 0 : 2;
if(pred_cu->intra.mip_flag && (width < 16 || height < 16)) {
max_lfnst_idx = 0;
}
@ -379,8 +377,8 @@ static double search_intra_trdepth(
pred_cu->mts_last_scan_pos = 0;
pred_cu->violates_mts_coeff_constraint = 0;
if ((trafo == MTS_SKIP && width > (1 << state->encoder_control->cfg.trskip_max_size))
|| !state->encoder_control->cfg.trskip_enable) {
if (trafo == MTS_SKIP && (width > (1 << state->encoder_control->cfg.trskip_max_size)
|| !state->encoder_control->cfg.trskip_enable)) {
continue;
}
}

View file

@ -580,6 +580,7 @@ void uvg_chroma_transform_search(
&u_has_coeffs,
&v_has_coeffs,
pred_cu->cr_lfnst_idx);
if(pred_cu->cr_lfnst_idx !=0 && !u_has_coeffs && !v_has_coeffs) continue;
if(pred_cu->type == CU_INTRA && transforms[i] != CHROMA_TS && (depth == 4 || tree_type == UVG_CHROMA_T)) {
bool constraints[2] = { false, false };