pixconv: add swizzle_ycc__convert_rgbx_x86_avx2

Some of the benchmark numbers move around even though they don't use the
new etc__convert_rgbx_x86_avx2 code paths. It's possibly just a code
alignment coincidence per https://news.ycombinator.com/item?id=23633583

name                                             old speed     new speed     delta

wuffs_jpeg_decode_19k_8bpp/clang11               372MB/s ± 0%  370MB/s ± 0%  -0.64%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/clang11  278MB/s ± 0%  295MB/s ± 0%  +5.89%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/clang11   710MB/s ± 0%  726MB/s ± 0%  +2.30%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/clang11              603MB/s ± 0%  622MB/s ± 0%  +3.12%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/clang11         635MB/s ± 0%  659MB/s ± 0%  +3.82%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/clang11         650MB/s ± 0%  649MB/s ± 0%  -0.17%  (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/clang11            629MB/s ± 0%  675MB/s ± 0%  +7.20%  (p=0.008 n=5+5)

wuffs_jpeg_decode_19k_8bpp/gcc10                 364MB/s ± 0%  351MB/s ± 0%  -3.62%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/gcc10    334MB/s ± 0%  334MB/s ± 0%  -0.06%  (p=0.032 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/gcc10     944MB/s ± 0%  924MB/s ± 0%  -2.19%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/gcc10                769MB/s ± 0%  740MB/s ± 0%  -3.75%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/gcc10           842MB/s ± 0%  812MB/s ± 0%  -3.60%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/gcc10           661MB/s ± 0%  647MB/s ± 0%  -2.13%  (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/gcc10              849MB/s ± 0%  817MB/s ± 0%  -3.77%  (p=0.016 n=5+4)
This commit is contained in:
Nigel Tao committed 2023-07-22 13:11:12 +10:00
1 parent 4facef4e01
commit 35c1f76f86
3 files changed
+338

No files matched your search

@@ -25,6 +25,17 @@ wuffs_base__pixel_swizzler__swizzle_ycc__convert_bgrx_x86_avx2(
const uint8_t* up0,
const uint8_t* up1,
const uint8_t* up2);
WUFFS_BASE__MAYBE_ATTRIBUTE_TARGET("pclmul,popcnt,sse4.2,avx2")
static void //
wuffs_base__pixel_swizzler__swizzle_ycc__convert_rgbx_x86_avx2(
wuffs_base__pixel_buffer* dst,
uint32_t x,
uint32_t x_end,
uint32_t y,
const uint8_t* up0,
const uint8_t* up1,
const uint8_t* up2);
#endif
// --------
@@ -977,6 +988,13 @@ wuffs_base__pixel_swizzler__swizzle_ycck(
case WUFFS_BASE__PIXEL_FORMAT__RGBA_NONPREMUL:
case WUFFS_BASE__PIXEL_FORMAT__RGBA_PREMUL:
case WUFFS_BASE__PIXEL_FORMAT__RGBX:
#if defined(WUFFS_BASE__CPU_ARCH__X86_FAMILY)
if (wuffs_base__cpu_arch__have_x86_sse42()) {
convfunc =
&wuffs_base__pixel_swizzler__swizzle_ycc__convert_rgbx_x86_avx2;
break;
}
#endif
convfunc = &wuffs_base__pixel_swizzler__swizzle_ycc__convert_rgbx;
break;
default: