[cabac] fix cbf_y context for tr splits

This commit is contained in:
Joose Sainio 2022-09-05 11:10:55 +03:00
parent 42bea563e4
commit 95b6ddbe67

View file

@ -724,8 +724,10 @@ static void encode_transform_coeff(
if ((cur_cu->type == CU_INTRA || tr_depth > 0 || cb_flag_u || cb_flag_v) && !only_chroma && tree_type != UVG_CHROMA_T) { if ((cur_cu->type == CU_INTRA || tr_depth > 0 || cb_flag_u || cb_flag_v) && !only_chroma && tree_type != UVG_CHROMA_T) {
cabac->cur_ctx = &(cabac->ctx.qt_cbf_model_luma[*luma_cbf_ctx]); cabac->cur_ctx = &(cabac->ctx.qt_cbf_model_luma[*luma_cbf_ctx]);
CABAC_BIN(cabac, cb_flag_y, "cbf_luma"); CABAC_BIN(cabac, cb_flag_y, "cbf_luma");
if (tr_depth == 0) {
*luma_cbf_ctx = 2 + cb_flag_y; *luma_cbf_ctx = 2 + cb_flag_y;
} }
}
if (cb_flag_y | cb_flag_u | cb_flag_v) { if (cb_flag_y | cb_flag_u | cb_flag_v) {
if (state->must_code_qp_delta && (only_chroma || cb_flag_y || depth != 4) ) { if (state->must_code_qp_delta && (only_chroma || cb_flag_y || depth != 4) ) {