#ifndef VPX_INTERNAL_VPX_PSNR_H_
#define VPX_INTERNAL_VPX_PSNR_H_
+#define MAX_PSNR 100.0
+
#ifdef __cplusplus
extern "C" {
#endif
#include "vpx/internal/vpx_psnr.h"
-#define MAX_PSNR 100.0
double vpx_sse_to_psnr(double samples, double peak, double sse) {
if (sse > 0.0) {
* This code was originally written by: Nathan E. Egge, at the Daala
* project.
*/
+#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "./vpx_dsp_rtcd.h"
#include "vpx_dsp/ssim.h"
#include "vpx_ports/system_state.h"
+
/* TODO(jbb): High bit depth version of this code needed */
typedef struct fs_level fs_level;
typedef struct fs_ctx fs_ctx;
}
static double convert_ssim_db(double _ssim, double _weight) {
+ assert(_weight >= _ssim);
+ if ((_weight - _ssim) < 1e-10)
+ return MAX_SSIM_DB;
return 10 * (log10(_weight) - log10(_weight - _ssim));
}
* This code was originally written by: Gregory Maxwell, at the Daala
* project.
*/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "./vpx_dsp_rtcd.h"
#include "vpx_dsp/ssim.h"
#include "vpx_ports/system_state.h"
+#include "vpx/internal/vpx_psnr.h"
#if !defined(M_PI)
# define M_PI (3.141592653589793238462643)
0.478717061273, 0.393021669543, 0.330555063063, 0.285345396658}};
static double convert_score_db(double _score, double _weight) {
+ assert(_score * _weight >= 0.0);
+ if (_weight * _score < 255 * 255 * 1e-10)
+ return MAX_PSNR;
return 10 * (log10(255 * 255) - log10(_weight * _score));
}
#ifndef VPX_DSP_SSIM_H_
#define VPX_DSP_SSIM_H_
+#define MAX_SSIM_DB 100.0;
+
#ifdef __cplusplus
extern "C" {
#endif