2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #ifndef VPX_DSP_SSIM_H_
12 #define VPX_DSP_SSIM_H_
14 #define MAX_SSIM_DB 100.0;
20 #include "./vpx_config.h"
21 #include "vpx_scale/yv12config.h"
23 // metrics used for calculating ssim, ssim2, dssim, and ssimc
25 // source sum ( over 8x8 region )
28 // reference sum (over 8x8 region )
31 // source sum squared ( over 8x8 region )
34 // reference sum squared (over 8x8 region )
37 // sum of source times reference (over 8x8 region)
40 // calculated ssim score between source and reference
44 // metrics collected on a frame basis
46 // ssim consistency error metric ( see code for explanation )
52 // revised ssim ( see code for explanation)
55 // ssim restated as an error metric like sse
58 // dssim converted to decibels
61 // ssimc converted to decibels
65 double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch, uint8_t *img2,
66 int img2_pitch, int width, int height, Ssimv *sv2,
67 Metrics *m, int do_inconsistency);
69 double vpx_calc_ssim(const YV12_BUFFER_CONFIG *source,
70 const YV12_BUFFER_CONFIG *dest, double *weight);
72 double vpx_calc_fastssim(const YV12_BUFFER_CONFIG *source,
73 const YV12_BUFFER_CONFIG *dest, double *ssim_y,
74 double *ssim_u, double *ssim_v, uint32_t bd,
77 #if CONFIG_VP9_HIGHBITDEPTH
78 double vpx_highbd_calc_ssim(const YV12_BUFFER_CONFIG *source,
79 const YV12_BUFFER_CONFIG *dest, double *weight,
80 uint32_t bd, uint32_t in_bd);
81 #endif // CONFIG_VP9_HIGHBITDEPTH
87 #endif // VPX_DSP_SSIM_H_