1124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com/* 2b0c97975894a5eebebf9d93147cdd941a3accb63fbarchard@google.com * Copyright 2011 The LibYuv Project Authors. All rights reserved. 3124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com * 4124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com * Use of this source code is governed by a BSD-style license 5124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com * that can be found in the LICENSE file in the root of the source 6124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com * tree. An additional intellectual property rights grant can be found 7cde587092fef0dbed2c35602f30b79e7b892e766fbarchard@google.com * in the file PATENTS. All contributing project authors may 8124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com * be found in the AUTHORS file in the root of the source tree. 9124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com */ 10124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com 11f37f9a3542799ed17cc5c1c03f94a7ef279cfc20fbarchard@google.com#ifndef INCLUDE_LIBYUV_COMPARE_H_ // NOLINT 12124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com#define INCLUDE_LIBYUV_COMPARE_H_ 13124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com 14124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com#include "libyuv/basic_types.h" 15124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com 16fe5ff7ed5451496281697bda9cb85084c532926cfbarchard@google.com#ifdef __cplusplus 17124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.comnamespace libyuv { 18fe5ff7ed5451496281697bda9cb85084c532926cfbarchard@google.comextern "C" { 19fe5ff7ed5451496281697bda9cb85084c532926cfbarchard@google.com#endif 20124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com 2164ce0ab544591b1e26ae6d276932cacdb8137071fbarchard@google.com// Compute a hash for specified memory. Seed of 5381 recommended. 22fc7314e86bc7a1a88b38b815e881183521801ea9fbarchard@google.comLIBYUV_API 233e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.comuint32 HashDjb2(const uint8* src, uint64 count, uint32 seed); 24fe5ff7ed5451496281697bda9cb85084c532926cfbarchard@google.com 259bcc9a25355841f844e9fae3ba40522447312a66fbarchard@google.com// Sum Square Error - used to compute Mean Square Error or PSNR. 26fc7314e86bc7a1a88b38b815e881183521801ea9fbarchard@google.comLIBYUV_API 273e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.comuint64 ComputeSumSquareError(const uint8* src_a, 283e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_b, int count); 292cb934c6241c8ddf65ba59247f4e742bcbd6f0c6frkoenig@google.com 30fc7314e86bc7a1a88b38b815e881183521801ea9fbarchard@google.comLIBYUV_API 313e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.comuint64 ComputeSumSquareErrorPlane(const uint8* src_a, int stride_a, 323e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_b, int stride_b, 332cb934c6241c8ddf65ba59247f4e742bcbd6f0c6frkoenig@google.com int width, int height); 342cb934c6241c8ddf65ba59247f4e742bcbd6f0c6frkoenig@google.com 353e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.comstatic const int kMaxPsnr = 128; 362cb934c6241c8ddf65ba59247f4e742bcbd6f0c6frkoenig@google.com 37fc7314e86bc7a1a88b38b815e881183521801ea9fbarchard@google.comLIBYUV_API 383e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.comdouble SumSquareErrorToPsnr(uint64 sse, uint64 count); 393e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com 40fc7314e86bc7a1a88b38b815e881183521801ea9fbarchard@google.comLIBYUV_API 413e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.comdouble CalcFramePsnr(const uint8* src_a, int stride_a, 423e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_b, int stride_b, 432cb934c6241c8ddf65ba59247f4e742bcbd6f0c6frkoenig@google.com int width, int height); 442cb934c6241c8ddf65ba59247f4e742bcbd6f0c6frkoenig@google.com 45fc7314e86bc7a1a88b38b815e881183521801ea9fbarchard@google.comLIBYUV_API 463e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.comdouble I420Psnr(const uint8* src_y_a, int stride_y_a, 473e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_u_a, int stride_u_a, 483e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_v_a, int stride_v_a, 493e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_y_b, int stride_y_b, 503e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_u_b, int stride_u_b, 513e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_v_b, int stride_v_b, 522cb934c6241c8ddf65ba59247f4e742bcbd6f0c6frkoenig@google.com int width, int height); 532cb934c6241c8ddf65ba59247f4e742bcbd6f0c6frkoenig@google.com 54fc7314e86bc7a1a88b38b815e881183521801ea9fbarchard@google.comLIBYUV_API 553e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.comdouble CalcFrameSsim(const uint8* src_a, int stride_a, 563e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_b, int stride_b, 573e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com int width, int height); 583e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com 59fc7314e86bc7a1a88b38b815e881183521801ea9fbarchard@google.comLIBYUV_API 603e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.comdouble I420Ssim(const uint8* src_y_a, int stride_y_a, 613e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_u_a, int stride_u_a, 623e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_v_a, int stride_v_a, 633e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_y_b, int stride_y_b, 643e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_u_b, int stride_u_b, 653e34b8e89dc386204bf5d2075a91d3a3dcb00671fbarchard@google.com const uint8* src_v_b, int stride_v_b, 662cb934c6241c8ddf65ba59247f4e742bcbd6f0c6frkoenig@google.com int width, int height); 67124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com 68fe5ff7ed5451496281697bda9cb85084c532926cfbarchard@google.com#ifdef __cplusplus 69fe5ff7ed5451496281697bda9cb85084c532926cfbarchard@google.com} // extern "C" 70124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com} // namespace libyuv 71fe5ff7ed5451496281697bda9cb85084c532926cfbarchard@google.com#endif 72124b76e5c90cd15331d50810baeb7c571688fb50fbarchard@google.com 73f37f9a3542799ed17cc5c1c03f94a7ef279cfc20fbarchard@google.com#endif // INCLUDE_LIBYUV_COMPARE_H_ NOLINT 74