Skip to content

Commit

Permalink
Model implementation based on avcodec_descriptor_next from libavcodec
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatNerdUKnow committed Nov 30, 2022
1 parent 50cceac commit 23138fd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libvmaf/include/libvmaf/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ typedef struct VmafModelCollectionScore {
} bootstrap;
} VmafModelCollectionScore;

typedef struct VmafBuiltInModel {
const char *version;
const char *data;
const int *data_len;
} VmafBuiltInModel;

const VmafBuiltInModel *vmaf_built_in_model_next(const VmafBuiltInModel *prev);

int vmaf_model_collection_load(VmafModel **model,
VmafModelCollection **model_collection,
VmafModelConfig *cfg,
Expand Down
7 changes: 7 additions & 0 deletions libvmaf/src/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,10 @@ int vmaf_model_collection_feature_overload(VmafModel *model,
return err;
}

const VmafBuiltInModel *vmaf_built_in_model_next(const VmafBuiltInModel *prev){
if(!prev)
return &built_in_models[0];
if(prev - built_in_models < BUILT_IN_MODEL_CNT)
return prev + 1;
return NULL;
}
8 changes: 8 additions & 0 deletions libvmaf/src/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ typedef struct VmafModelCollection {
const char *name;
} VmafModelCollection;

typedef struct VmafBuiltInModel {
const char *version;
const char *data;
const int *data_len;
} VmafBuiltInModel;

const VmafBuiltInModel *vmaf_built_in_model_next(const VmafBuiltInModel *prev);

char *vmaf_model_generate_name(VmafModelConfig *cfg);

int vmaf_model_collection_append(VmafModelCollection **model_collection,
Expand Down

0 comments on commit 23138fd

Please sign in to comment.