From 06233b5d3b02d38340349d3e6466ed374996d9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20M=C3=A4kinen?= Date: Thu, 4 Jul 2019 10:20:18 +0300 Subject: [PATCH] added alf parameter to cli --- src/cfg.c | 3 +++ src/cli.c | 2 ++ src/encoder_state-bitstream.c | 2 +- src/kvazaar.h | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cfg.c b/src/cfg.c index 8fb98e58..86418831 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -49,6 +49,7 @@ int kvz_config_init(kvz_config *cfg) cfg->deblock_beta = 0; cfg->deblock_tc = 0; cfg->sao_type = 3; + cfg->alf_enable = 0; cfg->rdoq_enable = 1; cfg->rdoq_skip = 1; cfg->signhide_enable = true; @@ -796,6 +797,8 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value) if (!parse_enum(value, sao_names, &sao_type)) sao_type = atobool(value) ? 3 : 0; cfg->sao_type = sao_type; } + else if OPT("alf") + cfg->alf_enable = atobool(value); else if OPT("rdoq") cfg->rdoq_enable = atobool(value); else if OPT("signhide") diff --git a/src/cli.c b/src/cli.c index 29aeb261..8dd79ce5 100644 --- a/src/cli.c +++ b/src/cli.c @@ -49,6 +49,8 @@ static const struct option long_options[] = { { "no-deblock", no_argument, NULL, 0 }, { "sao", required_argument, NULL, 0 }, { "no-sao", no_argument, NULL, 0 }, + { "alf", no_argument, NULL, 0 }, + { "no-alf", no_argument, NULL, 0 }, { "rdoq", no_argument, NULL, 0 }, { "no-rdoq", no_argument, NULL, 0 }, { "signhide", no_argument, NULL, 0 }, diff --git a/src/encoder_state-bitstream.c b/src/encoder_state-bitstream.c index e8ed3109..d8df4031 100644 --- a/src/encoder_state-bitstream.c +++ b/src/encoder_state-bitstream.c @@ -614,7 +614,7 @@ static void encoder_state_write_bitstream_seq_parameter_set(bitstream_t* stream, // if(!no_sao_constraint_flag) WRITE_U(stream, encoder->cfg.sao_type ? 1 : 0, 1, "sps_sao_enabled_flag"); // if(!no_alf_constraint_flag) - WRITE_U(stream, 0, 1, "sps_alf_enabled_flag"); + WRITE_U(stream, encoder->cfg.alf_enable, 1, "sps_alf_enable_flag"); WRITE_U(stream, 0, 1, "sps_lmcs_enable_flag"); diff --git a/src/kvazaar.h b/src/kvazaar.h index 434bbf17..506d8c44 100644 --- a/src/kvazaar.h +++ b/src/kvazaar.h @@ -286,6 +286,7 @@ typedef struct kvz_config int32_t framerate_denom; /*!< \brief Framerate denominator */ int32_t deblock_enable; /*!< \brief Flag to enable deblocking filter */ enum kvz_sao sao_type; /*!< \brief Flag to enable sample adaptive offset filter */ + int8_t alf_enable; /*!< \brief Flag to enable advanced loop filter */ int32_t rdoq_enable; /*!< \brief Flag to enable RD optimized quantization. */ int32_t signhide_enable; /*!< \brief Flag to enable sign hiding. */ int32_t smp_enable; /*!< \brief Flag to enable SMP blocks. */