Keep track of relative pixel offsets and utilize pshufb to efficiently extract relevant pixels for horizontal scaling ratios <= 4. Fall back to a generic approach for ratios > 4. Note that the generic approach can be backported to SSE2. The implementation assumes that data beyond the end of each line, before the next line begins, can be dirtied; which AFAICT is safe with the current usage of these routines. Speedup is ~6.67x/~3.26x (32-bit/64-bit) for horizontal ratios <= 2, ~6.24x/~3.00x for ratios within (2, 4], and ~4.89x/~2.17x for ratios > 4 when not memory-bound on Haswell as compared with the current SSE2 implementation.
Showing the changes to test/processing/ProcessUT_DownSample.cpp (1 of 6 files). Show all
Unified · Split
| @@ -343,6 +343,8 @@ GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearFastDownsamplerWrap_sse2, · 342 unmodified lines | ||
| 343 | 343 | WELS_CPU_SSE2) |
| 344 | 344 | GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearAccurateDownsamplerWrap_sse2, |
| 345 | 345 | GeneralBilinearAccurateDownsampler_ref, 1, WELS_CPU_SSE2) |
| 346 | +GENERATE_GeneralBilinearDownsampler_UT (GeneralBilinearFastDownsamplerWrap_ssse3, GeneralBilinearFastDownsampler_ref, 1, | |
| 347 | + WELS_CPU_SSSE3) | |
| 346 | 348 | #endif |
| 347 | 349 | |
| 348 | 350 | #if defined(HAVE_NEON) |