From 13924a2057575d036838009f3aacb01c3ba9eb62 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Thu, 16 Apr 2015 17:17:17 +0300 Subject: [PATCH] Add --no-info parameter. - Stops encoder information from being added to bitstream. - The version information overhead is too big when doing comparisons with very short sequences. --- README.md | 1 + src/config.c | 5 +++++ src/config.h | 2 ++ src/encmain.c | 1 + src/encoder_state-bitstream.c | 2 +- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 89c095f8..5a293f25 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ http://github.com/ultravideo/kvazaar/wiki/List-of-suggested-topics for a list of 0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8 --pu-depth-intra - : Range for sizes of intra prediction units to try. 0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8, 4: 4x4 + --no-info : Don't add information about the encoder to settings. Video Usability Information: --sar : Specify Sample Aspect Ratio diff --git a/src/config.c b/src/config.c index 34a9f493..13f57695 100644 --- a/src/config.c +++ b/src/config.c @@ -109,6 +109,8 @@ int config_init(config_t *cfg) cfg->pu_depth_intra.min = 1; // 0-4 cfg->pu_depth_intra.max = 4; // 0-4 + cfg->add_encoder_info = true; + return 1; } @@ -505,6 +507,8 @@ static int config_parse(config_t *cfg, const char *name, const char *value) } } } + else if OPT("info") + cfg->add_encoder_info = atobool(value); else return 0; #undef OPT @@ -566,6 +570,7 @@ int config_read(config_t *cfg,int argc, char *argv[]) { "cpuid", required_argument, NULL, 0 }, { "pu-depth-inter", required_argument, NULL, 0 }, { "pu-depth-intra", required_argument, NULL, 0 }, + { "no-info", no_argument, NULL, 0 }, {0, 0, 0, 0} }; diff --git a/src/config.h b/src/config.h index edf51069..63c93680 100644 --- a/src/config.h +++ b/src/config.h @@ -89,6 +89,8 @@ typedef struct int32_t min; int32_t max; } pu_depth_inter, pu_depth_intra; + + bool add_encoder_info; } config_t; /* Function definitions */ diff --git a/src/encmain.c b/src/encmain.c index 0b5ba849..6f06f463 100644 --- a/src/encmain.c +++ b/src/encmain.c @@ -136,6 +136,7 @@ int main(int argc, char *argv[]) " 0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8\n" " --pu-depth-intra - : Range for sizes of intra prediction units to try.\n" " 0: 64x64, 1: 32x32, 2: 16x16, 3: 8x8, 4: 4x4\n" + " --no-info : Don't add information about the encoder to settings.\n" "\n" " Video Usability Information:\n" " --sar : Specify Sample Aspect Ratio\n" diff --git a/src/encoder_state-bitstream.c b/src/encoder_state-bitstream.c index dbd98b5a..a6437e5e 100644 --- a/src/encoder_state-bitstream.c +++ b/src/encoder_state-bitstream.c @@ -720,7 +720,7 @@ static void encoder_state_write_bitstream_main(encoder_state_t * const state) { } // Send Kvazaar version information only in the first frame. - if (state->global->frame == 0) { + if (state->global->frame == 0 && state->encoder_control->cfg->add_encoder_info) { nal_write(stream, PREFIX_SEI_NUT, 0, first_nal_in_au); encoder_state_write_bitstream_prefix_sei_version(state); bitstream_align(stream);