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_
18 #include "./vpx_config.h"
19 #include "vpx_scale/yv12config.h"
21 // TODO(aconverse): Unify vp8/vp9_clear_system_state
22 #if ARCH_X86 || ARCH_X86_64
23 void vpx_reset_mmx_state(void);
24 #define vpx_clear_system_state() vpx_reset_mmx_state()
26 #define vpx_clear_system_state()
29 // metrics used for calculating ssim, ssim2, dssim, and ssimc
31 // source sum ( over 8x8 region )
34 // reference sum (over 8x8 region )
37 // source sum squared ( over 8x8 region )
40 // reference sum squared (over 8x8 region )
43 // sum of source times reference (over 8x8 region)
46 // calculated ssim score between source and reference
50 // metrics collected on a frame basis
52 // ssim consistency error metric ( see code for explanation )
58 // revised ssim ( see code for explanation)
61 // ssim restated as an error metric like sse
64 // dssim converted to decibels
67 // ssimc converted to decibels
71 double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch, uint8_t *img2,
72 int img2_pitch, int width, int height, Ssimv *sv2,
73 Metrics *m, int do_inconsistency);
75 double vpx_calc_ssim(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest,
78 double vpx_calc_ssimg(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest,
79 double *ssim_y, double *ssim_u, double *ssim_v);
81 double vpx_calc_fastssim(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest,
82 double *ssim_y, double *ssim_u, double *ssim_v);
84 double vpx_psnrhvs(const YV12_BUFFER_CONFIG *source,
85 const YV12_BUFFER_CONFIG *dest,
86 double *ssim_y, double *ssim_u, double *ssim_v);
88 #if CONFIG_VP9_HIGHBITDEPTH
89 double vpx_highbd_calc_ssim(YV12_BUFFER_CONFIG *source,
90 YV12_BUFFER_CONFIG *dest,
94 double vpx_highbd_calc_ssimg(YV12_BUFFER_CONFIG *source,
95 YV12_BUFFER_CONFIG *dest,
100 #endif // CONFIG_VP9_HIGHBITDEPTH
106 #endif // VPX_DSP_SSIM_H_