mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Update contexts
This commit is contained in:
parent
b309ed90be
commit
91528f3292
|
@ -59,7 +59,7 @@ typedef struct
|
|||
cabac_ctx_t intra_luma_mpm_flag_model; //!< \brief intra mode context models
|
||||
cabac_ctx_t intra_subpart_model[2]; //!< \brief intra sub part context models
|
||||
cabac_ctx_t chroma_pred_model;
|
||||
cabac_ctx_t inter_dir[5];
|
||||
cabac_ctx_t inter_dir[6];
|
||||
cabac_ctx_t qt_cbf_model_luma[4];
|
||||
cabac_ctx_t qt_cbf_model_cr[2];
|
||||
cabac_ctx_t qt_cbf_model_cb[1];
|
||||
|
|
150
src/context.c
150
src/context.c
|
@ -25,37 +25,37 @@
|
|||
|
||||
|
||||
static const uint8_t INIT_SPLIT_FLAG[4][9] = {
|
||||
{ 18, 27, 15, 11, 28, 30, 19, 22, 23, },
|
||||
{ 18, 27, 53, 12, 6, 30, 13, 15, 31, },
|
||||
{ 19, 28, 38, 12, 29, 38, 28, 38, 31, },
|
||||
{ 12, 13, 8, 8, 13, 12, 5, 10, 9, },
|
||||
{ 18, 27, 15, 18, 28, 30, 19, 7, 23, },
|
||||
{ 11, 35, 53, 12, 6, 30, 13, 15, 31, },
|
||||
{ 19, 28, 38, 27, 29, 38, 28, 38, 31, },
|
||||
{ 12, 13, 8, 8, 13, 12, 5, 9, 9, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_QT_SPLIT_FLAG[4][6] = {
|
||||
{ 26, 36, 38, 33, 34, 21, },
|
||||
{ 20, 7, 23, 18, 19, 6, },
|
||||
{ 12, 6, 15, 33, 27, 22, },
|
||||
{ 0, 8, 8, 12, 12, 12, },
|
||||
{ 20, 14, 23, 18, 19, 6, },
|
||||
{ 27, 6, 15, 25, 19, 22, },
|
||||
{ 0, 8, 8, 12, 12, 9, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_SKIP_FLAG[4][3] = {
|
||||
{ 57, 60, 53, },
|
||||
{ 57, 59, 45, },
|
||||
{ 0, 34, 36, },
|
||||
{ 0, 26, 28, },
|
||||
{ 5, 4, 8, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_MERGE_FLAG_EXT[4][1] = {
|
||||
{ 6, },
|
||||
{ 6, },
|
||||
{ 19, },
|
||||
{ 5, },
|
||||
{ 26, },
|
||||
{ 4, },
|
||||
};
|
||||
|
||||
|
||||
static const uint8_t INIT_MERGE_IDX_EXT[4][1] = {
|
||||
{ 41, },
|
||||
{ 43, },
|
||||
{ 33, },
|
||||
{ 35, },
|
||||
{ 34, },
|
||||
{ 4, },
|
||||
};
|
||||
|
@ -68,35 +68,35 @@ static const uint8_t INIT_PART_SIZE[4][4] = {
|
|||
};
|
||||
|
||||
static const uint8_t INIT_PRED_MODE[4][2] = {
|
||||
{ 40, 50, },
|
||||
{ 40, 35, },
|
||||
{ 40, 35, },
|
||||
{ CNU, CNU, },
|
||||
{ 5, 2, },
|
||||
{ 5, 1, },
|
||||
};
|
||||
|
||||
static const uint8_t MULTI_REF_LINE_MODE[4][2] = {
|
||||
{ 25, 58, },
|
||||
{ 25, 50, },
|
||||
{ 25, 57, },
|
||||
{ 25, 51, },
|
||||
{ 25, 59, },
|
||||
{ 6, 8, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_INTRA_LUMA_MPM_FLAG[4] = {
|
||||
36, 36, 45, 6
|
||||
29, 36, 45, 6
|
||||
};
|
||||
|
||||
static const uint8_t INIT_INTRA_LUMA_PLANAR_MODE[4][2] = {
|
||||
{ 13, 21, },
|
||||
{ 12, 13, },
|
||||
{ 13, 6, },
|
||||
{ 12, 20, },
|
||||
{ 13, 28, },
|
||||
{ 4, 5, },
|
||||
{ 1, 5, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_CHROMA_PRED_MODE[4] = {
|
||||
25,
|
||||
33,
|
||||
19,
|
||||
6,
|
||||
18,
|
||||
34,
|
||||
5,
|
||||
};
|
||||
|
||||
static const uint8_t INIT_CU_QP_DELTA_ABS[4][2] = {
|
||||
|
@ -106,15 +106,15 @@ static const uint8_t INIT_CU_QP_DELTA_ABS[4][2] = {
|
|||
{ DWS, DWS, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_INTER_DIR[4][5] = {
|
||||
{ 6, 13, 5, 4, 25, },
|
||||
{ 7, 6, 5, 4, 33, },
|
||||
{ CNU, CNU, CNU, CNU, CNU, },
|
||||
{ 0, 0, 1, 4, 0, },
|
||||
static const uint8_t INIT_INTER_DIR[4][6] = {
|
||||
{ 14, 6, 5, 4, 3, 40, },
|
||||
{ 7, 6, 5, 4, 11, 40, },
|
||||
{ CNU, CNU, CNU, CNU, CNU, CNU, },
|
||||
{ 0, 0, 1, 4, 1, 0, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_REF_PIC[4][2] = {
|
||||
{ 13, 20, },
|
||||
{ 20, 20, },
|
||||
{ 27, 35, },
|
||||
{ CNU, CNU, },
|
||||
{ 0, 4, },
|
||||
|
@ -136,21 +136,21 @@ static const uint8_t INIT_QT_ROOT_CBF[4][1] = {
|
|||
|
||||
|
||||
static const uint8_t INIT_QT_CBF[4][7] = {
|
||||
{ 15, CNU, 5, 14, 25, 9, 44},
|
||||
{ 15, CNU, 20, 7, 25, 25, 29},
|
||||
{ 7, CNU, 5, 7, 12, 33, 21},
|
||||
{ 5, DWS, 8, 8, 5, 2, 1},
|
||||
{ 15, 13, 5, 14, 25, 9, 44},
|
||||
{ 23, 4, 20, 7, 25, 25, 29},
|
||||
{ 7, 19, 5, 7, 12, 33, 28},
|
||||
{ 5, 1, 8, 9, 5, 2, 1},
|
||||
};
|
||||
|
||||
static const uint8_t BDPCM_MODE_INIT[4][2] = {
|
||||
{ CNU, CNU, },
|
||||
{ CNU, CNU, },
|
||||
{ CNU, CNU, },
|
||||
{ DWS, DWS, },
|
||||
{ 19, 28, },
|
||||
{ 40, 36, },
|
||||
{ 19, 35, },
|
||||
{ 4, 4, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_SIG_COEFF_GROUP[4][4] = {
|
||||
{ 25, 37, 25, 37},
|
||||
{ 25, 45, 25, 45},
|
||||
{ 25, 30, 25, 52},
|
||||
{ 18, 31, 25, 7},
|
||||
{ 8, 5, 5, 8},
|
||||
|
@ -158,33 +158,33 @@ static const uint8_t INIT_SIG_COEFF_GROUP[4][4] = {
|
|||
|
||||
static const uint8_t INIT_SIG_FLAG[6][4][12] = {
|
||||
{
|
||||
{ 17, 41, 49, 51, 1, 49, 50, 37, 48, 51, 58, 45, },
|
||||
{ 17, 41, 49, 36, 1, 49, 50, 37, 48, 51, 58, 45, },
|
||||
{ 17, 41, 42, 29, 25, 49, 43, 37, 33, 51, 51, 30, },
|
||||
{ 25, 19, 28, 14, 25, 20, 29, 30, 19, 52, 30, 38, },
|
||||
{ 25, 19, 28, 14, 25, 20, 29, 30, 19, 37, 30, 38, },
|
||||
{ 12, 9, 9, 10, 9, 9, 9, 10, 8, 8, 8, 10, },
|
||||
},
|
||||
{
|
||||
{ 9, 49, 42, 21, 48, 59, 59, 53, },
|
||||
{ 17, 19, 20, 29, 41, 59, 60, 38, },
|
||||
{ 25, 27, 28, 37, 49, 53, 53, 46, },
|
||||
{ 9, 9, 9, 13, 5, 5, 8, 9, },
|
||||
{ 9, 9, 9, 13, 4, 5, 8, 9, },
|
||||
},
|
||||
{
|
||||
{ 26, 45, 53, 46, 49, 54, 61, 39, 42, 39, 39, 39, },
|
||||
{ 19, 38, 38, 46, 34, 54, 54, 39, 6, 39, 39, 39, },
|
||||
{ 11, 38, 46, 54, 27, 39, 39, 39, 28, 39, 39, 39, },
|
||||
{ 9, 12, 8, 8, 8, 8, 8, 5, 8, 0, 0, 0, },
|
||||
{ 11, 38, 46, 54, 27, 39, 39, 39, 36, 39, 39, 39, },
|
||||
{ 9, 13, 8, 8, 8, 8, 8, 5, 8, 0, 0, 0, },
|
||||
},
|
||||
{
|
||||
{ 34, 45, 38, 31, 58, 39, 39, 39, },
|
||||
{ 35, 45, 53, 54, 51, 39, 39, 39, },
|
||||
{ 35, 45, 53, 54, 44, 39, 39, 39, },
|
||||
{ 19, 46, 38, 39, 52, 39, 39, 39, },
|
||||
{ 8, 12, 8, 8, 4, 0, 0, 0, },
|
||||
},
|
||||
{
|
||||
{ 19, 54, 39, 39, 50, 39, 39, 39, 0, 39, 39, 39, },
|
||||
{ 19, 39, 54, 39, 19, 39, 39, 39, 56, 39, 39, 39, },
|
||||
{ 18, 39, 39, 39, 11, 39, 39, 39, 0, 39, 39, 39, },
|
||||
{ 18, 39, 39, 39, 19, 39, 39, 39, 0, 39, 39, 39, },
|
||||
{ 8, 8, 8, 8, 8, 0, 4, 4, 0, 0, 0, 0, },
|
||||
},
|
||||
{
|
||||
|
@ -199,14 +199,14 @@ static const uint8_t INIT_PARITY_FLAG[2][4][21] =
|
|||
{
|
||||
{
|
||||
{ 33, 40, 25, 41, 26, 42, 25, 33, 26, 34, 27, 25, 41, 42, 42, 35, 33, 27, 35, 42, 43, },
|
||||
{ 18, 17, 33, 18, 34, 42, 25, 33, 26, 42, 27, 25, 34, 42, 42, 20, 26, 27, 42, 20, 20, },
|
||||
{ 33, 25, 18, 26, 34, 27, 25, 26, 19, 42, 35, 33, 19, 27, 35, 20, 34, 42, 20, 43, 20, },
|
||||
{ 18, 17, 33, 18, 34, 42, 25, 33, 26, 42, 27, 25, 34, 42, 42, 35, 26, 27, 42, 20, 20, },
|
||||
{ 33, 25, 18, 26, 34, 27, 25, 26, 19, 42, 35, 33, 19, 27, 35, 35, 34, 42, 20, 43, 20, },
|
||||
{ 8, 9, 12, 13, 13, 13, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 10, 13, 13, 13, 13, },
|
||||
},
|
||||
{
|
||||
{ 33, 25, 26, 19, 19, 27, 33, 42, 43, 27, 43, },
|
||||
{ 33, 25, 26, 19, 19, 27, 33, 42, 43, 35, 43, },
|
||||
{ 25, 25, 26, 11, 19, 27, 33, 42, 50, 20, 43, },
|
||||
{ 33, 25, 26, 42, 19, 27, 26, 50, 43, 20, 43, },
|
||||
{ 33, 25, 26, 42, 19, 27, 26, 50, 35, 20, 43, },
|
||||
{ 9, 13, 12, 12, 13, 13, 13, 13, 13, 13, 13, },
|
||||
}
|
||||
};
|
||||
|
@ -214,60 +214,60 @@ static const uint8_t INIT_PARITY_FLAG[2][4][21] =
|
|||
static const uint8_t INIT_GTX_FLAG[4][4][21] =
|
||||
{
|
||||
{
|
||||
{ 25, 0, 0, 17, 25, 18, 0, 9, 25, 33, 19, 0, 25, 33, 26, 20, 25, 33, 34, 42, 29, },
|
||||
{ 25, 0, 0, 17, 25, 18, 0, 9, 25, 33, 19, 0, 25, 33, 26, 20, 25, 33, 34, 35, 29, },
|
||||
{ 17, 0, 1, 17, 25, 18, 0, 9, 25, 33, 34, 9, 25, 18, 26, 20, 25, 18, 19, 27, 21, },
|
||||
{ 25, 1, 40, 25, 33, 11, 17, 25, 25, 18, 4, 17, 33, 11, 4, 5, 33, 19, 20, 28, 22, },
|
||||
{ 1, 5, 9, 9, 9, 6, 5, 9, 10, 10, 9, 9, 9, 9, 9, 9, 6, 8, 9, 8, 9, },
|
||||
{ 25, 1, 40, 25, 33, 11, 17, 25, 25, 18, 4, 17, 33, 26, 19, 5, 33, 19, 20, 28, 22, },
|
||||
{ 1, 5, 9, 9, 9, 6, 5, 9, 10, 10, 9, 9, 9, 9, 9, 9, 6, 8, 9, 9, 9, },
|
||||
},
|
||||
{
|
||||
{ 25, 1, 40, 33, 18, 4, 25, 33, 27, 36, 37, },
|
||||
{ 25, 1, 40, 33, 26, 4, 25, 33, 27, 36, 37, },
|
||||
{ 17, 9, 25, 10, 3, 4, 17, 33, 19, 28, 29, },
|
||||
{ 48, 9, 25, 18, 26, 27, 25, 26, 35, 28, 37, },
|
||||
{ 1, 5, 8, 8, 8, 6, 6, 9, 8, 8, 9, },
|
||||
{ 48, 9, 25, 18, 26, 35, 25, 26, 35, 28, 37, },
|
||||
{ 1, 5, 8, 8, 8, 6, 6, 9, 8, 8, 10, },
|
||||
},
|
||||
{
|
||||
{ 0, 0, 33, 34, 35, 36, 25, 49, 35, 28, 29, 40, 42, 43, 36, 37, 56, 58, 59, 45, 38, },
|
||||
{ 0, 17, 26, 19, 20, 21, 25, 34, 20, 28, 29, 33, 27, 28, 29, 37, 34, 28, 44, 37, 38, },
|
||||
{ 0, 0, 33, 34, 35, 36, 25, 34, 35, 28, 29, 40, 42, 43, 36, 30, 56, 43, 44, 45, 38, },
|
||||
{ 0, 17, 26, 19, 20, 21, 25, 34, 20, 28, 29, 33, 27, 28, 29, 22, 34, 28, 44, 37, 38, },
|
||||
{ 25, 25, 11, 27, 20, 21, 18, 12, 28, 21, 22, 34, 28, 29, 29, 30, 28, 29, 45, 30, 23, },
|
||||
{ 9, 5, 10, 13, 13, 10, 9, 10, 13, 13, 13, 9, 10, 10, 10, 10, 8, 9, 8, 10, 13, },
|
||||
{ 9, 5, 10, 13, 13, 10, 9, 10, 13, 13, 13, 9, 10, 10, 10, 13, 8, 9, 9, 10, 13, },
|
||||
},
|
||||
{
|
||||
{ 0, 40, 42, 20, 21, 29, 49, 52, 53, 38, 46, },
|
||||
{ 0, 40, 42, 20, 21, 29, 57, 52, 53, 38, 46, },
|
||||
{ 0, 25, 27, 20, 13, 6, 57, 52, 30, 38, 31, },
|
||||
{ 40, 33, 27, 28, 21, 37, 51, 37, 53, 38, 46, },
|
||||
{ 9, 9, 10, 12, 12, 10, 5, 9, 9, 9, 9, },
|
||||
{ 9, 9, 10, 12, 12, 10, 5, 9, 9, 9, 12, },
|
||||
}
|
||||
};
|
||||
|
||||
static const uint8_t INIT_LAST_X[4][23] = {
|
||||
{ 14, 6, 5, 7, 7, 12, 7, 7, 6, 12, 22, 7, 6, 14, 20, 28, 7, 13, 13, 20, 11, 5, 3},
|
||||
{ 6, 13, 12, 6, 6, 4, 14, 14, 5, 12, 29, 14, 13, 5, 36, 28, 14, 13, 20, 19, 19, 4, 18},
|
||||
{ 6, 13, 12, 6, 14, 12, 14, 14, 29, 4, 14, 7, 14, 29, 4, 29, 30, 37, 29, 58, 12, 11, 3},
|
||||
{ 8, 5, 4, 5, 4, 4, 5, 4, 1, 0, 5, 1, 0, 0, 0, 1, 1, 0, 0, 0, 2, 1, 1},
|
||||
{ 14, 6, 5, 7, 14, 4, 7, 7, 6, 12, 29, 7, 6, 6, 20, 28, 7, 13, 13, 20, 11, 5, 3,},
|
||||
{ 6, 13, 12, 6, 6, 4, 14, 14, 5, 12, 29, 14, 13, 5, 36, 28, 14, 13, 20, 19, 12, 4, 18,},
|
||||
{ 13, 5, 4, 6, 14, 4, 6, 14, 21, 11, 14, 7, 14, 13, 11, 21, 37, 37, 21, 50, 12, 4, 3,},
|
||||
{ 8, 5, 4, 5, 4, 4, 5, 4, 1, 0, 4, 1, 0, 0, 0, 1, 1, 0, 0, 0, 2, 1, 1,},
|
||||
};
|
||||
|
||||
static const uint8_t INIT_LAST_Y[4][23] = {
|
||||
{ 13, 13, 20, 6, 6, 12, 14, 14, 5, 13, 14, 7, 5, 12, 21, 13, 7, 13, 12, 41, 11, 5, 19},
|
||||
{ 5, 5, 12, 6, 6, 19, 6, 14, 5, 19, 29, 7, 13, 5, 36, 21, 7, 13, 5, 27, 11, 4, 18},
|
||||
{ 13, 5, 4, 6, 6, 11, 14, 14, 5, 11, 14, 7, 14, 5, 3, 21, 45, 45, 21, 34, 12, 4, 3},
|
||||
{ 8, 5, 8, 5, 5, 4, 5, 5, 4, 0, 5, 5, 1, 0, 0, 1, 4, 0, 0, 0, 6, 2, 2},
|
||||
{ 13, 5, 5, 6, 6, 12, 14, 6, 5, 5, 14, 7, 5, 12, 21, 13, 7, 13, 12, 41, 11, 5, 19,},
|
||||
{ 5, 5, 12, 6, 6, 19, 6, 14, 5, 19, 29, 7, 13, 5, 36, 21, 7, 13, 5, 27, 11, 4, 18,},
|
||||
{ 13, 5, 4, 6, 6, 11, 14, 14, 5, 11, 14, 22, 14, 12, 3, 21, 37, 52, 28, 34, 12, 4, 3,},
|
||||
{ 8, 5, 8, 5, 5, 4, 5, 5, 4, 0, 5, 5, 1, 0, 0, 1, 4, 0, 0, 0, 6, 2, 2,},
|
||||
};
|
||||
|
||||
static const uint8_t INIT_MVP_IDX[4][1] = {
|
||||
{ 34, },
|
||||
{ 49, },
|
||||
{ 34, },
|
||||
{ 42, },
|
||||
{ 12, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_JOINT_CB_CR_FLAG[4][3] = {
|
||||
{ 51, 44, 45, },
|
||||
{ 36, 44, 45, },
|
||||
{ 43, 29, 51, },
|
||||
{ 43, 51, 45, },
|
||||
{ 35, 44, 45, },
|
||||
{ 35, 29, 51, },
|
||||
{ 1, 1, 0, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_SAO_MERGE_FLAG[4] = { 2, 60, 59, 0 };
|
||||
static const uint8_t INIT_SAO_MERGE_FLAG[4] = { 10, 60, 52, 0 };
|
||||
|
||||
static const uint8_t INIT_SAO_TYPE_IDX[4] = { 10, 5, 5, 0 };
|
||||
|
||||
|
@ -279,8 +279,8 @@ static const uint8_t INIT_CU_TRANSQUANT_BYPASS[4][1] = {
|
|||
};
|
||||
|
||||
static const uint8_t INIT_INTRA_SUBPART_MODE[4][2] = {
|
||||
{ 48, 43, },
|
||||
{ 33, 43, },
|
||||
{ 33, 36, },
|
||||
{ 33, 43, },
|
||||
{ 9, 2, },
|
||||
};
|
||||
|
@ -408,7 +408,7 @@ void kvz_init_contexts(encoder_state_t *state, int8_t QP, int8_t slice)
|
|||
kvz_ctx_init(&cabac->ctx.qt_cbf_model_luma[i], QP, INIT_QT_CBF[slice][i], INIT_QT_CBF[3][i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
for (i = 0; i < 6; i++) {
|
||||
|
||||
kvz_ctx_init(&cabac->ctx.inter_dir[i], QP, INIT_INTER_DIR[slice][i], INIT_INTER_DIR[3][i]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue