Skip to content

Commit 855d7aa

Browse files
Yiğithan Yiğitnilfm99
Yiğithan Yiğit
authored andcommitted
refactor: revert unnecessary changes
1 parent 3115536 commit 855d7aa

File tree

5 files changed

+3
-71
lines changed

5 files changed

+3
-71
lines changed

libvmaf/include/libvmaf/libvmaf.h

-39
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ int vmaf_feature_score_at_index(VmafContext *vmaf, const char *feature_name,
257257
* Metadata structure.
258258
*
259259
* @param feature_name Name of the feature to fetch.
260-
* vmaf going to take ownership of this string.
261260
*
262261
* @param picture_index Picture index.
263262
*
@@ -286,31 +285,6 @@ typedef struct VmafMetadataConfiguration {
286285
void *data;
287286
} VmafMetadataConfiguration;
288287

289-
290-
/**
291-
* Metadata flags.
292-
*
293-
* Features can provide additional metrics about the score. To propagate those,
294-
* the `VmafMetadataFlags` enum should be used for specifying which information should be
295-
* propagated to the metadata.
296-
*
297-
* @param VMAF_METADATA_FLAG_NONE No flags.
298-
*
299-
* @param VMAF_METADATA_FLAG_FEATURE Include all indivual metrics.
300-
*
301-
* @param VMAF_METADATA_FLAG_MODEL Propagate only model score.
302-
*
303-
* @param VMAF_METADATA_FLAG_FEATURE_NAME Propagate only given feature name..
304-
*
305-
*/
306-
307-
enum VmafMetadataFlags {
308-
VMAF_METADATA_FLAG_NONE = 0,
309-
VMAF_METADATA_FLAG_FEATURE = 1 << 0,
310-
VMAF_METADATA_FLAG_MODEL = 1 << 1,
311-
VMAF_METADATA_FLAG_FEATURE_NAME = 1 << 2,
312-
};
313-
314288
/**
315289
* Register a callback to receive VMAF metadata.
316290
*
@@ -324,19 +298,6 @@ enum VmafMetadataFlags {
324298

325299
int vmaf_register_metadata_handler(VmafContext *vmaf, VmafMetadataConfiguration cfg);
326300

327-
/**
328-
* Get the number of registered metadata handlers.
329-
*
330-
* @param vmaf The VMAF context allocated with `vmaf_init()`.
331-
*
332-
* @param count Number of registered metadata handlers.
333-
*
334-
*
335-
* @return 0 on success, or < 0 (a negative errno code) on error.
336-
*/
337-
338-
int vmaf_get_metadata_handler_count(VmafContext *vmaf, unsigned *count);
339-
340301
/**
341302
* Pooled VMAF score for a specific interval.
342303
*

libvmaf/src/feature/feature_collector.c

-19
Original file line numberDiff line numberDiff line change
@@ -296,25 +296,6 @@ int vmaf_feature_collector_register_metadata(VmafFeatureCollector *feature_colle
296296
return 0;
297297
}
298298

299-
int vmaf_feature_collector_get_metadata_count(VmafFeatureCollector *feature_collector,
300-
unsigned *count)
301-
{
302-
if (!feature_collector) return -EINVAL;
303-
if (!count) return -EINVAL;
304-
305-
VmafCallbackList *metadata = feature_collector->metadata;
306-
unsigned cnt = 0;
307-
VmafCallbackItem *iter = metadata ? metadata->head : NULL;
308-
while (iter) {
309-
cnt++;
310-
iter = iter->next;
311-
}
312-
313-
*count = cnt;
314-
315-
return 0;
316-
}
317-
318299
static FeatureVector *find_feature_vector(VmafFeatureCollector *fc,
319300
const char *feature_name)
320301
{

libvmaf/src/libvmaf.c

-8
Original file line numberDiff line numberDiff line change
@@ -751,14 +751,6 @@ int vmaf_register_metadata_handler(VmafContext *vmaf, VmafMetadataConfiguration
751751
return vmaf_feature_collector_register_metadata(vmaf->feature_collector, cfg);
752752
}
753753

754-
int vmaf_get_metadata_handler_count(VmafContext *vmaf, unsigned *count)
755-
{
756-
if (!vmaf) return -EINVAL;
757-
if (!count) return -EINVAL;
758-
759-
return vmaf_feature_collector_get_metadata_count(vmaf->feature_collector, count);
760-
}
761-
762754
int vmaf_feature_score_at_index(VmafContext *vmaf, const char *feature_name,
763755
double *score, unsigned index)
764756
{

libvmaf/src/metadata_handler.c

-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ int vmaf_metadata_destroy(VmafCallbackList *metadata)
7171
VmafCallbackItem *iter = metadata->head;
7272
while (iter) {
7373
VmafCallbackItem *next = iter->next;
74-
if (iter->metadata_cfg.feature_name)
75-
free(iter->metadata_cfg.feature_name);
7674
free(iter);
7775
iter = next;
7876
}

libvmaf/test/test_predict.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static char* test_propagate_metadata()
107107
};
108108

109109
VmafMetadataConfiguration m = {
110-
.feature_name = strdup("vmaf"),
110+
.feature_name = "vmaf",
111111
.callback = set_meta,
112112
.data = &meta_data,
113113
};
@@ -146,7 +146,7 @@ static char* test_propagate_metadata()
146146
vmaf_feature_collector_destroy(feature_collector);
147147

148148
m.data = NULL;
149-
m.feature_name = strdup("vmaf");
149+
m.feature_name = "vmaf";
150150
err = vmaf_feature_collector_init(&feature_collector);
151151
mu_assert("problem during vmaf_feature_collector_init", !err);
152152

@@ -162,7 +162,7 @@ static char* test_propagate_metadata()
162162
vmaf_feature_collector_destroy(feature_collector);
163163

164164
m.callback = NULL;
165-
m.feature_name = strdup("vmaf");
165+
m.feature_name = "vmaf";
166166
err = vmaf_feature_collector_init(&feature_collector);
167167
mu_assert("problem during vmaf_feature_collector_init", !err);
168168

0 commit comments

Comments
 (0)