Commit da443d7a authored by fbarchard@google.com's avatar fbarchard@google.com

Remainder calc needs to be after blocks are done. Move calc to old location.

BUG=303
TESTED=Djb2 unittests
R=tpsiaki@google.com

Review URL: https://webrtc-codereview.appspot.com/6849004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@960 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 6700a27c
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 958 Version: 960
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 958 #define LIBYUV_VERSION 960
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -47,7 +47,7 @@ uint32 HashDjb2_AVX2(const uint8* src, int count, uint32 seed); ...@@ -47,7 +47,7 @@ uint32 HashDjb2_AVX2(const uint8* src, int count, uint32 seed);
LIBYUV_API LIBYUV_API
uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed) { uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed) {
const int kBlockSize = 1 << 15; // 32768; const int kBlockSize = 1 << 15; // 32768;
int remainder = (int)(count) & ~15; int remainder;
uint32 (*HashDjb2_SSE)(const uint8* src, int count, uint32 seed) = HashDjb2_C; uint32 (*HashDjb2_SSE)(const uint8* src, int count, uint32 seed) = HashDjb2_C;
#if defined(HAS_HASHDJB2_SSE41) #if defined(HAS_HASHDJB2_SSE41)
if (TestCpuFlag(kCpuHasSSE41)) { if (TestCpuFlag(kCpuHasSSE41)) {
...@@ -65,6 +65,7 @@ uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed) { ...@@ -65,6 +65,7 @@ uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed) {
src += kBlockSize; src += kBlockSize;
count -= kBlockSize; count -= kBlockSize;
} }
remainder = (int)(count) & ~15;
if (remainder) { if (remainder) {
seed = HashDjb2_SSE(src, remainder, seed); seed = HashDjb2_SSE(src, remainder, seed);
src += remainder; src += remainder;
......
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