Commit 79a06ac5 authored by fbarchard@google.com's avatar fbarchard@google.com

omp friendly version of psnr

BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/378007

git-svn-id: http://libyuv.googlecode.com/svn/trunk@167 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 3e34b8e8
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 165 Version: 167
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -16,7 +16,7 @@ namespace libyuv { ...@@ -16,7 +16,7 @@ namespace libyuv {
extern "C" { extern "C" {
#endif #endif
#define LIBYUV_VERSION 165 #define LIBYUV_VERSION 167
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
#include <float.h> #include <float.h>
#include <math.h> #include <math.h>
#ifdef _OPENMP
#include <omp.h>
#endif
#include "libyuv/basic_types.h" #include "libyuv/basic_types.h"
#include "libyuv/cpu_id.h" #include "libyuv/cpu_id.h"
...@@ -23,7 +26,7 @@ extern "C" { ...@@ -23,7 +26,7 @@ extern "C" {
#endif #endif
// hash seed of 5381 recommended. // hash seed of 5381 recommended.
uint32 HashDjb2(const uint8* src, size_t len, uint32 seed) { uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed) {
uint32 hash = seed; uint32 hash = seed;
if (len > 0) { if (len > 0) {
do { do {
...@@ -190,7 +193,9 @@ uint64 ComputeSumSquareError(const uint8* src_a, ...@@ -190,7 +193,9 @@ uint64 ComputeSumSquareError(const uint8* src_a,
{ {
SumSquareError = SumSquareError_C; SumSquareError = SumSquareError_C;
} }
const int kBlockSize = 32768; // 32K values will fit a 32bit int return value from SumSquareError.
// After each block of 32K, accumulate into 64 bit int.
const int kBlockSize = 1 << 15; // 32768;
uint64 sse = 0; uint64 sse = 0;
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for reduction(+: sse) #pragma omp parallel for reduction(+: sse)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment