libvmaf
Toggle main menu visibility
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
22
typedef
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
*/
29
enum
VmafPixelRange
{
30
VMAF_PIXEL_RANGE_UNKNOWN
,
31
VMAF_PIXEL_RANGE_LIMITED
,
32
VMAF_PIXEL_RANGE_FULL
,
33
};
34
35
/*
36
* Contains the necessary information to normalize a luma value down to [0, 1].
37
*/
38
typedef
struct
VmafLumaRange
{
39
int
foot
;
40
int
head
;
41
}
VmafLumaRange
;
42
43
/*
44
* Constructor for the LumaRange struct.
45
*/
46
int
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
*/
52
int
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
*/
58
double
vmaf_luminance_bt1886_eotf
(
double
V);
59
60
/*
61
* Takes a normalized luma value in the [0, 1] range and returns a luminance value.
62
*/
63
double
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
*/
69
double
vmaf_luminance_get_luminance
(
int
sample,
VmafLumaRange
luma_range,
VmafEOTF
eotf);
70
71
#endif
vmaf_luminance_get_luminance
double vmaf_luminance_get_luminance(int sample, VmafLumaRange luma_range, VmafEOTF eotf)
VmafEOTF
double(*) VmafEOTF(double V)
Definition
luminance_tools.h:22
vmaf_luminance_init_luma_range
int vmaf_luminance_init_luma_range(VmafLumaRange *luma_range, int bitdepth, enum VmafPixelRange pix_range)
vmaf_luminance_init_eotf
int vmaf_luminance_init_eotf(VmafEOTF *eotf, const char *eotf_str)
vmaf_luminance_bt1886_eotf
double vmaf_luminance_bt1886_eotf(double V)
vmaf_luminance_pq_eotf
double vmaf_luminance_pq_eotf(double V)
VmafPixelRange
VmafPixelRange
Definition
luminance_tools.h:29
VMAF_PIXEL_RANGE_UNKNOWN
@ VMAF_PIXEL_RANGE_UNKNOWN
Definition
luminance_tools.h:30
VMAF_PIXEL_RANGE_LIMITED
@ VMAF_PIXEL_RANGE_LIMITED
Definition
luminance_tools.h:31
VMAF_PIXEL_RANGE_FULL
@ VMAF_PIXEL_RANGE_FULL
Definition
luminance_tools.h:32
VmafLumaRange
Definition
luminance_tools.h:38
VmafLumaRange::head
int head
Definition
luminance_tools.h:40
VmafLumaRange::foot
int foot
Definition
luminance_tools.h:39
src
feature
luminance_tools.h
Generated by
1.18.0