From 3e23fd0601ce715527fb531579fe3fe76b29ab1a Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Mon, 5 Sep 2022 11:10:55 +0300 Subject: [PATCH] [cabac] fix cbf_y context for tr splits --- src/encode_coding_tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/encode_coding_tree.c b/src/encode_coding_tree.c index 9b0bf884..0fe488f9 100644 --- a/src/encode_coding_tree.c +++ b/src/encode_coding_tree.c @@ -724,7 +724,9 @@ 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) { cabac->cur_ctx = &(cabac->ctx.qt_cbf_model_luma[*luma_cbf_ctx]); CABAC_BIN(cabac, cb_flag_y, "cbf_luma"); - *luma_cbf_ctx = 2 + cb_flag_y; + if (tr_depth == 0) { + *luma_cbf_ctx = 2 + cb_flag_y; + } } if (cb_flag_y | cb_flag_u | cb_flag_v) {