Commit Graph
989 Commits
Author SHA1 Message Date
Nigel Tao 8d03a67e6e Re-do image decoders' call sequence state machine 2022-05-28 15:06:56 +10:00
Nigel Tao f55274aaa7 Fix -Werror=conversion in decode_bzip2.wuffs 2022-05-24 13:58:48 +10:00
Nigel Tao e6793fc501 Have std/bzip2 support QUIRK_IGNORE_CHECKSUM 2022-05-24 12:31:43 +10:00
Nigel Tao 09102fb1e8 Tweak std/bzip2 decoder.flush_fast applicability 2022-05-24 12:25:47 +10:00
Nigel Tao 6a3e43f495 Tweak std/bzip2 flush_* basic blocks
name                             old speed      new speed      delta

wuffs_bzip2_decode_10k/clang11   65.2MB/s ± 0%  65.2MB/s ± 0%    ~     (p=0.056 n=5+5)
wuffs_bzip2_decode_100k/clang11  52.4MB/s ± 0%  51.5MB/s ± 0%  -1.67%  (p=0.016 n=5+4)

wuffs_bzip2_decode_10k/gcc10     60.6MB/s ± 0%  61.7MB/s ± 0%  +1.81%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/gcc10    49.2MB/s ± 0%  49.6MB/s ± 0%  +0.86%  (p=0.008 n=5+5)
2022-05-24 12:01:30 +10:00
Nigel Tao bed155bd6f Optimize std/bzip2 flush_repeat_count checks
name                             old speed      new speed      delta

wuffs_bzip2_decode_10k/clang11   60.5MB/s ± 0%  65.2MB/s ± 0%   +7.85%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/clang11  45.7MB/s ± 1%  52.4MB/s ± 0%  +14.68%  (p=0.008 n=5+5)

wuffs_bzip2_decode_10k/gcc10     58.5MB/s ± 0%  60.6MB/s ± 0%   +3.67%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/gcc10    46.3MB/s ± 0%  49.2MB/s ± 0%   +6.31%  (p=0.008 n=5+5)
2022-05-24 11:56:23 +10:00
Nigel Tao 66f194f7e0 Introduce std/bzip2 decoder.flush_fast method
Compared to the recent commit 623290ef "Cache std/bzip2 Huffman tree
lookup":

name                             old speed      new speed      delta

wuffs_bzip2_decode_10k/clang11   60.5MB/s ± 0%  60.5MB/s ± 0%    ~     (p=1.000 n=5+5)
wuffs_bzip2_decode_100k/clang11  46.7MB/s ± 1%  45.7MB/s ± 1%  -2.05%  (p=0.008 n=5+5)

wuffs_bzip2_decode_10k/gcc10     58.7MB/s ± 0%  58.5MB/s ± 0%    ~     (p=0.222 n=5+5)
wuffs_bzip2_decode_100k/gcc10    46.9MB/s ± 0%  46.3MB/s ± 0%  -1.46%  (p=0.008 n=5+5)
2022-05-24 11:50:48 +10:00
Nigel Tao 29eec43287 Factor out std/bzip2/decode_flush_slow.wuffs 2022-05-24 11:27:09 +10:00
Nigel Tao ae1e075401 Rename std/bzip2 decode_block_* functions 2022-05-24 11:24:57 +10:00
Nigel Tao fc0c5e465b Rename std/bzip2/decode_block_*.wuffs 2022-05-24 11:24:15 +10:00
Nigel Tao 99b8c1cb9e Add std/bzip2 comment re QUIRK_IGNORE_CHECKSUM 2022-05-23 16:21:51 +10:00
Nigel Tao 623290ef87 Cache std/bzip2 Huffman tree lookup
name                             old speed      new speed      delta

wuffs_bzip2_decode_10k/clang11   46.5MB/s ± 0%  60.5MB/s ± 0%  +30.16%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/clang11  39.4MB/s ± 1%  46.7MB/s ± 1%  +18.43%  (p=0.008 n=5+5)

wuffs_bzip2_decode_10k/gcc10     43.8MB/s ± 0%  58.7MB/s ± 0%  +34.07%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/gcc10    35.9MB/s ± 0%  46.9MB/s ± 0%  +30.92%  (p=0.008 n=5+5)
2022-05-23 15:51:51 +10:00
Nigel Tao fdad12d59f Have std/bzip2 read 4 (not 1) bytes per inner loop
name                             old speed      new speed      delta

wuffs_bzip2_decode_10k/clang11   42.9MB/s ± 0%  46.5MB/s ± 0%   +8.38%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/clang11  36.9MB/s ± 0%  39.4MB/s ± 1%   +6.75%  (p=0.008 n=5+5)

wuffs_bzip2_decode_10k/gcc10     36.5MB/s ± 0%  43.8MB/s ± 0%  +19.73%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/gcc10    30.8MB/s ± 0%  35.9MB/s ± 0%  +16.37%  (p=0.008 n=5+5)
2022-05-23 15:22:31 +10:00
Nigel Tao 94a2c704d4 Factor out std/bzip2/decode_block_slow.wuffs 2022-05-23 13:54:50 +10:00
Nigel Tao 27e9b81588 Optimize bzip2 invert_bwt letter counting
name                             old speed      new speed      delta

wuffs_bzip2_decode_10k/clang11   42.2MB/s ± 0%  42.9MB/s ± 0%  +1.63%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/clang11  36.2MB/s ± 1%  36.9MB/s ± 0%  +2.07%  (p=0.008 n=5+5)

