Commit Graph
2901 Commits
Author SHA1 Message Date
Nigel Tao 77d5fa01e5 Have std/png decode 16-bit depth images 2021-02-06 23:41:37 +11:00
Nigel Tao b69e6964f7 Add space before WUFFS_BASE__POTENTIALLY_UNUSED 2021-02-05 23:13:00 +11:00
Nigel Tao d8d951b729 Remove std/png tricky field 2021-02-05 23:06:49 +11:00
Nigel Tao 0a1b8ddf78 Factor out std/png/decode_swizzle_fallback.wuffs 2021-02-05 22:59:26 +11:00
Nigel Tao f1a8019f41 Drop std/png filter_and_swizzle_low_bit_depth 2021-02-05 22:56:55 +11:00
Nigel Tao baad01d50f Have std/png decode interlaced PNG images 2021-02-05 22:53:05 +11:00
Nigel Tao 4053c2abe6 Refactor some std/png internals 2021-02-03 22:08:26 +11:00
Nigel Tao 4942324f25 Swizzler support src_pixfmt = PIXEL_FORMAT__Y_16BE
Binary size, before:
30800 gen/lib/c/clang-9-dynamic/wuffs-base-pixconv.lo
32424 gen/lib/c/clang-9-static/wuffs-base-pixconv.o
56200 gen/lib/c/gcc-dynamic/wuffs-base-pixconv.lo
56152 gen/lib/c/gcc-static/wuffs-base-pixconv.o

