Commit Graph
82 Commits
Author SHA1 Message Date
Nigel Tao ca76a01ac2 Have std/png support remapped transparency 2021-11-07 09:51:04 +11:00
Nigel Tao 00b329872a Tighten png.INTERLACING type refinement 2021-11-06 09:54:56 +11:00
Nigel Tao 744fbdd732 Have std/png decode iCCP chunks
Updates #39
2021-11-05 16:29:11 +11:00
Nigel Tao db5a407bab Have std/png decode sRGB chunks
Updates #39
2021-10-16 09:27:30 +11:00
Nigel Tao 911049e9f9 Have std/png decode cHRM and gAMA chunks
Updates #39
2021-10-15 15:08:47 +11:00
Nigel Tao d8ad363ef5 Tweak png.decoder.decode_image_config indentation 2021-10-15 13:35:15 +11:00
Nigel Tao f9c029c788 Fix std/png history_position for interlacing 2021-10-07 13:52:40 +11:00
Nigel Tao 28a54baa19 Add io_bind history_position arg 2021-08-15 08:36:14 +10:00
Nigel Tao 3358730f6f Have std/png reject zero width or height 2021-05-11 12:34:19 +10:00
Nigel Tao 5764f77913 Have std/png produce PIXEL_FORMAT__Y_16LE
Updates #46
2021-04-16 14:34:48 +10:00
Nigel Tao 3b5d8fdfba Use arm_neon_uAxB types and methods 2021-02-24 16:48:09 +11:00
Nigel Tao 62ee403d06 Add arm_neon u8x8, u16x4, etc types 2021-02-24 14:28:45 +11:00
Nigel Tao d4c23d091a Add base.x86_sse42_utility.make_m128i_single_u32 2021-02-18 20:30:59 +11:00
Nigel Tao 8c8f534a5c Add base.x86_sse42_utility 2021-02-18 20:02:58 +11:00
Nigel Tao 869be76fae Rename some std/png c/p variables 2021-02-18 14:32:35 +11:00
Nigel Tao 8c4348b8f6 Rename some std etc_sse42 functions 2021-02-18 13:48:46 +11:00
Nigel Tao 02e0955897 Rename std/png/decode_filter_sse42.wuffs 2021-02-18 13:40:40 +11:00
Nigel Tao 26c7fb941f Un-choosy-fy std/png decoder.filter_2 2021-02-18 13:32:25 +11:00
Nigel Tao 4d2df86a6d Fix some -Werror=conversion false positives 2021-02-16 22:45:50 +11:00
Nigel Tao b77137686d Remove redundant arm_neon zero-initialization 2021-02-16 22:32:06 +11:00
Nigel Tao d13039d96e Add std/png decoder.filter_4_distance_?_arm_neon
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):

wuffs_png_decode_filt_4_dist_3/clang9                      180MB/s ± 0%    217MB/s ± 0%   +20.57%  (p=0.008 n=5+5)
wuffs_png_decode_filt_4_dist_4/clang9                      161MB/s ± 0%    287MB/s ± 0%   +78.75%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/clang9                   99.1MB/s ± 0%   99.4MB/s ± 0%    +0.27%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   123MB/s ± 0%    165MB/s ± 0%   +33.61%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   112MB/s ± 0%    146MB/s ± 0%   +29.64%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9                 93.1MB/s ± 0%   93.2MB/s ± 0%    +0.15%  (p=0.040 n=5+5)

wuffs_png_decode_filt_4_dist_3/gcc8                       80.5MB/s ± 0%  211.7MB/s ± 0%  +163.12%  (p=0.008 n=5+5)
wuffs_png_decode_filt_4_dist_4/gcc8                       77.3MB/s ± 0%  280.4MB/s ± 0%  +262.98%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc8                     98.1MB/s ± 0%  100.8MB/s ± 0%    +2.78%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc8     114MB/s ± 0%    162MB/s ± 0%   +41.95%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc8     103MB/s ± 0%    140MB/s ± 0%   +36.07%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc8                   93.2MB/s ± 0%   94.1MB/s ± 0%    +0.96%  (p=0.008 n=5+5)
2021-02-14 23:53:36 +11:00
Nigel Tao 41825fcaae Add std/png decoder.filter_3_distance_4_arm_neon
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):

wuffs_png_decode_filt_3_dist_4/clang9                      639MB/s ± 0%   906MB/s ± 0%  +41.71%  (p=0.008 n=5+5)
wuffs_png_decode_filt_3_dist_4/gcc8                        656MB/s ± 0%   714MB/s ± 0%   +8.89%  (p=0.008 n=5+5)
2021-02-14 22:12:48 +11:00
Nigel Tao 435330494e Add std/png decoder.filter_1_distance_4_arm_neon
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):

