Changeset 5633 for pjproject/trunk/third_party/yuv/source/compare_gcc.cc
- Timestamp:
- Jul 28, 2017 2:51:44 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/third_party/yuv/source/compare_gcc.cc
r5358 r5633 22 22 #if !defined(LIBYUV_DISABLE_X86) && \ 23 23 (defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER))) 24 25 uint32 HammingDistance_X86(const uint8* src_a, const uint8* src_b, int count) { 26 uint32 diff = 0u; 27 28 int i; 29 for (i = 0; i < count - 7; i += 8) { 30 uint64 x = *((uint64*)src_a) ^ *((uint64*)src_b); 31 src_a += 8; 32 src_b += 8; 33 diff += __builtin_popcountll(x); 34 } 35 return diff; 36 } 24 37 25 38 uint32 SumSquareError_SSE2(const uint8* src_a, const uint8* src_b, int count) { … … 63 76 } 64 77 65 static uvec32 kHash16x33 = { 0x92d9e201, 0, 0, 0}; // 33 ^ 1678 static uvec32 kHash16x33 = {0x92d9e201, 0, 0, 0}; // 33 ^ 16 66 79 static uvec32 kHashMul0 = { 67 0x0c3525e1, // 33 ^ 1568 0xa3476dc1, // 33 ^ 1469 0x3b4039a1, // 33 ^ 1370 0x4f5f0981, // 33 ^ 1280 0x0c3525e1, // 33 ^ 15 81 0xa3476dc1, // 33 ^ 14 82 0x3b4039a1, // 33 ^ 13 83 0x4f5f0981, // 33 ^ 12 71 84 }; 72 85 static uvec32 kHashMul1 = { 73 0x30f35d61, // 33 ^ 1174 0x855cb541, // 33 ^ 1075 0x040a9121, // 33 ^ 976 0x747c7101, // 33 ^ 886 0x30f35d61, // 33 ^ 11 87 0x855cb541, // 33 ^ 10 88 0x040a9121, // 33 ^ 9 89 0x747c7101, // 33 ^ 8 77 90 }; 78 91 static uvec32 kHashMul2 = { 79 0xec41d4e1, // 33 ^ 780 0x4cfa3cc1, // 33 ^ 681 0x025528a1, // 33 ^ 582 0x00121881, // 33 ^ 492 0xec41d4e1, // 33 ^ 7 93 0x4cfa3cc1, // 33 ^ 6 94 0x025528a1, // 33 ^ 5 95 0x00121881, // 33 ^ 4 83 96 }; 84 97 static uvec32 kHashMul3 = { 85 0x00008c61, // 33 ^ 386 0x00000441, // 33 ^ 287 0x00000021, // 33 ^ 188 0x00000001, // 33 ^ 098 0x00008c61, // 33 ^ 3 99 0x00000441, // 33 ^ 2 100 0x00000021, // 33 ^ 1 101 0x00000001, // 33 ^ 0 89 102 }; 90 103 … … 149 162 } // namespace libyuv 150 163 #endif 151
Note: See TracChangeset
for help on using the changeset viewer.