diff --git a/README.md b/README.md index 4a775a21..5c839386 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ Video structure: - 8: B-frame pyramid of length 8 - lp-: Low-delay P-frame GOP (e.g. lp-g8d4t2, see README) + --(no-)open-gop : Use open GOP configuration. [enabled] --cqmfile : Read custom quantization matrices from a file. --bitrate : Target bitrate [0] - 0: Disable rate control. diff --git a/doc/kvazaar.1 b/doc/kvazaar.1 index ccfd148d..fbfb1662 100644 --- a/doc/kvazaar.1 +++ b/doc/kvazaar.1 @@ -1,4 +1,4 @@ -.TH KVAZAAR "1" "August 2018" "kvazaar v1.2.0" "User Commands" +.TH KVAZAAR "1" "October 2018" "kvazaar v1.2.0" "User Commands" .SH NAME kvazaar \- open source HEVC encoder .SH SYNOPSIS @@ -121,6 +121,9 @@ GOP structure [8] \- lp\-: Low\-delay P\-frame GOP (e.g. lp\-g8d4t2, see README) .TP +\fB\-\-(no\-)open\-gop +Use open GOP configuration. [enabled] +.TP \fB\-\-cqmfile Read custom quantization matrices from a file. .TP diff --git a/src/cfg.c b/src/cfg.c index a8b3f32e..234e4a31 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -117,6 +117,7 @@ int kvz_config_init(kvz_config *cfg) cfg->gop_lp_definition.d = 3; cfg->gop_lp_definition.t = 1; + cfg->open_gop = true; cfg->roi.width = 0; cfg->roi.height = 0; @@ -939,6 +940,9 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value) return 0; } } + else if OPT("open-gop") { + cfg->open_gop = (bool)atobool(value); + } else if OPT("bipred") cfg->bipred = atobool(value); else if OPT("bitrate") diff --git a/src/cli.c b/src/cli.c index 07a918ae..32618aa6 100644 --- a/src/cli.c +++ b/src/cli.c @@ -131,6 +131,8 @@ static const struct option long_options[] = { { "me-steps", required_argument, NULL, 0 }, { "fast-residual-cost", required_argument, NULL, 0 }, { "set-qp-in-cu", no_argument, NULL, 0 }, + { "open-gop", no_argument, NULL, 0 }, + { "no-open-gop", no_argument, NULL, 0 }, {0, 0, 0, 0} }; @@ -395,6 +397,7 @@ void print_help(void) " - 8: B-frame pyramid of length 8\n" " - lp-: Low-delay P-frame GOP\n" " (e.g. lp-g8d4t2, see README)\n" + " --(no-)open-gop : Use open GOP configuration. [enabled]\n" " --cqmfile : Read custom quantization matrices from a file.\n" " --bitrate : Target bitrate [0]\n" " - 0: Disable rate control.\n" diff --git a/src/kvazaar.h b/src/kvazaar.h index 262be213..02dedd6b 100644 --- a/src/kvazaar.h +++ b/src/kvazaar.h @@ -372,6 +372,9 @@ typedef struct kvz_config /** \brief Set QP at CU level keeping pic_init_qp_minus26 in PPS zero */ int8_t set_qp_in_cu; + /** \brief Flag to enable/disable open GOP configuration */ + int8_t open_gop; + } kvz_config; /**