libvmaf
Loading...
Searching...
No Matches
luminance_tools.h
Go to the documentation of this file.
1
18
19#ifndef VMAF_LUMINANCE_TOOLS_H_
20#define VMAF_LUMINANCE_TOOLS_H_
21
22typedef double (*VmafEOTF)(double V);
23
24/*
25 * Limited pixel range means that only values between 16 and 235 will be used in 8 bits
26 * (rescale the bounds appropriately for other bitdepths).
27 * Full pixel range means that values from 0 to 2^bitdepth - 1 will be used.
28 */
34
35/*
36 * Contains the necessary information to normalize a luma value down to [0, 1].
37 */
38typedef struct VmafLumaRange {
39 int foot;
40 int head;
42
43/*
44 * Constructor for the LumaRange struct.
45 */
46int vmaf_luminance_init_luma_range(VmafLumaRange *luma_range, int bitdepth, enum VmafPixelRange pix_range);
47
48/*
49 * Returns the EOTF corresponding to the string given.
50 * eotf_str must be one of ['bt1886', 'pq']
51 */
52int vmaf_luminance_init_eotf(VmafEOTF *eotf, const char *eotf_str);
53
54
55/*
56 * Takes a normalized luma value in the [0, 1] range and returns a luminance value.
57 */
59
60/*
61 * Takes a normalized luma value in the [0, 1] range and returns a luminance value.
62 */
63double vmaf_luminance_pq_eotf(double V);
64
65/*
66 * Takes a luma value, normalizes it and applies the given VmafEOTF
67 * to return a luminance value.
68 */
69double vmaf_luminance_get_luminance(int sample, VmafLumaRange luma_range, VmafEOTF eotf);
70
71#endif
double vmaf_luminance_get_luminance(int sample, VmafLumaRange luma_range, VmafEOTF eotf)
double(*) VmafEOTF(double V)
Definition luminance_tools.h:22
int vmaf_luminance_init_luma_range(VmafLumaRange *luma_range, int bitdepth, enum VmafPixelRange pix_range)
int vmaf_luminance_init_eotf(VmafEOTF *eotf, const char *eotf_str)
double vmaf_luminance_bt1886_eotf(double V)
double vmaf_luminance_pq_eotf(double V)
VmafPixelRange
Definition luminance_tools.h:29
@ VMAF_PIXEL_RANGE_UNKNOWN
Definition luminance_tools.h:30
@ VMAF_PIXEL_RANGE_LIMITED
Definition luminance_tools.h:31
@ VMAF_PIXEL_RANGE_FULL
Definition luminance_tools.h:32
Definition luminance_tools.h:38
int head
Definition luminance_tools.h:40
int foot
Definition luminance_tools.h:39