After:
33416 gen/lib/c/clang-9-dynamic/wuffs-base-pixconv.lo
35120 gen/lib/c/clang-9-static/wuffs-base-pixconv.o
59504 gen/lib/c/gcc-dynamic/wuffs-base-pixconv.lo
59440 gen/lib/c/gcc-static/wuffs-base-pixconv.o
2021-02-03 13:11:22 +11:00
Nigel Tao e77e16cd98 Add fact for "lhs = x[i .. j]" for constant i, j 2021-02-02 22:53:02 +11:00
Nigel Tao 10146b75dd Drop old facts after an impure function call 2021-02-02 22:11:45 +11:00
Nigel Tao 4848859f97 Tweak std/deflate decode_huffman_fast asserts
wuffs_deflate_decode_1k_full_init/clang9         95.0MB/s ± 0%  92.9MB/s ± 0%   -2.25%  (p=0.008 n=5+5)
wuffs_deflate_decode_1k_part_init/clang9          108MB/s ± 0%   108MB/s ± 0%   +0.34%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/clang9         141MB/s ± 0%   165MB/s ± 1%  +16.77%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/clang9         143MB/s ± 0%   169MB/s ± 0%  +17.73%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/clang9    185MB/s ± 0%   181MB/s ± 0%   -2.09%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/clang9   156MB/s ± 1%   151MB/s ± 0%   -3.12%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k_full_init/gcc10          98.6MB/s ± 0%  97.5MB/s ± 0%   -1.05%  (p=0.016 n=4+5)
wuffs_deflate_decode_1k_part_init/gcc10           112MB/s ± 0%   111MB/s ± 0%   -1.05%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/gcc10          183MB/s ± 0%   181MB/s ± 1%   -0.73%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/gcc10          186MB/s ± 0%   185MB/s ± 0%   -0.80%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/gcc10     213MB/s ± 0%   216MB/s ± 0%   +1.55%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/gcc10    174MB/s ± 0%   179MB/s ± 0%   +2.79%  (p=0.008 n=5+5)
2021-02-02 13:08:21 +11:00
Nigel Tao dc60821826 Roll back the previous "pixel swizzler" commit
See the previous commit for the rationale.
2021-02-02 11:32:23 +11:00
Nigel Tao 83a72f3d77 Performance mystery: unused pixel swizzler code
A recent commit (c392a632de, "Swizzler let
src_pixfmt = INDEXED__BGRA_NONPREMUL") introduced new pixel swizzler
functions. These code paths weren't taken by the std/gif codec, but for
some mysterious reason, they dramatically impact the std/gif benchmarks.

To record that quantitatively in the git log, this commit touches the
INDEXED__BGRA_NONPREMUL code (editing wuffs-unsupported-snapshot.c
directly), making it incorrect but affecting the std/gif benchmarks (for
gcc10 but not for clang9). To repeat, the new code is not exercised by
the std/gif code. Even though test_wuffs_pixel_swizzler_swizzle now
fails, the std/gif tests still pass with this incorrect commit.

It is a mystery why this happens. This small, self-contained commit
will be immediately followed by a roll back, but it is committed anyway
so that we can refer to these numbers in the git log. To reproduce:

----
$ git clone https://github.com/google/wuffs.git
$ cd wuffs
$ gcc --version | head -n 1
gcc (Debian 10.2.1-3) 10.2.1 20201224

$ # Check out this commit.
$ git checkout --quiet THE_HASH_OF_THIS_COMMIT
$ gcc -O3 -Wall -std=c99 test/c/std/gif.c -DWUFFS_MIMIC -lgif
$ ./a.out -bench -focus=wuffs_gif_decode_1000k_full_init | grep MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 8242690 ns/op	     121.408 MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 8233370 ns/op	     121.546 MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 8228690 ns/op	     121.615 MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 8236640 ns/op	     121.497 MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 8239820 ns/op	     121.451 MB/s

$ # Check out the parent commit.
$ git checkout --quiet THE_HASH_OF_THIS_COMMIT^
$ gcc -O3 -Wall -std=c99 test/c/std/gif.c -DWUFFS_MIMIC -lgif
$ ./a.out -bench -focus=wuffs_gif_decode_1000k_full_init | grep MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 9614630 ns/op	     104.084 MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 9556300 ns/op	     104.719 MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 9522440 ns/op	     105.092 MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 9438460 ns/op	     106.027 MB/s
Benchmarkwuffs_gif_decode_1000k_full_init/gcc10	     100	 9477400 ns/op	     105.591 MB/s
----

On a mid-range x86_64 laptop:

wuffs_gif_decode_1k_bw/clang9                367MB/s ± 0%    347MB/s ± 0%   -5.37%  (p=0.016 n=4+5)
wuffs_gif_decode_1k_color_full_init/clang9  89.8MB/s ± 0%   90.6MB/s ± 0%   +0.83%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_part_init/clang9   107MB/s ± 0%    107MB/s ± 0%     ~     (p=0.413 n=4+5)
wuffs_gif_decode_10k_bgra/clang9             421MB/s ± 0%    420MB/s ± 0%     ~     (p=0.548 n=5+5)
wuffs_gif_decode_10k_indexed/clang9          111MB/s ± 0%    112MB/s ± 0%     ~     (p=0.056 n=5+5)
wuffs_gif_decode_20k/clang9                  134MB/s ± 0%    134MB/s ± 0%   -0.33%  (p=0.016 n=5+5)
wuffs_gif_decode_100k_artificial/clang9      301MB/s ± 0%    301MB/s ± 0%     ~     (p=0.151 n=5+5)
wuffs_gif_decode_100k_realistic/clang9       115MB/s ± 0%    115MB/s ± 0%     ~     (p=0.151 n=5+5)
wuffs_gif_decode_1000k_full_init/clang9      117MB/s ± 0%    117MB/s ± 0%   -0.17%  (p=0.016 n=5+5)
wuffs_gif_decode_1000k_part_init/clang9      117MB/s ± 1%    117MB/s ± 0%     ~     (p=0.690 n=5+5)
wuffs_gif_decode_anim_screencap/clang9       675MB/s ± 0%    674MB/s ± 0%   -0.20%  (p=0.016 n=4+5)

wuffs_gif_decode_1k_bw/gcc10                 309MB/s ± 0%    313MB/s ± 0%   +1.18%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_full_init/gcc10   85.4MB/s ± 0%  104.1MB/s ± 0%  +21.81%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_part_init/gcc10   97.9MB/s ± 0%  123.3MB/s ± 0%  +25.92%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/gcc10              372MB/s ± 0%    447MB/s ± 0%  +19.92%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/gcc10          97.9MB/s ± 0%  119.0MB/s ± 0%  +21.54%  (p=0.008 n=5+5)
wuffs_gif_decode_20k/gcc10                   123MB/s ± 0%    139MB/s ± 0%  +12.98%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/gcc10       271MB/s ± 0%    293MB/s ± 0%   +8.16%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/gcc10        104MB/s ± 0%    119MB/s ± 0%  +13.90%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k_full_init/gcc10       106MB/s ± 0%    121MB/s ± 0%  +14.06%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k_part_init/gcc10       106MB/s ± 0%    121MB/s ± 0%  +14.24%  (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/gcc10        633MB/s ± 0%    653MB/s ± 0%   +3.24%  (p=0.008 n=5+5)

mimic_gif_decode_1k_bw                      84.3MB/s ± 0%   84.1MB/s ± 0%     ~     (p=0.151 n=5+5)
mimic_gif_decode_1k_color                   45.1MB/s ± 0%   45.0MB/s ± 1%     ~     (p=0.421 n=5+5)
mimic_gif_decode_10k_indexed                52.4MB/s ± 0%   52.4MB/s ± 0%     ~     (p=0.841 n=5+5)
mimic_gif_decode_20k                        52.6MB/s ± 0%   52.6MB/s ± 0%     ~     (p=0.310 n=5+5)
mimic_gif_decode_100k_artificial            82.9MB/s ± 0%   82.7MB/s ± 1%     ~     (p=0.460 n=5+5)
mimic_gif_decode_100k_realistic             51.1MB/s ± 0%   51.0MB/s ± 0%   -0.12%  (p=0.016 n=5+5)
mimic_gif_decode_1000k                      52.5MB/s ± 0%   52.4MB/s ± 0%     ~     (p=0.548 n=5+5)
mimic_gif_decode_anim_screencap             98.2MB/s ± 0%   98.1MB/s ± 0%   -0.11%  (p=0.032 n=5+5)
2021-02-02 11:32:04 +11:00
Nigel Tao f1a27fd980 Tweak std/png's swizzle_low_bit_depth scratch use 2021-02-01 22:48:01 +11:00
Nigel Tao 4d8e179279 Have std/png process the tRNS chunk 2021-02-01 21:34:28 +11:00
Nigel Tao c392a632de Swizzler let src_pixfmt = INDEXED__BGRA_NONPREMUL 2021-01-31 22:38:52 +11:00
Nigel Tao b74dbc103d Have tilde-mod ops' cgen cast to integer type 2021-01-30 22:13:42 +11:00
Nigel Tao a4d818699a Have std/png support low bit depths 2021-01-29 22:44:27 +11:00
Nigel Tao f89c3d81bd Build fix for hand-written decode_huffman_fast 2021-01-29 09:08:25 +11:00
Nigel Tao 8c4c714ad1 Add 0b prefixed binary numbers 2021-01-28 21:54:06 +11:00
Nigel Tao 1a63b53e13 Have std/deflate read 64 bits once per inner loop
On a mid-range x86_64 laptop:

wuffs_deflate_decode_1k_full_init/clang9                   101MB/s ± 0%     92MB/s ± 2%   -9.22%  (p=0.008 n=5+5)
wuffs_deflate_decode_1k_part_init/clang9                   117MB/s ± 0%    107MB/s ± 3%   -8.00%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/clang9                  129MB/s ± 0%    140MB/s ± 1%   +8.36%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/clang9                  131MB/s ± 0%    142MB/s ± 1%   +8.59%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/clang9             158MB/s ± 0%    184MB/s ± 1%  +16.29%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/clang9            133MB/s ± 0%    155MB/s ± 1%  +16.26%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k_full_init/gcc10                   98.0MB/s ± 0%   97.7MB/s ± 0%     ~     (p=0.222 n=5+5)
wuffs_deflate_decode_1k_part_init/gcc10                    112MB/s ± 0%    111MB/s ± 0%   -1.04%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/gcc10                   138MB/s ± 0%    179MB/s ± 1%  +29.91%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/gcc10                   140MB/s ± 0%    183MB/s ± 1%  +30.52%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/gcc10              188MB/s ± 0%    211MB/s ± 1%  +12.32%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/gcc10             156MB/s ± 0%    172MB/s ± 1%  +10.00%  (p=0.008 n=5+5)

mimic_deflate_decode_1k                                    128MB/s ± 0%    127MB/s ± 1%   -0.99%  (p=0.016 n=5+5)
mimic_deflate_decode_10k                                   143MB/s ± 0%    142MB/s ± 1%     ~     (p=0.056 n=5+5)
mimic_deflate_decode_100k_just_one_read                    176MB/s ± 0%    174MB/s ± 1%     ~     (p=0.151 n=5+5)
mimic_deflate_decode_100k_many_big_reads                   135MB/s ± 0%    134MB/s ± 1%     ~     (p=0.151 n=5+5)

wuffs_gzip_decode_10k/clang9                               134MB/s ± 1%    127MB/s ± 0%   -5.23%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/clang9                              150MB/s ± 0%    162MB/s ± 0%   +8.23%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/gcc10                                131MB/s ± 0%    152MB/s ± 0%  +16.36%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc10                               159MB/s ± 2%    188MB/s ± 0%  +17.78%  (p=0.008 n=5+5)

mimic_gzip_decode_10k                                      121MB/s ± 0%    121MB/s ± 0%     ~     (p=0.841 n=5+5)
mimic_gzip_decode_100k                                     144MB/s ± 0%    143MB/s ± 0%   -0.11%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/clang9                               139MB/s ± 0%    135MB/s ± 0%   -2.36%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/clang9                              155MB/s ± 0%    176MB/s ± 0%  +13.83%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/gcc10                                141MB/s ± 0%    156MB/s ± 1%  +10.94%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc10                               172MB/s ± 0%    193MB/s ± 1%  +12.27%  (p=0.016 n=4+5)

mimic_zlib_decode_10k                                      133MB/s ± 0%    132MB/s ± 0%   -1.29%  (p=0.008 n=5+5)
mimic_zlib_decode_100k                                     160MB/s ± 0%    158MB/s ± 0%   -1.02%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/clang9                    94.7MB/s ± 0%  103.4MB/s ± 0%   +9.17%  (p=0.016 n=4+5)
wuffs_png_decode_image_40k_24bpp/clang9                    135MB/s ± 0%    146MB/s ± 0%   +8.03%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9                     351MB/s ± 0%    380MB/s ± 0%   +8.48%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   320MB/s ± 1%    343MB/s ± 0%   +7.20%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   308MB/s ± 0%    328MB/s ± 0%   +6.59%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                  138MB/s ± 0%    149MB/s ± 0%   +8.02%  (p=0.016 n=5+4)

wuffs_png_decode_image_19k_8bpp/gcc10                      101MB/s ± 1%    116MB/s ± 0%  +14.61%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc10                     136MB/s ± 0%    154MB/s ± 0%  +13.10%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc10                      371MB/s ± 0%    426MB/s ± 0%  +14.80%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    333MB/s ± 0%    357MB/s ± 0%   +7.31%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    318MB/s ± 0%    341MB/s ± 0%   +7.27%  (p=0.016 n=5+4)
wuffs_png_decode_image_4002k_24bpp/gcc10                   138MB/s ± 0%    157MB/s ± 0%  +13.59%  (p=0.008 n=5+5)

mimic_png_decode_image_19k_8bpp                           58.2MB/s ± 0%   58.1MB/s ± 0%     ~     (p=0.841 n=5+5)
mimic_png_decode_image_40k_24bpp                          73.3MB/s ± 0%   73.2MB/s ± 0%   -0.16%  (p=0.032 n=5+5)
mimic_png_decode_image_77k_8bpp                            177MB/s ± 0%    177MB/s ± 0%     ~     (p=0.690 n=5+5)
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          146MB/s ± 0%    146MB/s ± 0%     ~     (p=0.690 n=5+5)
mimic_png_decode_image_4002k_24bpp                         104MB/s ± 0%    104MB/s ± 0%     ~     (p=0.841 n=5+5)
2021-01-28 09:34:37 +11:00
Nigel Tao b61a827354 Optimize std/adler32 for SSE4.2
On a mid-range x86_64 laptop:

wuffs_adler32_10k/clang9                                  1.35GB/s ± 0%  10.78GB/s ± 1%  +700.65%  (p=0.008 n=5+5)
wuffs_adler32_100k/clang9                                 1.35GB/s ± 0%  12.88GB/s ± 0%  +856.09%  (p=0.008 n=5+5)

wuffs_adler32_10k/gcc10                                   1.85GB/s ± 0%  11.21GB/s ± 0%  +506.34%  (p=0.008 n=5+5)
wuffs_adler32_100k/gcc10                                  1.84GB/s ± 0%  11.43GB/s ± 0%  +521.51%  (p=0.008 n=5+5)

mimic_adler32_10k                                         1.76GB/s ± 0%   1.76GB/s ± 0%      ~     (p=0.841 n=5+5)
mimic_adler32_100k                                        1.72GB/s ± 0%   1.72GB/s ± 0%      ~     (p=0.222 n=5+5)

wuffs_zlib_decode_10k/clang9                               124MB/s ± 0%    139MB/s ± 0%   +12.29%  (p=0.016 n=4+5)
wuffs_zlib_decode_100k/clang9                              148MB/s ± 0%    155MB/s ± 0%    +4.21%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/gcc10                                133MB/s ± 1%    141MB/s ± 0%    +5.75%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc10                               159MB/s ± 0%    172MB/s ± 0%    +7.77%  (p=0.016 n=5+4)

mimic_zlib_decode_10k                                      133MB/s ± 0%    133MB/s ± 0%    +0.38%  (p=0.008 n=5+5)
mimic_zlib_decode_100k                                     160MB/s ± 0%    160MB/s ± 0%      ~     (p=0.841 n=5+5)

wuffs_png_decode_image_19k_8bpp/clang9                    90.6MB/s ± 0%   94.7MB/s ± 0%    +4.58%  (p=0.016 n=5+4)
wuffs_png_decode_image_40k_24bpp/clang9                    129MB/s ± 0%    135MB/s ± 0%    +4.49%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9                     335MB/s ± 0%    351MB/s ± 0%    +4.62%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   322MB/s ± 0%    320MB/s ± 1%    -0.71%  (p=0.016 n=4+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   256MB/s ± 0%    308MB/s ± 0%   +20.24%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                  131MB/s ± 0%    138MB/s ± 0%    +5.24%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/gcc10                     95.1MB/s ± 0%  100.8MB/s ± 1%    +6.08%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc10                     131MB/s ± 0%    136MB/s ± 0%    +3.65%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc10                      350MB/s ± 1%    371MB/s ± 0%    +6.06%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    327MB/s ± 0%    333MB/s ± 0%    +1.66%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    274MB/s ± 0%    318MB/s ± 0%   +15.93%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc10                   132MB/s ± 0%    138MB/s ± 0%    +4.73%  (p=0.008 n=5+5)

mimic_png_decode_image_19k_8bpp                           58.1MB/s ± 0%   58.2MB/s ± 0%    +0.27%  (p=0.008 n=5+5)
mimic_png_decode_image_40k_24bpp                          73.0MB/s ± 1%   73.3MB/s ± 0%    +0.45%  (p=0.008 n=5+5)
mimic_png_decode_image_77k_8bpp                            177MB/s ± 0%    177MB/s ± 0%      ~     (p=0.421 n=5+5)
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          146MB/s ± 0%    146MB/s ± 0%      ~     (p=0.310 n=5+5)
mimic_png_decode_image_4002k_24bpp                         104MB/s ± 0%    104MB/s ± 0%      ~     (p=0.056 n=5+5)
2021-01-26 22:31:54 +11:00
Nigel Tao cee57bc4ae Add some more base.x86_m128i methods 2021-01-26 10:46:36 +11:00
Nigel Tao 2f2bbc6ab0 Rename default github.com branch s/master/main/ 2021-01-25 11:30:15 +11:00
Nigel Tao 0e76de7c65 Add std/png bench comment for the roll back 2021-01-25 10:12:32 +11:00
Nigel Tao 7de3742121 Roll back 'png filter_1_distance_? use more SIMD'
See the previous commit for the rationale.
2021-01-25 10:08:33 +11:00
Nigel Tao 1660f92686 Have std/png filter_1_distance_? use more SIMD
This commit will soon be followed by a rollback, but it is committed
anyway so that we can refer to these numbers in the git log.

wuffs_png_decode_filt_1_dist_3/clang9  1.82GB/s ± 0%  1.03GB/s ± 0%  -43.49%  (p=0.008 n=5+5)
wuffs_png_decode_filt_1_dist_4/clang9  6.02GB/s ± 0%  5.23GB/s ± 0%  -13.05%  (p=0.008 n=5+5)

wuffs_png_decode_filt_1_dist_3/gcc10   1.82GB/s ± 1%  1.03GB/s ± 0%  -43.36%  (p=0.008 n=5+5)
wuffs_png_decode_filt_1_dist_4/gcc10   5.42GB/s ± 0%  5.13GB/s ± 1%   -5.39%  (p=0.008 n=5+5)
2021-01-25 10:05:33 +11:00
Nigel Tao 14f194cdfc Remove built-in range reset methods 2021-01-24 22:16:57 +11:00
Nigel Tao 77b9316aad Have "SSE42 capable" also include PCLMUL 2021-01-24 22:11:17 +11:00
Nigel Tao 8e89a17bb1 Rename std/png/decode_filter_sse128.wuffs 2021-01-24 22:05:40 +11:00
Nigel Tao 73d95387f5 Change some more s/sse128/sse42/ 2021-01-24 22:04:53 +11:00
Nigel Tao 5941e7e5cc Rename sse128/sse128i to x86_sse42/x86_m128i 2021-01-24 21:58:00 +11:00
Nigel Tao a563bb7cf8 Add sse128_i._mm_blend_epi16 2021-01-23 23:48:09 +11:00
Nigel Tao 0c1f083522 Change _mm_loadu_si128 to _mm_lddqu_si128 2021-01-23 23:01:18 +11:00
Nigel Tao de9affaed8 Have _mm_cvtsi32_si128 cast its arg to int32_t 2021-01-23 22:59:52 +11:00
Nigel Tao d1b741338b Add sse128_i.load_slice128 2021-01-23 22:58:21 +11:00
Nigel Tao 2f78804e62 Use more inclusive language 2021-01-23 19:50:47 +11:00
Nigel Tao 07b5e017e1 Unroll some std/png fallback loops
wuffs_png_decode_filt_1_dist_3/clang9                     1.57GB/s ± 0%   1.84GB/s ± 0%  +16.85%  (p=0.008 n=5+5)
wuffs_png_decode_filt_3_dist_3/clang9                      909MB/s ± 0%   1153MB/s ± 0%  +26.92%  (p=0.008 n=5+5)

wuffs_png_decode_image_40k_24bpp/clang9                    127MB/s ± 0%    129MB/s ± 0%   +1.56%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                  128MB/s ± 0%    131MB/s ± 0%   +2.05%  (p=0.008 n=5+5)

wuffs_png_decode_filt_1_dist_3/gcc10                      1.84GB/s ± 0%   1.85GB/s ± 0%     ~     (p=0.095 n=5+5)
wuffs_png_decode_filt_3_dist_3/gcc10                      1.08GB/s ± 0%   1.14GB/s ± 1%   +5.87%  (p=0.008 n=5+5)

wuffs_png_decode_image_40k_24bpp/gcc10                     131MB/s ± 0%    132MB/s ± 0%   +0.46%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc10                   131MB/s ± 0%    132MB/s ± 0%   +0.66%  (p=0.008 n=5+5)
2021-01-23 18:25:08 +11:00
Nigel Tao d09788938b Unroll some std/png sse128 loops
wuffs_png_decode_filt_1_dist_3/clang9                     1.57GB/s ± 0%  1.57GB/s ± 0%     ~     (p=0.151 n=5+5)
wuffs_png_decode_filt_1_dist_4/clang9                     4.62GB/s ± 0%  5.87GB/s ± 1%  +26.93%  (p=0.008 n=5+5)
wuffs_png_decode_filt_2_dist_3/clang9                     13.3GB/s ± 0%  13.1GB/s ± 1%   -1.52%  (p=0.008 n=5+5)
wuffs_png_decode_filt_2_dist_4/clang9                     13.3GB/s ± 0%  13.1GB/s ± 1%   -1.50%  (p=0.008 n=5+5)
wuffs_png_decode_filt_3_dist_3/clang9                      910MB/s ± 0%   909MB/s ± 0%     ~     (p=0.095 n=5+5)
wuffs_png_decode_filt_3_dist_4/clang9                     1.78GB/s ± 0%  1.84GB/s ± 0%   +3.65%  (p=0.008 n=5+5)
wuffs_png_decode_filt_4_dist_3/clang9                      542MB/s ± 0%   571MB/s ± 0%   +5.31%  (p=0.016 n=4+5)
wuffs_png_decode_filt_4_dist_4/clang9                      844MB/s ± 0%   819MB/s ± 0%   -3.00%  (p=0.008 n=5+5)

wuffs_png_decode_image_40k_24bpp/clang9                    127MB/s ± 0%   127MB/s ± 0%     ~     (p=0.310 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   326MB/s ± 0%   322MB/s ± 0%   -1.19%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   259MB/s ± 0%   256MB/s ± 0%   -1.31%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                  128MB/s ± 0%   128MB/s ± 0%     ~     (p=0.278 n=5+5)

wuffs_png_decode_filt_1_dist_3/gcc10                      1.84GB/s ± 0%  1.84GB/s ± 0%     ~     (p=0.190 n=4+5)
wuffs_png_decode_filt_1_dist_4/gcc10                      3.38GB/s ± 1%  5.41GB/s ± 1%  +59.98%  (p=0.008 n=5+5)
wuffs_png_decode_filt_2_dist_3/gcc10                      8.29GB/s ± 0%  8.30GB/s ± 0%     ~     (p=0.222 n=5+5)
wuffs_png_decode_filt_2_dist_4/gcc10                      8.28GB/s ± 0%  8.30GB/s ± 0%   +0.24%  (p=0.008 n=5+5)
wuffs_png_decode_filt_3_dist_3/gcc10                      1.07GB/s ± 0%  1.08GB/s ± 0%     ~     (p=0.421 n=5+5)
wuffs_png_decode_filt_3_dist_4/gcc10                      2.13GB/s ± 0%  2.36GB/s ± 0%  +10.74%  (p=0.008 n=5+5)
wuffs_png_decode_filt_4_dist_3/gcc10                       587MB/s ± 0%   616MB/s ± 0%   +4.95%  (p=0.016 n=4+5)
wuffs_png_decode_filt_4_dist_4/gcc10                       796MB/s ± 0%   871MB/s ± 0%   +9.44%  (p=0.008 n=5+5)

wuffs_png_decode_image_40k_24bpp/gcc10                     130MB/s ± 0%   131MB/s ± 0%   +0.78%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    320MB/s ± 0%   325MB/s ± 0%   +1.69%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    270MB/s ± 0%   273MB/s ± 0%   +1.30%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc10                   131MB/s ± 0%   131MB/s ± 0%   +0.40%  (p=0.008 n=5+5)
2021-01-22 23:25:19 +11:00
Nigel Tao 5d88f3cb37 Remove some wuffs_base__make_empty_struct calls 2021-01-22 23:01:27 +11:00
Nigel Tao 414a011491 Add doc/note for WUFFS_BASE__QUIRK_IGNORE_CHECKSUM 2021-01-22 13:23:54 +11:00
Nigel Tao fd8025342e Be able to test and bench the libspng library
That's libspng with an 's', instead of libpng without an 's'.

Wuffs' std/png and std/zlib implementations have not been fully
optimized yet, but as a snapshot, here's how it compares with these
"mimic" libraries, libspng and libpng.

On a mid-range x86_64 laptop:

Wuffs/clang9:
wuffs_png_decode_image_19k_8bpp/clang9                    91.9MB/s ± 0%
wuffs_png_decode_image_40k_24bpp/clang9                    128MB/s ± 0%
wuffs_png_decode_image_77k_8bpp/clang9                     342MB/s ± 0%
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   324MB/s ± 0%
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   258MB/s ± 0%
wuffs_png_decode_image_4002k_24bpp/clang9                  127MB/s ± 0%

Wuffs/gcc10:
wuffs_png_decode_image_19k_8bpp/gcc10                     94.3MB/s ± 0%
wuffs_png_decode_image_40k_24bpp/gcc10                     131MB/s ± 0%
wuffs_png_decode_image_77k_8bpp/gcc10                      348MB/s ± 1%
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    319MB/s ± 0%
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    269MB/s ± 0%
wuffs_png_decode_image_4002k_24bpp/gcc10                   131MB/s ± 0%

libspng/clang9:
mimic_png_decode_image_19k_8bpp/clang9                    59.3MB/s ± 1%
mimic_png_decode_image_40k_24bpp/clang9                   78.4MB/s ± 0%
mimic_png_decode_image_77k_8bpp/clang9                     189MB/s ± 0%
mimic_png_decode_image_552k_32bpp_ignore_checksum/clang9   235MB/s ± 0%
mimic_png_decode_image_552k_32bpp_verify_checksum/clang9   203MB/s ± 0%
mimic_png_decode_image_4002k_24bpp/clang9                  110MB/s ± 0%

libspng/gcc10:
mimic_png_decode_image_19k_8bpp/gcc10                     59.5MB/s ± 0%
mimic_png_decode_image_40k_24bpp/gcc10                    77.6MB/s ± 0%
mimic_png_decode_image_77k_8bpp/gcc10                      188MB/s ± 0%
mimic_png_decode_image_552k_32bpp_ignore_checksum/gcc10    223MB/s ± 0%
mimic_png_decode_image_552k_32bpp_verify_checksum/gcc10    193MB/s ± 0%
mimic_png_decode_image_4002k_24bpp/gcc10                   109MB/s ± 0%

libpng (Debian_Testing_Bullseye /usr/lib/x86_64-linux-gnu/libpng.so):
mimic_png_decode_image_19k_8bpp                           58.3MB/s ± 0%
mimic_png_decode_image_40k_24bpp                          73.1MB/s ± 0%
mimic_png_decode_image_77k_8bpp                            177MB/s ± 0%
mimic_png_decode_image_552k_32bpp_ignore_checksum               skipped
mimic_png_decode_image_552k_32bpp_verify_checksum          146MB/s ± 0%
mimic_png_decode_image_4002k_24bpp                         104MB/s ± 0%
2021-01-22 13:15:42 +11:00
Nigel Tao 170a810486 Add std/png benches for ignore/verify checksums
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   324MB/s ± 0%
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   258MB/s ± 0%

wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    319MB/s ± 0%
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    269MB/s ± 0%
2021-01-22 11:34:52 +11:00
Nigel Tao 5669f6da87 Rename some std/png tests and benches 2021-01-21 22:56:58 +11:00
Nigel Tao 78da50820e Rename set_ignore_checksum! as a quirk 2021-01-21 22:52:11 +11:00
Nigel Tao 0de64ee8b7 Use WUFFS_BASE__QUIRK_IGNORE_CHECKSUM 2021-01-21 22:49:57 +11:00
Nigel Tao b2fe296a43 Add WUFFS_BASE__QUIRK_IGNORE_CHECKSUM 2021-01-21 22:43:24 +11:00
Nigel Tao cf4aff9ef0 Have testlib image_decoder helpers take quirks 2021-01-21 22:29:30 +11:00
Nigel Tao 88cde52f8c Tweak how std/png checksums the "IHDR" bytes 2021-01-21 20:27:14 +11:00
Nigel Tao 5477132298 Have std/png verify PLTE chunk checksums 2021-01-21 20:21:33 +11:00