mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
[lfnst] Add commandline option for lfnst. Implement cabac lfnst flag init and sps flag.
This commit is contained in:
parent
4880b47a4e
commit
213fe13a27
|
@ -73,6 +73,7 @@ typedef struct
|
||||||
cabac_ctx_t alf_cc_filter_control_flag[6];
|
cabac_ctx_t alf_cc_filter_control_flag[6];
|
||||||
cabac_ctx_t sao_merge_flag_model;
|
cabac_ctx_t sao_merge_flag_model;
|
||||||
cabac_ctx_t sao_type_idx_model;
|
cabac_ctx_t sao_type_idx_model;
|
||||||
|
cabac_ctx_t lfnst_idx[3];
|
||||||
cabac_ctx_t mts_idx_model[4];
|
cabac_ctx_t mts_idx_model[4];
|
||||||
cabac_ctx_t split_flag_model[9]; //!< \brief split flag context models
|
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 qt_split_flag_model[6]; //!< \brief qt split flag context models
|
||||||
|
|
|
@ -204,6 +204,8 @@ int uvg_config_init(uvg_config *cfg)
|
||||||
|
|
||||||
cfg->mip = false;
|
cfg->mip = false;
|
||||||
|
|
||||||
|
cfg->lfnst = false;
|
||||||
|
|
||||||
parse_qp_map(cfg, 0);
|
parse_qp_map(cfg, 0);
|
||||||
|
|
||||||
cfg->jccr = 0;
|
cfg->jccr = 0;
|
||||||
|
@ -1439,6 +1441,9 @@ int uvg_config_parse(uvg_config *cfg, const char *name, const char *value)
|
||||||
else if OPT("mip") {
|
else if OPT("mip") {
|
||||||
cfg->mip = atobool(value);
|
cfg->mip = atobool(value);
|
||||||
}
|
}
|
||||||
|
else if OPT("lfnst") {
|
||||||
|
cfg->lfnst = atobool(value);
|
||||||
|
}
|
||||||
else if OPT("jccr") {
|
else if OPT("jccr") {
|
||||||
cfg->jccr = (bool)atobool(value);
|
cfg->jccr = (bool)atobool(value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,6 +174,8 @@ static const struct option long_options[] = {
|
||||||
{ "no-mrl", no_argument, NULL, 0 },
|
{ "no-mrl", no_argument, NULL, 0 },
|
||||||
{ "mip", no_argument, NULL, 0 },
|
{ "mip", no_argument, NULL, 0 },
|
||||||
{ "no-mip", no_argument, NULL, 0 },
|
{ "no-mip", no_argument, NULL, 0 },
|
||||||
|
{ "lfnst", no_argument, NULL, 0 },
|
||||||
|
{ "no-lfnst", no_argument, NULL, 0 },
|
||||||
{ "jccr", no_argument, NULL, 0 },
|
{ "jccr", no_argument, NULL, 0 },
|
||||||
{ "no-jccr", no_argument, NULL, 0 },
|
{ "no-jccr", no_argument, NULL, 0 },
|
||||||
{ "amvr", no_argument, NULL, 0 },
|
{ "amvr", no_argument, NULL, 0 },
|
||||||
|
@ -647,6 +649,7 @@ void print_help(void)
|
||||||
" --(no-)mrl : Enable use of multiple reference lines in intra\n"
|
" --(no-)mrl : Enable use of multiple reference lines in intra\n"
|
||||||
" predictions.\n"
|
" predictions.\n"
|
||||||
" --(no-)mip : Enable matrix weighted intra prediction.\n"
|
" --(no-)mip : Enable matrix weighted intra prediction.\n"
|
||||||
|
" --(no-)lfnst : Enable low frequency non-separable transform. [disabled]"
|
||||||
" --mts <string> : Multiple Transform Selection [off].\n"
|
" --mts <string> : Multiple Transform Selection [off].\n"
|
||||||
" (Currently only implemented for intra\n"
|
" (Currently only implemented for intra\n"
|
||||||
" and has effect only when rd >= 2)\n"
|
" and has effect only when rd >= 2)\n"
|
||||||
|
|
|
@ -284,6 +284,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_SAO_TYPE_IDX[4] = { 2, 5, 13, 4 };
|
||||||
|
|
||||||
|
static const uint8_t INIT_LFNST_IDX[4][3] = {
|
||||||
|
{ 52, 37, 27, },
|
||||||
|
{ 37, 45, 27, },
|
||||||
|
{ 28, 52, 42, },
|
||||||
|
{ 9, 9, 10, },
|
||||||
|
};
|
||||||
|
|
||||||
static const uint8_t INIT_MTS_IDX[4][4] = {
|
static const uint8_t INIT_MTS_IDX[4][4] = {
|
||||||
{ 45, 25, 27, 0, },
|
{ 45, 25, 27, 0, },
|
||||||
{ 45, 40, 27, 0, },
|
{ 45, 40, 27, 0, },
|
||||||
|
@ -502,7 +509,8 @@ void uvg_init_contexts(encoder_state_t *state, int8_t QP, int8_t slice)
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
uvg_ctx_init(&cabac->ctx.cu_skip_flag_model[i], QP, INIT_SKIP_FLAG[slice][i], INIT_SKIP_FLAG[3][i]);
|
uvg_ctx_init(&cabac->ctx.cu_skip_flag_model[i], QP, INIT_SKIP_FLAG[slice][i], INIT_SKIP_FLAG[3][i]);
|
||||||
uvg_ctx_init(&cabac->ctx.joint_cb_cr[i], QP, INIT_JOINT_CB_CR_FLAG[slice][i], INIT_JOINT_CB_CR_FLAG[3][i]);
|
uvg_ctx_init(&cabac->ctx.joint_cb_cr[i], QP, INIT_JOINT_CB_CR_FLAG[slice][i], INIT_JOINT_CB_CR_FLAG[3][i]);
|
||||||
|
uvg_ctx_init(&cabac->ctx.lfnst_idx[i], QP, INIT_LFNST_IDX[slice][i], INIT_LFNST_IDX[3][i]);
|
||||||
uvg_ctx_init(&cabac->ctx.transform_skip_sig_coeff_group[i], QP, INIT_TRANSFORM_SKIP_SIG_COEFF_GROUP[slice][i], INIT_TRANSFORM_SKIP_SIG_COEFF_GROUP[3][i]);
|
uvg_ctx_init(&cabac->ctx.transform_skip_sig_coeff_group[i], QP, INIT_TRANSFORM_SKIP_SIG_COEFF_GROUP[slice][i], INIT_TRANSFORM_SKIP_SIG_COEFF_GROUP[3][i]);
|
||||||
uvg_ctx_init(&cabac->ctx.transform_skip_sig[i], QP, INIT_TRANSFORM_SKIP_SIG[slice][i], INIT_TRANSFORM_SKIP_SIG[3][i]);
|
uvg_ctx_init(&cabac->ctx.transform_skip_sig[i], QP, INIT_TRANSFORM_SKIP_SIG[slice][i], INIT_TRANSFORM_SKIP_SIG[3][i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -667,6 +667,12 @@ static void encoder_state_write_bitstream_seq_parameter_set(bitstream_t* stream,
|
||||||
} else {
|
} else {
|
||||||
WRITE_U(stream, 0, 1, "sps_mrl_enabled_flag");
|
WRITE_U(stream, 0, 1, "sps_mrl_enabled_flag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state->encoder_control->cfg.lfnst) {
|
||||||
|
WRITE_U(stream, 1, 1, "sps_lfnst_enabled_flag");
|
||||||
|
} else {
|
||||||
|
WRITE_U(stream, 0, 1, "sps_lfnst_enabled_flag");
|
||||||
|
}
|
||||||
|
|
||||||
if (state->encoder_control->cfg.mip) {
|
if (state->encoder_control->cfg.mip) {
|
||||||
WRITE_U(stream, 1, 1, "sps_mip_enabled_flag");
|
WRITE_U(stream, 1, 1, "sps_mip_enabled_flag");
|
||||||
|
|
|
@ -518,10 +518,12 @@ typedef struct uvg_config
|
||||||
int8_t chroma_scale_out[3][17];
|
int8_t chroma_scale_out[3][17];
|
||||||
|
|
||||||
/** \brief enable use of multiple reference lines in intra prediction */
|
/** \brief enable use of multiple reference lines in intra prediction */
|
||||||
int8_t mrl;
|
int8_t mrl;
|
||||||
|
|
||||||
/** \brief enable matrix weighted intra prediction */
|
/** \brief enable matrix weighted intra prediction */
|
||||||
int8_t mip;
|
int8_t mip;
|
||||||
|
/** \brief enable low frequency non-separable transform */
|
||||||
|
int8_t lfnst;
|
||||||
|
|
||||||
|
|
||||||
int8_t jccr;
|
int8_t jccr;
|
||||||
|
|
Loading…
Reference in a new issue