[cleanup] Remove deprecated width and height parameters and other small changes

* change some mentions of Kvazaar to uvg266
  * remove cfg.framerate
This commit is contained in:
Marko Viitanen 2021-12-02 22:57:44 +02:00
parent 3a447e09c2
commit 1dd378e851
5 changed files with 7 additions and 21 deletions

View file

@ -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;

View file

@ -43,13 +43,11 @@
#include <getopt.h>
#include <ctype.h>
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");
}

View file

@ -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");

View file

@ -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;

View file

@ -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 */