History

[Encoder] Add an SSE4.2 implementation of WelsGetNonZeroCount

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.

Sindre Aamås committed 10 years ago

Commit 4645bd21 parent d906dda4 files · +22 −0Browse files

Showing the changes to test/encoder/EncUT_EncoderMbAux.cpp (1 of 4 files). Show all

Unified · Split

test/encoder/EncUT_EncoderMbAux.cpp+4−0
@@ -301,6 +301,10 @@ TEST (EncodeMbAuxTest, WelsGetNoneZeroCount_c) { · 300 unmodified lines
301TEST (EncodeMbAuxTest, WelsGetNoneZeroCount_sse2) {301TEST (EncodeMbAuxTest, WelsGetNoneZeroCount_sse2) {
302 TestGetNoneZeroCount (WelsGetNoneZeroCount_sse2);302 TestGetNoneZeroCount (WelsGetNoneZeroCount_sse2);
303}303}
304TEST (EncodeMbAuxTest, WelsGetNoneZeroCount_sse42) {
305 if (WelsCPUFeatureDetect (0) & WELS_CPU_SSE42)
306 TestGetNoneZeroCount (WelsGetNoneZeroCount_sse42);
307}
304#endif308#endif
305#define WELS_ABS_LC(a) ((sign ^ (int32_t)(a)) - sign)309#define WELS_ABS_LC(a) ((sign ^ (int32_t)(a)) - sign)
306#define NEW_QUANT(pDct, ff, mf) (((ff)+ WELS_ABS_LC(pDct))*(mf)) >>16310#define NEW_QUANT(pDct, ff, mf) (((ff)+ WELS_ABS_LC(pDct))*(mf)) >>16

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t