diff --git a/README.md b/README.md index b09f33a8..20bf105c 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ http://github.com/ultravideo/kvazaar/wiki/List-of-suggested-topics for a list of beta and tc range is -6..6 [0:0] --no-sao : Disable sample adaptive offset --no-rdoq : Disable RDO quantization + --no-signhide : Disable sign hiding in quantization --rd : Rate-Distortion Optimization level [1] 0: no RDO 1: estimated RDO diff --git a/src/config.c b/src/config.c index 15692deb..8830b233 100644 --- a/src/config.c +++ b/src/config.c @@ -65,6 +65,7 @@ int config_init(config *cfg) cfg->deblock_tc = 0; cfg->sao_enable = 1; cfg->rdoq_enable = 1; + cfg->signhide_enable = true; cfg->rdo = 1; cfg->full_intra_search = 0; cfg->trskip_enable = 1; @@ -372,6 +373,8 @@ static int config_parse(config *cfg, const char *name, const char *value) cfg->sao_enable = atobool(value); else if OPT("rdoq") cfg->rdoq_enable = atobool(value); + else if OPT("signhide") + cfg->signhide_enable = (bool)atobool(value); else if OPT("rd") { int rdo = 0; @@ -524,6 +527,7 @@ int config_read(config *cfg,int argc, char *argv[]) { "deblock", required_argument, NULL, 0 }, { "no-sao", no_argument, NULL, 0 }, { "no-rdoq", no_argument, NULL, 0 }, + { "no-signhide", no_argument, NULL, 0 }, { "rd", required_argument, NULL, 0 }, { "full-intra-search", no_argument, NULL, 0 }, { "no-transform-skip", no_argument, NULL, 0 }, diff --git a/src/config.h b/src/config.h index 453036b5..cb41e57e 100644 --- a/src/config.h +++ b/src/config.h @@ -44,6 +44,7 @@ typedef struct int32_t deblock_enable; /*!< \brief Flag to enable deblocking filter */ int32_t sao_enable; /*!< \brief Flag to enable sample adaptive offset filter */ int32_t rdoq_enable; /*!< \brief Flag to enable RD optimized quantization. */ + bool signhide_enable; int32_t rdo; /*!< \brief RD-calculation level (0..2) */ bool full_intra_search; /*!< \brief Don't skip modes in intra search.e */ int32_t trskip_enable; /*!< \brief Flag to enable transform skip (for 4x4 blocks). */ diff --git a/src/encmain.c b/src/encmain.c index 110b1ec4..86a14334 100644 --- a/src/encmain.c +++ b/src/encmain.c @@ -109,6 +109,7 @@ int main(int argc, char *argv[]) " beta and tc range is -6..6 [0:0]\n" " --no-sao : Disable sample adaptive offset\n" " --no-rdoq : Disable RDO quantization\n" + " --no-signhide : Disable sign hiding in quantization\n" " --rd : Rate-Distortion Optimization level [1]\n" " 0: no RDO\n" " 1: estimated RDO\n" @@ -277,6 +278,7 @@ int main(int argc, char *argv[]) // RDO encoder.rdoq_enable = (int8_t)encoder.cfg->rdoq_enable; encoder.rdo = (int8_t)encoder.cfg->rdo; + encoder.sign_hiding = encoder.cfg->signhide_enable; encoder.full_intra_search = (int8_t)encoder.cfg->full_intra_search; // TR SKIP encoder.trskip_enable = (int8_t)encoder.cfg->trskip_enable; @@ -299,8 +301,6 @@ int main(int argc, char *argv[]) // TODO: Add config option for vps_period. encoder.vps_period = (encoder.cfg->rdo == 0 ? encoder.cfg->intra_period : 0); - encoder.sign_hiding = ENABLE_SIGN_HIDING; - encoder.in.file = input; fprintf(stderr, "Input: %s, output: %s\n", cfg->input, cfg->output); diff --git a/src/global.h b/src/global.h index 29fbd4c9..8765f97e 100644 --- a/src/global.h +++ b/src/global.h @@ -76,7 +76,6 @@ typedef int16_t coefficient; #define TR_DEPTH_INTER 2 /*!< spec: max_transform_hierarchy_depth_inter */ #define ENABLE_PCM 0 /*!< spec: pcm_enabled_flag, Setting to 1 will enable using PCM blocks (current intra-search does not consider PCM) */ -#define ENABLE_SIGN_HIDING 1 /*!< spec: sign_data_hiding_enabled_flag */ #define ENABLE_TEMPORAL_MVP 0 /*!< Enable usage of temporal Motion Vector Prediction */