Set correct size for pu-depth min/max data structure

This commit is contained in:
Jaakko Laitinen 2020-03-19 09:29:43 +02:00
parent fe428dcbe1
commit b2ddba38c2
2 changed files with 8 additions and 4 deletions

View file

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

View file

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