From 1dd378e85192898818685581ed5e93b204fabc91 Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Thu, 2 Dec 2021 22:57:44 +0200 Subject: [PATCH] [cleanup] Remove deprecated width and height parameters and other small changes * change some mentions of Kvazaar to uvg266 * remove cfg.framerate --- src/cfg.c | 11 +---------- src/cli.c | 12 +++++------- src/debug.c | 2 +- src/encoder.c | 2 -- src/kvazaar.h | 1 - 5 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index 517d78a4..2290be66 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -52,7 +52,6 @@ int kvz_config_init(kvz_config *cfg) { cfg->width = 0; cfg->height = 0; - cfg->framerate = 25; // deprecated and will be removed. cfg->framerate_num = 25; cfg->framerate_denom = 1; cfg->qp = 22; @@ -862,11 +861,7 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value) } #define OPT(STR) (!strcmp(name, STR)) - if OPT("width") - cfg->width = atoi(value); - else if OPT("height") - cfg->height = atoi(value); - else if OPT("input-res") + if OPT("input-res") if (!strcmp(value, "auto")) { return 1; } else { @@ -1650,10 +1645,6 @@ int kvz_config_validate(const kvz_config *const cfg) } } - if (cfg->framerate < 0.0) { - fprintf(stderr, "Input error: --input-fps must be positive\n"); - error = 1; - } if (cfg->framerate_num < 0) { fprintf(stderr, "Input error: --input-fps must >=0\n"); error = 1; diff --git a/src/cli.c b/src/cli.c index a45a0d01..37419ae7 100644 --- a/src/cli.c +++ b/src/cli.c @@ -43,13 +43,11 @@ #include #include -static const char short_options[] = "i:o:d:w:h:n:q:p:r:"; +static const char short_options[] = "i:o:d:n:q:p:r:"; static const struct option long_options[] = { { "input", required_argument, NULL, 'i' }, { "output", required_argument, NULL, 'o' }, { "debug", required_argument, NULL, 'd' }, - { "width", required_argument, NULL, 'w' }, // deprecated - { "height", required_argument, NULL, 'h' }, // deprecated { "frames", required_argument, NULL, 'n' }, { "qp", required_argument, NULL, 'q' }, { "period", required_argument, NULL, 'p' }, @@ -388,16 +386,16 @@ void cmdline_opts_free(const kvz_api *const api, cmdline_opts_t *opts) void print_usage(void) { fprintf(stdout, - "Kvazaar usage: -i and --input-res to set input, -o to set output\n" - " --help for more information\n"); + "uvg266 usage: -i and --input-res to set input, -o to set output\n" + " --help for more information\n"); } void print_version(void) { fprintf(stdout, - "Kvazaar " VERSION_STRING "\n" - "Kvazaar license: 3-clause BSD\n"); + "uvg266 " VERSION_STRING "\n" + "uvg266 license: 3-clause BSD\n"); } diff --git a/src/debug.c b/src/debug.c index 8a4197da..c5f13cfc 100644 --- a/src/debug.c +++ b/src/debug.c @@ -98,7 +98,7 @@ void kvz_dbg_yuview_init(const encoder_control_t* const encoder, char* filename, yuview_frames = 0; fprintf(yuview_output, "%%;syntax-version;v1.22\r\n"); - fprintf(yuview_output, "%%;seq-specs;%s;layer2;%d;%d;%f\r\n", sequence, encoder->in.width, encoder->in.height, encoder->cfg.framerate); + fprintf(yuview_output, "%%;seq-specs;%s;layer2;%d;%d;%f\r\n", sequence, encoder->in.width, encoder->in.height, (double)encoder->cfg.framerate_num / (double)encoder->cfg.framerate_denom); fprintf(yuview_output, "%%;type;0;CU-type;range\r\n"); fprintf(yuview_output, "%%;defaultRange;0;2;jet\r\n"); fprintf(yuview_output, "%%;type;1;IntraDirLuma;range\r\n"); diff --git a/src/encoder.c b/src/encoder.c index e32c3c6d..98d87690 100644 --- a/src/encoder.c +++ b/src/encoder.c @@ -426,8 +426,6 @@ encoder_control_t* kvz_encoder_control_init(const kvz_config *const cfg) if (encoder->cfg.framerate_num != 0) { double framerate = encoder->cfg.framerate_num / (double)encoder->cfg.framerate_denom; encoder->target_avg_bppic = encoder->cfg.target_bitrate / framerate; - } else { - encoder->target_avg_bppic = encoder->cfg.target_bitrate / encoder->cfg.framerate; } encoder->target_avg_bpp = encoder->target_avg_bppic / encoder->in.pixels_per_pic; diff --git a/src/kvazaar.h b/src/kvazaar.h index 0b09e49b..1e459085 100644 --- a/src/kvazaar.h +++ b/src/kvazaar.h @@ -312,7 +312,6 @@ typedef struct kvz_config int32_t width; /*!< \brief frame width, must be a multiple of 8 */ int32_t height; /*!< \brief frame height, must be a multiple of 8 */ - double framerate; /*!< \brief Deprecated, will be removed. */ int32_t framerate_num; /*!< \brief Framerate numerator */ int32_t framerate_denom; /*!< \brief Framerate denominator */ int32_t lmcs_enable; /*!< \brief Flag to enable luma mapping with chroma scaling - filter */