Patrick Georgi
f563f32f82
Add SPDX identifier to license headers
...
SPDX is an ISO standard for describing licenses in a computer readable
format, which is useful when applying license compliance tools and the
like to source code.
In addition to ensuring that the Wuffs C distribution is properly
annotated to the benefit of projects using Wuffs and SPDX-supporting
tools, add it everywhere else where there's a license in this repo for
consistency, too.
2023-10-06 20:52:36 +02:00
Nigel Tao
1304ee6265
std/xxhash64: add new package
2023-10-06 13:10:47 +11:00
Nigel Tao
74a6ea2fcd
all: relicense from Apache2 to dual Apache2/MIT
...
The LICENSE has changed from a single license (Apache2) to a dual
license (Apache2 or MIT, at your option).
If you've previously used Wuffs under the Apache2 license, you are able
to keep doing so. No further action required by you.
The two files listed below (previous releases) are exceptions, as they
are older snapshots, frozen in time. Their license has not changed:
release/c/wuffs-v0.2.c
release/c/wuffs-v0.3.c
Every name in the AUTHORS file, other than Google Inc., has signed
Google's CLA (Contributor License Agreement).
2023-10-06 10:00:59 +11:00
Nigel Tao
bec02d7c31
std/xxhash32: add new package
2023-10-05 19:08:22 +11:00
Nigel Tao
59aa09a7ee
script: fix wuffs_foo__bar::unique_ptr decls
2023-10-04 20:25:24 +11:00
Nigel Tao
8e42e01d3c
std/gif: remove the std/lzw dependency
...
name old speed new speed delta
wuffs_gif_decode_1k_bw/clang11 683MB/s ± 0% 682MB/s ± 0% ~ (p=0.690 n=5+5)
wuffs_gif_decode_1k_color_full_init/clang11 168MB/s ± 0% 184MB/s ± 0% +10.01% (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_part_init/clang11 204MB/s ± 0% 230MB/s ± 0% +12.77% (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/clang11 746MB/s ± 0% 819MB/s ± 0% +9.90% (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/clang11 200MB/s ± 0% 218MB/s ± 0% +8.97% (p=0.008 n=5+5)
wuffs_gif_decode_20k/clang11 246MB/s ± 0% 257MB/s ± 0% +4.33% (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/clang11 543MB/s ± 0% 562MB/s ± 0% +3.44% (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/clang11 210MB/s ± 0% 220MB/s ± 0% +4.90% (p=0.008 n=5+5)
wuffs_gif_decode_1000k_full_init/clang11 214MB/s ± 0% 224MB/s ± 0% +4.96% (p=0.008 n=5+5)
wuffs_gif_decode_1000k_part_init/clang11 214MB/s ± 0% 224MB/s ± 0% +4.98% (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/clang11 1.24GB/s ± 0% 1.29GB/s ± 0% +3.85% (p=0.008 n=5+5)
wuffs_gif_decode_1k_bw/gcc10 649MB/s ± 0% 588MB/s ± 0% -9.42% (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_full_init/gcc10 167MB/s ± 0% 198MB/s ± 0% +18.57% (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_part_init/gcc10 195MB/s ± 0% 251MB/s ± 0% +28.64% (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/gcc10 753MB/s ± 0% 871MB/s ± 0% +15.64% (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/gcc10 199MB/s ± 0% 233MB/s ± 0% +16.86% (p=0.008 n=5+5)
wuffs_gif_decode_20k/gcc10 258MB/s ± 0% 265MB/s ± 0% +2.93% (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/gcc10 560MB/s ± 0% 561MB/s ± 0% +0.19% (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/gcc10 221MB/s ± 0% 227MB/s ± 0% +2.65% (p=0.008 n=5+5)
wuffs_gif_decode_1000k_full_init/gcc10 227MB/s ± 0% 232MB/s ± 0% +2.29% (p=0.008 n=5+5)
wuffs_gif_decode_1000k_part_init/gcc10 227MB/s ± 0% 232MB/s ± 0% +2.28% (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/gcc10 1.29GB/s ± 0% 1.28GB/s ± 0% -0.22% (p=0.008 n=5+5)
2023-10-04 20:19:25 +11:00
Nigel Tao
268b959462
script: add print-jpeg-markers.go
...
Also make truncate-progressive-jpeg.go work with reset markers.
2023-09-10 18:12:55 +10:00
Nigel Tao
4f67db8842
script: confirm-matches-djpeg note truncated input
2023-08-27 21:17:57 +10:00
Nigel Tao
41d0c095c8
std/jpeg: implement block smoothing
...
"script/confirm-matches-djpeg.sh test/data/*.jpeg" is now all matches.
name old speed new speed delta
wuffs_jpeg_decode_19k_8bpp/clang11 369MB/s ± 0% 366MB/s ± 0% -0.79% (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/clang11 335MB/s ± 0% 302MB/s ± 0% -9.93% (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/clang11 1.01GB/s ± 0% 1.00GB/s ± 0% -1.07% (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/clang11 829MB/s ± 0% 820MB/s ± 0% -1.03% (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/clang11 903MB/s ± 0% 895MB/s ± 0% -0.93% (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/clang11 1.12GB/s ± 0% 1.11GB/s ± 0% -1.28% (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/clang11 906MB/s ± 0% 897MB/s ± 0% -0.93% (p=0.008 n=5+5)
wuffs_jpeg_decode_19k_8bpp/gcc10 350MB/s ± 0% 370MB/s ± 0% +5.54% (p=0.016 n=4+5)
wuffs_jpeg_decode_30k_24bpp_progressive/gcc10 334MB/s ± 0% 309MB/s ± 0% -7.46% (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/gcc10 924MB/s ± 0% 948MB/s ± 0% +2.61% (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/gcc10 745MB/s ± 0% 769MB/s ± 0% +3.25% (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/gcc10 813MB/s ± 0% 841MB/s ± 0% +3.41% (p=0.029 n=4+4)
wuffs_jpeg_decode_552k_24bpp_444/gcc10 1.00GB/s ± 0% 1.00GB/s ± 0% +0.25% (p=0.029 n=4+4)
wuffs_jpeg_decode_4002k_24bpp/gcc10 821MB/s ± 0% 846MB/s ± 0% +3.00% (p=0.008 n=5+5)
2023-08-19 17:16:51 +10:00
Nigel Tao
be9d3fcf0f
example/convert-to-nia: add -output-netpbm flag
2023-08-06 10:49:53 +10:00
Nigel Tao
dd29401137
std/jpeg: re-format generated IDCT code
2023-06-28 13:49:55 +10:00
Nigel Tao
97c4e85e0e
std/jpeg: add more-SIMD-like IDCT algorithm
...
This adds commented-out code that is equivalent to the existing IDCT
algorithm. It's slower as is (and hence commented out) but it is closer
to a follow-up commit's SIMD-optimized algorithm.
2023-06-28 13:45:25 +10:00
Nigel Tao
5b84fb54d8
script: add RUSTFLAGS to bench-rust-jpeg
...
Adding "RUSTFLAGS='-C target-cpu=native'" numbers to the previous
commit's numbers:
name speed
// Go 1.21
go_jpeg_decode_19k_8bpp 46.8MB/s ± 5%
go_jpeg_decode_30k_24bpp_progressive 55.8MB/s ± 5%
go_jpeg_decode_30k_24bpp_sequential 90.5MB/s ± 5%
go_jpeg_decode_77k_24bpp 75.8MB/s ± 2%
go_jpeg_decode_552k_24bpp_420 81.1MB/s ± 6%
go_jpeg_decode_552k_24bpp_444 83.0MB/s ± 5%
go_jpeg_decode_4002k_24bpp 91.3MB/s ± 4%
// Rust 1.63, default configuration
rust_jpeg_decode_image_19k_8bpp 153MB/s ± 3%
rust_jpeg_decode_image_30k_24bpp_progressive 51.1MB/s ± 3%
rust_jpeg_decode_image_30k_24bpp_sequential 107MB/s ± 6%
rust_jpeg_decode_image_77k_24bpp 118MB/s ± 2%
rust_jpeg_decode_image_552k_24bpp_420 183MB/s ± 3%
rust_jpeg_decode_image_552k_24bpp_444 181MB/s ± 4%
rust_jpeg_decode_image_4002k_24bpp 258MB/s ± 3%
// Rust 1.63, RUSTFLAGS='-C target-cpu=native'
rust_jpeg_decode_image_19k_8bpp 158MB/s ± 1%
rust_jpeg_decode_image_30k_24bpp_progressive 54.4MB/s ± 3%
rust_jpeg_decode_image_30k_24bpp_sequential 137MB/s ± 6%
rust_jpeg_decode_image_77k_24bpp 130MB/s ± 1%
rust_jpeg_decode_image_552k_24bpp_420 211MB/s ± 7%
rust_jpeg_decode_image_552k_24bpp_444 201MB/s ± 4%
rust_jpeg_decode_image_4002k_24bpp 280MB/s ± 0%
// Wuffs, clang 14.0
wuffs_jpeg_decode_19k_8bpp/clang14 177MB/s ± 0%
wuffs_jpeg_decode_30k_24bpp_progressive/clang14 191MB/s ± 0%
wuffs_jpeg_decode_30k_24bpp_sequential/clang14 339MB/s ± 0%
wuffs_jpeg_decode_77k_24bpp/clang14 286MB/s ± 0%
wuffs_jpeg_decode_552k_24bpp_420/clang14 298MB/s ± 0%
wuffs_jpeg_decode_552k_24bpp_444/clang14 369MB/s ± 0%
wuffs_jpeg_decode_4002k_24bpp/clang14 297MB/s ± 0%
// Wuffs, gcc 12.2
wuffs_jpeg_decode_19k_8bpp/gcc12 160MB/s ± 0%
wuffs_jpeg_decode_30k_24bpp_progressive/gcc12 208MB/s ± 1%
wuffs_jpeg_decode_30k_24bpp_sequential/gcc12 400MB/s ± 1%
wuffs_jpeg_decode_77k_24bpp/gcc12 292MB/s ± 0%
wuffs_jpeg_decode_552k_24bpp_420/gcc12 305MB/s ± 0%
wuffs_jpeg_decode_552k_24bpp_444/gcc12 363MB/s ± 1%
wuffs_jpeg_decode_4002k_24bpp/gcc12 305MB/s ± 0%
2023-06-16 09:41:16 +10:00
Nigel Tao
32961a8413
script: add bench-rust-jpeg
...
This commit only adds Rust code, but it's as good a moment as any to
take a snapshot of how Wuffs' work-in-progress JPEG decoder performance
(which does not use SIMD optimizations yet) compares to Go and Rust.
The numbers in this commit were measured on different hardware (and
different C compiler versions) than other recent Wuffs commits, so the
absolute numbers aren't directly comparable across commits.
name speed
// Go 1.21
go_jpeg_decode_19k_8bpp 46.8MB/s ± 5%
go_jpeg_decode_30k_24bpp_progressive 55.8MB/s ± 5%
go_jpeg_decode_30k_24bpp_sequential 90.5MB/s ± 5%
go_jpeg_decode_77k_24bpp 75.8MB/s ± 2%
go_jpeg_decode_552k_24bpp_420 81.1MB/s ± 6%
go_jpeg_decode_552k_24bpp_444 83.0MB/s ± 5%
go_jpeg_decode_4002k_24bpp 91.3MB/s ± 4%
// Rust 1.63
rust_jpeg_decode_image_19k_8bpp 153MB/s ± 3%
rust_jpeg_decode_image_30k_24bpp_progressive 51.1MB/s ± 3%
rust_jpeg_decode_image_30k_24bpp_sequential 107MB/s ± 6%
rust_jpeg_decode_image_77k_24bpp 118MB/s ± 2%
rust_jpeg_decode_image_552k_24bpp_420 183MB/s ± 3%
rust_jpeg_decode_image_552k_24bpp_444 181MB/s ± 4%
rust_jpeg_decode_image_4002k_24bpp 258MB/s ± 3%
// Wuffs, clang 14.0
wuffs_jpeg_decode_19k_8bpp/clang14 177MB/s ± 0%
wuffs_jpeg_decode_30k_24bpp_progressive/clang14 191MB/s ± 0%
wuffs_jpeg_decode_30k_24bpp_sequential/clang14 339MB/s ± 0%
wuffs_jpeg_decode_77k_24bpp/clang14 286MB/s ± 0%
wuffs_jpeg_decode_552k_24bpp_420/clang14 298MB/s ± 0%
wuffs_jpeg_decode_552k_24bpp_444/clang14 369MB/s ± 0%
wuffs_jpeg_decode_4002k_24bpp/clang14 297MB/s ± 0%
// Wuffs, gcc 12.2
wuffs_jpeg_decode_19k_8bpp/gcc12 160MB/s ± 0%
wuffs_jpeg_decode_30k_24bpp_progressive/gcc12 208MB/s ± 1%
wuffs_jpeg_decode_30k_24bpp_sequential/gcc12 400MB/s ± 1%
wuffs_jpeg_decode_77k_24bpp/gcc12 292MB/s ± 0%
wuffs_jpeg_decode_552k_24bpp_420/gcc12 305MB/s ± 0%
wuffs_jpeg_decode_552k_24bpp_444/gcc12 363MB/s ± 1%
wuffs_jpeg_decode_4002k_24bpp/gcc12 305MB/s ± 0%
2023-06-14 22:55:09 +10:00
Nigel Tao
e1df1b2835
script: update print-jpeg-idct-code.go
...
Its output now once again matches the fragment in
std/jpeg/decode_idct_default.wuffs, which was recently hand-edited in
commit c0d7d7d0 "std/jpeg: remove decode_idct block-selector arg". This
commit's edit should have been part of that previous commit.
2023-06-14 16:12:48 +10:00
Nigel Tao
d6cc525059
std/jpeg: optimize IDCT when AC terms are zero
...
name old speed new speed delta
wuffs_jpeg_decode_19k_8bpp/clang11 199MB/s ± 0% 211MB/s ± 0% +5.69% (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/clang11 169MB/s ± 1% 176MB/s ± 0% +4.32% (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/clang11 269MB/s ± 0% 291MB/s ± 0% +7.89% (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/clang11 250MB/s ± 0% 254MB/s ± 0% +1.90% (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/clang11 258MB/s ± 0% 262MB/s ± 0% +1.51% (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/clang11 275MB/s ± 0% 356MB/s ± 0% +29.59% (p=0.016 n=5+4)
wuffs_jpeg_decode_4002k_24bpp/clang11 261MB/s ± 0% 263MB/s ± 1% +0.61% (p=0.008 n=5+5)
wuffs_jpeg_decode_19k_8bpp/gcc10 153MB/s ± 0% 165MB/s ± 0% +8.09% (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/gcc10 180MB/s ± 0% 197MB/s ± 0% +9.56% (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/gcc10 288MB/s ± 0% 337MB/s ± 0% +16.81% (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/gcc10 237MB/s ± 0% 245MB/s ± 0% +3.47% (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/gcc10 247MB/s ± 0% 256MB/s ± 0% +3.71% (p=0.016 n=4+5)
wuffs_jpeg_decode_552k_24bpp_444/gcc10 249MB/s ± 0% 348MB/s ± 0% +39.88% (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/gcc10 247MB/s ± 0% 254MB/s ± 0% +2.81% (p=0.008 n=5+5)
2023-06-08 22:03:46 +10:00
Nigel Tao
dcb5b0e1c7
test: add 4:4:4 (not just 4:2:0) JPEG test+bench
2023-06-05 22:25:22 +10:00
Nigel Tao
e5c92a0ce3
script: add bench-go-jpeg
2023-06-04 12:58:27 +10:00
Nigel Tao
27a3197727
script: add truncate-progressive-jpeg.go
...
"script/confirm-matches-djpeg.sh test/data/*.jpeg" shows differences on
"test/data/peacock.progressive.scan00[0-8].jpeg".
2023-06-01 22:32:37 +10:00
Nigel Tao
56fae16567
script: add confirm-matches-djpeg.sh
2023-05-18 10:17:08 +10:00
Nigel Tao
85b244aa49
std/netpbm: add new package
2023-05-16 16:29:58 +10:00
Nigel Tao
8cfe304f3c
std/jpeg: implement Inverse DCT
...
Updates #42
2023-05-08 21:51:47 +10:00
Nigel Tao
6e84987d33
std: change set_quirk_enabled to set_quirk
2023-04-14 21:42:15 +10:00
Nigel Tao
00d5e35865
floatconv: optimize parse_number_f64 fallback
...
The time taken running script/manual-test-parse-number-f64.cc on the
parse-number-fxx-test-data suite falls from 3.565s to 2.491s (a 1.43x
ratio; the inverse is 0.70 = 100% - 30%).
Fixes #113
2023-04-08 14:56:32 +10:00
Nigel Tao
05f0172b93
script/manual-test-truncated-input: re-enable WBMP
2023-04-07 16:06:09 +10:00
Nigel Tao
baac49dca7
script: add manual-test-truncated-input.cc
...
Updates #96
2023-03-27 21:15:38 +11:00
Nigel Tao
a12a807d0e
script/print-image-metadata: fix infinite loop
...
Fixes #107
2023-03-18 14:49:50 +11:00
Nigel Tao
be1f605108
Run gofmt
2022-08-21 21:41:06 +10:00
Nigel Tao
d0f0591f64
Add lib/litonlylzma
2022-06-24 13:22:36 +10:00
Nigel Tao
e1b43cd767
Add test/data/artificial-bzip2/abraca.txt.bz2
2022-06-08 14:04:09 +10:00
Nigel Tao
3ff4bf4674
Add script/print-image-metadata.cc
...
Updates #58
2022-06-03 14:15:13 +10:00
Nigel Tao
89411bc91d
Add lib/nie Go library for decoding NIE images
2022-05-28 16:26:59 +10:00
Nigel Tao
a56dbb3e3b
Tweak script/print-average-pixel.cc output
2022-05-26 14:28:30 +10:00
Nigel Tao
0f98004914
Add script/print-average-pixel.cc
2022-05-25 16:59:13 +10:00
Nigel Tao
68b76a8a56
Implement std/bzip2
2022-05-16 23:35:32 +10:00
Michael Mc Donnell
3fa3928c68
Fix Rust PNG benchmark
...
The Rust PNG benchmark no longer compiles. This is similar to the issue
that was fixed in pull request #68 for the Rust GIF benchmark. A new
version of the png crate was published that broke clean builds. I've
pinned the version to 0.17, which is the newest, and changed the code to
use the new API.
NOTE: Parts of the png crate documentation hasn't been updated to
correctly list the new transformation defaults. The documentation for
the `normalize_to_color8` method does say that the defaults changed from
version 0.16 to 0.17.
2022-01-17 13:36:18 -08:00
Michael Mc Donnell
d17fc6e6eb
Fix Rust GIF benchmark
...
The Rust GIF benchmark no longer compiles. The Cargo.toml file uses a
star to specify the gif crate version. That means a clean compile will
use the latest version even if it has breaking changes. Version 0.11 has
breaking changes which means the benchmark can no longer be compiled
from a clean start.
I fixed the benchmark by pinning the version to 0.11 and updating the
code to use the new API.
2022-01-14 11:01:11 -08:00
Nigel Tao
42de49a938
Have make-artificial.go mark incomplete Huffman
2022-01-09 10:49:38 +11:00
Nigel Tao
92ea631055
Have make-artificial.go check canonical Huffman
2022-01-09 10:41:31 +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
425eefeb35
Replace "go get" advice with "go install"
...
Fixes #62
2021-12-30 22:58:12 +11:00
Nigel Tao
1d8fb411ba
Let bench-history.sh handle compile/bench failures
2021-11-22 13:12:57 +11:00
Nigel Tao
fe15c471df
Use LANG=C sort for test/nia-checksums-of-data.txt
2021-11-19 17:09:10 +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
6c2a591e84
Let script/make-artificial.go generate PNG files
2021-11-16 11:08:04 +11:00
Nigel Tao
c19e3b1cab
Add script/extract-nia-frames.go
2021-11-11 11:47:08 +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
d557bc3836
Embiggen test/data/red-blue-gradient.*.png
2021-10-22 09:23:49 +11:00
Nigel Tao
6ea3144379
Add test/data/checkerboard.*.png
2021-10-20 09:58:42 +11:00