Ignore:
Timestamp:
Nov 21, 2017 9:25:11 AM (3 years ago)
Author:
riza
Message:

Close #2065: Update libyuv to fix linker error when building libyuv as dll on Visual Studio 2015.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/third_party/yuv/source/compare.cc

    r5633 r5699  
    111111} 
    112112 
     113// NEON version accumulates in 16 bit shorts which overflow at 65536 bytes. 
     114// So actual maximum is 1 less loop, which is 64436 - 32 bytes. 
     115 
    113116LIBYUV_API 
    114117uint64 ComputeHammingDistance(const uint8* src_a, 
    115118                              const uint8* src_b, 
    116119                              int count) { 
    117   const int kBlockSize = 65536; 
    118   int remainder = count & (kBlockSize - 1) & ~31; 
     120  const int kBlockSize = 1 << 15;  // 32768; 
     121  const int kSimdSize = 64; 
     122  // SIMD for multiple of 64, and C for remainder 
     123  int remainder = count & (kBlockSize - 1) & ~(kSimdSize - 1); 
    119124  uint64 diff = 0; 
    120125  int i; 
     
    126131  } 
    127132#endif 
    128 #if defined(HAS_HAMMINGDISTANCE_X86) 
    129   if (TestCpuFlag(kCpuHasX86)) { 
    130     HammingDistance = HammingDistance_X86; 
     133#if defined(HAS_HAMMINGDISTANCE_SSSE3) 
     134  if (TestCpuFlag(kCpuHasSSSE3)) { 
     135    HammingDistance = HammingDistance_SSSE3; 
     136  } 
     137#endif 
     138#if defined(HAS_HAMMINGDISTANCE_SSE42) 
     139  if (TestCpuFlag(kCpuHasSSE42)) { 
     140    HammingDistance = HammingDistance_SSE42; 
    131141  } 
    132142#endif 
     
    136146  } 
    137147#endif 
     148#if defined(HAS_HAMMINGDISTANCE_MSA) 
     149  if (TestCpuFlag(kCpuHasMSA)) { 
     150    HammingDistance = HammingDistance_MSA; 
     151  } 
     152#endif 
    138153#ifdef _OPENMP 
    139154#pragma omp parallel for reduction(+ : diff) 
     
    149164    src_b += remainder; 
    150165  } 
    151   remainder = count & 31; 
     166  remainder = count & (kSimdSize - 1); 
    152167  if (remainder) { 
    153168    diff += HammingDistance_C(src_a, src_b, remainder); 
     
    185200    // Note only used for multiples of 32 so count is not checked. 
    186201    SumSquareError = SumSquareError_AVX2; 
     202  } 
     203#endif 
     204#if defined(HAS_SUMSQUAREERROR_MSA) 
     205  if (TestCpuFlag(kCpuHasMSA)) { 
     206    SumSquareError = SumSquareError_MSA; 
    187207  } 
    188208#endif 
Note: See TracChangeset for help on using the changeset viewer.