mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Update of contexts.
This commit is contained in:
parent
2fc8558926
commit
232332dc5f
111
src/context.c
111
src/context.c
|
@ -25,17 +25,17 @@
|
|||
|
||||
|
||||
static const uint8_t INIT_SPLIT_FLAG[4][9] = {
|
||||
{ 18, 27, 15, 18, 28, 45, 19, 7, 23, },
|
||||
{ 18, 27, 15, 18, 28, 45, 26, 7, 23, },
|
||||
{ 11, 35, 53, 12, 6, 30, 13, 15, 31, },
|
||||
{ 19, 28, 38, 27, 29, 38, 28, 38, 31, },
|
||||
{ 19, 28, 38, 27, 29, 38, 20, 30, 31, },
|
||||
{ 12, 13, 8, 8, 13, 12, 5, 9, 9, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_QT_SPLIT_FLAG[4][6] = {
|
||||
{ 26, 36, 38, 18, 34, 21, },
|
||||
{ 20, 14, 23, 18, 19, 6, },
|
||||
{ 27, 6, 15, 25, 19, 22, },
|
||||
{ 0, 8, 8, 12, 12, 9, },
|
||||
{ 27, 6, 15, 25, 19, 37, },
|
||||
{ 0, 8, 8, 12, 12, 8, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_SKIP_FLAG[4][3] = {
|
||||
|
@ -47,15 +47,15 @@ static const uint8_t INIT_SKIP_FLAG[4][3] = {
|
|||
|
||||
static const uint8_t INIT_MERGE_FLAG_EXT[4][1] = {
|
||||
{ 6, },
|
||||
{ 6, },
|
||||
{ 21, },
|
||||
{ 26, },
|
||||
{ 4, },
|
||||
};
|
||||
|
||||
|
||||
static const uint8_t INIT_MERGE_IDX_EXT[4][1] = {
|
||||
{ 33, },
|
||||
{ 35, },
|
||||
{ 18, },
|
||||
{ 20, },
|
||||
{ 34, },
|
||||
{ 4, },
|
||||
};
|
||||
|
@ -82,7 +82,7 @@ static const uint8_t MULTI_REF_LINE_MODE[4][2] = {
|
|||
};
|
||||
|
||||
static const uint8_t INIT_INTRA_LUMA_MPM_FLAG[4] = {
|
||||
29, 36, 45, 6
|
||||
44, 36, 45, 6
|
||||
};
|
||||
|
||||
static const uint8_t INIT_INTRA_LUMA_PLANAR_MODE[4][2] = {
|
||||
|
@ -107,7 +107,7 @@ static const uint8_t INIT_CU_QP_DELTA_ABS[4][2] = {
|
|||
};
|
||||
|
||||
static const uint8_t INIT_INTER_DIR[4][6] = {
|
||||
{ 14, 6, 5, 4, 3, 40, },
|
||||
{ 14, 13, 5, 4, 3, 40, },
|
||||
{ 7, 6, 5, 12, 4, 40, },
|
||||
{ CNU, CNU, CNU, CNU, CNU, CNU, },
|
||||
{ 0, 0, 1, 4, 4, 0, },
|
||||
|
@ -121,7 +121,7 @@ static const uint8_t INIT_REF_PIC[4][2] = {
|
|||
};
|
||||
|
||||
static const uint8_t INIT_MVD[4][2] = {
|
||||
{ 51, 58, },
|
||||
{ 51, 36, },
|
||||
{ 44, 43, },
|
||||
{ 14, 45, },
|
||||
{ 9, 5, },
|
||||
|
@ -142,17 +142,17 @@ static const uint8_t INIT_QT_CBF[4][9] = {
|
|||
{ 5, 1, 8, 9, 5, 0, 2, 1, 0},
|
||||
};
|
||||
|
||||
static const uint8_t BDPCM_MODE_INIT[4][2] = {
|
||||
{ 19, 28, },
|
||||
{ 40, 36, },
|
||||
{ 19, 35, },
|
||||
{ 4, 4, },
|
||||
static const uint8_t BDPCM_MODE_INIT[4][4] = {
|
||||
{ 19, 21, 0, 28, },
|
||||
{ 40, 36, 0, 13, },
|
||||
{ 19, 35, 1, 27, },
|
||||
{ 1, 4, 1, 0, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_SIG_COEFF_GROUP[4][4] = {
|
||||
{ 25, 45, 25, 45},
|
||||
{ 25, 30, 25, 52},
|
||||
{ 18, 31, 25, 7},
|
||||
{ 25, 45, 25, 14},
|
||||
{ 25, 30, 25, 45},
|
||||
{ 18, 31, 25, 15},
|
||||
{ 8, 5, 5, 8},
|
||||
};
|
||||
|
||||
|
@ -164,13 +164,13 @@ static const uint8_t INIT_SIG_FLAG[6][4][12] = {
|
|||
{ 12, 9, 9, 10, 9, 9, 9, 10, 8, 8, 8, 10, },
|
||||
},
|
||||
{
|
||||
{ 9, 49, 50, 29, 48, 59, 59, 38, },
|
||||
{ 17, 19, 20, 29, 41, 59, 60, 38, },
|
||||
{ 25, 27, 28, 37, 49, 53, 53, 46, },
|
||||
{ 9, 9, 9, 13, 4, 5, 8, 9, },
|
||||
{ 9, 49, 50, 36, 48, 59, 59, 38, },
|
||||
{ 17, 34, 35, 21, 41, 59, 60, 38, },
|
||||
{ 25, 27, 28, 37, 34, 53, 53, 46, },
|
||||
{ 12, 12, 9, 13, 4, 5, 8, 9, },
|
||||
},
|
||||
{
|
||||
{ 26, 45, 53, 46, 49, 54, 61, 39, 42, 39, 39, 39, },
|
||||
{ 26, 45, 53, 46, 49, 54, 61, 39, 35, 39, 39, 39, },
|
||||
{ 19, 38, 38, 46, 34, 54, 54, 39, 6, 39, 39, 39, },
|
||||
{ 11, 38, 46, 54, 27, 39, 39, 39, 44, 39, 39, 39, },
|
||||
{ 9, 13, 8, 8, 8, 8, 8, 5, 8, 0, 0, 0, },
|
||||
|
@ -179,12 +179,12 @@ static const uint8_t INIT_SIG_FLAG[6][4][12] = {
|
|||
{ 34, 45, 38, 31, 58, 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, },
|
||||
{ 8, 12, 12, 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, 19, 39, 39, 39, 0, 39, 39, 39, },
|
||||
{ 18, 39, 39, 39, 27, 39, 39, 39, 0, 39, 39, 39, },
|
||||
{ 8, 8, 8, 8, 8, 0, 4, 4, 0, 0, 0, 0, },
|
||||
},
|
||||
{
|
||||
|
@ -204,53 +204,53 @@ static const uint8_t INIT_PARITY_FLAG[2][4][21] =
|
|||
{ 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, 35, 43, },
|
||||
{ 25, 25, 26, 11, 19, 27, 33, 42, 35, 20, 43, },
|
||||
{ 33, 25, 26, 34, 19, 27, 33, 42, 43, 35, 43, },
|
||||
{ 25, 25, 26, 11, 19, 27, 33, 42, 35, 35, 43, },
|
||||
{ 33, 25, 26, 42, 19, 27, 26, 50, 35, 20, 43, },
|
||||
{ 9, 13, 12, 12, 13, 13, 13, 13, 13, 13, 13, },
|
||||
{ 8, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, },
|
||||
}
|
||||
};
|
||||
|
||||
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, 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, 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, 0, 0, 17, 25, 26, 0, 9, 25, 33, 19, 0, 25, 33, 26, 20, 25, 33, 27, 35, 22, },
|
||||
{ 17, 0, 1, 17, 25, 18, 0, 9, 25, 33, 34, 9, 25, 18, 26, 20, 25, 18, 19, 27, 29, },
|
||||
{ 25, 1, 40, 25, 33, 11, 17, 25, 25, 18, 4, 17, 33, 26, 19, 13, 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, 10, },
|
||||
},
|
||||
{
|
||||
{ 25, 1, 25, 33, 11, 4, 25, 33, 27, 36, 37, },
|
||||
{ 17, 9, 25, 10, 3, 4, 17, 33, 19, 28, 29, },
|
||||
{ 48, 9, 25, 18, 26, 35, 25, 26, 35, 28, 37, },
|
||||
{ 1, 5, 8, 8, 8, 6, 6, 9, 8, 8, 10, },
|
||||
{ 25, 1, 25, 33, 26, 12, 25, 33, 27, 28, 37, },
|
||||
{ 17, 9, 25, 10, 18, 4, 17, 33, 19, 20, 29, },
|
||||
{ 40, 9, 25, 18, 26, 35, 25, 26, 35, 28, 37, },
|
||||
{ 1, 5, 8, 8, 9, 6, 6, 9, 8, 8, 9, },
|
||||
},
|
||||
{
|
||||
{ 0, 0, 33, 34, 35, 36, 25, 34, 35, 28, 29, 40, 42, 43, 36, 30, 56, 43, 44, 45, 38, },
|
||||
{ 0, 0, 33, 34, 35, 21, 25, 34, 35, 28, 29, 40, 42, 43, 29, 30, 49, 36, 37, 45, 38, },
|
||||
{ 0, 17, 26, 19, 35, 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, 13, 8, 9, 9, 10, 13, },
|
||||
{ 25, 25, 11, 27, 20, 21, 33, 12, 28, 21, 22, 34, 28, 29, 29, 30, 36, 29, 45, 30, 23, },
|
||||
{ 9, 5, 10, 13, 13, 10, 9, 10, 13, 13, 13, 9, 10, 10, 10, 13, 8, 9, 10, 10, 13, },
|
||||
},
|
||||
{
|
||||
{ 0, 40, 42, 28, 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, 13, },
|
||||
{ 0, 40, 34, 43, 36, 37, 57, 52, 45, 38, 46, },
|
||||
{ 0, 25, 19, 20, 13, 14, 57, 44, 30, 30, 23, },
|
||||
{ 40, 33, 27, 28, 21, 37, 36, 37, 45, 38, 46, },
|
||||
{ 8, 8, 9, 12, 12, 10, 5, 9, 9, 9, 13, },
|
||||
}
|
||||
};
|
||||
|
||||
static const uint8_t INIT_LAST_X[4][23] = {
|
||||
{ 14, 6, 12, 7, 6, 4, 14, 7, 6, 4, 29, 7, 6, 6, 12, 28, 7, 13, 13, 20, 26, 5, 3,},
|
||||
{ 6, 13, 12, 6, 6, 12, 14, 14, 13, 12, 29, 7, 6, 13, 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,},
|
||||
{ 6, 6, 12, 14, 6, 4, 14, 7, 6, 4, 29, 7, 6, 6, 12, 28, 7, 13, 13, 35, },
|
||||
{ 6, 13, 12, 6, 6, 12, 14, 14, 13, 12, 29, 7, 6, 13, 36, 28, 14, 13, 5, 26, },
|
||||
{ 13, 5, 4, 21, 14, 4, 6, 14, 21, 11, 14, 7, 14, 5, 11, 21, 30, 22, 13, 42, },
|
||||
{ 8, 5, 4, 5, 4, 4, 5, 4, 1, 0, 4, 1, 0, 0, 0, 0, 1, 0, 0, 0, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_LAST_Y[4][23] = {
|
||||
{ 5, 5, 5, 13, 6, 12, 14, 6, 12, 5, 14, 7, 5, 4, 13, 13, 7, 13, 12, 41, 11, 5, 19,},
|
||||
{ 5, 5, 12, 6, 6, 19, 6, 14, 5, 12, 14, 7, 13, 5, 36, 21, 7, 13, 5, 42, 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,},
|
||||
{ 5, 5, 20, 13, 13, 19, 21, 6, 12, 12, 14, 14, 5, 4, 12, 13, 7, 13, 12, 41, },
|
||||
{ 5, 5, 12, 6, 6, 4, 6, 14, 5, 12, 14, 7, 13, 5, 13, 21, 14, 20, 12, 34, },
|
||||
{ 13, 5, 4, 6, 13, 11, 14, 6, 5, 3, 14, 22, 6, 4, 3, 6, 22, 29, 20, 34, },
|
||||
{ 8, 5, 8, 5, 5, 4, 5, 5, 4, 0, 5, 4, 1, 0, 0, 1, 4, 0, 0, 0, },
|
||||
};
|
||||
|
||||
static const uint8_t INIT_MVP_IDX[4][1] = {
|
||||
|
@ -266,9 +266,9 @@ 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_JOINT_CB_CR_FLAG[4][3] = {
|
||||
{ 50, 51, 45, },
|
||||
{ 27, 44, 45, },
|
||||
{ 35, 29, 43, },
|
||||
{ 42, 43, 52, },
|
||||
{ 27, 36, 45, },
|
||||
{ 12, 21, 35, },
|
||||
{ 1, 1, 0, },
|
||||
};
|
||||
|
||||
|
@ -391,7 +391,6 @@ void kvz_init_contexts(encoder_state_t *state, int8_t QP, int8_t slice)
|
|||
kvz_ctx_init(&cabac->ctx.cu_mvd_model[i], QP, INIT_MVD[slice][i], INIT_MVD[3][i]);
|
||||
kvz_ctx_init(&cabac->ctx.cu_ref_pic_model[i], QP, INIT_REF_PIC[slice][i], INIT_REF_PIC[3][i]);
|
||||
kvz_ctx_init(&cabac->ctx.luma_planar_model[i], QP, INIT_INTRA_LUMA_PLANAR_MODE[slice][i], INIT_INTRA_LUMA_PLANAR_MODE[3][i]);
|
||||
kvz_ctx_init(&cabac->ctx.bdpcm_mode[i], QP, BDPCM_MODE_INIT[slice][i], BDPCM_MODE_INIT[3][i]);
|
||||
kvz_ctx_init(&cabac->ctx.cu_qp_delta_abs[i], QP, INIT_CU_QP_DELTA_ABS[slice][i], INIT_CU_QP_DELTA_ABS[3][i]);
|
||||
}
|
||||
|
||||
|
@ -404,7 +403,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.part_size_model[i], QP, INIT_PART_SIZE[slice][i], INIT_PART_SIZE[3][i]);
|
||||
|
||||
kvz_ctx_init(&cabac->ctx.bdpcm_mode[i], QP, BDPCM_MODE_INIT[slice][i], BDPCM_MODE_INIT[3][i]);
|
||||
kvz_ctx_init(&cabac->ctx.qt_cbf_model_luma[i], QP, INIT_QT_CBF[slice][i], INIT_QT_CBF[3][i]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue