Commit Graph
400 Commits
Author SHA1 Message Date
Nigel Tao 4dfd70928b std: add "get_quirk(key: u32) u64" 2023-07-16 12:04:09 +10:00
Nigel Tao 65924cd44d std/lzw: have flush return a roslice 2023-05-06 10:00:02 +10:00
Nigel Tao bc86394bef base: rename min/max arg to no_more/less_than 2023-04-16 12:12:27 +10:00
Nigel Tao e126c998e0 std: limit supported image dimensions to 0xFF_FFFF 2023-04-16 08:57:55 +10:00
Nigel Tao d8c23a3a66 std/lzw: change set_literal_width to set_quirk 2023-04-15 09:59:40 +10:00
Nigel Tao 6e84987d33 std: change set_quirk_enabled to set_quirk 2023-04-14 21:42:15 +10:00
Nigel Tao ea3fbc37f5 lang: change const array to const roarray 2023-04-10 16:06:10 +10:00
Nigel Tao 49fa501f0d lang/parse: struct private data now needs a "+" 2023-04-09 15:45:06 +10:00
Nigel Tao f5eb38d76e wuffsfmt: indent with 4 spaces (not a tab) 2023-04-09 15:28:07 +10:00
Nigel Tao 9c03b8c71d wuffsfmt: double-indents hanging lines 2023-04-09 15:22:25 +10:00
Nigel Tao 248bddcfd2 std/*image_decoder*: add "#truncated input"
name                                                       old speed      new speed       delta

wuffs_bmp_decode_40k/clang11                               4.36GB/s ± 0%   4.48GB/s ± 0%   +2.74%  (p=0.008 n=5+5)

wuffs_bmp_decode_40k/gcc10                                 4.49GB/s ± 0%   4.50GB/s ± 0%   +0.15%  (p=0.008 n=5+5)

wuffs_gif_decode_1k_bw/clang11                              723MB/s ± 0%    742MB/s ± 0%   +2.64%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_full_init/clang11                 177MB/s ± 0%    177MB/s ± 0%     ~     (p=0.841 n=5+5)
wuffs_gif_decode_1k_color_part_init/clang11                 216MB/s ± 0%    217MB/s ± 0%   +0.66%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/clang11                           793MB/s ± 0%    785MB/s ± 0%   -1.04%  (p=0.016 n=4+5)
wuffs_gif_decode_10k_indexed/clang11                        210MB/s ± 0%    209MB/s ± 0%   -0.38%  (p=0.008 n=5+5)
wuffs_gif_decode_20k/clang11                                254MB/s ± 0%    255MB/s ± 0%   +0.37%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/clang11                    568MB/s ± 0%    569MB/s ± 0%   +0.14%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/clang11                     221MB/s ± 0%    221MB/s ± 0%     ~     (p=0.222 n=5+5)
wuffs_gif_decode_1000k_full_init/clang11                    224MB/s ± 0%    224MB/s ± 0%     ~     (p=0.690 n=5+5)
wuffs_gif_decode_1000k_part_init/clang11                    224MB/s ± 0%    224MB/s ± 0%     ~     (p=0.841 n=5+5)
wuffs_gif_decode_anim_screencap/clang11                    1.30GB/s ± 0%   1.30GB/s ± 0%     ~     (p=0.111 n=5+5)

wuffs_gif_decode_1k_bw/gcc10                                638MB/s ± 0%    672MB/s ± 0%   +5.23%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_full_init/gcc10                   175MB/s ± 0%    181MB/s ± 0%   +3.03%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_part_init/gcc10                   203MB/s ± 0%    209MB/s ± 0%   +3.38%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/gcc10                             798MB/s ± 0%    804MB/s ± 0%   +0.70%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/gcc10                          210MB/s ± 0%    212MB/s ± 0%   +0.84%  (p=0.008 n=5+5)
wuffs_gif_decode_20k/gcc10                                  265MB/s ± 0%    265MB/s ± 0%     ~     (p=0.222 n=5+5)
wuffs_gif_decode_100k_artificial/gcc10                      576MB/s ± 0%    577MB/s ± 0%     ~     (p=0.690 n=5+5)
wuffs_gif_decode_100k_realistic/gcc10                       226MB/s ± 0%    227MB/s ± 0%   +0.21%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k_full_init/gcc10                      230MB/s ± 0%    231MB/s ± 0%   +0.32%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k_part_init/gcc10                      230MB/s ± 0%    231MB/s ± 0%   +0.43%  (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/gcc10                      1.32GB/s ± 0%   1.32GB/s ± 0%   +0.18%  (p=0.008 n=5+5)

wuffs_png_decode_image_19k_8bpp/clang11                     267MB/s ± 0%    273MB/s ± 0%   +2.47%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/clang11                    326MB/s ± 0%    327MB/s ± 0%   +0.51%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang11                     954MB/s ± 0%    969MB/s ± 0%   +1.58%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang11   865MB/s ± 0%    864MB/s ± 0%   -0.18%  (p=0.016 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang11   832MB/s ± 0%    831MB/s ± 0%   -0.11%  (p=0.016 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang11                  331MB/s ± 0%    332MB/s ± 0%   +0.18%  (p=0.016 n=5+5)

wuffs_png_decode_image_19k_8bpp/gcc10                       298MB/s ± 0%    292MB/s ± 0%   -2.17%  (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc10                      352MB/s ± 0%    349MB/s ± 0%   -0.75%  (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc10                      1.05GB/s ± 0%   1.03GB/s ± 0%   -1.56%  (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10     950MB/s ± 0%    949MB/s ± 0%     ~     (p=0.310 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10     905MB/s ± 0%    902MB/s ± 0%   -0.35%  (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc10                    360MB/s ± 0%    358MB/s ± 0%   -0.40%  (p=0.008 n=5+5)

wuffs_tga_decode_19k_8bpp/clang11                          7.81GB/s ± 0%   7.90GB/s ± 0%   +1.22%  (p=0.008 n=5+5)
wuffs_tga_decode_77k_24bpp/clang11                         4.34GB/s ± 0%   4.36GB/s ± 0%   +0.59%  (p=0.008 n=5+5)

wuffs_tga_decode_19k_8bpp/gcc10                            7.10GB/s ± 0%   7.13GB/s ± 0%   +0.33%  (p=0.008 n=5+5)
wuffs_tga_decode_77k_24bpp/gcc10                           4.61GB/s ± 0%   4.60GB/s ± 0%   -0.35%  (p=0.008 n=5+5)

Updates #96
2023-02-01 16:36:56 +11:00
Nigel Tao ebe080c9ec Fix gif metadata when skipping decode_image_config 2022-06-03 11:43:05 +10:00
Nigel Tao 65afe919b5 Fix std/gif "@end of data" for 0-frame GIFs
This fixes a regression introduced by 8d03a67e "Re-do image decoders'
call sequence state machine".

build-all.sh's script/print-nia-checksums.sh test once again matches
test/nia-checksums-of-data.txt:
-4c6d02c3 test/data/artificial-gif/no-frames.gif
+ba6e48f8 test/data/artificial-gif/no-frames.gif
2022-06-02 16:48:06 +10:00
Nigel Tao 8d03a67e6e Re-do image decoders' call sequence state machine 2022-05-28 15:06:56 +10:00
Nigel Tao ac4d3e6420 Use 0 (not 1) num_animation_loops for still GIFs
For example, the crc32 checksums in test/nia-checksums-of-data.txt for
test/data/pjw-thumbnail.{bmp,gif,png} now all match.
2021-11-23 15:06:55 +11:00
Nigel Tao e44920d382 Let gif "ignore too much" quirk skip lzw errors
The modified test/data/*/*.gif files differ by only one byte:
 00000000  47 49 46 38 39 61 02 00  02 00 81 00 00 00 00 ff  |GIF89a..........|
 00000010  11 00 ff 22 00 ff 33 00  ff 2c 00 00 00 00 02 00  |..."..3..,......|
-00000020  02 00 00 02 02 84 f1 00  3b                       |........;|
+00000020  02 00 00 02 02 84 5d 00  3b                       |......].;|

The etc-good-lzw.gif bits have changed, even though the
etc-good-lzw.etc.txt file only had comments added, due to a Go standard
library change: "compress/lzw: output a Clear code first, per GIF spec"
https://github.com/golang/go/commit/9c1dbdf60edbffeff10f58af21fa055eb0fdd29f

Updates PR #57
Updates https://crbug.com/1270631
2021-11-19 13:30:23 +11:00
Nigel Tao 7dd0dd264b Delete superfluous "// --------" comment 2021-11-17 12:03:43 +11:00
Nigel Tao 0045ce49f3 Rename table.row as table.row_u32 2021-11-15 10:49:42 +11:00
Nigel Tao 2373340f83 Add base.ANIMATION_DISPOSAL__ETC constants 2021-11-09 09:53:29 +11:00
Nigel Tao 74c1dfce96 Rename std/gif num_loops field 2021-11-09 08:55:15 +11:00
Nigel Tao 8f9a4f40c2 Rename METADATA_RAW as METADATA_RAW_PASSTHROUGH 2021-10-31 15:17:46 +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 ad1d983698 Add ETC__MORE_INFORMATION__FLAVOR__METADATA_PARSED 2021-10-14 17:17:11 +11:00
Nigel Tao 28a54baa19 Add io_bind history_position arg 2021-08-15 08:36:14 +10:00
Nigel Tao 2f2bbc6ab0 Rename default github.com branch s/master/main/ 2021-01-25 11:30:15 +11:00
Nigel Tao 38827d87f3 Have restart_frame require decode_image_config 2020-12-19 22:45:41 +11:00
Nigel Tao 68fb70f9d5 Harmonize image decoders' call_sequence states 2020-12-19 22:42:49 +11:00
Nigel Tao 695a6815b1 Remove gif.config_decoder
The original motivation (having a low-featured low-memory decoder just
for counting GIF frames) is obsolete: https://crbug.com/1132828

