Add prefix to kvazaar.h define

This commit is contained in:
Jaakko Laitinen 2020-03-20 09:04:00 +02:00
parent b2ddba38c2
commit aaac3df69b
3 changed files with 11 additions and 10 deletions

View file

@ -951,9 +951,9 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value)
else if OPT("cpuid") else if OPT("cpuid")
cfg->cpuid = atobool(value); cfg->cpuid = atobool(value);
else if OPT("pu-depth-inter") else if OPT("pu-depth-inter")
return parse_pu_depth_list(value, cfg->pu_depth_inter.min, cfg->pu_depth_inter.max, MAX_GOP_LAYERS); return parse_pu_depth_list(value, cfg->pu_depth_inter.min, cfg->pu_depth_inter.max, KVZ_MAX_GOP_LAYERS);
else if OPT("pu-depth-intra") else if OPT("pu-depth-intra")
return parse_pu_depth_list(value, cfg->pu_depth_intra.min, cfg->pu_depth_intra.max, MAX_GOP_LAYERS); return parse_pu_depth_list(value, cfg->pu_depth_intra.min, cfg->pu_depth_intra.max, KVZ_MAX_GOP_LAYERS);
else if OPT("info") else if OPT("info")
cfg->add_encoder_info = atobool(value); cfg->add_encoder_info = atobool(value);
else if OPT("gop") { else if OPT("gop") {
@ -1545,7 +1545,7 @@ int kvz_config_validate(const kvz_config *const cfg)
error = 1; error = 1;
} }
for( size_t i = 0; i < MAX_GOP_LAYERS; i++ ) for( size_t i = 0; i < KVZ_MAX_GOP_LAYERS; i++ )
{ {
if( cfg->pu_depth_inter.min[i] < 0 || cfg->pu_depth_inter.max[i] < 0 ) continue; if( cfg->pu_depth_inter.min[i] < 0 || cfg->pu_depth_inter.max[i] < 0 ) continue;

View file

@ -608,7 +608,7 @@ encoder_control_t* kvz_encoder_control_init(const kvz_config *const cfg)
#endif //KVZ_DEBUG #endif //KVZ_DEBUG
} }
for( size_t i = 0; i < MAX_GOP_LAYERS; i++ ) for( size_t i = 0; i < KVZ_MAX_GOP_LAYERS; i++ )
{ {
if( encoder->cfg.pu_depth_inter.min[i] < 0 || cfg->pu_depth_inter.max[i] < 0 ) continue; if( encoder->cfg.pu_depth_inter.min[i] < 0 || cfg->pu_depth_inter.max[i] < 0 ) continue;
assert( WITHIN( encoder->cfg.pu_depth_inter.min[i], PU_DEPTH_INTER_MIN, PU_DEPTH_INTER_MAX ) ); assert( WITHIN( encoder->cfg.pu_depth_inter.min[i], PU_DEPTH_INTER_MIN, PU_DEPTH_INTER_MAX ) );

View file

@ -63,10 +63,11 @@ extern "C" {
* Maximum length of a GoP structure. * Maximum length of a GoP structure.
*/ */
#define KVZ_MAX_GOP_LENGTH 32 #define KVZ_MAX_GOP_LENGTH 32
//Also defined in global.h
#ifndef MAX_GOP_LAYERS /**
#define MAX_GOP_LAYERS 6 * Maximum amount of GoP layers.
#endif */
#define KVZ_MAX_GOP_LAYERS 6
/** /**
* Size of data chunks. * Size of data chunks.
@ -312,8 +313,8 @@ typedef struct kvz_config
int32_t cpuid; int32_t cpuid;
struct { struct {
int32_t min[MAX_GOP_LAYERS]; int32_t min[KVZ_MAX_GOP_LAYERS];
int32_t max[MAX_GOP_LAYERS]; int32_t max[KVZ_MAX_GOP_LAYERS];
} pu_depth_inter, pu_depth_intra; } pu_depth_inter, pu_depth_intra;
int32_t add_encoder_info; int32_t add_encoder_info;