Commit Graph
47 Commits
Author SHA1 Message Date
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 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 d8c23a3a66 std/lzw: change set_literal_width to set_quirk 2023-04-15 09:59:40 +10:00
Nigel Tao 48e69da5af std/lzw: add "#truncated input" error
name                                         old speed      new speed      delta

wuffs_gif_decode_1k_bw/clang11                659MB/s ± 0%   748MB/s ± 0%  +13.43%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_full_init/clang11   182MB/s ± 0%   178MB/s ± 0%   -2.17%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_part_init/clang11   223MB/s ± 0%   219MB/s ± 0%   -2.00%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/clang11             799MB/s ± 0%   795MB/s ± 0%   -0.52%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/clang11          211MB/s ± 0%   210MB/s ± 0%   -0.47%  (p=0.008 n=5+5)
wuffs_gif_decode_20k/clang11                  250MB/s ± 1%   254MB/s ± 0%   +1.75%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/clang11      581MB/s ± 0%   568MB/s ± 0%   -2.09%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/clang11       221MB/s ± 0%   221MB/s ± 0%     ~     (p=0.690 n=5+5)
wuffs_gif_decode_1000k_full_init/clang11      222MB/s ± 0%   224MB/s ± 0%   +0.65%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k_part_init/clang11      223MB/s ± 0%   224MB/s ± 0%   +0.58%  (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/clang11      1.28GB/s ± 0%  1.30GB/s ± 0%   +1.45%  (p=0.008 n=5+5)

wuffs_gif_decode_1k_bw/gcc10                  595MB/s ± 0%   642MB/s ± 0%   +7.91%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_full_init/gcc10     168MB/s ± 0%   169MB/s ± 0%   +0.36%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color_part_init/gcc10     202MB/s ± 0%   203MB/s ± 0%   +0.46%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/gcc10               790MB/s ± 0%   798MB/s ± 0%   +1.04%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/gcc10            208MB/s ± 0%   210MB/s ± 0%   +1.00%  (p=0.008 n=5+5)
wuffs_gif_decode_20k/gcc10                    258MB/s ± 0%   266MB/s ± 0%   +3.08%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/gcc10        566MB/s ± 0%   577MB/s ± 0%   +1.83%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/gcc10         220MB/s ± 0%   227MB/s ± 0%   +3.03%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k_full_init/gcc10        223MB/s ± 0%   231MB/s ± 0%   +3.23%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k_part_init/gcc10        224MB/s ± 0%   231MB/s ± 0%   +3.14%  (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/gcc10        1.30GB/s ± 0%  1.32GB/s ± 0%   +1.70%  (p=0.008 n=5+5)

wuffs_lzw_decode_20k/clang11                  294MB/s ± 0%   321MB/s ± 0%   +9.11%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/clang11                 533MB/s ± 0%   560MB/s ± 0%   +5.13%  (p=0.008 n=5+5)

wuffs_lzw_decode_20k/gcc10                    271MB/s ± 0%   272MB/s ± 0%   +0.55%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/gcc10                   527MB/s ± 0%   521MB/s ± 0%   -1.31%  (p=0.008 n=5+5)

Updates #96
2023-01-31 20:18:53 +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 ad40102c5a Change mimic marker symbol from "!!" to "¿" 2021-03-25 22:22:27 +11:00
Nigel Tao 2f78804e62 Use more inclusive language 2021-01-23 19:50:47 +11:00
Nigel Tao b72dd16f9b Have test/* global variable names start with g_ 2020-03-27 17:12:38 +11:00
Nigel Tao c5c10e95b7 Remove some superfluous empty // comments 2020-03-18 21:58:19 +11:00
Nigel Tao 6892095998 Have C programs handle flags consistently 2020-03-03 11:25:18 +11:00
Nigel Tao 2914bae3b2 Re-format C function signatures 2020-02-26 09:40:30 +11:00
Nigel Tao 7b199116b0 Rename s/got/have/ in test/c 2020-02-24 21:23:58 +11:00
Nigel Tao 92a5bfd7ec Have various structs implement base.io_transformer 2020-01-11 22:25:31 +11:00
Nigel Tao 5f8d2da74f Rename decode_io_writer methods to transform_io 2020-01-11 10:19:25 +11:00
Nigel Tao 7f1572ca16 Add CHECK_STATUS testlib macro 2020-01-05 12:50:56 +11:00
Nigel Tao 77a5311c4b Add CHECK_STRING testlib macro 2020-01-05 11:19:22 +11:00
Nigel Tao e6db7f6a40 Make wuffs_base__status a struct 2020-01-05 10:48:20 +11:00
Nigel Tao c50f16e58b Separate status and status_msg local variables 2020-01-04 11:57:33 +11:00
Nigel Tao aa846d2dd7 Remove io_{reader,writer} C types 2019-07-06 17:23:34 +10:00
Nigel Tao e5f535db4f Remove set_{reader,writer}_limit in test/c code 2019-07-06 08:43:41 +10:00
Nigel Tao 881474be5a Remove "0 means no I/O limit" in tests 2019-07-06 08:41:46 +10:00
Nigel Tao 29311483e2 Add a std/lzw test for a 0 literal width 2019-06-22 08:37:41 +10:00
Nigel Tao 5bea867f72 Allow an LZW literal width of 1 2019-05-12 21:32:30 +10:00
Nigel Tao b41f121d20 Make "uninitialized internal buffers" explicit 2019-02-16 14:02:32 +11:00
Nigel Tao 37a5ead3b7 Have tests let the initializers memset to zero 2019-02-10 14:08:21 +11:00
Nigel Tao c9830ceb9a Add a workbuf argument to decode_io_writer 2019-02-02 15:35:05 +11:00
Nigel Tao 670b45be53 Add some "horizontal rule" comment lines 2019-02-02 08:10:08 +11:00
Nigel Tao 16e97281e2 Rename some decode methods to decode_io_writer 2019-01-12 10:29:41 +11:00
Nigel Tao 11d7629efd Fix a "release/c/etc.c" comment typo 2018-12-29 15:20:38 +11:00
Nigel Tao dd94ad3821 Rename z variable to status, in C code 2018-12-28 16:14:03 +11:00
Nigel Tao 04c91f1410 Generate .c files instead of .h files
The files' contents haven't changed (other than some relative #include's
that refer to other .c files).

Some build systems have difficulty recognizing .h files as things to be
compiled, instead of just things referred to by things to be compiled.
2018-12-22 15:29:00 +11:00
Nigel Tao 179f7afb9b Have lzw rewind in and flush out on a bad code
name                                    old speed      new speed      delta

wuffs_lzw_decode_20k/clang               214MB/s ± 0%   204MB/s ± 2%  -4.62%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/clang              369MB/s ± 0%   337MB/s ± 2%  -8.72%  (p=0.008 n=5+5)

wuffs_lzw_decode_20k/gcc                 232MB/s ± 1%   236MB/s ± 0%  +1.99%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/gcc                384MB/s ± 1%   396MB/s ± 1%  +3.00%  (p=0.008 n=5+5)

wuffs_gif_decode_1k_bw/clang             236MB/s ± 0%   230MB/s ± 0%  -2.67%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color/clang          118MB/s ± 1%   120MB/s ± 0%  +1.10%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/clang          562MB/s ± 0%   562MB/s ± 0%    ~     (p=0.690 n=5+5)
wuffs_gif_decode_10k_indexed/clang       149MB/s ± 0%   149MB/s ± 0%    ~     (p=0.421 n=5+5)
wuffs_gif_decode_100k_artificial/clang   487MB/s ± 0%   459MB/s ± 1%  -5.63%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/clang    183MB/s ± 0%   174MB/s ± 0%  -4.52%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k/clang             185MB/s ± 0%   177MB/s ± 1%  -4.61%  (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/clang   1.02GB/s ± 0%  0.97GB/s ± 0%  -5.30%  (p=0.008 n=5+5)

wuffs_gif_decode_1k_bw/gcc               250MB/s ± 0%   249MB/s ± 0%  -0.63%  (p=0.016 n=5+5)
wuffs_gif_decode_1k_color/gcc            133MB/s ± 0%   133MB/s ± 1%    ~     (p=0.151 n=5+5)
wuffs_gif_decode_10k_bgra/gcc            543MB/s ± 1%   543MB/s ± 0%    ~     (p=0.548 n=5+5)
wuffs_gif_decode_10k_indexed/gcc         167MB/s ± 1%   166MB/s ± 1%  -0.83%  (p=0.032 n=5+5)
wuffs_gif_decode_100k_artificial/gcc     465MB/s ± 1%   465MB/s ± 1%    ~     (p=0.841 n=5+5)
wuffs_gif_decode_100k_realistic/gcc      190MB/s ± 0%   190MB/s ± 1%    ~     (p=0.222 n=5+5)
wuffs_gif_decode_1000k/gcc               192MB/s ± 1%   193MB/s ± 0%    ~     (p=0.421 n=5+5)
wuffs_gif_decode_anim_screencap/gcc     1.00GB/s ± 1%  1.00GB/s ± 1%    ~     (p=0.841 n=5+5)
2018-12-22 14:45:42 +11:00
Nigel Tao 010df42d75 Have std/lzw always rewind excess bits
I'm not sure of the underlying reason for the lzw/gcc benchmark anomaly
(the gif/gcc numbers don't change), but it's the same mystery as commit
ecb3995 `Tweak how std/lzw yields "short read"`.

name                                    old speed      new speed      delta

wuffs_lzw_decode_20k/clang               223MB/s ± 0%   214MB/s ± 0%   -3.96%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/clang              385MB/s ± 0%   369MB/s ± 0%   -4.15%  (p=0.008 n=5+5)

wuffs_lzw_decode_20k/gcc                 186MB/s ± 1%   232MB/s ± 1%  +24.41%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/gcc                224MB/s ± 1%   384MB/s ± 1%  +71.81%  (p=0.008 n=5+5)

wuffs_gif_decode_1k_bw/clang             238MB/s ± 1%   236MB/s ± 0%     ~     (p=0.222 n=5+5)
wuffs_gif_decode_1k_color/clang          124MB/s ± 0%   118MB/s ± 1%   -4.75%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/clang          596MB/s ± 0%   562MB/s ± 0%   -5.71%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/clang       159MB/s ± 0%   149MB/s ± 0%   -6.42%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/clang   492MB/s ± 1%   487MB/s ± 0%   -0.98%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/clang    192MB/s ± 0%   183MB/s ± 0%   -5.07%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k/clang             195MB/s ± 0%   185MB/s ± 0%   -4.93%  (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/clang   1.01GB/s ± 1%  1.02GB/s ± 0%   +1.25%  (p=0.008 n=5+5)

wuffs_gif_decode_1k_bw/gcc               247MB/s ± 0%   250MB/s ± 0%   +1.26%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color/gcc            131MB/s ± 2%   133MB/s ± 0%     ~     (p=0.151 n=5+5)
wuffs_gif_decode_10k_bgra/gcc            541MB/s ± 1%   543MB/s ± 1%     ~     (p=0.548 n=5+5)
wuffs_gif_decode_10k_indexed/gcc         167MB/s ± 0%   167MB/s ± 1%     ~     (p=0.730 n=4+5)
wuffs_gif_decode_100k_artificial/gcc     469MB/s ± 0%   465MB/s ± 1%   -0.78%  (p=0.016 n=4+5)
wuffs_gif_decode_100k_realistic/gcc      190MB/s ± 0%   190MB/s ± 0%   -0.34%  (p=0.032 n=4+5)
wuffs_gif_decode_1000k/gcc               193MB/s ± 1%   192MB/s ± 1%     ~     (p=0.556 n=4+5)
wuffs_gif_decode_anim_screencap/gcc      995MB/s ± 1%   995MB/s ± 1%     ~     (p=0.841 n=5+5)
2018-12-22 14:05:34 +11:00
Nigel Tao 3854ce3e89 Let test binaries run from any dir in the repo
Also spin out generate.WuffsRoot into its own package.
2018-11-03 08:46:31 +11:00
Nigel Tao 6cc954d7e1 Have tests return a "const char*" status 2018-09-22 08:43:56 +10:00
Nigel Tao 6fed251b40 Split an io_buffer's fields into data and meta 2018-09-15 08:45:50 +10:00
Nigel Tao b840c80040 Make the status type a const char*, not a struct 2018-08-12 16:05:14 +10:00
Nigel Tao 2a32a86a6c Make the status type a struct, not an int32_t 2018-08-11 13:27:29 +10:00
Nigel Tao fd43e777bc Have check_wuffs_version return a status code 2018-08-05 22:29:54 +10:00
Jimmy Casey 3c50ada2c6 Fixed Spelling. 2018-07-26 17:12:19 +00:00
Nigel Tao bc82e51371 Rename wuffs-unsupported-snapshot.h 2018-07-21 09:20:10 +10:00
Nigel Tao a0bafff465 Ship as a "single file C library" 2018-07-14 08:59:36 +10:00
Nigel Tao 6183aba9d7 Capitalize the $CC and $CXX environment variables 2018-06-30 10:43:26 +10:00
Nigel Tao 50a955317a Remove the WUFFS_FOO__STATUS_ETC names 2018-06-10 22:05:06 +10:00
Nigel Tao d770e879ab Remove the wuffs_foo__status types 2018-06-10 21:40:43 +10:00
Nigel Tao 43bb14e886 Redo the encoding of error codes 2018-06-10 21:22:41 +10:00
Nigel Tao 6d510bcfcb Spin out a std/lzw package 2018-06-02 14:15:09 +10:00