webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
compare.h
Go to the documentation of this file.
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_
12 #define INCLUDE_LIBYUV_COMPARE_H_
13 
14 #include "libyuv/basic_types.h"
15 
16 #ifdef __cplusplus
17 namespace libyuv {
18 extern "C" {
19 #endif
20 
21 // Compute a hash for specified memory. Seed of 5381 recommended.
24 
25 // Scan an opaque argb image and return fourcc based on alpha offset.
26 // Returns FOURCC_ARGB, FOURCC_BGRA, or 0 if unknown.
28 uint32 ARGBDetect(const uint8* argb, int stride_argb, int width, int height);
29 
30 // Sum Square Error - used to compute Mean Square Error or PSNR.
33  const uint8* src_b, int count);
34 
36 uint64 ComputeSumSquareErrorPlane(const uint8* src_a, int stride_a,
37  const uint8* src_b, int stride_b,
38  int width, int height);
39 
40 static const int kMaxPsnr = 128;
41 
44 
46 double CalcFramePsnr(const uint8* src_a, int stride_a,
47  const uint8* src_b, int stride_b,
48  int width, int height);
49 
51 double I420Psnr(const uint8* src_y_a, int stride_y_a,
52  const uint8* src_u_a, int stride_u_a,
53  const uint8* src_v_a, int stride_v_a,
54  const uint8* src_y_b, int stride_y_b,
55  const uint8* src_u_b, int stride_u_b,
56  const uint8* src_v_b, int stride_v_b,
57  int width, int height);
58 
60 double CalcFrameSsim(const uint8* src_a, int stride_a,
61  const uint8* src_b, int stride_b,
62  int width, int height);
63 
65 double I420Ssim(const uint8* src_y_a, int stride_y_a,
66  const uint8* src_u_a, int stride_u_a,
67  const uint8* src_v_a, int stride_v_a,
68  const uint8* src_y_b, int stride_y_b,
69  const uint8* src_u_b, int stride_u_b,
70  const uint8* src_v_b, int stride_v_b,
71  int width, int height);
72 
73 #ifdef __cplusplus
74 } // extern "C"
75 } // namespace libyuv
76 #endif
77 
78 #endif // INCLUDE_LIBYUV_COMPARE_H_
GLint GLsizei count
Definition: gl2.h:421
EGLSurface EGLint EGLint EGLint EGLint height
Definition: eglext.h:950
LIBYUV_API double I420Psnr(const uint8 *src_y_a, int stride_y_a, const uint8 *src_u_a, int stride_u_a, const uint8 *src_v_a, int stride_v_a, const uint8 *src_y_b, int stride_y_b, const uint8 *src_u_b, int stride_u_b, const uint8 *src_v_b, int stride_v_b, int width, int height)
Definition: compare.cc:213
long seed
Definition: float-mm.c:84
EGLSurface EGLint EGLint EGLint width
Definition: eglext.h:950
LIBYUV_API uint32 ARGBDetect(const uint8 *argb, int stride_argb, int width, int height)
Definition: compare.cc:97
LIBYUV_API double I420Ssim(const uint8 *src_y_a, int stride_y_a, const uint8 *src_u_a, int stride_u_a, const uint8 *src_v_a, int stride_v_a, const uint8 *src_y_b, int stride_y_b, const uint8 *src_u_b, int stride_u_b, const uint8 *src_v_b, int stride_v_b, int width, int height)
Definition: compare.cc:317
unsigned char uint8
Definition: basic_types.h:62
LIBYUV_API double CalcFrameSsim(const uint8 *src_a, int stride_a, const uint8 *src_b, int stride_b, int width, int height)
Definition: compare.cc:291
LIBYUV_API uint64 ComputeSumSquareErrorPlane(const uint8 *src_a, int stride_a, const uint8 *src_b, int stride_b, int width, int height)
Definition: compare.cc:165
uint64_t uint64
Definition: angle_config.h:30
LIBYUV_API uint32 HashDjb2(const uint8 *src, uint64 count, uint32 seed)
Definition: compare.cc:32
LIBYUV_API double CalcFramePsnr(const uint8 *src_a, int stride_a, const uint8 *src_b, int stride_b, int width, int height)
Definition: compare.cc:202
LIBYUV_API double SumSquareErrorToPsnr(uint64 sse, uint64 count)
Definition: compare.cc:186
LIBYUV_API uint64 ComputeSumSquareError(const uint8 *src_a, const uint8 *src_b, int count)
Definition: compare.cc:116
GLenum src
Definition: gl2ext.h:304
Definition: basictypes_test.cc:14
#define LIBYUV_API
Definition: basic_types.h:102
uint32_t uint32
Definition: angle_config.h:28