From bc8507cc8df1b7d4f4b72d92ef3f34132b8e1df5 Mon Sep 17 00:00:00 2001 From: Arttu Makinen Date: Fri, 18 Dec 2020 18:35:11 +0200 Subject: [PATCH] MTS context. --- src/cabac.h | 1 + src/context.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/cabac.h b/src/cabac.h index 995c9c7f..6bd321ea 100644 --- a/src/cabac.h +++ b/src/cabac.h @@ -54,6 +54,7 @@ typedef struct struct { cabac_ctx_t sao_merge_flag_model; cabac_ctx_t sao_type_idx_model; + cabac_ctx_t mts_idx_model[4]; cabac_ctx_t split_flag_model[9]; //!< \brief split flag context models cabac_ctx_t qt_split_flag_model[6]; //!< \brief qt split flag context models cabac_ctx_t intra_luma_mpm_flag_model; //!< \brief intra mode context models diff --git a/src/context.c b/src/context.c index 2eed37bd..13da104c 100644 --- a/src/context.c +++ b/src/context.c @@ -265,6 +265,13 @@ static const uint8_t INIT_SAO_MERGE_FLAG[4] = { 2, 60, 60, 0 }; static const uint8_t INIT_SAO_TYPE_IDX[4] = { 2, 5, 13, 4 }; +static const uint8_t INIT_MTS_IDX[4][4] = { + { 45, 25, 27, 0, }, + { 45, 40, 27, 0, }, + { 29, 0, 28, 0, }, + { 8, 0, 9, 0, }, +}; + static const uint8_t INIT_JOINT_CB_CR_FLAG[4][3] = { { 42, 43, 52, }, { 27, 36, 45, }, @@ -368,6 +375,7 @@ void kvz_init_contexts(encoder_state_t *state, int8_t QP, int8_t slice) for (i = 0; i < 4; i++) { kvz_ctx_init(&cabac->ctx.sig_coeff_group_model[i], QP, INIT_SIG_COEFF_GROUP[slice][i], INIT_SIG_COEFF_GROUP[3][i]); + kvz_ctx_init(&cabac->ctx.mts_idx_model[i], QP, INIT_MTS_IDX[slice][i], INIT_MTS_IDX[3][i]); }