diff --git a/README.md b/README.md index 20bf105c..f0853b9a 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,11 @@ http://github.com/ultravideo/kvazaar/wiki/List-of-suggested-topics for a list of 0: only first picture is intra 1: all pictures are intra 2-N: every Nth picture is intra + --vps-period : Specify how often the video parameter set is + re-sent. [0] + 0: only send VPS with the first frame + 1: send VPS with every intra frame + N: send VPS with every Nth intra frame -r, --ref : Reference frames, range 1..15 [3] --no-deblock : Disable deblocking filter --deblock : Deblocking filter parameters diff --git a/src/config.c b/src/config.c index 8830b233..c134a8a2 100644 --- a/src/config.c +++ b/src/config.c @@ -60,6 +60,7 @@ int config_init(config *cfg) cfg->height = 0; cfg->qp = 32; cfg->intra_period = 0; + cfg->vps_period = 0; cfg->deblock_enable = 1; cfg->deblock_beta = 0; cfg->deblock_tc = 0; @@ -340,6 +341,8 @@ static int config_parse(config *cfg, const char *name, const char *value) cfg->qp = atoi(value); else if OPT("period") cfg->intra_period = atoi(value); + else if OPT("vps-period") + cfg->vps_period = atoi(value); else if OPT("ref") { cfg->ref_frames = atoi(value); if (cfg->ref_frames < 1 || cfg->ref_frames >= MAX_REF_PIC_COUNT) { @@ -522,6 +525,7 @@ int config_read(config *cfg,int argc, char *argv[]) { "qp", required_argument, NULL, 'q' }, { "period", required_argument, NULL, 'p' }, { "ref", required_argument, NULL, 'r' }, + { "vps-period", required_argument, NULL, 0 }, { "input-res", required_argument, NULL, 0 }, { "no-deblock", no_argument, NULL, 0 }, { "deblock", required_argument, NULL, 0 }, diff --git a/src/config.h b/src/config.h index cb41e57e..045f9eab 100644 --- a/src/config.h +++ b/src/config.h @@ -38,6 +38,7 @@ typedef struct char *debug; /*!< \brief Pointer to debug output */ int32_t qp; /*!< \brief Quantization parameter */ int32_t intra_period; /*!< \brief the period of intra frames in stream */ + int32_t vps_period; /*!< \brief how often the vps is re-sent */ int32_t frames; /*!< \brief Number of frames to decode */ int32_t width; /*!< \brief frame width */ int32_t height; /*!< \brief frame height */ diff --git a/src/encmain.c b/src/encmain.c index 86a14334..37fc8b04 100644 --- a/src/encmain.c +++ b/src/encmain.c @@ -103,6 +103,11 @@ int main(int argc, char *argv[]) " 0: only first picture is intra\n" " 1: all pictures are intra\n" " 2-N: every Nth picture is intra\n" + " --vps-period : Specify how often the video parameter set is\n" + " re-sent. [0]\n" + " 0: only send VPS with the first frame\n" + " 1: send VPS with every intra frame\n" + " N: send VPS with every Nth intra frame\n" " -r, --ref : Reference frames, range 1..15 [3]\n" " --no-deblock : Disable deblocking filter\n" " --deblock : Deblocking filter parameters\n" @@ -298,8 +303,7 @@ int main(int argc, char *argv[]) // AUD encoder.aud_enable = (int8_t)encoder.cfg->aud_enable; - // TODO: Add config option for vps_period. - encoder.vps_period = (encoder.cfg->rdo == 0 ? encoder.cfg->intra_period : 0); + encoder.vps_period = encoder.cfg->vps_period * encoder.cfg->intra_period; encoder.in.file = input;