wuffs_bzip2_decode_10k/gcc10     35.3MB/s ± 0%  36.5MB/s ± 0%  +3.62%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/gcc10    29.5MB/s ± 0%  30.8MB/s ± 0%  +4.59%  (p=0.008 n=5+5)
2022-05-23 13:36:55 +10:00
Nigel Tao 2422997ee5 Tweak std/bzip2's "inverse of T" description 2022-05-17 00:10:46 +10:00
Nigel Tao 68b76a8a56 Implement std/bzip2 2022-05-16 23:35:32 +10:00
Nigel Tao fc635d76f7 Add std/bzip2/README.md note about bzip 1 2022-05-13 10:37:36 +10:00
Nigel Tao ce8d08598d Add std/bzip2 package
This is just a placeholder decoder implementation.
2022-05-12 23:52:12 +10:00
Nigel Tao 4c56f5bdb2 Fix png.DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE 2022-05-12 22:30:28 +10:00
Nigel Tao b5f12153db Add std/bzip2/README.md 2022-05-12 22:15:31 +10:00
Nigel Tao e9cb3c8b34 Use hd consistently, not xxd, in docs 2022-04-30 13:20:08 +10:00
Nigel Tao 03fd43cfcc Add "#png: unsupported CgBI extension" status 2022-03-21 14:12:25 +11:00
Nigel Tao dd9679b56e Remove some redundant assignments after yields 2022-01-25 21:33:19 +11:00
Nigel Tao 7b51266642 Remove redundant json decode_comment "while true" 2022-01-25 21:26:27 +11:00
Nigel Tao 5a93c63f0a Tweak json.decoder.decode_comment 2022-01-25 21:24:54 +11:00
Nigel Tao 656c0bdf92 Remove some redundant assignments after yields 2022-01-25 20:37:50 +11:00
Nigel Tao b374b2b34f Tweak json decode_trailer whitespace_length var 2022-01-25 20:36:10 +11:00
Nigel Tao ad46513ded Remove some redundant assignments after yields 2022-01-25 20:25:46 +11:00
Nigel Tao 5ecd84e0ed Have std/png partially decode invalid images 2022-01-25 14:36:31 +11:00
Nigel Tao a4b14a0f17 Simpify std/png "yield short read" loop 2022-01-25 14:29:18 +11:00
Nigel Tao d53f37997f Have std/png decode truncated images
Fixes #71
2022-01-23 22:59:06 +11:00
Nigel Tao c203818556 Have std/tga ignore X-Origin and Y-Origin fields
Updates #67
2022-01-15 15:10:03 +11:00
Nigel Tao fd69133c5d Fix std/tga opaque-ness
Updates #67
2022-01-15 14:11:56 +11:00
Nigel Tao f4002c5b21 Have std/tga decode RLE images
Updates #67
2022-01-15 14:10:05 +11:00
Nigel Tao fc77dc35ff Have std/tga decode BGRX5551 images
Updates #67
2022-01-15 12:53:24 +11:00
Nigel Tao c997066a2a Have std/tga decode color-mapped images
Updates #67
2022-01-15 12:38:21 +11:00
Nigel Tao 2c10bc32b0 Have std/tga decode non-color-mapped images
Updates #67
2022-01-15 11:37:45 +11:00
Nigel Tao 5aa7a9339f Have std/tga decode width and height
Updates #67
2022-01-15 08:28:53 +11:00
Nigel Tao 4c09c77bb9 Add std/tga package
This is just a placeholder decoder implementation  (and all of the
required plumbing) that produces a 1x1 reddish-purple image. Follow-up
commits will add flesh to the metaphorical bones.

TGA has no magic identifier, so MIME sniffers have to use heuristics.
The test/data/cbor-rfc-7049-examples.cbor file (which is CBOR binary
data, not a TGA image) is mistakenly sniffed as TGA. The /usr/bin/file
program makes the same classification (a false positive).

$ file test/data/cbor-rfc-7049-examples.cbor
test/data/cbor-rfc-7049-examples.cbor: Targa image data - Map 59395 x 26
x 15 +6169 +6500 - 2-bit alpha - interleave "@\033"

Some test/3pdata/tgasuite/*.tga test files, which are invalid TGA
images, are also false positives for now.

Updates #67
2022-01-14 22:53:20 +11:00
Nigel Tao f86c80e425 Fix std/deflate degenerate H-D Huffman table
RFC 1951 section 3.2.7. "Compression with dynamic Huffman codes
(BTYPE=10)" says, "If only one distance code is used, it is encoded
using one bit, not zero bits; in this case there is a single code length
of one, with one unused code."

I had previously mis-read that excerpt to also require that the sole
distance code was the shortest distance (code 0, a distance of 1).

Fixes #66
2022-01-08 13:57:34 +11:00
Nigel Tao 8ef4c062d9 Add zlib QUIRK_JUST_RAW_DEFLATE 2021-11-26 23:13:57 +11:00
Nigel Tao 38b101d170 Push std/png decoder.tell_me_more goto_done later 2021-11-26 19:46:36 +11:00
Nigel Tao 5d1473a2ca Refactor std/png decoder.tell_me_more 2021-11-26 19:45:42 +11:00
Nigel Tao 72d4a9e769 Have std/png pass through EXIF data
Fixes #59
2021-11-26 19:14:30 +11:00
Nigel Tao 5f6a522563 Add a "while.goto_done" no-op to std/png 2021-11-26 17:26:12 +11:00
Nigel Tao 4dedbedbbc Remove unnecessary std/nie struct parentheses 2021-11-26 17:24:57 +11: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 f5c68a13cb Fix std/png for depth-16 grayscale interlaced 2021-11-20 22:54:21 +11:00
Nigel Tao 5e8b448c12 Drop std/deflate's "Re-purpose the hdist variable" 2021-11-20 22:03:29 +11:00