Nigel Tao
f5c68a13cb
Fix std/png for depth-16 grayscale interlaced
2021-11-20 22:54:21 +11:00
Nigel Tao
49a431f98d
Fix std/deflate decode_huffman_slow suspends
...
Unlike the other decode_huffman_etc! methods, decode_huffman_slow? (with
a ?) can suspend. The (hlen, hdist) and the remainder (length, distance)
pairs might not be stable across a suspension, as the args.dst io_writer
might change its history length. We have to re-calculate those pairs
after a short write.
The test/3pdata/nia-checksums-of-pngsuite.txt for interlaced and
non-interlaced flavors of the same image now match.
2021-11-20 21:31:40 +11:00
Nigel Tao
a684928240
Let std/png allow PLTE for RGB, RGBA color types
2021-11-20 15:39:07 +11:00
Nigel Tao
cdf3bbfb26
Add test/3pdata/pngsuite
2021-11-20 14:49:10 +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
3b882be500
Rename test/.../pixel-data-too-much.gif*
2021-11-19 11:54:39 +11:00
Nigel Tao
6a8ee57ac0
Loosen test_wuffs_png_decode_metadata_kvp bound
2021-11-19 09:48:47 +11:00
Nigel Tao
8562375fd9
Update test/nia-checksums-of-data.txt
2021-11-18 08:11:06 +11:00
Nigel Tao
bb028ae764
Update tests for artificial/* filename rename
2021-11-18 08:10:12 +11:00
Nigel Tao
29560a336b
Convert std/png text from Latin-1 to UTF-8
...
Fixes #55
2021-11-17 23:04:49 +11:00
Nigel Tao
6737565c20
Let std/png decode iTXt, tEXt and zTXt chunks
...
Updates #55
2021-11-17 11:56:49 +11:00
Nigel Tao
3642d73714
Factor test/data/artificial into many directories
2021-11-16 15:37:57 +11:00
Nigel Tao
37ac4def8e
Move some test/data/artificial files up one dir
2021-11-16 15:12:29 +11:00
Nigel Tao
ce9ab13ecd
Let std/png decode first fcTL after the last IDAT
2021-11-16 12:55:43 +11:00
Nigel Tao
6c2a591e84
Let script/make-artificial.go generate PNG files
2021-11-16 11:08:04 +11:00
Nigel Tao
d40bf000a9
Rename wuffs_base__table_u8__row as etc__row_u32
2021-11-15 17:26:51 +11:00
Nigel Tao
8025bf1bd7
Fix std/png filter benches
2021-11-14 21:20:05 +11:00
Nigel Tao
a4fa6a2554
Let std/png decode (animated) APNG
...
The test/nia-checksums-of-data.txt checksums for the *.apng files now
match the (multiple frame) *.gif files. Previously, they matched the
(single frame) *.000000.nie files.
Fixes #41
2021-11-14 18:20:15 +11:00
Nigel Tao
22eed1fd8d
Let example/convert-to-nia decode NIE
2021-11-13 11:21:35 +11:00
Nigel Tao
c19e3b1cab
Add script/extract-nia-frames.go
2021-11-11 11:47:08 +11:00
Nigel Tao
9af2666aec
Move std/png first_frame_io_position earlier
2021-11-10 16:52:59 +11:00
Nigel Tao
f4c2d4652e
Fix test/data/animated-red-blue.apng loop count
...
The diff of the "hd" hex dump shows that the acTL chunk's nominal loop
count changed from 2 to 3. The 4-byte CRC-32 checksum was also updated.
00000000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 |.PNG........IHDR|
00000010 00 00 00 40 00 00 00 30 08 02 00 00 00 2e 29 eb |...@...0......).|
00000020 48 00 00 00 08 61 63 54 4c 00 00 00 04 00 00 00 |H....acTL.......|
-00000030 02 92 c3 07 fc 00 00 00 06 74 52 4e 53 00 00 00 |.........tRNS...|
+00000030 03 e5 c4 37 6a 00 00 00 06 74 52 4e 53 00 00 00 |...7j....tRNS...|
00000040 00 00 10 73 11 17 f5 00 00 00 1a 66 63 54 4c 00 |...s.......fcTL.|
00000050 00 00 00 00 00 00 40 00 00 00 30 00 00 00 00 00 |......@...0.....|
00000060 00 00 00 00 0a 00 64 00 00 80 50 f1 a2 00 00 03 |......d...P.....|
2021-11-07 10:43:32 +11:00
Nigel Tao
ca76a01ac2
Have std/png support remapped transparency
2021-11-07 09:51:04 +11:00
Nigel Tao
0a7168fd64
Add test/data/*.apng
2021-11-05 22:28:08 +11:00
Nigel Tao
750df217dd
Rename deprecated ETC__FLAVOR__METADATA
2021-11-05 16:48:58 +11:00
Nigel Tao
744fbdd732
Have std/png decode iCCP chunks
...
Updates #39
2021-11-05 16:29:11 +11:00
Nigel Tao
d5075c7e94
Push "int i" into "for (int i = etc; etc; etc)"
2021-11-02 14:07:58 +11:00
Nigel Tao
f40ef01244
Have make-red-blue-gradient use iCCP profile name
2021-10-31 15:35:14 +11:00
Nigel Tao
a9a6332be2
Have etc__magic_number_guess_fourcc find ICO
2021-10-22 15:51:44 +11:00
Nigel Tao
d557bc3836
Embiggen test/data/red-blue-gradient.*.png
2021-10-22 09:23:49 +11:00
Nigel Tao
01a5b8842b
Update test/nia-checksums-of-data.txt
2021-10-20 19:38:43 +11:00
Nigel Tao
35cb4df973
Rename test/data/red-blue-gradient.dcip3d65.png
2021-10-20 19:38:24 +11:00
Nigel Tao
6ea3144379
Add test/data/checkerboard.*.png
2021-10-20 09:58:42 +11:00
Nigel Tao
9437d1a265
Tighten magic number guessing for WBMP
2021-10-17 22:57:42 +11:00
Nigel Tao
2e821791a9
Update test/nia-checksums-of-data.txt
2021-10-17 13:08:24 +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
e6733aec19
Add test/data/red-blue-gradient.dcip3d65.png
2021-10-15 11:29:26 +11:00
Nigel Tao
dbc209dd7e
Add test/data/red-blue-gradient.*.png
2021-10-14 15:58:03 +11:00
Nigel Tao
5a4dd303f0
Remove hippopotamus.interlaced.png "wuffs test"
...
Coverage now comes from build-all.sh's nia-checksums-of-data.txt test.
2021-10-07 16:52:17 +11:00
Nigel Tao
62125d8967
Add test/nia-checksums-of-data.txt
2021-10-07 16:49:38 +11:00
Nigel Tao
f9c029c788
Fix std/png history_position for interlacing
2021-10-07 13:52:40 +11:00
Nigel Tao
de45ab1d2b
Add archive.password-is-asdf.zip
...
$ zip --password asdf archive.password-is-asdf.zip etc etc
2021-09-21 11:54:02 +10:00
Nigel Tao
c8592d2b7a
Remove obsolete comments re s/gAMA/hAMA/ PNG chunk
...
The one-byte patch was added in commit 88616cc9 but no longer applied as
of commit 54771322 .
2021-09-06 23:14:29 +10:00
Nigel Tao
9d10438914
Add test/data/bricks-dither.no-ancillary.png
2021-09-06 22:57:55 +10:00
Nigel Tao
75faea996d
Add parse "122.416294033786585" test case
2021-08-22 16:02:44 +10:00
Nigel Tao
592bc14ed1
Have std/deflate allow non-compact dst history
...
Fixes #52
On a mid-range x86_64 laptop (2016, Skylake):
name old speed new speed delta
wuffs_deflate_decode_1k_full_init/clang9 101MB/s ± 1% 100MB/s ± 1% -1.22% (p=0.000 n=9+9)
wuffs_deflate_decode_1k_part_init/clang9 119MB/s ± 1% 119MB/s ± 1% ~ (p=0.139 n=8+9)
wuffs_deflate_decode_10k_full_init/clang9 221MB/s ± 1% 210MB/s ± 1% -4.94% (p=0.000 n=9+9)
wuffs_deflate_decode_10k_part_init/clang9 225MB/s ± 3% 215MB/s ± 1% -4.33% (p=0.000 n=10+8)
wuffs_deflate_decode_100k_just_one_read/clang9 290MB/s ± 0% 284MB/s ± 1% -2.26% (p=0.000 n=8+9)
wuffs_deflate_decode_100k_many_big_reads/clang9 188MB/s ± 3% 177MB/s ± 1% -5.78% (p=0.000 n=9+10)
wuffs_deflate_decode_1k_full_init/gcc10 101MB/s ± 0% 97MB/s ± 1% -3.65% (p=0.000 n=8+9)
wuffs_deflate_decode_1k_part_init/gcc10 119MB/s ± 1% 113MB/s ± 2% -4.65% (p=0.000 n=9+9)
wuffs_deflate_decode_10k_full_init/gcc10 214MB/s ± 3% 224MB/s ± 1% +4.83% (p=0.000 n=10+10)
wuffs_deflate_decode_10k_part_init/gcc10 222MB/s ± 1% 231MB/s ± 1% +4.03% (p=0.000 n=9+10)
wuffs_deflate_decode_100k_just_one_read/gcc10 281MB/s ± 2% 297MB/s ± 0% +5.78% (p=0.000 n=9+9)
wuffs_deflate_decode_100k_many_big_reads/gcc10 184MB/s ± 0% 194MB/s ± 0% +5.85% (p=0.000 n=10+8)
mimic_deflate_decode_1k_full_init 138MB/s ± 1% 138MB/s ± 0% ~ (p=0.546 n=9+9)
mimic_deflate_decode_10k_full_init 156MB/s ± 2% 156MB/s ± 0% ~ (p=0.387 n=9+9)
mimic_deflate_decode_100k_just_one_read 191MB/s ± 1% 190MB/s ± 2% -0.94% (p=0.004 n=9+10)
mimic_deflate_decode_100k_many_big_reads 147MB/s ± 1% 147MB/s ± 1% ~ (p=0.356 n=9+10)
wuffs_gzip_decode_10k/clang9 220MB/s ± 1% 209MB/s ± 1% -5.29% (p=0.000 n=10+9)
wuffs_gzip_decode_100k/clang9 283MB/s ± 2% 279MB/s ± 1% -1.47% (p=0.002 n=10+10)
wuffs_gzip_decode_10k/gcc10 218MB/s ± 1% 214MB/s ± 2% -1.76% (p=0.000 n=9+10)
wuffs_gzip_decode_100k/gcc10 274MB/s ± 0% 264MB/s ± 2% -3.61% (p=0.000 n=7+10)
mimic_gzip_decode_10k 131MB/s ± 2% 132MB/s ± 0% +0.81% (p=0.000 n=10+8)
mimic_gzip_decode_100k 156MB/s ± 0% 156MB/s ± 1% ~ (p=0.423 n=8+9)
wuffs_zlib_decode_10k/clang9 223MB/s ± 2% 209MB/s ± 2% -6.41% (p=0.000 n=10+10)
wuffs_zlib_decode_100k/clang9 285MB/s ± 0% 280MB/s ± 0% -1.87% (p=0.000 n=8+9)
wuffs_zlib_decode_10k/gcc10 235MB/s ± 0% 215MB/s ± 1% -8.22% (p=0.000 n=10+9)
wuffs_zlib_decode_100k/gcc10 293MB/s ± 0% 268MB/s ± 1% -8.38% (p=0.000 n=8+10)
mimic_zlib_decode_10k 145MB/s ± 1% 145MB/s ± 1% -0.45% (p=0.004 n=9+9)
mimic_zlib_decode_100k 175MB/s ± 1% 174MB/s ± 0% ~ (p=0.055 n=10+8)
wuffs_png_decode_image_19k_8bpp/clang9 142MB/s ± 1% 152MB/s ± 1% +6.98% (p=0.000 n=9+9)
wuffs_png_decode_image_40k_24bpp/clang9 172MB/s ± 0% 170MB/s ± 0% -1.63% (p=0.000 n=8+9)
wuffs_png_decode_image_77k_8bpp/clang9 504MB/s ± 2% 540MB/s ± 1% +7.28% (p=0.000 n=9+10)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9 462MB/s ± 1% 470MB/s ± 0% +1.57% (p=0.000 n=9+10)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9 445MB/s ± 1% 451MB/s ± 0% +1.49% (p=0.000 n=8+10)
wuffs_png_decode_image_4002k_24bpp/clang9 175MB/s ± 3% 175MB/s ± 1% ~ (p=0.356 n=9+10)
wuffs_png_decode_image_19k_8bpp/gcc10 150MB/s ± 0% 153MB/s ± 1% +2.03% (p=0.000 n=10+10)
wuffs_png_decode_image_40k_24bpp/gcc10 186MB/s ± 0% 186MB/s ± 0% ~ (p=0.408 n=10+8)
wuffs_png_decode_image_77k_8bpp/gcc10 543MB/s ± 0% 542MB/s ± 0% -0.23% (p=0.019 n=9+9)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10 478MB/s ± 1% 498MB/s ± 0% +4.12% (p=0.000 n=10+9)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10 451MB/s ± 4% 476MB/s ± 0% +5.37% (p=0.000 n=10+9)
wuffs_png_decode_image_4002k_24bpp/gcc10 185MB/s ± 2% 190MB/s ± 1% +2.78% (p=0.000 n=10+9)
mimic_png_decode_image_19k_8bpp 63.0MB/s ± 0% 62.9MB/s ± 1% ~ (p=0.673 n=8+9)
mimic_png_decode_image_40k_24bpp 78.7MB/s ± 0% 78.9MB/s ± 0% ~ (p=0.059 n=9+8)
mimic_png_decode_image_77k_8bpp 192MB/s ± 1% 193MB/s ± 3% +0.44% (p=0.028 n=10+9)
mimic_png_decode_image_552k_32bpp_verify_checksum 157MB/s ± 0% 158MB/s ± 1% ~ (p=0.053 n=10+9)
mimic_png_decode_image_4002k_24bpp 113MB/s ± 1% 113MB/s ± 1% ~ (p=0.053 n=10+9)
2021-08-15 10:50:41 +10:00
Nigel Tao
77f855206d
Have JSON line-comment tokens exclude the "\n"
...
Before this commit, line-comment token chains included the final "\n"
the way block-comments included the final "*/". The "\n" was mandatory.
However, when parsing with both QUIRK_ALLOW_COMMENT_LINE and
QUIRK_ALLOW_TRAILING_FILLER, input like "123//xyz" (without a "\n"
before the EOF) was rejected before and accepted after this commit.
So that line-comments are consistent, in that they either always or
never include the final "\n", they now never include the final "\n".
An input fragment (parsed with QUIRK_ALLOW_COMMENT_LINE) like
"//abc\n\t\t" was, before this commit, parsed as a 6 byte comment token
and a 2 byte other-filler token. That split is now 5+3.
2021-07-20 14:17:09 +10:00
Nigel Tao
40ffa334ee
Add more json allow_trailing_comments test cases
2021-07-18 23:27:56 +10:00
Nigel Tao
816475b285
Add "b" (for "binary") to fopen calls
...
Updates #50
2021-07-07 20:28:35 +10:00