Binary size, before:
42264 gen/lib/c/clang-9-dynamic/wuffs-std-gif.lo
42392 gen/lib/c/clang-9-static/wuffs-std-gif.o
44824 gen/lib/c/gcc-dynamic/wuffs-std-gif.lo
45624 gen/lib/c/gcc-static/wuffs-std-gif.o

After:
26736 gen/lib/c/clang-9-dynamic/wuffs-std-gif.lo
26712 gen/lib/c/clang-9-static/wuffs-std-gif.o
27976 gen/lib/c/gcc-dynamic/wuffs-std-gif.lo
28392 gen/lib/c/gcc-static/wuffs-std-gif.o
2020-12-18 22:06:08 +11:00
Nigel Tao 8482161c91 Add base.pixel_buffer.palette_or_else 2020-12-02 22:13:35 +11:00
Nigel Tao be8542e313 Rename I/O available methods to length 2020-08-13 23:26:08 +10:00
Nigel Tao 7e32336de0 Add base.PIXEL_FORMAT__ETC constants 2020-06-09 12:34:34 +10:00
Nigel Tao 71528b33dd Rename frame_config.update to frame_config.set 2020-06-03 11:34:57 +10:00
Nigel Tao 54196c4e80 Rename pixel_swizzler.swizzle_interleaved 2020-05-29 16:54:05 +10:00
Nigel Tao 91dcf8f582 Add io_reader.limited_copy_u32_to_slice 2020-05-27 23:47:10 +10:00
Nigel Tao 8b70ad0565 Rename skip32 to skip_u32 2020-05-27 23:29:20 +10:00
Nigel Tao 1239280ad8 Roll back 'dst_palette into the pixel_swizzler'
See the previous commit for the rationale.
2020-05-26 14:13:28 +10:00
Nigel Tao 2d8ec9ace9 Roll dst_palette into the pixel_swizzler struct
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.

name                                        old speed      new speed      delta

