MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / mpsnr_sumdiff

Function mpsnr_sumdiff

Source/astcenccli_error_metrics.cpp:92–107  ·  view source on GitHub ↗

* @brief mPSNR difference between two values. * * Differences are given as "val1 - val2". * * @param val1 The first color value * @param val2 The second color value * @param fstop_lo The low exposure fstop; should be in range [-125, 125] * @param fstop_hi The high exposure fstop; should be in range [-125, 125] * * @return The summed mPSNR difference across all active fstop

Source from the content-addressed store, hash-verified

90 * @return The summed mPSNR difference across all active fstop levels
91 */
92static float mpsnr_sumdiff(
93 float val1,
94 float val2,
95 int fstop_lo,
96 int fstop_hi
97) {
98 float summa = 0.0f;
99 for (int i = fstop_lo; i <= fstop_hi; i++)
100 {
101 float mval1 = mpsnr_operator(val1, i);
102 float mval2 = mpsnr_operator(val2, i);
103 float mdiff = mval1 - mval2;
104 summa += mdiff * mdiff;
105 }
106 return summa;
107}
108
109/* See header for documentation */
110void compute_error_metrics(

Callers 1

compute_error_metricsFunction · 0.85

Calls 1

mpsnr_operatorFunction · 0.85

Tested by

no test coverage detected