[dual-tree] works for depths 1 and 2

This commit is contained in:
Joose Sainio 2022-06-08 16:33:14 +03:00
parent 15cb06ded1
commit 1c313e9c19
2 changed files with 6 additions and 5 deletions

View file

@ -965,6 +965,7 @@ static void encode_chroma_intra_cu(
break;
}
}
assert(pred_mode != 5 && "Invalid chroma prediction mode");
/*else if (intra_pred_mode_chroma == 66) {
// Angular 66 mode is possible only if intra pred mode is one of the
// possible chroma pred modes, in which case it is signaled with that

View file

@ -922,7 +922,7 @@ static double search_cu(
}
#endif
double intra_cost = intra_search.cost;
if (intra_cost < cost || tree_type == KVZ_CHROMA_T) {
if (intra_cost < cost && tree_type != KVZ_LUMA_T) {
int8_t intra_mode = intra_search.pred_cu.intra.mode;
if(state->encoder_control->cfg.cclm && tree_type == KVZ_BOTH_T) {
intra_search.pred_cu.intra.mode_chroma = -1;
@ -945,7 +945,8 @@ static double search_cu(
// into account, so there is less of a chanse of luma mode being
// really bad for chroma.
if(tree_type == KVZ_CHROMA_T) {
intra_search.pred_cu.intra = kvz_get_co_located_luma_cu(x, y, luma_width, luma_width, lcu, NULL, KVZ_CHROMA_T)->intra;
intra_search.pred_cu.intra = kvz_get_co_located_luma_cu(x, y, luma_width, luma_width, NULL, state->tile->frame->cu_array, KVZ_CHROMA_T)->intra;
intra_mode = intra_search.pred_cu.intra.mode;
}
intra_search.pred_cu.intra.mode_chroma = intra_search.pred_cu.intra.mode;
if (ctrl->cfg.rdo >= 3 || ctrl->cfg.jccr || ctrl->cfg.lfnst) {
@ -973,9 +974,8 @@ static double search_cu(
intra_search.pred_cu.violates_lfnst_constrained_chroma = false;
intra_search.pred_cu.lfnst_last_scan_pos = false;
}
if(tree_type != KVZ_CHROMA_T) {
intra_search.pred_cu.intra.mode = intra_mode;
}
intra_search.pred_cu.intra.mode = intra_mode;
}
if (intra_cost < cost) {
cost = intra_cost;