libvmaf
Loading...
Searching...
No Matches
adm_csf_tools.h
Go to the documentation of this file.
1
18
19#include <math.h>
20#include "common/macros.h"
21
22#pragma once
23
24#ifndef ADM_CSF_TOOLS_H_
25#define ADM_CSF_TOOLS_H_
26
27/*
28 * CSF used in the DLM paper:
29 * Image Quality Assessment by Separately Evaluating Detail Losses and Additive Impairments
30 * Songnan Li, Fan Zhang, Lin Ma, King Ngi Ngan, IEEE Transactions on Multimedia 13(5):935-949
31 */
32FORCE_INLINE inline float adm_native_csf(int lambda, double adm_norm_view_dist, int adm_ref_display_height,
33 int theta)
34{
35 /* This is the display visual resolution (DVR), in pixels/degree of visual angle. It should be ~56.55. */
36 float r = adm_norm_view_dist * adm_ref_display_height * M_PI / 180.0;
37 /* This is the nominal spatial frequency for each DWT level; first level (level = 0) is half of the DVR. */
38 float spatial_frequency = r / pow(2, lambda + 1);
39
40 /*
41 * Oblique effect: the HVS is more sensitive to the horizontal and vertical
42 * channels than the diagonal channels.
43 */
44 if (theta == 45) {
45 spatial_frequency /= 0.7;
46 }
47
48 return (0.31 + 0.69 * spatial_frequency) * exp(-0.29 * spatial_frequency);
49}
50
51#endif /* ADM_CSF_TOOLS_H_ */
FORCE_INLINE float adm_native_csf(int lambda, double adm_norm_view_dist, int adm_ref_display_height, int theta)
Definition adm_csf_tools.h:32
#define M_PI
Definition adm_tools.h:25