Avoid touching some cache lines by using popcnt instead of table lookups. Also gives a speedup of ~1.4x on Haswell as compared with SSE2.
Showing the changes to test/encoder/EncUT_EncoderMbAux.cpp (1 of 4 files). Show all
Unified · Split
| @@ -301,6 +301,10 @@ TEST (EncodeMbAuxTest, WelsGetNoneZeroCount_c) { · 300 unmodified lines | ||
| 301 | 301 | TEST (EncodeMbAuxTest, WelsGetNoneZeroCount_sse2) { |
| 302 | 302 | TestGetNoneZeroCount (WelsGetNoneZeroCount_sse2); |
| 303 | 303 | } |
| 304 | +TEST (EncodeMbAuxTest, WelsGetNoneZeroCount_sse42) { | |
| 305 | + if (WelsCPUFeatureDetect (0) & WELS_CPU_SSE42) | |
| 306 | + TestGetNoneZeroCount (WelsGetNoneZeroCount_sse42); | |
| 307 | +} | |
| 304 | 308 | #endif |
| 305 | 309 | #define WELS_ABS_LC(a) ((sign ^ (int32_t)(a)) - sign) |
| 306 | 310 | #define NEW_QUANT(pDct, ff, mf) (((ff)+ WELS_ABS_LC(pDct))*(mf)) >>16 |