1/*
2 *  Copyright 2011 The LibYuv Project Authors. All rights reserved.
3 *
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.
9 */
10
11#ifndef INCLUDE_LIBYUV_COMPARE_H_  // NOLINT
12#define INCLUDE_LIBYUV_COMPARE_H_
13
14#include "libyuv/basic_types.h"
15
16#ifdef __cplusplus
17namespace libyuv {
18extern "C" {
19#endif
20
21// Compute a hash for specified memory. Seed of 5381 recommended.
22LIBYUV_API
23uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed);
24
25// Sum Square Error - used to compute Mean Square Error or PSNR.
26LIBYUV_API
27uint64 ComputeSumSquareError(const uint8* src_a,
28                             const uint8* src_b, int count);
29
30LIBYUV_API
31uint64 ComputeSumSquareErrorPlane(const uint8* src_a, int stride_a,
32                                  const uint8* src_b, int stride_b,
33                                  int width, int height);
34
35static const int kMaxPsnr = 128;
36
37LIBYUV_API
38double SumSquareErrorToPsnr(uint64 sse, uint64 count);
39
40LIBYUV_API
41double CalcFramePsnr(const uint8* src_a, int stride_a,
42                     const uint8* src_b, int stride_b,
43                     int width, int height);
44
45LIBYUV_API
46double I420Psnr(const uint8* src_y_a, int stride_y_a,
47                const uint8* src_u_a, int stride_u_a,
48                const uint8* src_v_a, int stride_v_a,
49                const uint8* src_y_b, int stride_y_b,
50                const uint8* src_u_b, int stride_u_b,
51                const uint8* src_v_b, int stride_v_b,
52                int width, int height);
53
54LIBYUV_API
55double CalcFrameSsim(const uint8* src_a, int stride_a,
56                     const uint8* src_b, int stride_b,
57                     int width, int height);
58
59LIBYUV_API
60double I420Ssim(const uint8* src_y_a, int stride_y_a,
61                const uint8* src_u_a, int stride_u_a,
62                const uint8* src_v_a, int stride_v_a,
63                const uint8* src_y_b, int stride_y_b,
64                const uint8* src_u_b, int stride_u_b,
65                const uint8* src_v_b, int stride_v_b,
66                int width, int height);
67
68#ifdef __cplusplus
69}  // extern "C"
70}  // namespace libyuv
71#endif
72
73#endif  // INCLUDE_LIBYUV_COMPARE_H_  NOLINT
74