wuffs_gif_decode_1k_bw/clang5                286MB/s ± 1%   251MB/s ± 0%  -12.11%  (p=0.000 n=10+9)
wuffs_gif_decode_1k_color_full_init/clang5  96.0MB/s ± 0%  88.9MB/s ± 0%   -7.35%  (p=0.000 n=10+10)
wuffs_gif_decode_1k_color_part_init/clang5   119MB/s ± 0%   108MB/s ± 0%   -9.06%  (p=0.000 n=10+8)
wuffs_gif_decode_10k_bgra/clang5             469MB/s ± 1%   438MB/s ± 0%   -6.50%  (p=0.000 n=10+8)
wuffs_gif_decode_10k_indexed/clang5          125MB/s ± 1%   117MB/s ± 1%   -6.78%  (p=0.000 n=9+9)
wuffs_gif_decode_20k/clang5                  153MB/s ± 0%   139MB/s ± 0%   -9.40%  (p=0.000 n=9+9)
wuffs_gif_decode_100k_artificial/clang5      324MB/s ± 0%   304MB/s ± 0%   -6.22%  (p=0.000 n=10+9)
wuffs_gif_decode_100k_realistic/clang5       139MB/s ± 1%   125MB/s ± 1%   -9.69%  (p=0.000 n=9+10)
wuffs_gif_decode_1000k_full_init/clang5      141MB/s ± 0%   126MB/s ± 0%  -10.40%  (p=0.000 n=10+10)
wuffs_gif_decode_1000k_part_init/clang5      141MB/s ± 1%   126MB/s ± 0%  -10.50%  (p=0.000 n=10+8)
wuffs_gif_decode_anim_screencap/clang5       655MB/s ± 0%   617MB/s ± 1%   -5.91%  (p=0.000 n=9+9)

wuffs_gif_decode_1k_bw/gcc7                  299MB/s ± 0%   295MB/s ± 0%   -1.18%  (p=0.000 n=10+8)
wuffs_gif_decode_1k_color_full_init/gcc7    85.2MB/s ± 1%  88.2MB/s ± 0%   +3.58%  (p=0.000 n=10+10)
wuffs_gif_decode_1k_color_part_init/gcc7     104MB/s ± 0%   103MB/s ± 0%   -0.39%  (p=0.001 n=9+10)
wuffs_gif_decode_10k_bgra/gcc7               349MB/s ± 2%   352MB/s ± 0%   +0.77%  (p=0.000 n=9+10)
wuffs_gif_decode_10k_indexed/gcc7            106MB/s ± 0%   106MB/s ± 2%     ~     (p=0.762 n=8+10)
wuffs_gif_decode_20k/gcc7                    133MB/s ± 0%   133MB/s ± 0%     ~     (p=0.258 n=9+9)
wuffs_gif_decode_100k_artificial/gcc7        302MB/s ± 0%   301MB/s ± 1%   -0.41%  (p=0.035 n=10+10)
wuffs_gif_decode_100k_realistic/gcc7         118MB/s ± 1%   118MB/s ± 1%     ~     (p=0.095 n=9+10)
wuffs_gif_decode_1000k_full_init/gcc7        120MB/s ± 1%   119MB/s ± 0%   -0.34%  (p=0.007 n=10+10)
wuffs_gif_decode_1000k_part_init/gcc7        119MB/s ± 1%   119MB/s ± 1%     ~     (p=0.138 n=10+10)
wuffs_gif_decode_anim_screencap/gcc7         640MB/s ± 0%   640MB/s ± 0%     ~     (p=0.905 n=9+10)
2020-05-26 14:07:30 +10:00
Nigel Tao f9a90d8ade Loosen what std/gif allows as the trailer byte 2020-05-21 22:06:21 +10:00
Nigel Tao 9a1b8def46 Tweak pixel_format bits 2020-05-16 10:12:16 +10:00
Nigel Tao ad1cff3921 Add tell_me_more? mechanism 2020-05-12 11:12:39 +10:00
Nigel Tao e39f3cbf42 Redo Wuffs structs' quirk bool fields 2020-04-14 23:03:18 +10:00
Nigel Tao 532e18c4a5 Add colons to const syntax 2020-04-14 14:57:30 +10:00
Nigel Tao 74871344f0 Capitalize Wuffs const names 2020-04-13 15:52:36 +10:00
Nigel Tao 3fe3f84106 Add double-curly blocks 2020-04-02 21:56:53 +11:00
Nigel Tao 58351d44da Make endwhile mandatory for nameless loops 2020-03-25 21:40:00 +11:00
Nigel Tao 9e50918718 Add single-quoted strings 2020-03-25 19:41:02 +11:00
Nigel Tao a3827275c0 Add std/json quirks 2020-03-12 16:47:26 +11:00
Nigel Tao 2d2a880c18 Ban unlabeled break/continue for labeled loop 2020-02-24 14:20:05 +11:00
Nigel Tao b1e3a15c08 Add endwhile syntax 2020-02-22 13:11:02 +11:00
Nigel Tao 05b790d088 Refine pixel_format.bits_per_pixel return type 2020-02-08 18:27:38 +11:00