From b2ddba38c23fbfde1c7b29bc740e667c757771e7 Mon Sep 17 00:00:00 2001 From: Jaakko Laitinen Date: Thu, 19 Mar 2020 09:29:43 +0200 Subject: [PATCH] Set correct size for pu-depth min/max data structure --- src/cfg.c | 4 ++-- src/kvazaar.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index f33ff87a..5f764ec1 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -951,9 +951,9 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value) else if OPT("cpuid") cfg->cpuid = atobool(value); else if OPT("pu-depth-inter") - return parse_pu_depth_list(value, cfg->pu_depth_inter.min, cfg->pu_depth_inter.max, KVZ_MAX_GOP_LENGTH); + return parse_pu_depth_list(value, cfg->pu_depth_inter.min, cfg->pu_depth_inter.max, MAX_GOP_LAYERS); else if OPT("pu-depth-intra") - return parse_pu_depth_list(value, cfg->pu_depth_intra.min, cfg->pu_depth_intra.max, KVZ_MAX_GOP_LENGTH); + return parse_pu_depth_list(value, cfg->pu_depth_intra.min, cfg->pu_depth_intra.max, MAX_GOP_LAYERS); else if OPT("info") cfg->add_encoder_info = atobool(value); else if OPT("gop") { diff --git a/src/kvazaar.h b/src/kvazaar.h index 84994c11..1475415b 100644 --- a/src/kvazaar.h +++ b/src/kvazaar.h @@ -63,6 +63,10 @@ extern "C" { * Maximum length of a GoP structure. */ #define KVZ_MAX_GOP_LENGTH 32 +//Also defined in global.h +#ifndef MAX_GOP_LAYERS +#define MAX_GOP_LAYERS 6 +#endif /** * Size of data chunks. @@ -308,8 +312,8 @@ typedef struct kvz_config int32_t cpuid; struct { - int32_t min[KVZ_MAX_GOP_LENGTH]; - int32_t max[KVZ_MAX_GOP_LENGTH]; + int32_t min[MAX_GOP_LAYERS]; + int32_t max[MAX_GOP_LAYERS]; } pu_depth_inter, pu_depth_intra; int32_t add_encoder_info;