2 * Copyright 2011 The LibYuv 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 INCLUDE_LIBYUV_COMPARE_H_ // NOLINT
12 #define INCLUDE_LIBYUV_COMPARE_H_
14 #include "libyuv/basic_types.h"
21 // Compute a hash for specified memory. Seed of 5381 recommended.
23 uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed);
25 // Sum Square Error - used to compute Mean Square Error or PSNR.
27 uint64 ComputeSumSquareError(const uint8* src_a,
28 const uint8* src_b, int count);
31 uint64 ComputeSumSquareErrorPlane(const uint8* src_a, int stride_a,
32 const uint8* src_b, int stride_b,
33 int width, int height);
35 static const int kMaxPsnr = 128;
38 double SumSquareErrorToPsnr(uint64 sse, uint64 count);
41 double CalcFramePsnr(const uint8* src_a, int stride_a,
42 const uint8* src_b, int stride_b,
43 int width, int height);
46 double 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);
55 double CalcFrameSsim(const uint8* src_a, int stride_a,
56 const uint8* src_b, int stride_b,
57 int width, int height);
60 double 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);
73 #endif // INCLUDE_LIBYUV_COMPARE_H_ NOLINT