wuffs_png_decode_filt_1_dist_4/clang9                     1.09GB/s ± 1%  1.42GB/s ± 0%  +30.50%  (p=0.008 n=5+5)
wuffs_png_decode_filt_1_dist_4/gcc8                        859MB/s ± 0%   891MB/s ± 0%   +3.66%  (p=0.008 n=5+5)
2021-02-14 21:43:56 +11:00
Nigel Tao 77d5fa01e5 Have std/png decode 16-bit depth images 2021-02-06 23:41:37 +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 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 a4d818699a Have std/png support low bit depths 2021-01-29 22:44:27 +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 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 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 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 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
Nigel Tao 04ab103809 Have std/png check CRC-32 checksums
wuffs_png_decode_19k_8bpp/clang9       90.3MB/s ± 0%  89.0MB/s ± 0%  -1.49%  (p=0.008 n=5+5)
wuffs_png_decode_40k_24bpp/clang9       128MB/s ± 0%   126MB/s ± 0%  -1.42%  (p=0.008 n=5+5)
wuffs_png_decode_77k_8bpp/clang9        340MB/s ± 0%   333MB/s ± 0%  -1.81%  (p=0.008 n=5+5)
wuffs_png_decode_552k_32bpp/clang9      256MB/s ± 0%   253MB/s ± 0%  -1.06%  (p=0.008 n=5+5)
wuffs_png_decode_4002k_24bpp/clang9     128MB/s ± 0%   126MB/s ± 0%  -1.77%  (p=0.008 n=5+5)

wuffs_png_decode_19k_8bpp/gcc10        97.7MB/s ± 0%  95.2MB/s ± 0%  -2.52%  (p=0.008 n=5+5)
wuffs_png_decode_40k_24bpp/gcc10        136MB/s ± 3%   129MB/s ± 0%  -5.13%  (p=0.008 n=5+5)
wuffs_png_decode_77k_8bpp/gcc10         362MB/s ± 1%   353MB/s ± 1%  -2.52%  (p=0.008 n=5+5)
wuffs_png_decode_552k_32bpp/gcc10       273MB/s ± 0%   271MB/s ± 0%  -0.54%  (p=0.008 n=5+5)
wuffs_png_decode_4002k_24bpp/gcc10      136MB/s ± 0%   130MB/s ± 0%  -4.45%  (p=0.008 n=5+5)
2021-01-21 13:28:10 +11:00
Nigel Tao 92cda94f66 Add png.decoder.filter_4_distance_?_sse128
wuffs_png_decode_40k_24bpp/clang9       128MB/s ± 0%    131MB/s ± 0%    +2.38%  (p=0.008 n=5+5)
wuffs_png_decode_552k_32bpp/clang9      169MB/s ± 0%    258MB/s ± 0%   +52.72%  (p=0.008 n=5+5)
wuffs_png_decode_4002k_24bpp/clang9     129MB/s ± 1%    131MB/s ± 0%    +1.79%  (p=0.008 n=5+5)

wuffs_png_decode_filt_4_dist_3/clang9   131MB/s ± 0%    540MB/s ± 0%  +311.86%  (p=0.016 n=4+5)
wuffs_png_decode_filt_4_dist_4/clang9   138MB/s ± 0%    784MB/s ± 0%  +469.66%  (p=0.008 n=5+5)

wuffs_png_decode_40k_24bpp/gcc10        131MB/s ± 0%    135MB/s ± 0%    +3.48%  (p=0.008 n=5+5)
wuffs_png_decode_552k_32bpp/gcc10       167MB/s ± 0%    275MB/s ± 0%   +65.10%  (p=0.008 n=5+5)
wuffs_png_decode_4002k_24bpp/gcc10      134MB/s ± 0%    136MB/s ± 0%    +1.78%  (p=0.008 n=5+5)

wuffs_png_decode_filt_4_dist_3/gcc10   95.8MB/s ± 0%  594.7MB/s ± 0%  +520.73%  (p=0.008 n=5+5)
wuffs_png_decode_filt_4_dist_4/gcc10   91.5MB/s ± 0%  795.3MB/s ± 0%  +769.14%  (p=0.008 n=5+5)
2021-01-19 21:55:03 +11:00
Nigel Tao a1788a0808 Add png.decoder.filter_3_distance_4_sse128
wuffs_png_decode_filt_3_dist_3/clang9   905MB/s ± 0%   913MB/s ± 0%    +0.81%  (p=0.008 n=5+5)
wuffs_png_decode_filt_3_dist_4/clang9   944MB/s ± 1%  1780MB/s ± 0%   +88.51%  (p=0.008 n=5+5)
wuffs_png_decode_filt_3_dist_3/gcc10   1.07GB/s ± 0%  1.08GB/s ± 0%    +0.42%  (p=0.008 n=5+5)
wuffs_png_decode_filt_3_dist_4/gcc10   1.01GB/s ± 1%  2.11GB/s ± 0%  +109.79%  (p=0.008 n=5+5)
2021-01-18 23:44:57 +11:00