mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5ccd9e8e7 | ||
|
|
b0e9efff3f | ||
|
|
8b7f82142c | ||
|
|
b245252e1e | ||
|
|
bad2693efb | ||
|
|
be1f605108 |
No files matched your search
+14
-14
@@ -35,20 +35,20 @@
|
||||
// To quantify "much faster", on this one C file, this program was 80 times
|
||||
// faster than `clang-format`, even without a column limit:
|
||||
//
|
||||
// $ wc release/c/wuffs-v0.2.c
|
||||
// 11858 35980 431885 release/c/wuffs-v0.2.c
|
||||
// $ time dumbindent < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.008s
|
||||
// user 0m0.005s
|
||||
// sys 0m0.005s
|
||||
// $ time clang-format-9 < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.668s
|
||||
// user 0m0.618s
|
||||
// sys 0m0.032s
|
||||
// $ time clang-format-9 -style='{ColumnLimit: 0}' < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.641s
|
||||
// user 0m0.585s
|
||||
// sys 0m0.037s
|
||||
// $ wc release/c/wuffs-v0.2.c
|
||||
// 11858 35980 431885 release/c/wuffs-v0.2.c
|
||||
// $ time dumbindent < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.008s
|
||||
// user 0m0.005s
|
||||
// sys 0m0.005s
|
||||
// $ time clang-format-9 < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.668s
|
||||
// user 0m0.618s
|
||||
// sys 0m0.032s
|
||||
// $ time clang-format-9 -style='{ColumnLimit: 0}' < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.641s
|
||||
// user 0m0.585s
|
||||
// sys 0m0.037s
|
||||
//
|
||||
// More commentary is at:
|
||||
// https://godoc.org/github.com/google/wuffs/lib/dumbindent
|
||||
|
||||
+137
-137
@@ -33,7 +33,7 @@ https://github.com/google/wuffs/blob/main/doc/spec/rac-spec.md
|
||||
|
||||
Usage:
|
||||
|
||||
ractool [flags] [input_filename]
|
||||
ractool [flags] [input_filename]
|
||||
|
||||
If no input_filename is given, stdin is used. Either way, output is written to
|
||||
stdout.
|
||||
@@ -63,10 +63,10 @@ or temporary disk space.
|
||||
|
||||
Examples:
|
||||
|
||||
ractool -decode foo.rac | sha256sum
|
||||
ractool -decode -drange=400..500 foo.rac
|
||||
ractool -encode foo.dat > foo.rac
|
||||
ractool -encode -codec=zlib -dchunksize=256k foo.dat > foo.rac
|
||||
ractool -decode foo.rac | sha256sum
|
||||
ractool -decode -drange=400..500 foo.rac
|
||||
ractool -encode foo.dat > foo.rac
|
||||
ractool -encode -codec=zlib -dchunksize=256k foo.dat > foo.rac
|
||||
|
||||
The "400..500" flag value means the 100 bytes ranging from a DSpace offset
|
||||
(offset in terms of decompressed bytes, not compressed bytes) of 400
|
||||
@@ -79,42 +79,42 @@ Similarly, "1m" and "1M" both mean 1 mebibyte (1048576 bytes).
|
||||
|
||||
General Flags:
|
||||
|
||||
-decode
|
||||
whether to decode the input
|
||||
-encode
|
||||
whether to encode the input
|
||||
-quiet
|
||||
whether to suppress messages
|
||||
-decode
|
||||
whether to decode the input
|
||||
-encode
|
||||
whether to encode the input
|
||||
-quiet
|
||||
whether to suppress messages
|
||||
|
||||
Decode-Related Flags:
|
||||
|
||||
-drange
|
||||
the "i..j" range to decompress, "..8" means the first 8 bytes
|
||||
-singlethreaded
|
||||
whether to decode on a single execution thread
|
||||
-drange
|
||||
the "i..j" range to decompress, "..8" means the first 8 bytes
|
||||
-singlethreaded
|
||||
whether to decode on a single execution thread
|
||||
|
||||
Encode-Related Flags:
|
||||
|
||||
-cchunksize
|
||||
the chunk size (in CSpace)
|
||||
-codec
|
||||
the compression codec (default "zstd")
|
||||
-cpagesize
|
||||
the page size (in CSpace)
|
||||
-dchunksize
|
||||
the chunk size (in DSpace)
|
||||
-indexlocation
|
||||
the index location, "start" or "end" (default "start")
|
||||
-resources
|
||||
comma-separated list of resource files, such as shared dictionaries
|
||||
-tmpdir
|
||||
directory (e.g. $TMPDIR) for intermediate work; empty means in-memory
|
||||
-cchunksize
|
||||
the chunk size (in CSpace)
|
||||
-codec
|
||||
the compression codec (default "zstd")
|
||||
-cpagesize
|
||||
the page size (in CSpace)
|
||||
-dchunksize
|
||||
the chunk size (in DSpace)
|
||||
-indexlocation
|
||||
the index location, "start" or "end" (default "start")
|
||||
-resources
|
||||
comma-separated list of resource files, such as shared dictionaries
|
||||
-tmpdir
|
||||
directory (e.g. $TMPDIR) for intermediate work; empty means in-memory
|
||||
|
||||
Codecs:
|
||||
|
||||
lz4
|
||||
zlib
|
||||
zstd
|
||||
lz4
|
||||
zlib
|
||||
zstd
|
||||
|
||||
Only zlib is fully supported. The others will work for the flags' default
|
||||
values, but they (1) don't support -cchunksize, only -dchunksize, and (2) don't
|
||||
@@ -125,123 +125,123 @@ Installation:
|
||||
|
||||
Like any other implemented-in-Go program, to install the ractool program:
|
||||
|
||||
go install github.com/google/wuffs/cmd/ractool
|
||||
go install github.com/google/wuffs/cmd/ractool
|
||||
|
||||
Extended Example:
|
||||
|
||||
--------
|
||||
$ # Fetch and unzip the enwik8 test file, a sample of Wikipedia.
|
||||
$ wget http://mattmahoney.net/dc/enwik8.zip
|
||||
$ unzip enwik8.zip
|
||||
--------
|
||||
$ # Fetch and unzip the enwik8 test file, a sample of Wikipedia.
|
||||
$ wget http://mattmahoney.net/dc/enwik8.zip
|
||||
$ unzip enwik8.zip
|
||||
|
||||
$ # Also zstd-encode it, as a reference point. Using compression level 15,
|
||||
$ # instead of the default of 3, matches what ractool uses.
|
||||
$ zstd -15 enwik8
|
||||
$ # Also zstd-encode it, as a reference point. Using compression level 15,
|
||||
$ # instead of the default of 3, matches what ractool uses.
|
||||
$ zstd -15 enwik8
|
||||
|
||||
$ # Create a shared dictionary. Using zstd-the-program produces a
|
||||
$ # dictionary that is especially useful for zstd-the-format, but it can
|
||||
$ # also be used by other formats as a 'raw' prefix dictionary.
|
||||
$ zstd -15 --train -B64K --maxdict=32K -o dict.dat enwik8
|
||||
$ # Create a shared dictionary. Using zstd-the-program produces a
|
||||
$ # dictionary that is especially useful for zstd-the-format, but it can
|
||||
$ # also be used by other formats as a 'raw' prefix dictionary.
|
||||
$ zstd -15 --train -B64K --maxdict=32K -o dict.dat enwik8
|
||||
|
||||
$ # RAC-encode it with various codecs, with and without that dictionary.
|
||||
$ ractool -encode -codec=zlib -resources=dict.dat enwik8 > zlib.withdict.rac
|
||||
$ ractool -encode -codec=zlib enwik8 > zlib.sansdict.rac
|
||||
$ ractool -encode -codec=zstd -resources=dict.dat enwik8 > zstd.withdict.rac
|
||||
$ ractool -encode -codec=zstd enwik8 > zstd.sansdict.rac
|
||||
$ ractool -encode -codec=lz4 enwik8 > lz4.sansdict.rac
|
||||
$ # RAC-encode it with various codecs, with and without that dictionary.
|
||||
$ ractool -encode -codec=zlib -resources=dict.dat enwik8 > zlib.withdict.rac
|
||||
$ ractool -encode -codec=zlib enwik8 > zlib.sansdict.rac
|
||||
$ ractool -encode -codec=zstd -resources=dict.dat enwik8 > zstd.withdict.rac
|
||||
$ ractool -encode -codec=zstd enwik8 > zstd.sansdict.rac
|
||||
$ ractool -encode -codec=lz4 enwik8 > lz4.sansdict.rac
|
||||
|
||||
$ # The size overhead (comparing RAC+Xxx to Xxx) is about 0.2% (with) or
|
||||
$ # 4.8% (sans) for zlib/zip and about 13% (with) or 28% (sans) for zstd,
|
||||
$ # depending on whether we used a shared dictionary (with or sans).
|
||||
$ ls -l
|
||||
total 362080
|
||||
-rw-r----- 1 tao tao 32768 Oct 25 10:10 dict.dat
|
||||
-rw-r----- 1 tao tao 100000000 Jun 2 2011 enwik8
|
||||
-rw-r----- 1 tao tao 36445475 Sep 2 2011 enwik8.zip
|
||||
-rw-r----- 1 tao tao 29563109 Jun 2 2011 enwik8.zst
|
||||
-rw-r----- 1 tao tao 58813316 Oct 25 10:17 lz4.sansdict.rac
|
||||
-rw-r----- 1 tao tao 38185178 Oct 25 10:16 zlib.sansdict.rac
|
||||
-rw-r----- 1 tao tao 36505786 Oct 25 10:16 zlib.withdict.rac
|
||||
-rw-r----- 1 tao tao 37820491 Oct 25 10:17 zstd.sansdict.rac
|
||||
-rw-r----- 1 tao tao 33386395 Oct 25 10:17 zstd.withdict.rac
|
||||
$ # The size overhead (comparing RAC+Xxx to Xxx) is about 0.2% (with) or
|
||||
$ # 4.8% (sans) for zlib/zip and about 13% (with) or 28% (sans) for zstd,
|
||||
$ # depending on whether we used a shared dictionary (with or sans).
|
||||
$ ls -l
|
||||
total 362080
|
||||
-rw-r----- 1 tao tao 32768 Oct 25 10:10 dict.dat
|
||||
-rw-r----- 1 tao tao 100000000 Jun 2 2011 enwik8
|
||||
-rw-r----- 1 tao tao 36445475 Sep 2 2011 enwik8.zip
|
||||
-rw-r----- 1 tao tao 29563109 Jun 2 2011 enwik8.zst
|
||||
-rw-r----- 1 tao tao 58813316 Oct 25 10:17 lz4.sansdict.rac
|
||||
-rw-r----- 1 tao tao 38185178 Oct 25 10:16 zlib.sansdict.rac
|
||||
-rw-r----- 1 tao tao 36505786 Oct 25 10:16 zlib.withdict.rac
|
||||
-rw-r----- 1 tao tao 37820491 Oct 25 10:17 zstd.sansdict.rac
|
||||
-rw-r----- 1 tao tao 33386395 Oct 25 10:17 zstd.withdict.rac
|
||||
|
||||
$ # Check that the decompressed forms all match.
|
||||
$ cat enwik8 | sha256sum
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
$ unzip -p enwik8.zip | sha256sum
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
$ unzstd --stdout enwik8.zst | sha256sum
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
$ for f in *.rac; do ractool -decode $f | sha256sum; done
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
$ # Check that the decompressed forms all match.
|
||||
$ cat enwik8 | sha256sum
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
$ unzip -p enwik8.zip | sha256sum
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
$ unzstd --stdout enwik8.zst | sha256sum
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
$ for f in *.rac; do ractool -decode $f | sha256sum; done
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
2b49720ec4d78c3c9fabaee6e4179a5e997302b3a70029f30f2d582218c024a8 -
|
||||
|
||||
$ # Compare how long it takes to produce 8 bytes from the middle of
|
||||
$ # the decompressed file, which happens to be the word "Business".
|
||||
$ time unzip -p enwik8.zip | dd if=/dev/stdin status=none \
|
||||
> iflag=skip_bytes,count_bytes skip=50000000 count=8
|
||||
Business
|
||||
real 0m0.379s
|
||||
user 0m0.410s
|
||||
sys 0m0.080s
|
||||
$ time unzstd --stdout enwik8.zst | dd if=/dev/stdin status=none \
|
||||
> iflag=skip_bytes,count_bytes skip=50000000 count=8
|
||||
Business
|
||||
real 0m0.172s
|
||||
user 0m0.141s
|
||||
sys 0m0.103s
|
||||
$ time ractool -decode -drange=50000000..50000008 zstd.withdict.rac
|
||||
Business
|
||||
real 0m0.004s
|
||||
user 0m0.005s
|
||||
sys 0m0.001s
|
||||
$ # Compare how long it takes to produce 8 bytes from the middle of
|
||||
$ # the decompressed file, which happens to be the word "Business".
|
||||
$ time unzip -p enwik8.zip | dd if=/dev/stdin status=none \
|
||||
> iflag=skip_bytes,count_bytes skip=50000000 count=8
|
||||
Business
|
||||
real 0m0.379s
|
||||
user 0m0.410s
|
||||
sys 0m0.080s
|
||||
$ time unzstd --stdout enwik8.zst | dd if=/dev/stdin status=none \
|
||||
> iflag=skip_bytes,count_bytes skip=50000000 count=8
|
||||
Business
|
||||
real 0m0.172s
|
||||
user 0m0.141s
|
||||
sys 0m0.103s
|
||||
$ time ractool -decode -drange=50000000..50000008 zstd.withdict.rac
|
||||
Business
|
||||
real 0m0.004s
|
||||
user 0m0.005s
|
||||
sys 0m0.001s
|
||||
|
||||
$ # A RAC file's chunks can be decoded in parallel, unlike ZIP,
|
||||
$ # substantially reducing the real (wall clock) time taken even
|
||||
$ # though both of these files use DEFLATE (RFC 1951) compression.
|
||||
$ #
|
||||
$ # Comparing the -singlethreaded time suggests that zlib-the-library's
|
||||
$ # DEFLATE implementation is faster than unzip's.
|
||||
$ time unzip -p enwik8.zip > /dev/null
|
||||
real 0m0.711s
|
||||
user 0m0.690s
|
||||
sys 0m0.021s
|
||||
$ time ractool -decode -singlethreaded zlib.withdict.rac > /dev/null
|
||||
real 0m0.519s
|
||||
user 0m0.513s
|
||||
sys 0m0.017s
|
||||
$ time ractool -decode zlib.withdict.rac > /dev/null
|
||||
real 0m0.052s
|
||||
user 0m0.678s
|
||||
sys 0m0.036s
|
||||
$ # A RAC file's chunks can be decoded in parallel, unlike ZIP,
|
||||
$ # substantially reducing the real (wall clock) time taken even
|
||||
$ # though both of these files use DEFLATE (RFC 1951) compression.
|
||||
$ #
|
||||
$ # Comparing the -singlethreaded time suggests that zlib-the-library's
|
||||
$ # DEFLATE implementation is faster than unzip's.
|
||||
$ time unzip -p enwik8.zip > /dev/null
|
||||
real 0m0.711s
|
||||
user 0m0.690s
|
||||
sys 0m0.021s
|
||||
$ time ractool -decode -singlethreaded zlib.withdict.rac > /dev/null
|
||||
real 0m0.519s
|
||||
user 0m0.513s
|
||||
sys 0m0.017s
|
||||
$ time ractool -decode zlib.withdict.rac > /dev/null
|
||||
real 0m0.052s
|
||||
user 0m0.678s
|
||||
sys 0m0.036s
|
||||
|
||||
$ # A similar comparison can be made for Zstandard.
|
||||
$ time unzstd --stdout enwik8.zst > /dev/null
|
||||
real 0m0.203s
|
||||
user 0m0.187s
|
||||
sys 0m0.016s
|
||||
$ time ractool -decode -singlethreaded zstd.withdict.rac > /dev/null
|
||||
real 0m0.235s
|
||||
user 0m0.206s
|
||||
sys 0m0.033s
|
||||
$ time ractool -decode zstd.withdict.rac > /dev/null
|
||||
real 0m0.037s
|
||||
user 0m0.374s
|
||||
sys 0m0.080s
|
||||
$ # A similar comparison can be made for Zstandard.
|
||||
$ time unzstd --stdout enwik8.zst > /dev/null
|
||||
real 0m0.203s
|
||||
user 0m0.187s
|
||||
sys 0m0.016s
|
||||
$ time ractool -decode -singlethreaded zstd.withdict.rac > /dev/null
|
||||
real 0m0.235s
|
||||
user 0m0.206s
|
||||
sys 0m0.033s
|
||||
$ time ractool -decode zstd.withdict.rac > /dev/null
|
||||
real 0m0.037s
|
||||
user 0m0.374s
|
||||
sys 0m0.080s
|
||||
|
||||
$ # For reference, LZ4 numbers.
|
||||
$ time ractool -decode -singlethreaded lz4.sansdict.rac > /dev/null
|
||||
real 0m0.072s
|
||||
user 0m0.053s
|
||||
sys 0m0.021s
|
||||
$ time ractool -decode lz4.sansdict.rac > /dev/null
|
||||
real 0m0.024s
|
||||
user 0m0.097s
|
||||
sys 0m0.034s
|
||||
--------
|
||||
$ # For reference, LZ4 numbers.
|
||||
$ time ractool -decode -singlethreaded lz4.sansdict.rac > /dev/null
|
||||
real 0m0.072s
|
||||
user 0m0.053s
|
||||
sys 0m0.021s
|
||||
$ time ractool -decode lz4.sansdict.rac > /dev/null
|
||||
real 0m0.024s
|
||||
user 0m0.097s
|
||||
sys 0m0.034s
|
||||
--------
|
||||
*/
|
||||
package main
|
||||
|
||||
|
||||
+262
-204
@@ -5,20 +5,34 @@ below. Higher is better.
|
||||
|
||||
"Mimic" tests check that Wuffs' output mimics (i.e. exactly matches) other
|
||||
libraries' output. "Mimic" benchmarks give the numbers for those other
|
||||
libraries, as shipped with Debian. These were measured on a Debian Testing
|
||||
system as of October 2019, which meant these compiler versions:
|
||||
libraries, as shipped with Debian. These were measured on a Debian Bullseye
|
||||
system as of September 2022, which meant these compiler versions:
|
||||
|
||||
- clang/llvm 8.0.1
|
||||
- gcc 9.2.1
|
||||
- clang/llvm 11.0.1
|
||||
- gcc 10.2.1
|
||||
|
||||
and these "mimic" library versions, all written in C:
|
||||
and these popular "mimic" library versions, all written in C:
|
||||
|
||||
- libgif 5.1.4
|
||||
- zlib 1.2.11
|
||||
- libbz2 1.0.8
|
||||
- libgif 5.1.9
|
||||
- libpng 1.6.37
|
||||
- zlib 1.2.11 (we'll call this "ztl" or "zlib the library", as opposed to "zlib
|
||||
the format")
|
||||
|
||||
Unless otherwise stated, the numbers below were measured on an Intel x86\_64
|
||||
Broadwell, and were taken as of Wuffs git commit ffdce5ef "Have bench-rust-gif
|
||||
process animated / RGBA images".
|
||||
and these alternative "mimic" library versions, again all written in C:
|
||||
|
||||
- [libdeflate](https://github.com/ebiggers/libdeflate) 1.7.1
|
||||
- [libspng](https://github.com/randy408/libspng) 0.7.3
|
||||
- [lodepng](https://github.com/lvandeve/lodepng) 20220717
|
||||
- [miniz](https://github.com/richgel999/miniz) 2.2.0
|
||||
- [stb](https://github.com/nothings/stb) 2.27
|
||||
|
||||
Unless otherwise stated, the numbers below were taken as of Wuffs git commit
|
||||
315b2e52 "wuffs gen -version=0.3.0-rc.1", the first Wuffs v0.3 release
|
||||
candidate. As for the CPU model:
|
||||
|
||||
$ cat /proc/cpuinfo | grep model.name | uniq
|
||||
model name: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
|
||||
|
||||
|
||||
## Reproducing
|
||||
@@ -89,65 +103,110 @@ power management can be controlled with:
|
||||
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes are hashed.
|
||||
|
||||
name speed vs_mimic
|
||||
name speed vs_mimic
|
||||
|
||||
wuffs_adler32_10k/clang8 2.41GB/s 0.84x
|
||||
wuffs_adler32_100k/clang8 2.42GB/s 0.84x
|
||||
wuffs_adler32_10k/clang11 22.3 GB/s 6.4x
|
||||
wuffs_adler32_100k/clang11 26.4 GB/s 7.5x
|
||||
|
||||
wuffs_adler32_10k/gcc9 3.24GB/s 1.13x
|
||||
wuffs_adler32_100k/gcc9 3.24GB/s 1.12x
|
||||
wuffs_adler32_10k/gcc10 21.9 GB/s 6.3x
|
||||
wuffs_adler32_100k/gcc10 22.4 GB/s 6.4x
|
||||
|
||||
mimic_adler32_10k 2.87GB/s 1.00x
|
||||
mimic_adler32_100k 2.90GB/s 1.00x
|
||||
mimicztl_adler32_10k 3.50 GB/s 1.0x
|
||||
mimicztl_adler32_100k 3.52 GB/s 1.0x
|
||||
|
||||
mimiclibdeflate_adler32_10k 50.4 GB/s 14.4x
|
||||
mimiclibdeflate_adler32_100k 49.4 GB/s 14.0x
|
||||
|
||||
|
||||
# Bzip2
|
||||
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there are in the
|
||||
decoded output.
|
||||
|
||||
name speed vs_mimic
|
||||
|
||||
wuffs_bzip2_decode_10k/clang11 63.0 MB/s 1.86x
|
||||
wuffs_bzip2_decode_100k/clang11 48.9 MB/s 1.62x
|
||||
|
||||
wuffs_bzip2_decode_10k/gcc10 61.1 MB/s 1.81x
|
||||
wuffs_bzip2_decode_100k/gcc10 49.1 MB/s 1.62x
|
||||
|
||||
mimic_bzip2_decode_10k 33.8 MB/s 1.00x
|
||||
mimic_bzip2_decode_100k 30.2 MB/s 1.00x
|
||||
|
||||
|
||||
# CRC-32
|
||||
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes are hashed.
|
||||
|
||||
name speed vs_mimic
|
||||
name speed vs_mimic
|
||||
|
||||
wuffs_crc32_ieee_10k/clang8 2.85GB/s 2.11x
|
||||
wuffs_crc32_ieee_100k/clang8 2.87GB/s 2.13x
|
||||
wuffs_crc32_ieee_10k/clang11 14.7 GB/s 9.1x
|
||||
wuffs_crc32_ieee_100k/clang11 21.6 GB/s 13.3x
|
||||
|
||||
wuffs_crc32_ieee_10k/gcc9 3.38GB/s 2.50x
|
||||
wuffs_crc32_ieee_100k/gcc9 3.40GB/s 2.52x
|
||||
wuffs_crc32_ieee_10k/gcc10 14.9 GB/s 9.2x
|
||||
wuffs_crc32_ieee_100k/gcc10 23.8 GB/s 14.7x
|
||||
|
||||
mimic_crc32_ieee_10k 1.35GB/s 1.00x
|
||||
mimic_crc32_ieee_100k 1.35GB/s 1.00x
|
||||
mimicztl_crc32_ieee_10k 1.62 GB/s 1.0x
|
||||
mimicztl_crc32_ieee_100k 1.62 GB/s 1.0x
|
||||
|
||||
mimiclibdeflate_crc32_ieee_10k 24.6 GB/s 15.2x
|
||||
mimiclibdeflate_crc32_ieee_100k 25.4 GB/s 15.7x
|
||||
|
||||
|
||||
# Deflate
|
||||
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there in the
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there are in the
|
||||
decoded output.
|
||||
|
||||
The `full_init` vs `part_init` suffixes are whether
|
||||
[`WUFFS_INITIALIZE__LEAVE_INTERNAL_BUFFERS_UNINITIALIZED`](/doc/note/initialization.md#partial-zero-initialization)
|
||||
is unset or set.
|
||||
|
||||
name speed vs_mimic
|
||||
name speed vs_mimic
|
||||
|
||||
wuffs_deflate_decode_1k_full_init/clang8 160MB/s 0.74x
|
||||
wuffs_deflate_decode_1k_part_init/clang8 199MB/s 0.92x
|
||||
wuffs_deflate_decode_10k_full_init/clang8 255MB/s 0.94x
|
||||
wuffs_deflate_decode_10k_part_init/clang8 263MB/s 0.97x
|
||||
wuffs_deflate_decode_100k_just_one_read/clang8 306MB/s 0.93x
|
||||
wuffs_deflate_decode_100k_many_big_reads/clang8 250MB/s 0.98x
|
||||
wuffs_deflate_decode_1k_full_init/clang11 195 MB/s 0.81x
|
||||
wuffs_deflate_decode_1k_part_init/clang11 226 MB/s 0.93x
|
||||
wuffs_deflate_decode_10k_full_init/clang11 409 MB/s 1.41x
|
||||
wuffs_deflate_decode_10k_part_init/clang11 418 MB/s 1.47x
|
||||
wuffs_deflate_decode_100k_just_one_read/clang11 521 MB/s 1.48x
|
||||
wuffs_deflate_decode_100k_many_big_reads/clang11 330 MB/s 1.19x
|
||||
|
||||
wuffs_deflate_decode_1k_full_init/gcc9 164MB/s 0.76x
|
||||
wuffs_deflate_decode_1k_part_init/gcc9 207MB/s 0.95x
|
||||
wuffs_deflate_decode_10k_full_init/gcc9 247MB/s 0.91x
|
||||
wuffs_deflate_decode_10k_part_init/gcc9 254MB/s 0.94x
|
||||
wuffs_deflate_decode_100k_just_one_read/gcc9 333MB/s 1.01x
|
||||
wuffs_deflate_decode_100k_many_big_reads/gcc9 261MB/s 1.02x
|
||||
wuffs_deflate_decode_1k_full_init/gcc10 183 MB/s 0.76x
|
||||
wuffs_deflate_decode_1k_part_init/gcc10 217 MB/s 0.90x
|
||||
wuffs_deflate_decode_10k_full_init/gcc10 402 MB/s 1.39x
|
||||
wuffs_deflate_decode_10k_part_init/gcc10 414 MB/s 1.43x
|
||||
wuffs_deflate_decode_100k_just_one_read/gcc10 522 MB/s 1.48x
|
||||
wuffs_deflate_decode_100k_many_big_reads/gcc10 330 MB/s 1.19x
|
||||
|
||||
mimic_deflate_decode_1k 217MB/s 1.00x
|
||||
mimic_deflate_decode_10k 270MB/s 1.00x
|
||||
mimic_deflate_decode_100k_just_one_read 329MB/s 1.00x
|
||||
mimic_deflate_decode_100k_many_big_reads 256MB/s 1.00x
|
||||
mimicztl_deflate_decode_1k_full_init 241 MB/s 1.00x
|
||||
mimicztl_deflate_decode_10k_full_init 289 MB/s 1.00x
|
||||
mimicztl_deflate_decode_100k_just_one_read 352 MB/s 1.00x
|
||||
mimicztl_deflate_decode_100k_many_big_reads 277 MB/s 1.00x
|
||||
|
||||
32-bit ARMv7 (2012 era Samsung Exynos 5 Chromebook), Debian Stretch (2017):
|
||||
mimiclibdeflate_deflate_decode_1k_full_init 326 MB/s 1.35x
|
||||
mimiclibdeflate_deflate_decode_10k_full_init 503 MB/s 1.74x
|
||||
mimiclibdeflate_deflate_decode_100k_just_one_read 507 MB/s 1.44x
|
||||
|
||||
mimicminiz_deflate_decode_1k_full_init 204 MB/s 0.85x
|
||||
mimicminiz_deflate_decode_10k_full_init 252 MB/s 0.87x
|
||||
mimicminiz_deflate_decode_100k_just_one_read 287 MB/s 0.82x
|
||||
|
||||
go_deflate_decode_1k_full_init 71 MB/s 0.29x
|
||||
go_deflate_decode_10k_full_init 120 MB/s 0.42x
|
||||
go_deflate_decode_100k_just_one_read 135 MB/s 0.38x
|
||||
|
||||
rust_deflate_decode_1k_full_init 165 MB/s 0.68x
|
||||
rust_deflate_decode_10k_full_init 259 MB/s 0.90x
|
||||
rust_deflate_decode_100k_just_one_read 272 MB/s 0.77x
|
||||
|
||||
To reproduce the libdeflate or miniz numbers, look in
|
||||
`test/c/mimiclib/deflate-gzip-zlib.c`. For Go 1.19, run `go run main.go` in
|
||||
`script/bench-go-deflate`. For Rust 1.48 / flate2 1.0.24 / miniz\_oxide 0.5.3,
|
||||
run `cargo run --release` in `script/bench-rust-deflate`.
|
||||
|
||||
Historical (Wuffs v0.2; 2019) numbers for 32-bit ARMv7 (2012 era Samsung Exynos
|
||||
5 Chromebook), Debian Stretch (2017):
|
||||
|
||||
name speed vs_mimic
|
||||
|
||||
@@ -171,63 +230,6 @@ is unset or set.
|
||||
mimic_deflate_decode_100k_many_big_reads 90.0MB/s 1.00x
|
||||
|
||||
|
||||
## Deflate (C, miniz)
|
||||
|
||||
For comparison, here are [miniz](https://github.com/richgel999/miniz) 2.1.0's
|
||||
numbers.
|
||||
|
||||
name speed vs_mimic
|
||||
|
||||
miniz_deflate_decode_1k/clang8 174MB/s 0.80x
|
||||
miniz_deflate_decode_10k/clang8 245MB/s 0.91x
|
||||
miniz_deflate_decode_100k_just_one_read/clang8 309MB/s 0.94x
|
||||
|
||||
miniz_deflate_decode_1k/gcc9 158MB/s 0.73x
|
||||
miniz_deflate_decode_10k/gcc9 221MB/s 0.82x
|
||||
miniz_deflate_decode_100k_just_one_read/gcc9 250MB/s 0.76x
|
||||
|
||||
To reproduce these numbers, look in `test/c/mimiclib/deflate-gzip-zlib.c`.
|
||||
|
||||
|
||||
## Deflate (Go)
|
||||
|
||||
For comparison, here are Go 1.12.10's numbers, using Go's standard library's
|
||||
`compress/flate` package.
|
||||
|
||||
name speed vs_mimic
|
||||
|
||||
go_deflate_decode_1k 45.4MB/s 0.21x
|
||||
go_deflate_decode_10k 82.5MB/s 0.31x
|
||||
go_deflate_decode_100k 94.0MB/s 0.29x
|
||||
|
||||
To reproduce these numbers:
|
||||
|
||||
git clone https://github.com/google/wuffs.git
|
||||
cd wuffs/script/bench-go-deflate/
|
||||
go run main.go
|
||||
|
||||
|
||||
## Deflate (Rust)
|
||||
|
||||
For comparison, here are Rust 1.37.0's numbers, using the
|
||||
[alexcrichton/flate2-rs](https://github.com/alexcrichton/flate2-rs) and
|
||||
[Frommi/miniz_oxide](https://github.com/Frommi/miniz_oxide) crates, which [this
|
||||
file](https://github.com/sile/libflate/blob/77a1004edf6518a0badab7ce8837bc5338ff9bc3/README.md#an-informal-benchmark)
|
||||
suggests is the fastest pure-Rust Deflate decoder.
|
||||
|
||||
name speed vs_mimic
|
||||
|
||||
rust_deflate_decode_1k 104MB/s 0.48x
|
||||
rust_deflate_decode_10k 202MB/s 0.75x
|
||||
rust_deflate_decode_100k 218MB/s 0.66x
|
||||
|
||||
To reproduce these numbers:
|
||||
|
||||
git clone https://github.com/google/wuffs.git
|
||||
cd wuffs/script/bench-rust-deflate/
|
||||
cargo run --release
|
||||
|
||||
|
||||
# GIF
|
||||
|
||||
The `1k`, `10k`, etc. numbers are approximately how many pixels there are in
|
||||
@@ -245,42 +247,67 @@ is unset or set.
|
||||
The libgif library doesn't export any API for decode-to-BGRA or decode-to-RGBA,
|
||||
so there are no mimic numbers to compare to for the `bgra` suffix.
|
||||
|
||||
name speed vs_mimic
|
||||
name speed vs_mimic
|
||||
|
||||
wuffs_gif_decode_1k_bw/clang8 461MB/s 3.18x
|
||||
wuffs_gif_decode_1k_color_full_init/clang8 141MB/s 1.85x
|
||||
wuffs_gif_decode_1k_color_part_init/clang8 189MB/s 2.48x
|
||||
wuffs_gif_decode_10k_bgra/clang8 743MB/s n/a
|
||||
wuffs_gif_decode_10k_indexed/clang8 200MB/s 2.11x
|
||||
wuffs_gif_decode_20k/clang8 245MB/s 2.50x
|
||||
wuffs_gif_decode_100k_artificial/clang8 531MB/s 3.43x
|
||||
wuffs_gif_decode_100k_realistic/clang8 218MB/s 2.27x
|
||||
wuffs_gif_decode_1000k_full_init/clang8 221MB/s 2.25x
|
||||
wuffs_gif_decode_1000k_part_init/clang8 221MB/s 2.25x
|
||||
wuffs_gif_decode_anim_screencap/clang8 1.07GB/s 6.01x
|
||||
wuffs_gif_decode_1k_bw/clang11 758 MB/s 4.38x
|
||||
wuffs_gif_decode_1k_color_full_init/clang11 176 MB/s 1.96x
|
||||
wuffs_gif_decode_1k_color_part_init/clang11 213 MB/s 2.37x
|
||||
wuffs_gif_decode_10k_bgra/clang11 786 MB/s n/a
|
||||
wuffs_gif_decode_10k_indexed/clang11 208 MB/s 1.98x
|
||||
wuffs_gif_decode_20k/clang11 262 MB/s 2.47x
|
||||
wuffs_gif_decode_100k_artificial/clang11 580 MB/s 3.52x
|
||||
wuffs_gif_decode_100k_realistic/clang11 225 MB/s 2.18x
|
||||
wuffs_gif_decode_1000k_full_init/clang11 229 MB/s 2.16x
|
||||
wuffs_gif_decode_1000k_part_init/clang11 229 MB/s 2.16x
|
||||
wuffs_gif_decode_anim_screencap/clang11 1.31 GB/s 6.58x
|
||||
|
||||
wuffs_gif_decode_1k_bw/gcc9 478MB/s 3.30x
|
||||
wuffs_gif_decode_1k_color_full_init/gcc9 148MB/s 1.94x
|
||||
wuffs_gif_decode_1k_color_part_init/gcc9 194MB/s 2.54x
|
||||
wuffs_gif_decode_10k_bgra/gcc9 645MB/s n/a
|
||||
wuffs_gif_decode_10k_indexed/gcc9 203MB/s 2.14x
|
||||
wuffs_gif_decode_20k/gcc9 244MB/s 2.49x
|
||||
wuffs_gif_decode_100k_artificial/gcc9 532MB/s 3.43x
|
||||
wuffs_gif_decode_100k_realistic/gcc9 214MB/s 2.23x
|
||||
wuffs_gif_decode_1000k_full_init/gcc9 217MB/s 2.21x
|
||||
wuffs_gif_decode_1000k_part_init/gcc9 218MB/s 2.22x
|
||||
wuffs_gif_decode_anim_screencap/gcc9 1.11GB/s 6.24x
|
||||
wuffs_gif_decode_1k_bw/gcc10 659 MB/s 3.80x
|
||||
wuffs_gif_decode_1k_color_full_init/gcc10 175 MB/s 1.94x
|
||||
wuffs_gif_decode_1k_color_part_init/gcc10 202 MB/s 2.24x
|
||||
wuffs_gif_decode_10k_bgra/gcc10 768 MB/s n/a
|
||||
wuffs_gif_decode_10k_indexed/gcc10 202 MB/s 1.92x
|
||||
wuffs_gif_decode_20k/gcc10 250 MB/s 2.36x
|
||||
wuffs_gif_decode_100k_artificial/gcc10 564 MB/s 3.42x
|
||||
wuffs_gif_decode_100k_realistic/gcc10 217 MB/s 2.11x
|
||||
wuffs_gif_decode_1000k_full_init/gcc10 221 MB/s 2.08x
|
||||
wuffs_gif_decode_1000k_part_init/gcc10 221 MB/s 2.08x
|
||||
wuffs_gif_decode_anim_screencap/gcc10 1.31 GB/s 6.58x
|
||||
|
||||
mimic_gif_decode_1k_bw 145MB/s 1.00x
|
||||
mimic_gif_decode_1k_color 76.3MB/s 1.00x
|
||||
mimic_gif_decode_10k_indexed 94.9MB/s 1.00x
|
||||
mimic_gif_decode_20k 98.1MB/s 1.00x
|
||||
mimic_gif_decode_100k_artificial 155MB/s 1.00x
|
||||
mimic_gif_decode_100k_realistic 96.1MB/s 1.00x
|
||||
mimic_gif_decode_1000k 98.4MB/s 1.00x
|
||||
mimic_gif_decode_anim_screencap 178MB/s 1.00x
|
||||
mimic_gif_decode_1k_bw 173 MB/s 1.00x
|
||||
mimic_gif_decode_1k_color_full_init 90 MB/s 1.00x
|
||||
mimic_gif_decode_10k_indexed 105 MB/s 1.00x
|
||||
mimic_gif_decode_20k 106 MB/s 1.00x
|
||||
mimic_gif_decode_100k_artificial 165 MB/s 1.00x
|
||||
mimic_gif_decode_100k_realistic 103 MB/s 1.00x
|
||||
mimic_gif_decode_1000k_full_init 106 MB/s 1.00x
|
||||
mimic_gif_decode_anim_screencap 199 MB/s 1.00x
|
||||
|
||||
32-bit ARMv7 (2012 era Samsung Exynos 5 Chromebook), Debian Stretch (2017):
|
||||
go_gif_decode_1k_bw 167 MB/s 0.97x
|
||||
go_gif_decode_1k_color_full_init 63 MB/s 0.70x
|
||||
go_gif_decode_10k_bgra 216 MB/s n/a
|
||||
go_gif_decode_10k_indexed 92 MB/s 0.88x
|
||||
go_gif_decode_20k 102 MB/s 0.96x
|
||||
go_gif_decode_100k_artificial 202 MB/s 1.22x
|
||||
go_gif_decode_100k_realistic 102 MB/s 0.99x
|
||||
go_gif_decode_1000k_full_init 103 MB/s 0.97x
|
||||
go_gif_decode_anim_screencap 237 MB/s 1.19x
|
||||
|
||||
rust_gif_decode_1k_bw 362 MB/s 2.09x
|
||||
rust_gif_decode_1k_color_full_init 113 MB/s 1.26x
|
||||
rust_gif_decode_10k_bgra 333 MB/s n/a
|
||||
rust_gif_decode_10k_indexed 101 MB/s 0.96x
|
||||
rust_gif_decode_20k 119 MB/s 1.12x
|
||||
rust_gif_decode_100k_artificial 248 MB/s 1.50x
|
||||
rust_gif_decode_100k_realistic 113 MB/s 1.10x
|
||||
rust_gif_decode_1000k_full_init 115 MB/s 1.08x
|
||||
rust_gif_decode_anim_screencap 513 MB/s 2.58x
|
||||
|
||||
To reproduce the Go 1.19 numbers, run `go run main.go` in
|
||||
`script/bench-go-gif`. For Rust 1.48 / gif 0.11.4, run `cargo run --release` in
|
||||
`script/bench-rust-gif`.
|
||||
|
||||
Historical (Wuffs v0.2; 2019) numbers for 32-bit ARMv7 (2012 era Samsung Exynos
|
||||
5 Chromebook), Debian Stretch (2017):
|
||||
|
||||
name speed vs_mimic
|
||||
|
||||
@@ -318,106 +345,137 @@ so there are no mimic numbers to compare to for the `bgra` suffix.
|
||||
mimic_gif_decode_anim_screencap 60.3MB/s 1.00x
|
||||
|
||||
|
||||
## GIF (Go)
|
||||
|
||||
For comparison, here are Go 1.12.10's numbers, using Go's standard library's
|
||||
`image/gif` package.
|
||||
|
||||
name speed vs_mimic
|
||||
|
||||
go_gif_decode_1k_bw 107MB/s 0.74x
|
||||
go_gif_decode_1k_color 39.2MB/s 0.51x
|
||||
go_gif_decode_10k_bgra 117MB/s n/a
|
||||
go_gif_decode_10k_indexed 57.8MB/s 0.61x
|
||||
go_gif_decode_20k 67.2MB/s 0.69x
|
||||
go_gif_decode_100k_artificial 151MB/s 0.97x
|
||||
go_gif_decode_100k_realistic 67.2MB/s 0.70x
|
||||
go_gif_decode_1000k 68.1MB/s 0.69x
|
||||
go_gif_decode_anim_screencap 206MB/s 1.16x
|
||||
|
||||
To reproduce these numbers:
|
||||
|
||||
git clone https://github.com/google/wuffs.git
|
||||
cd wuffs/script/bench-go-gif/
|
||||
go run main.go
|
||||
|
||||
|
||||
## GIF (Rust)
|
||||
|
||||
For comparison, here are Rust 1.37.0's numbers, using the
|
||||
[image-rs/image-gif](https://github.com/image-rs/image-gif) crate, easily the
|
||||
top `crates.io` result for ["gif"](https://crates.io/search?q=gif).
|
||||
|
||||
name speed vs_mimic
|
||||
|
||||
rust_gif_decode_1k_bw 89.2MB/s 0.62x
|
||||
rust_gif_decode_1k_color 20.7MB/s 0.27x
|
||||
rust_gif_decode_10k_bgra 74.5MB/s n/a
|
||||
rust_gif_decode_10k_indexed 20.4MB/s 0.21x
|
||||
rust_gif_decode_20k 28.9MB/s 0.29x
|
||||
rust_gif_decode_100k_artificial 79.1MB/s 0.51x
|
||||
rust_gif_decode_100k_realistic 27.9MB/s 0.29x
|
||||
rust_gif_decode_1000k 27.9MB/s 0.28x
|
||||
rust_gif_decode_anim_screencap 144MB/s 0.81x
|
||||
|
||||
To reproduce these numbers:
|
||||
|
||||
git clone https://github.com/google/wuffs.git
|
||||
cd wuffs/script/bench-rust-gif/
|
||||
cargo run --release
|
||||
|
||||
|
||||
# Gzip (Deflate + CRC-32)
|
||||
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there in the
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there are in the
|
||||
decoded output.
|
||||
|
||||
name speed vs_mimic
|
||||
name speed vs_mimic
|
||||
|
||||
wuffs_gzip_decode_10k/clang8 238MB/s 1.05x
|
||||
wuffs_gzip_decode_100k/clang8 273MB/s 1.03x
|
||||
wuffs_gzip_decode_10k/clang11 420 MB/s 1.71x
|
||||
wuffs_gzip_decode_100k/clang11 527 MB/s 1.81x
|
||||
|
||||
wuffs_gzip_decode_10k/gcc9 239MB/s 1.06x
|
||||
wuffs_gzip_decode_100k/gcc9 297MB/s 1.12x
|
||||
wuffs_gzip_decode_10k/gcc10 427 MB/s 1.74x
|
||||
wuffs_gzip_decode_100k/gcc10 550 MB/s 1.89x
|
||||
|
||||
mimic_gzip_decode_10k 226MB/s 1.00x
|
||||
mimic_gzip_decode_100k 265MB/s 1.00x
|
||||
mimicztl_gzip_decode_10k 246 MB/s 1.00x
|
||||
mimicztl_gzip_decode_100k 291 MB/s 1.00x
|
||||
|
||||
mimiclibdeflate_gzip_decode_10k 494 MB/s 2.01x
|
||||
mimiclibdeflate_gzip_decode_100k 496 MB/s 1.70x
|
||||
|
||||
|
||||
# LZW
|
||||
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there in the
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there are in the
|
||||
decoded output.
|
||||
|
||||
The libgif library doesn't export its LZW decoder in its API, so there are no
|
||||
mimic numbers to compare to.
|
||||
|
||||
name speed vs_mimic
|
||||
name speed vs_mimic
|
||||
|
||||
wuffs_lzw_decode_20k/clang8 263MB/s n/a
|
||||
wuffs_lzw_decode_100k/clang8 438MB/s n/a
|
||||
wuffs_lzw_decode_20k/clang11 293 MB/s n/a
|
||||
wuffs_lzw_decode_100k/clang11 489 MB/s n/a
|
||||
|
||||
wuffs_lzw_decode_20k/gcc9 266MB/s n/a
|
||||
wuffs_lzw_decode_100k/gcc9 450MB/s n/a
|
||||
wuffs_lzw_decode_20k/gcc10 259 MB/s n/a
|
||||
wuffs_lzw_decode_100k/gcc10 516 MB/s n/a
|
||||
|
||||
|
||||
# PNG
|
||||
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there are in the
|
||||
decoded image. For example, the `test/data/harvesters.*` images are 1165 × 859,
|
||||
approximately 1000k pixels and hence 4000k bytes at 4 bytes per pixel.
|
||||
|
||||
The `full_init` vs `part_init` suffixes are whether
|
||||
[`WUFFS_INITIALIZE__LEAVE_INTERNAL_BUFFERS_UNINITIALIZED`](/doc/note/initialization.md#partial-zero-initialization)
|
||||
is unset or set.
|
||||
|
||||
libpng's "simplified API" doesn't provide a way to ignore the checksum. We copy
|
||||
the `verify_checksum` numbers for a 1.00x baseline.
|
||||
|
||||
name speed vs_mimic
|
||||
|
||||
wuffs_png_decode_image_19k_8bpp/clang11 279 MB/s 2.29x
|
||||
wuffs_png_decode_image_40k_24bpp/clang11 323 MB/s 2.20x
|
||||
wuffs_png_decode_image_77k_8bpp/clang11 984 MB/s 2.66x
|
||||
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang11 871 MB/s 3.01x
|
||||
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang11 837 MB/s 2.90x
|
||||
wuffs_png_decode_image_4002k_24bpp/clang11 331 MB/s 1.55x
|
||||
|
||||
wuffs_png_decode_image_19k_8bpp/gcc10 277 MB/s 2.27x
|
||||
wuffs_png_decode_image_40k_24bpp/gcc10 343 MB/s 2.33x
|
||||
wuffs_png_decode_image_77k_8bpp/gcc10 1.00 GB/s 2.70x
|
||||
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10 914 MB/s 3.16x
|
||||
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10 870 MB/s 3.01x
|
||||
wuffs_png_decode_image_4002k_24bpp/gcc10 353 MB/s 1.65x
|
||||
|
||||
mimiclibpng_png_decode_image_19k_8bpp 122 MB/s 1.00x
|
||||
mimiclibpng_png_decode_image_40k_24bpp 147 MB/s 1.00x
|
||||
mimiclibpng_png_decode_image_77k_8bpp 370 MB/s 1.00x
|
||||
mimiclibpng_png_decode_image_552k_32bpp_verify_checksum 289 MB/s 1.00x
|
||||
mimiclibpng_png_decode_image_4002k_24bpp 214 MB/s 1.00x
|
||||
|
||||
mimiclibspng_png_decode_image_19k_8bpp 125 MB/s 1.02x
|
||||
mimiclibspng_png_decode_image_40k_24bpp 155 MB/s 1.05x
|
||||
mimiclibspng_png_decode_image_77k_8bpp 384 MB/s 1.04x
|
||||
mimiclibspng_png_decode_image_552k_32bpp_ignore_checksum 461 MB/s 1.60x
|
||||
mimiclibspng_png_decode_image_552k_32bpp_verify_checksum 392 MB/s 1.36x
|
||||
mimiclibspng_png_decode_image_4002k_24bpp 225 MB/s 1.05x
|
||||
|
||||
mimiclodepng_png_decode_image_19k_8bpp 138 MB/s 1.13x
|
||||
mimiclodepng_png_decode_image_40k_24bpp 166 MB/s 1.13x
|
||||
mimiclodepng_png_decode_image_77k_8bpp 404 MB/s 1.09x
|
||||
mimiclodepng_png_decode_image_552k_32bpp_verify_checksum 258 MB/s 0.89x
|
||||
mimiclodepng_png_decode_image_4002k_24bpp 165 MB/s 0.77x
|
||||
|
||||
mimicstb_png_decode_image_19k_8bpp 150 MB/s 1.23x
|
||||
mimicstb_png_decode_image_40k_24bpp 166 MB/s 1.13x
|
||||
mimicstb_png_decode_image_77k_8bpp 443 MB/s 1.20x
|
||||
mimicstb_png_decode_image_552k_32bpp_ignore_checksum 288 MB/s 1.00x
|
||||
mimicstb_png_decode_image_4002k_24bpp 163 MB/s 0.76x
|
||||
|
||||
go_png_decode_image_19k_8bpp 92 MB/s 0.75x
|
||||
go_png_decode_image_40k_24bpp 107 MB/s 0.73x
|
||||
go_png_decode_image_77k_8bpp 207 MB/s 0.56x
|
||||
go_png_decode_image_552k_32bpp_verify_checksum 246 MB/s 0.85x
|
||||
go_png_decode_image_4002k_24bpp 116 MB/s 0.54x
|
||||
|
||||
rust_png_decode_image_19k_8bpp 187 MB/s 1.53x
|
||||
rust_png_decode_image_40k_24bpp 260 MB/s 1.77x
|
||||
rust_png_decode_image_77k_8bpp 330 MB/s 0.89x
|
||||
rust_png_decode_image_552k_32bpp_verify_checksum 299 MB/s 1.03x
|
||||
rust_png_decode_image_4002k_24bpp 264 MB/s 1.23x
|
||||
|
||||
To reproduce the Go 1.19 numbers, run `go run main.go` in
|
||||
`script/bench-go-png`. For Rust 1.48 / png 0.17.5 / deflate 1.0.0 /
|
||||
miniz\_oxide 0.5.3, run `cargo run --release` in `script/bench-rust-png`.
|
||||
|
||||
|
||||
# Zlib (Deflate + Adler-32)
|
||||
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there in the
|
||||
The `1k`, `10k`, etc. numbers are approximately how many bytes there are in the
|
||||
decoded output.
|
||||
|
||||
name speed vs_mimic
|
||||
name speed vs_mimic
|
||||
|
||||
wuffs_zlib_decode_10k/clang8 237MB/s 0.96x
|
||||
wuffs_zlib_decode_100k/clang8 272MB/s 0.92x
|
||||
wuffs_zlib_decode_10k/clang11 410 MB/s 1.53x
|
||||
wuffs_zlib_decode_100k/clang11 505 MB/s 1.56x
|
||||
|
||||
wuffs_zlib_decode_10k/gcc9 242MB/s 0.98x
|
||||
wuffs_zlib_decode_100k/gcc9 294MB/s 0.99x
|
||||
wuffs_zlib_decode_10k/gcc10 431 MB/s 1.61x
|
||||
wuffs_zlib_decode_100k/gcc10 548 MB/s 1.70x
|
||||
|
||||
mimic_zlib_decode_10k 247MB/s 1.00x
|
||||
mimic_zlib_decode_100k 296MB/s 1.00x
|
||||
mimicztl_zlib_decode_10k 268 MB/s 1.00x
|
||||
mimicztl_zlib_decode_100k 323 MB/s 1.00x
|
||||
|
||||
mimiclibdeflate_zlib_decode_10k 497 MB/s 1.85x
|
||||
mimiclibdeflate_zlib_decode_100k 499 MB/s 1.54x
|
||||
|
||||
mimicminiz_zlib_decode_10k 237 MB/s 0.88x
|
||||
mimicminiz_zlib_decode_100k 272 MB/s 0.84x
|
||||
|
||||
|
||||
---
|
||||
|
||||
Updated on December 2019.
|
||||
Updated on September 2022.
|
||||
+1
-4
@@ -2,11 +2,8 @@
|
||||
|
||||
Short term:
|
||||
|
||||
- [Image decode API for color spaces and gamma
|
||||
correction.](https://github.com/google/wuffs/issues/39)
|
||||
- [Image decode API for Region of
|
||||
Interest.](https://github.com/google/wuffs/issues/40)
|
||||
- [Decode APNG.](https://github.com/google/wuffs/issues/41)
|
||||
- [Decode JPEG.](https://github.com/google/wuffs/issues/42)
|
||||
- [Decode LZ4.](https://github.com/google/wuffs/issues/43)
|
||||
- [Decode RAC.](https://github.com/google/wuffs/issues/22)
|
||||
@@ -41,4 +38,4 @@ Long term:
|
||||
|
||||
---
|
||||
|
||||
Updated on March 2021.
|
||||
Updated on October 2022.
|
||||
@@ -125,7 +125,7 @@ func (g *gen) writeInitialLoadDerivedVar(b *buffer, n *a.Field) error {
|
||||
b.printf("%s%s* %s%s WUFFS_BASE__POTENTIALLY_UNUSED = NULL;\n", c, elem, io1Prefix, preName)
|
||||
b.printf("%s%s* %s%s WUFFS_BASE__POTENTIALLY_UNUSED = NULL;\n", c, elem, io2Prefix, preName)
|
||||
|
||||
b.printf("if (%s) {\n", preName)
|
||||
b.printf("if (%s && %s->data.ptr) {\n", preName, preName)
|
||||
|
||||
b.printf("%s%s = %s->data.ptr;\n", io0Prefix, preName, preName)
|
||||
b.printf("%s%s = %s%s + %s->%s;\n", io1Prefix, preName, io0Prefix, preName, preName, i1)
|
||||
@@ -149,8 +149,8 @@ func (g *gen) writeFinalSaveDerivedVar(b *buffer, n *a.Field) error {
|
||||
}
|
||||
preName := aPrefix + n.Name().Str(g.tm)
|
||||
|
||||
b.printf("if (%s) {\n%s->%s = ((size_t)(%s%s - %s->data.ptr));\n}\n",
|
||||
preName, preName, i1, iopPrefix, preName, preName)
|
||||
b.printf("if (%s && %s->data.ptr) {\n%s->%s = ((size_t)(%s%s - %s->data.ptr));\n}\n",
|
||||
preName, preName, preName, i1, iopPrefix, preName, preName)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
+82
-82
@@ -328,12 +328,12 @@ func (n *Raw) SetPackage(tm *t.Map, pkg t.ID) error {
|
||||
const MaxExprDepth = 255
|
||||
|
||||
// Expr is an expression, such as "i", "+j" or "k + l[m(n, o)].p":
|
||||
// - ID0: <0|operator|IDOpenParen|IDOpenBracket|IDDotDot|IDDot>
|
||||
// - ID2: <0|literal|ident>
|
||||
// - LHS: <nil|Expr>
|
||||
// - MHS: <nil|Expr>
|
||||
// - RHS: <nil|Expr|TypeExpr>
|
||||
// - List0: <Arg|Expr> function call args, assoc. op args or list members.
|
||||
// - ID0: <0|operator|IDOpenParen|IDOpenBracket|IDDotDot|IDDot>
|
||||
// - ID2: <0|literal|ident>
|
||||
// - LHS: <nil|Expr>
|
||||
// - MHS: <nil|Expr>
|
||||
// - RHS: <nil|Expr|TypeExpr>
|
||||
// - List0: <Arg|Expr> function call args, assoc. op args or list members.
|
||||
//
|
||||
// A zero ID0 means an identifier or literal in ID2, like `foo`, `42` or a
|
||||
// status literal like `"#foo"`.
|
||||
@@ -468,10 +468,10 @@ func NewExpr(flags Flags, operator t.ID, ident t.ID, lhs *Node, mhs *Node, rhs *
|
||||
|
||||
// Assert is "assert RHS via ID2(args)", "choose etc", "pre etc", "inv etc" or
|
||||
// "post etc":
|
||||
// - ID0: <IDAssert|IDChoose|IDPre|IDInv|IDPost>
|
||||
// - ID2: <"-string literal> reason
|
||||
// - RHS: <Expr>
|
||||
// - List0: <Arg> reason arguments
|
||||
// - ID0: <IDAssert|IDChoose|IDPre|IDInv|IDPost>
|
||||
// - ID2: <"-string literal> reason
|
||||
// - RHS: <Expr>
|
||||
// - List0: <Arg> reason arguments
|
||||
type Assert Node
|
||||
|
||||
func (n *Assert) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -513,8 +513,8 @@ func NewAssert(keyword t.ID, condition *Expr, reason t.ID, args []*Node) *Assert
|
||||
}
|
||||
|
||||
// Arg is "name:value".
|
||||
// - ID2: <ident> name
|
||||
// - RHS: <Expr> value
|
||||
// - ID2: <ident> name
|
||||
// - RHS: <Expr> value
|
||||
type Arg Node
|
||||
|
||||
func (n *Arg) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -530,9 +530,9 @@ func NewArg(name t.ID, value *Expr) *Arg {
|
||||
}
|
||||
|
||||
// Assign is "LHS = RHS" or "LHS op= RHS" or "RHS":
|
||||
// - ID0: operator
|
||||
// - LHS: <nil|Expr>
|
||||
// - RHS: <Expr>
|
||||
// - ID0: operator
|
||||
// - LHS: <nil|Expr>
|
||||
// - RHS: <Expr>
|
||||
type Assign Node
|
||||
|
||||
func (n *Assign) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -550,8 +550,8 @@ func NewAssign(operator t.ID, lhs *Expr, rhs *Expr) *Assign {
|
||||
}
|
||||
|
||||
// Var is "var ID2 LHS":
|
||||
// - ID2: name
|
||||
// - LHS: <TypeExpr>
|
||||
// - ID2: name
|
||||
// - LHS: <TypeExpr>
|
||||
type Var Node
|
||||
|
||||
func (n *Var) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -569,9 +569,9 @@ func NewVar(name t.ID, xType *TypeExpr) *Var {
|
||||
}
|
||||
|
||||
// Field is a "name : type" struct field:
|
||||
// - FlagsPrivateData is the initializer need not explicitly memset to zero.
|
||||
// - ID2: name
|
||||
// - LHS: <TypeExpr>
|
||||
// - FlagsPrivateData is the initializer need not explicitly memset to zero.
|
||||
// - ID2: name
|
||||
// - LHS: <TypeExpr>
|
||||
type Field Node
|
||||
|
||||
func (n *Field) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -590,11 +590,11 @@ func NewField(flags Flags, name t.ID, xType *TypeExpr) *Field {
|
||||
|
||||
// IOManip is "io_bind (io:LHS, data:MHS, history_position:RHS) { List2 }" or
|
||||
// "io_limit (io:LHS, limit:MHS) { List2 }":
|
||||
// - ID0: <IDIOBind|IDIOLimit>
|
||||
// - LHS: <Expr>
|
||||
// - MHS: <Expr>
|
||||
// - RHS: <Expr>
|
||||
// - List2: <Statement> body
|
||||
// - ID0: <IDIOBind|IDIOLimit>
|
||||
// - LHS: <Expr>
|
||||
// - MHS: <Expr>
|
||||
// - RHS: <Expr>
|
||||
// - List2: <Statement> body
|
||||
type IOManip Node
|
||||
|
||||
func (n *IOManip) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -617,16 +617,16 @@ func NewIOManip(keyword t.ID, io *Expr, arg1 *Expr, historyPosition *Expr, body
|
||||
|
||||
// Iterate is
|
||||
// "iterate.ID1 (assigns)(length:ID2, advance:ID0, unroll:LHS), List1 { List2 } else RHS":
|
||||
// - FlagsHasBreak is the iterate has an explicit break
|
||||
// - FlagsHasContinue is the iterate has an explicit continue
|
||||
// - ID0: advance
|
||||
// - ID1: <0|label>
|
||||
// - ID2: length
|
||||
// - LHS: <Expr> unroll
|
||||
// - RHS: <nil|Iterate>
|
||||
// - List0: <Assign> assigns
|
||||
// - List1: <Assert> asserts
|
||||
// - List2: <Statement> body
|
||||
// - FlagsHasBreak is the iterate has an explicit break
|
||||
// - FlagsHasContinue is the iterate has an explicit continue
|
||||
// - ID0: advance
|
||||
// - ID1: <0|label>
|
||||
// - ID2: length
|
||||
// - LHS: <Expr> unroll
|
||||
// - RHS: <nil|Iterate>
|
||||
// - List0: <Assign> assigns
|
||||
// - List1: <Assert> asserts
|
||||
// - List2: <Statement> body
|
||||
type Iterate Node
|
||||
|
||||
func (n *Iterate) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -661,12 +661,12 @@ func NewIterate(label t.ID, assigns []*Node, length t.ID, advance t.ID, unroll t
|
||||
}
|
||||
|
||||
// While is "while.ID1 MHS, List1 { List2 } endwhile.ID1":
|
||||
// - FlagsHasBreak is the while has an explicit break
|
||||
// - FlagsHasContinue is the while has an explicit continue
|
||||
// - ID1: <0|label>
|
||||
// - MHS: <Expr>
|
||||
// - List1: <Assert> asserts
|
||||
// - List2: <Statement> body
|
||||
// - FlagsHasBreak is the while has an explicit break
|
||||
// - FlagsHasContinue is the while has an explicit continue
|
||||
// - ID1: <0|label>
|
||||
// - MHS: <Expr>
|
||||
// - List1: <Assert> asserts
|
||||
// - List2: <Statement> body
|
||||
//
|
||||
// TODO: should we be able to unroll while loops too?
|
||||
type While Node
|
||||
@@ -699,10 +699,10 @@ func NewWhile(label t.ID, condition *Expr, asserts []*Node) *While {
|
||||
}
|
||||
|
||||
// If is "if MHS { List2 } else RHS" or "if MHS { List2 } else { List1 }":
|
||||
// - MHS: <Expr>
|
||||
// - RHS: <nil|If>
|
||||
// - List1: <Statement> if-false body
|
||||
// - List2: <Statement> if-true body
|
||||
// - MHS: <Expr>
|
||||
// - RHS: <nil|If>
|
||||
// - List1: <Statement> if-false body
|
||||
// - List2: <Statement> if-true body
|
||||
type If Node
|
||||
|
||||
func (n *If) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -722,8 +722,8 @@ func NewIf(condition *Expr, bodyIfTrue []*Node, bodyIfFalse []*Node, elseIf *If)
|
||||
}
|
||||
|
||||
// Choose is "choose ID2: List0":
|
||||
// - ID2: name
|
||||
// - List0: <Expr> method names.
|
||||
// - ID2: name
|
||||
// - List0: <Expr> method names.
|
||||
type Choose Node
|
||||
|
||||
func (n *Choose) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -739,9 +739,9 @@ func NewChoose(name t.ID, args []*Node) *Choose {
|
||||
}
|
||||
|
||||
// Ret is "return LHS" or "yield LHS":
|
||||
// - FlagsReturnsError LHS is an error status
|
||||
// - ID0: <IDReturn|IDYield>
|
||||
// - LHS: <Expr>
|
||||
// - FlagsReturnsError LHS is an error status
|
||||
// - ID0: <IDReturn|IDYield>
|
||||
// - LHS: <Expr>
|
||||
type Ret Node
|
||||
|
||||
func (n *Ret) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -760,8 +760,8 @@ func NewRet(keyword t.ID, value *Expr) *Ret {
|
||||
}
|
||||
|
||||
// Jump is "break" or "continue", with an optional label, "break.label":
|
||||
// - ID0: <IDBreak|IDContinue>
|
||||
// - ID1: <0|label>
|
||||
// - ID0: <IDBreak|IDContinue>
|
||||
// - ID1: <0|label>
|
||||
type Jump Node
|
||||
|
||||
func (n *Jump) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -784,12 +784,12 @@ const MaxTypeExprDepth = 63
|
||||
|
||||
// TypeExpr is a type expression, such as "base.u32", "base.u32[..= 8]", "foo",
|
||||
// "pkg.bar", "ptr T", "array[8] T", "slice T" or "table T":
|
||||
// - ID0: <0|IDArray|IDFunc|IDNptr|IDPtr|IDSlice|IDTable>
|
||||
// - ID1: <0|pkg>
|
||||
// - ID2: <0|type name>
|
||||
// - LHS: <nil|Expr>
|
||||
// - MHS: <nil|Expr>
|
||||
// - RHS: <nil|TypeExpr>
|
||||
// - ID0: <0|IDArray|IDFunc|IDNptr|IDPtr|IDSlice|IDTable>
|
||||
// - ID1: <0|pkg>
|
||||
// - ID2: <0|type name>
|
||||
// - LHS: <nil|Expr>
|
||||
// - MHS: <nil|Expr>
|
||||
// - RHS: <nil|TypeExpr>
|
||||
//
|
||||
// An IDNptr or IDPtr ID0 means "nptr RHS" or "ptr RHS". RHS is the inner type.
|
||||
//
|
||||
@@ -958,14 +958,14 @@ func NewTypeExpr(decorator t.ID, pkg t.ID, name t.ID, alenRecvMin *Node, max *Ex
|
||||
const MaxBodyDepth = 255
|
||||
|
||||
// Func is "func ID2.ID0(LHS)(RHS) { List2 }":
|
||||
// - FlagsPublic is "pub" vs "pri"
|
||||
// - ID0: funcName
|
||||
// - ID1: <0|receiverPkg> (set by calling SetPackage)
|
||||
// - ID2: <0|receiverName>
|
||||
// - LHS: <Struct> in-parameters
|
||||
// - RHS: <Struct> out-parameters
|
||||
// - List1: <Assert> asserts
|
||||
// - List2: <Statement> body
|
||||
// - FlagsPublic is "pub" vs "pri"
|
||||
// - ID0: funcName
|
||||
// - ID1: <0|receiverPkg> (set by calling SetPackage)
|
||||
// - ID2: <0|receiverName>
|
||||
// - LHS: <Struct> in-parameters
|
||||
// - RHS: <Struct> out-parameters
|
||||
// - List1: <Assert> asserts
|
||||
// - List2: <Statement> body
|
||||
type Func Node
|
||||
|
||||
func (n *Func) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -1033,9 +1033,9 @@ func NewFunc(flags Flags, filename string, line uint32, receiverName t.ID, funcN
|
||||
}
|
||||
|
||||
// Status is "error (RHS) ID2" or "suspension (RHS) ID2":
|
||||
// - FlagsPublic is "pub" vs "pri"
|
||||
// - ID1: <0|pkg> (set by calling SetPackage)
|
||||
// - ID2: message
|
||||
// - FlagsPublic is "pub" vs "pri"
|
||||
// - ID1: <0|pkg> (set by calling SetPackage)
|
||||
// - ID2: message
|
||||
type Status Node
|
||||
|
||||
func (n *Status) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -1055,11 +1055,11 @@ func NewStatus(flags Flags, filename string, line uint32, message t.ID) *Status
|
||||
}
|
||||
|
||||
// Const is "const ID2 LHS = RHS":
|
||||
// - FlagsPublic is "pub" vs "pri"
|
||||
// - ID1: <0|pkg> (set by calling SetPackage)
|
||||
// - ID2: name
|
||||
// - LHS: <TypeExpr>
|
||||
// - RHS: <Expr>
|
||||
// - FlagsPublic is "pub" vs "pri"
|
||||
// - ID1: <0|pkg> (set by calling SetPackage)
|
||||
// - ID2: name
|
||||
// - LHS: <TypeExpr>
|
||||
// - RHS: <Expr>
|
||||
type Const Node
|
||||
|
||||
func (n *Const) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -1087,12 +1087,12 @@ func NewConst(flags Flags, filename string, line uint32, name t.ID, xType *TypeE
|
||||
const MaxImplements = 63
|
||||
|
||||
// Struct is "struct ID2? implements List0 (List1)":
|
||||
// - FlagsPublic is "pub" vs "pri"
|
||||
// - FlagsClassy is "ID2" vs "ID2?"
|
||||
// - ID1: <0|pkg> (set by calling SetPackage)
|
||||
// - ID2: name
|
||||
// - List0: <TypeExpr> implements
|
||||
// - List1: <Field> fields
|
||||
// - FlagsPublic is "pub" vs "pri"
|
||||
// - FlagsClassy is "ID2" vs "ID2?"
|
||||
// - ID1: <0|pkg> (set by calling SetPackage)
|
||||
// - ID2: name
|
||||
// - List0: <TypeExpr> implements
|
||||
// - List1: <Field> fields
|
||||
//
|
||||
// The question mark indicates a classy struct - one that supports methods,
|
||||
// especially coroutines.
|
||||
@@ -1120,7 +1120,7 @@ func NewStruct(flags Flags, filename string, line uint32, name t.ID, implements
|
||||
}
|
||||
|
||||
// Use is "use ID2":
|
||||
// - ID2: <"-string literal> package path
|
||||
// - ID2: <"-string literal> package path
|
||||
type Use Node
|
||||
|
||||
func (n *Use) AsNode() *Node { return (*Node)(n) }
|
||||
@@ -1138,7 +1138,7 @@ func NewUse(filename string, line uint32, path t.ID) *Use {
|
||||
}
|
||||
|
||||
// File is a file of source code:
|
||||
// - List0: <Const|Func|Status|Struct|Use> top-level declarations
|
||||
// - List0: <Const|Func|Status|Struct|Use> top-level declarations
|
||||
type File Node
|
||||
|
||||
func (n *File) AsNode() *Node { return (*Node)(n) }
|
||||
|
||||
+15
-12
@@ -201,16 +201,16 @@ type Token struct {
|
||||
}
|
||||
|
||||
// nBuiltInIDs is the number of built-in IDs. The packing is:
|
||||
// - 0x00 is invalid.
|
||||
// - 0x01 ..= 0x0F are squiggly punctuation, such as ";", "." and "?".
|
||||
// - 0x10 ..= 0x1F are squiggly bookends, such as "(", ")" and "]".
|
||||
// - 0x20 ..= 0x3F are squiggly assignments, such as "=" and "+=".
|
||||
// - 0x40 ..= 0x6F are operators, such as "+", "==" and "not".
|
||||
// - 0x70 ..= 0xAF are x-ops (disambiguation forms): unary vs binary "+".
|
||||
// - 0xB0 ..= 0xCF are keywords, such as "if" and "return".
|
||||
// - 0xD0 ..= 0xDF are type modifiers, such as "ptr" and "slice".
|
||||
// - 0xE0 ..= 0xFF are literals, such as "ok" and "true".
|
||||
// - 0x100 ..= 0x3FF are identifiers, such as "bool", "u32" and "read_u8".
|
||||
// - 0x00 is invalid.
|
||||
// - 0x01 ..= 0x0F are squiggly punctuation, such as ";", "." and "?".
|
||||
// - 0x10 ..= 0x1F are squiggly bookends, such as "(", ")" and "]".
|
||||
// - 0x20 ..= 0x3F are squiggly assignments, such as "=" and "+=".
|
||||
// - 0x40 ..= 0x6F are operators, such as "+", "==" and "not".
|
||||
// - 0x70 ..= 0xAF are x-ops (disambiguation forms): unary vs binary "+".
|
||||
// - 0xB0 ..= 0xCF are keywords, such as "if" and "return".
|
||||
// - 0xD0 ..= 0xDF are type modifiers, such as "ptr" and "slice".
|
||||
// - 0xE0 ..= 0xFF are literals, such as "ok" and "true".
|
||||
// - 0x100 ..= 0x3FF are identifiers, such as "bool", "u32" and "read_u8".
|
||||
//
|
||||
// Squiggly means a sequence of non-alpha-numeric bytes, such as "+" and "&=".
|
||||
const (
|
||||
@@ -1299,9 +1299,12 @@ func init() {
|
||||
// addXForms modifies table so that, if table[x] == y, then table[y] = y.
|
||||
//
|
||||
// For example, for the unaryForms table, the explicit entries are like:
|
||||
// IDPlus: IDXUnaryPlus,
|
||||
//
|
||||
// IDPlus: IDXUnaryPlus,
|
||||
//
|
||||
// and this function implicitly addes entries like:
|
||||
// IDXUnaryPlus: IDXUnaryPlus,
|
||||
//
|
||||
// IDXUnaryPlus: IDXUnaryPlus,
|
||||
func addXForms(table *[nBuiltInSymbolicIDs]ID) {
|
||||
implicitEntries := [nBuiltInSymbolicIDs]bool{}
|
||||
for _, y := range table {
|
||||
|
||||
@@ -27,57 +27,57 @@
|
||||
// repository was 80 times faster than `clang-format`, even without a column
|
||||
// limit:
|
||||
//
|
||||
// $ wc release/c/wuffs-v0.2.c
|
||||
// 11858 35980 431885 release/c/wuffs-v0.2.c
|
||||
// $ time dumbindent < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.008s
|
||||
// user 0m0.005s
|
||||
// sys 0m0.005s
|
||||
// $ time clang-format-9 < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.668s
|
||||
// user 0m0.618s
|
||||
// sys 0m0.032s
|
||||
// $ time clang-format-9 -style='{ColumnLimit: 0}' < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.641s
|
||||
// user 0m0.585s
|
||||
// sys 0m0.037s
|
||||
// $ wc release/c/wuffs-v0.2.c
|
||||
// 11858 35980 431885 release/c/wuffs-v0.2.c
|
||||
// $ time dumbindent < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.008s
|
||||
// user 0m0.005s
|
||||
// sys 0m0.005s
|
||||
// $ time clang-format-9 < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.668s
|
||||
// user 0m0.618s
|
||||
// sys 0m0.032s
|
||||
// $ time clang-format-9 -style='{ColumnLimit: 0}' < release/c/wuffs-v0.2.c > /dev/null
|
||||
// real 0m0.641s
|
||||
// user 0m0.585s
|
||||
// sys 0m0.037s
|
||||
//
|
||||
// Apart from some rare and largely uninteresting exceptions, the dumbindent
|
||||
// algorithm only considers:
|
||||
//
|
||||
// ∙ '{' and '}' curly braces,
|
||||
// ∙ '(' and ')' round parentheses,
|
||||
// ∙ '\n' line breaks,
|
||||
// ∙ ' ' spaces and '\t' tabs that start or end a line, and
|
||||
// ∙ strings, comments and preprocessor directives (in order to ignore any of
|
||||
// the above special characters within them),
|
||||
// ∙ '{' and '}' curly braces,
|
||||
// ∙ '(' and ')' round parentheses,
|
||||
// ∙ '\n' line breaks,
|
||||
// ∙ ' ' spaces and '\t' tabs that start or end a line, and
|
||||
// ∙ strings, comments and preprocessor directives (in order to ignore any of
|
||||
// the above special characters within them),
|
||||
//
|
||||
// Everything else is an opaque byte. Consider this input:
|
||||
//
|
||||
// for (i = 0; i < 3; i++) {
|
||||
// j = 0; // Ignore { in a comment.
|
||||
// if (i < j) { foo(); }
|
||||
// u = (v +
|
||||
// w);
|
||||
// }
|
||||
// for (i = 0; i < 3; i++) {
|
||||
// j = 0; // Ignore { in a comment.
|
||||
// if (i < j) { foo(); }
|
||||
// u = (v +
|
||||
// w);
|
||||
// }
|
||||
//
|
||||
// From the algorithm's point of view, this input is equivalent to:
|
||||
//
|
||||
// ....(.................).{
|
||||
// .................................
|
||||
// ...(.....).{....()..}
|
||||
// ....(...
|
||||
// .);
|
||||
// }
|
||||
// ....(.................).{
|
||||
// .................................
|
||||
// ...(.....).{....()..}
|
||||
// ....(...
|
||||
// .);
|
||||
// }
|
||||
//
|
||||
// The formatted output (using the default of 2 spaces per indent level) is:
|
||||
//
|
||||
// ....(.................).{
|
||||
// .................................
|
||||
// ...(.....).{....()..}
|
||||
// ....(...
|
||||
// .);
|
||||
// }
|
||||
// ....(.................).{
|
||||
// .................................
|
||||
// ...(.....).{....()..}
|
||||
// ....(...
|
||||
// .);
|
||||
// }
|
||||
//
|
||||
// Dumbindent adjusts lines horizontally (indenting) but not vertically (it
|
||||
// does not break or un-break lines, or collapse consecutive blank lines),
|
||||
@@ -103,9 +103,9 @@
|
||||
//
|
||||
// Similarly, dumbindent will not correct this mis-indentation:
|
||||
//
|
||||
// if (condition)
|
||||
// goto fail;
|
||||
// goto fail;
|
||||
// if (condition)
|
||||
// goto fail;
|
||||
// goto fail;
|
||||
//
|
||||
// Instead, when automatically or manually generating the input for dumbindent,
|
||||
// it is recommended to always emit curly braces (again, similar to `gofmt`
|
||||
|
||||
+14
-14
@@ -130,23 +130,23 @@ func (b *bitstream) take(nBits uint32) int32 {
|
||||
// 4, 4)" example from RFC 1951 section 3.2.2, the huffman struct is
|
||||
// initialized by calling:
|
||||
//
|
||||
// h.construct([]uint32{
|
||||
// 'A': 3, 'B': 3, 'C': 3, 'D': 3, 'E': 3, 'F': 2, 'G': 4, 'H': 4,
|
||||
// })
|
||||
// h.construct([]uint32{
|
||||
// 'A': 3, 'B': 3, 'C': 3, 'D': 3, 'E': 3, 'F': 2, 'G': 4, 'H': 4,
|
||||
// })
|
||||
//
|
||||
// which results in:
|
||||
//
|
||||
// huffman{
|
||||
// counts: [maxCodeBits + 1]uint32{
|
||||
// 2: 1, 3: 5, 4: 2,
|
||||
// },
|
||||
// symbols: [maxNumCodes]int32{
|
||||
// 0: 'F', 1: 'A', 2: 'B', 3: 'C', 4: 'D', 5: 'E', 6: 'G', 7: 'H',
|
||||
// },
|
||||
// lookUpTable: [256]uint32{
|
||||
// etc,
|
||||
// },
|
||||
// }
|
||||
// huffman{
|
||||
// counts: [maxCodeBits + 1]uint32{
|
||||
// 2: 1, 3: 5, 4: 2,
|
||||
// },
|
||||
// symbols: [maxNumCodes]int32{
|
||||
// 0: 'F', 1: 'A', 2: 'B', 3: 'C', 4: 'D', 5: 'E', 6: 'G', 7: 'H',
|
||||
// },
|
||||
// lookUpTable: [256]uint32{
|
||||
// etc,
|
||||
// },
|
||||
// }
|
||||
//
|
||||
// Continuing the example from the RFC, decoding "1110" from the bitstream will
|
||||
// produce the 'G' symbol.
|
||||
|
||||
+31
-28
@@ -1057,18 +1057,19 @@ func orOneNegOneNonNeg(neg IntRange, non IntRange) (z IntRange) {
|
||||
// possible xx in x and yy in y.
|
||||
//
|
||||
// Algorithm:
|
||||
// // If the two intervals overlap, the result is the minimum of the two
|
||||
// // intervals' maxima.
|
||||
// //
|
||||
// // This overlaps code path is just an optimization.
|
||||
// if overlaps(x, y) {
|
||||
// return min(xMax, yMax)
|
||||
// }
|
||||
// xFlip = bitFillRight(bitFillRight(xMax & ~xMin) & xMax & ~yMax)
|
||||
// xResult = yMax & ((xMax & ~xFlip) | (xFlip >> 1))
|
||||
// yFlip = bitFillRight(bitFillRight(yMax & ~yMin) & yMax & ~xMax)
|
||||
// yResult = xMax & ((yMax & ~yFlip) | (yFlip >> 1))
|
||||
// return max(xResult, yResult)
|
||||
//
|
||||
// // If the two intervals overlap, the result is the minimum of the two
|
||||
// // intervals' maxima.
|
||||
// //
|
||||
// // This overlaps code path is just an optimization.
|
||||
// if overlaps(x, y) {
|
||||
// return min(xMax, yMax)
|
||||
// }
|
||||
// xFlip = bitFillRight(bitFillRight(xMax & ~xMin) & xMax & ~yMax)
|
||||
// xResult = yMax & ((xMax & ~xFlip) | (xFlip >> 1))
|
||||
// yFlip = bitFillRight(bitFillRight(yMax & ~yMin) & yMax & ~xMax)
|
||||
// yResult = xMax & ((yMax & ~yFlip) | (yFlip >> 1))
|
||||
// return max(xResult, yResult)
|
||||
//
|
||||
// If xMin and yMin are both zero, the overlaps branch is taken.
|
||||
//
|
||||
@@ -1189,13 +1190,15 @@ func (x IntRange) andMax(y IntRange) *big.Int {
|
||||
// possible xx in x and yy in y.
|
||||
//
|
||||
// Algorithm:
|
||||
// droppable = bitFillRight((xMax & ~xMin) | (yMax & ~yMin))
|
||||
// available = xMax & yMax & droppable
|
||||
// return xMax | yMax | (bitFillRight(available) >> 1)
|
||||
//
|
||||
// droppable = bitFillRight((xMax & ~xMin) | (yMax & ~yMin))
|
||||
// available = xMax & yMax & droppable
|
||||
// return xMax | yMax | (bitFillRight(available) >> 1)
|
||||
//
|
||||
// If xMin and yMin are both zero, this simplifies to:
|
||||
// available = xMax & yMax
|
||||
// return xMax | yMax | (bitFillRight(available) >> 1)
|
||||
//
|
||||
// available = xMax & yMax
|
||||
// return xMax | yMax | (bitFillRight(available) >> 1)
|
||||
func (x IntRange) orMax(y IntRange) *big.Int {
|
||||
if x[0].Sign() == 0 && y[0].Sign() == 0 {
|
||||
i := big.NewInt(0)
|
||||
@@ -1257,17 +1260,17 @@ func (x IntRange) orMax(y IntRange) *big.Int {
|
||||
}
|
||||
|
||||
// bitFillRight modifies i to round up to the next power of 2 minus 1:
|
||||
// - If i is +0 then bitFillRight(i) sets i to 0.
|
||||
// - If i is +1 then bitFillRight(i) sets i to 1.
|
||||
// - If i is +2 then bitFillRight(i) sets i to 3.
|
||||
// - If i is +3 then bitFillRight(i) sets i to 3.
|
||||
// - If i is +4 then bitFillRight(i) sets i to 7.
|
||||
// - If i is +5 then bitFillRight(i) sets i to 7.
|
||||
// - If i is +6 then bitFillRight(i) sets i to 7.
|
||||
// - If i is +7 then bitFillRight(i) sets i to 7.
|
||||
// - If i is +8 then bitFillRight(i) sets i to 15.
|
||||
// - If i is +9 then bitFillRight(i) sets i to 15.
|
||||
// - Etc.
|
||||
// - If i is +0 then bitFillRight(i) sets i to 0.
|
||||
// - If i is +1 then bitFillRight(i) sets i to 1.
|
||||
// - If i is +2 then bitFillRight(i) sets i to 3.
|
||||
// - If i is +3 then bitFillRight(i) sets i to 3.
|
||||
// - If i is +4 then bitFillRight(i) sets i to 7.
|
||||
// - If i is +5 then bitFillRight(i) sets i to 7.
|
||||
// - If i is +6 then bitFillRight(i) sets i to 7.
|
||||
// - If i is +7 then bitFillRight(i) sets i to 7.
|
||||
// - If i is +8 then bitFillRight(i) sets i to 15.
|
||||
// - If i is +9 then bitFillRight(i) sets i to 15.
|
||||
// - Etc.
|
||||
func bitFillRight(i *big.Int) {
|
||||
if s := i.Sign(); s < 0 {
|
||||
panic("pre-condition failure")
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"github.com/google/wuffs/lib/litonlylzma"
|
||||
)
|
||||
|
||||
func ExampleRoundTrip() {
|
||||
func ExampleRoundTripLZMA() {
|
||||
original := []byte("Hello world.\n")
|
||||
compressed, err := litonlylzma.FileFormatLZMA.Encode(nil, original)
|
||||
if err != nil {
|
||||
@@ -31,15 +31,51 @@ func ExampleRoundTrip() {
|
||||
if err != nil {
|
||||
log.Fatalf("Decode: %v", err)
|
||||
}
|
||||
|
||||
for i, c := range compressed {
|
||||
if i > 0 {
|
||||
if (i & 15) > 0 {
|
||||
fmt.Printf(" ")
|
||||
}
|
||||
fmt.Printf("%02X", c)
|
||||
if ((i & 15) == 15) || ((i + 1) == len(compressed)) {
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
fmt.Printf("\n%s\n", recovered)
|
||||
fmt.Printf("%s", recovered)
|
||||
|
||||
// Output:
|
||||
// 5D 00 10 00 00 0D 00 00 00 00 00 00 00 00 24 19 49 86 E7 D5 E5 E2 56 ED 6A E6 0E 81 FE B8 00 00
|
||||
// 5D 00 10 00 00 0D 00 00 00 00 00 00 00 00 24 19
|
||||
// 49 86 E7 D5 E5 E2 56 ED 6A E6 0E 81 FE B8 00 00
|
||||
// Hello world.
|
||||
}
|
||||
|
||||
func ExampleRoundTripXz() {
|
||||
original := []byte("Hello world.\n")
|
||||
compressed, err := litonlylzma.FileFormatXz.Encode(nil, original)
|
||||
if err != nil {
|
||||
log.Fatalf("Encode: %v", err)
|
||||
}
|
||||
recovered, _, err := litonlylzma.FileFormatXz.Decode(nil, compressed)
|
||||
if err != nil {
|
||||
log.Fatalf("Decode: %v", err)
|
||||
}
|
||||
|
||||
for i, c := range compressed {
|
||||
if (i & 15) > 0 {
|
||||
fmt.Printf(" ")
|
||||
}
|
||||
fmt.Printf("%02X", c)
|
||||
if ((i & 15) == 15) || ((i + 1) == len(compressed)) {
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
fmt.Printf("%s", recovered)
|
||||
|
||||
// Output:
|
||||
// FD 37 7A 58 5A 00 00 01 69 22 DE 36 02 00 21 01
|
||||
// 00 00 00 00 37 27 97 D6 01 00 0C 48 65 6C 6C 6F
|
||||
// 20 77 6F 72 6C 64 2E 0A 00 00 00 00 8E F8 31 35
|
||||
// 00 01 21 0D 75 DC A8 D2 90 42 99 0D 01 00 00 00
|
||||
// 00 01 59 5A
|
||||
// Hello world.
|
||||
}
|
||||
+390
-102
@@ -14,39 +14,45 @@
|
||||
|
||||
// ----------------
|
||||
|
||||
// Package litonlylzma provides a decoder and encoder for Literal Only LZMA, a
|
||||
// subset of the LZMA compressed file format.
|
||||
// Package litonlylzma provides a decoder and encoder for Literal Only LZMA (or
|
||||
// Literal Only Xz), a subset of the LZMA (or Xz) compressed file formats.
|
||||
//
|
||||
// Subset means that the Encode method's output is a valid LZMA file and can be
|
||||
// decompressed by the tools available at https://www.7-zip.org/sdk.html (and
|
||||
// available as /usr/bin/lzma on a Debian system).
|
||||
// Subset means that:
|
||||
// - the Encode methods' output is a valid LZMA/Xz file and can be
|
||||
// decompressed by the tools available at https://www.7-zip.org/sdk.html or
|
||||
// https://tukaani.org/xz/ (and available as /usr/bin/lzma or /usr/bin/xz
|
||||
// on a Debian system).
|
||||
// - the Decode methods supports the Encode methods' output but they do not
|
||||
// support the full set of valid LZMA/Xz files.
|
||||
// - this codec's compression ratios are not as good as full LZMA/Xz
|
||||
// (although compression times are much faster). Moderate compression is
|
||||
// still achieved, through range coding, but there are no Lempel Ziv
|
||||
// back-references.
|
||||
//
|
||||
// Subset also means that this codec's compression ratios are not as good as
|
||||
// full-LZMA (although compression times are much faster). Moderate compression
|
||||
// is still achieved, through range coding, but there are no Lempel Ziv
|
||||
// back-references. The main benefit, compared to full-LZMA, is that this
|
||||
// implementation is much simpler and hence easier to study. It is only a few
|
||||
// hundred lines of code.
|
||||
// The main benefit, compared to full LZMA/Xz, is that this implementation is
|
||||
// much simpler and hence easier to study. It is around 800 lines of code.
|
||||
//
|
||||
// Example compression numbers on a small English text file (at
|
||||
// https://github.com/google/wuffs/blob/main/test/data/romeo.txt):
|
||||
// - romeo.txt is 942 bytes (100%).
|
||||
// - romeo.txt.litonlylzma is 659 bytes (70%).
|
||||
// - romeo.txt.xz is 644 bytes (68%).
|
||||
// - romeo.txt.lzma is 598 bytes (63%).
|
||||
// - romeo.txt.bz2 is 568 bytes (60%).
|
||||
// - romeo.txt.zst is 559 bytes (59%).
|
||||
// - romeo.txt.gz is 558 bytes (59%).
|
||||
// - romeo.txt is 942 bytes (100%).
|
||||
// - romeo.txt.litonlyxz is 708 bytes (75%).
|
||||
// - romeo.txt.litonlylzma is 659 bytes (70%).
|
||||
// - romeo.txt.xz is 644 bytes (68%).
|
||||
// - romeo.txt.lzma is 598 bytes (63%).
|
||||
// - romeo.txt.bz2 is 568 bytes (60%).
|
||||
// - romeo.txt.zst is 559 bytes (59%).
|
||||
// - romeo.txt.gz is 558 bytes (59%).
|
||||
//
|
||||
// Example compression numbers on a large archive of source code (at
|
||||
// https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.0.1.tar.xz):
|
||||
// - linux-5.0.1.tar is 863313920 bytes (100%).
|
||||
// - linux-5.0.1.tar.litonlylzma is 449726070 bytes (52%).
|
||||
// - linux-5.0.1.tar.gz is 164575959 bytes (19%).
|
||||
// - linux-5.0.1.tar.zst is 156959897 bytes (18%).
|
||||
// - linux-5.0.1.tar.bz2 is 125873134 bytes (15%).
|
||||
// - linux-5.0.1.tar.xz is 108233572 bytes (13%).
|
||||
// - linux-5.0.1.tar.lzma is 108216601 bytes (13%).
|
||||
// - linux-5.0.1.tar is 863313920 bytes (100%).
|
||||
// - linux-5.0.1.tar.litonlyxz is 454480932 bytes (53%).
|
||||
// - linux-5.0.1.tar.litonlylzma is 449726070 bytes (52%).
|
||||
// - linux-5.0.1.tar.gz is 164575959 bytes (19%).
|
||||
// - linux-5.0.1.tar.zst is 156959897 bytes (18%).
|
||||
// - linux-5.0.1.tar.bz2 is 125873134 bytes (15%).
|
||||
// - linux-5.0.1.tar.xz is 108233572 bytes (13%).
|
||||
// - linux-5.0.1.tar.lzma is 108216601 bytes (13%).
|
||||
//
|
||||
// The various tools (/usr/bin/gzip, /usr/bin/xz, etc) were all ran with their
|
||||
// default settings, not their "maximum compression" settings. This is why the
|
||||
@@ -55,13 +61,16 @@ package litonlylzma
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"hash/crc32"
|
||||
)
|
||||
|
||||
var (
|
||||
// ErrUnsupportedLZMAData is potentially returned by Decode.
|
||||
// ErrUnsupportedXxxData is potentially returned by Decode.
|
||||
ErrUnsupportedLZMAData = errors.New("litonlylzma: unsupported LZMA data")
|
||||
ErrUnsupportedXzData = errors.New("litonlylzma: unsupported Xz data")
|
||||
|
||||
errInvalidLZMAData = errors.New("litonlylzma: invalid LZMA data")
|
||||
errInvalidXzData = errors.New("litonlylzma: invalid Xz data")
|
||||
errUnexpectedEOF = errors.New("litonlylzma: unexpected EOF")
|
||||
errUnsupportedFileFormat = errors.New("litonlylzma: unsupported FileFormat")
|
||||
)
|
||||
@@ -79,13 +88,30 @@ const (
|
||||
pbMask = (1 << pb) - 1
|
||||
)
|
||||
|
||||
// lzmaHeader5 is the first 5 bytes of the LZMA header using the hard-coded
|
||||
// configuration for the subset-of-LZMA that this package supports. 0x5D
|
||||
// encodes the (lc, lp, pb) triple and the next four bytes hold the u32le
|
||||
// dictionary size. 0x1000 is LZMA's minimum dictionary size, although our
|
||||
// lzmaHeader5 is the first 5 bytes of an LZMA file using the hard-coded
|
||||
// configuration for the subset-of-LZMA that this package supports.
|
||||
//
|
||||
// 0x5D encodes the (lc, lp, pb) triple and the next four bytes hold the u32le
|
||||
// dictionary size. 0x00001000 is LZMA's minimum dictionary size, although our
|
||||
// subset-of-LZMA does not use a dictionary (also called a "sliding window").
|
||||
const lzmaHeader5 = "\x5D\x00\x10\x00\x00"
|
||||
|
||||
// xzHeader24 is the first 24 bytes of an Xz file using the hard-coded
|
||||
// configuration for the subset-of-Xz that this package supports.
|
||||
const xzHeader24 = "" +
|
||||
"\xFD\x37\x7A\x58\x5A\x00" + // Stream Header Magic Bytes.
|
||||
// ----
|
||||
"\x00\x01" + // Stream Flags (0x01 means CRC-32).
|
||||
"\x69\x22\xDE\x36" + // CRC-32 of the previous 2 bytes.
|
||||
// ----
|
||||
"\x02" + // Block Header Size (0x02 * 4 = 8 bytes).
|
||||
"\x00" + // Block Flags.
|
||||
"\x21" + // Filter ID (0x21 means LZMA2).
|
||||
"\x01" + // Size of Filter Properties (size of the next line).
|
||||
"\x00" + // Filter Properties (0x00 means an 0x1000 dictionary size).
|
||||
"\x00\x00\x00" + // Padding to 4-byte alignment.
|
||||
"\x37\x27\x97\xD6" // CRC-32 of the previous 8 bytes.
|
||||
|
||||
// rangeDecoder and rangeEncoder hold the state for range coding (also known as
|
||||
// arithmetic coding, roughly speaking). "range" is a keyword in Go, so in this
|
||||
// implementation, what's traditionally called the "range" fields are called
|
||||
@@ -120,13 +146,13 @@ const lzmaHeader5 = "\x5D\x00\x10\x00\x00"
|
||||
// digit is stashed as the pendingHead field. low is set to 8872, width is set
|
||||
// to (46055 - 38872) = 7183 and we progress until the width drops below 1000,
|
||||
// causing a 'zoom in' event. There are three cases:
|
||||
// - if low is less than 9000 (but starts with an '8'), we can emit the '3'
|
||||
// with confidence (and then stash '8' in the pendingHead field).
|
||||
// - if low overflows 9999, we can emit the '4' with confidence (and then stash
|
||||
// low's 'thousands digit' in the pendingHead field).
|
||||
// - if low is in 9000 ..= 9999 then we could still be unsure. Keep the '3'
|
||||
// pending but extend it so that there are two pending digits: '39'. If this
|
||||
// occurs again: '399', and so on.
|
||||
// - if low is less than 9000 (but starts with an '8'), we can emit the '3'
|
||||
// with confidence (and then stash '8' in the pendingHead field).
|
||||
// - if low overflows 9999, we can emit the '4' with confidence (and then
|
||||
// stash low's 'thousands digit' in the pendingHead field).
|
||||
// - if low is in 9000 ..= 9999 then we could still be unsure. Keep the '3'
|
||||
// pending but extend it so that there are two pending digits: '39'. If
|
||||
// this occurs again: '399', and so on.
|
||||
//
|
||||
// In all three cases, 'zooming in' causes us to shift out the most significant
|
||||
// digit of the low field. This method is therefore named shiftLow here, the
|
||||
@@ -260,39 +286,39 @@ func (p *prob) encodeBit(rEnc *rangeEncoder, bitValue uint32) {
|
||||
|
||||
// byteProbs hold probabilities for coding 8 bits (1 byte) of data. It is a 256
|
||||
// element array such that:
|
||||
// - The 0th element is unused.
|
||||
// - The 1st element holds the probability that the 7th bit (the highest, most
|
||||
// significant bit) is 0.
|
||||
// - The 2nd element holds the probability that the 6th bit is 0, conditional
|
||||
// on the high bit being 0.
|
||||
// - The 3rd element holds the probability that the 6th bit is 0, conditional
|
||||
// on the high bit being 1.
|
||||
// - The 4th element holds the probability that the 5th bit is 0, conditional
|
||||
// on the high two bits being 00.
|
||||
// - The 5th element holds the probability that the 5th bit is 0, conditional
|
||||
// on the high two bits being 01.
|
||||
// - The 6th element holds the probability that the 5th bit is 0, conditional
|
||||
// on the high two bits being 10.
|
||||
// - The 7th element holds the probability that the 5th bit is 0, conditional
|
||||
// on the high two bits being 11.
|
||||
// - The 8th element holds the probability that the 4th bit is 0, conditional
|
||||
// on the high three bits being 000.
|
||||
// - etc
|
||||
// - The 255th element holds the probability that the 0th bit (the lowest,
|
||||
// least significant bit) is 0, conditional on the high seven bits being
|
||||
// 1111111.
|
||||
// - The 0th element is unused.
|
||||
// - The 1st element holds the probability that the 7th bit (the highest, most
|
||||
// significant bit) is 0.
|
||||
// - The 2nd element holds the probability that the 6th bit is 0, conditional
|
||||
// on the high bit being 0.
|
||||
// - The 3rd element holds the probability that the 6th bit is 0, conditional
|
||||
// on the high bit being 1.
|
||||
// - The 4th element holds the probability that the 5th bit is 0, conditional
|
||||
// on the high two bits being 00.
|
||||
// - The 5th element holds the probability that the 5th bit is 0, conditional
|
||||
// on the high two bits being 01.
|
||||
// - The 6th element holds the probability that the 5th bit is 0, conditional
|
||||
// on the high two bits being 10.
|
||||
// - The 7th element holds the probability that the 5th bit is 0, conditional
|
||||
// on the high two bits being 11.
|
||||
// - The 8th element holds the probability that the 4th bit is 0, conditional
|
||||
// on the high three bits being 000.
|
||||
// - etc
|
||||
// - The 255th element holds the probability that the 0th bit (the lowest,
|
||||
// least significant bit) is 0, conditional on the high seven bits being
|
||||
// 1111111.
|
||||
//
|
||||
// Put another way, the 256 elements' value of N, as in "it's a probability for
|
||||
// the Nth bit", looks like this (when arranged in 8 rows of 32 elements):
|
||||
//
|
||||
// u7665555444444443333333333333333
|
||||
// 22222222222222222222222222222222
|
||||
// 11111111111111111111111111111111
|
||||
// 11111111111111111111111111111111
|
||||
// 00000000000000000000000000000000
|
||||
// 00000000000000000000000000000000
|
||||
// 00000000000000000000000000000000
|
||||
// 00000000000000000000000000000000
|
||||
// u7665555444444443333333333333333
|
||||
// 22222222222222222222222222222222
|
||||
// 11111111111111111111111111111111
|
||||
// 11111111111111111111111111111111
|
||||
// 00000000000000000000000000000000
|
||||
// 00000000000000000000000000000000
|
||||
// 00000000000000000000000000000000
|
||||
// 00000000000000000000000000000000
|
||||
//
|
||||
// The 'u' means that the 0th element is unused.
|
||||
type byteProbs [0x100]prob
|
||||
@@ -320,7 +346,7 @@ func (p *byteProbs) encodeByte(rEnc *rangeEncoder, byteValue byte) {
|
||||
}
|
||||
|
||||
// FileFormat is a compressed file format, either the original LZMA format
|
||||
// itself or something that builds on or varies that.
|
||||
// itself or something like Xz that builds on or varies that.
|
||||
//
|
||||
// Each valid FileFormatXxx value does not distinguish between the full file
|
||||
// format (as spoken by numerous Xxx software tools) and the subset-of-Xxx
|
||||
@@ -328,26 +354,27 @@ func (p *byteProbs) encodeByte(rEnc *rangeEncoder, byteValue byte) {
|
||||
// produce compressed data that is valid full-LZMA (and is also valid
|
||||
// subset-of-LZMA). FileFormatLZMA.Decode can decode subset-of-LZMA (but not
|
||||
// full-LZMA).
|
||||
//
|
||||
// This package currently defines only one valid FileFormatXxx value:
|
||||
// FileFormatLZMA. Future versions of this package could define e.g.
|
||||
// FileFormatLZMA2 or FileFormatXz such that FileFormatXz.Encode would produce
|
||||
// valid full-XZ data: a valid XZ file (that could be decoded by official XZ
|
||||
// tools) that used the LZMA compression filter, but elected not to use the
|
||||
// full capabilities of that filter (using LZ literals only, not matches).
|
||||
type FileFormat uint32
|
||||
|
||||
const (
|
||||
FileFormatInvalid = FileFormat(0)
|
||||
FileFormatLZMA = FileFormat(1)
|
||||
FileFormatXz = FileFormat(2)
|
||||
)
|
||||
|
||||
// Decode converts src from the Literal Only LZMA compressed file format,
|
||||
func (f FileFormat) String() string {
|
||||
switch f {
|
||||
case FileFormatLZMA:
|
||||
return "FileFormatLZMA"
|
||||
case FileFormatXz:
|
||||
return "FileFormatXz"
|
||||
}
|
||||
return "FileFormatInvalid"
|
||||
}
|
||||
|
||||
// Decode converts src from the Literal Only LZMA/Xz compressed file format,
|
||||
// appending the decoding to dst.
|
||||
//
|
||||
// f should be FileFormatLZMA but future versions of this package may support
|
||||
// other file formats.
|
||||
//
|
||||
// It is valid to pass a nil dst, like the way it's valid to pass nil to the
|
||||
// built-in append function.
|
||||
//
|
||||
@@ -356,14 +383,19 @@ const (
|
||||
// It can also return partial results. The appendedDst and remainingSrc return
|
||||
// values may be non-zero even if retErr is non-zero.
|
||||
//
|
||||
// It returns ErrUnsupportedLZMAData if the source bytes look like LZMA
|
||||
// formatted data that is outside the subset-of-LZMA that this package
|
||||
// implements.
|
||||
// It returns ErrUnsupportedXxxData if the source bytes look like Xxx formatted
|
||||
// data that is outside the subset-of-Xxx that this package implements.
|
||||
func (f FileFormat) Decode(dst []byte, src []byte) (appendedDst []byte, remainingSrc []byte, retErr error) {
|
||||
if f != FileFormatLZMA {
|
||||
return dst, nil, errUnsupportedFileFormat
|
||||
switch f {
|
||||
case FileFormatLZMA:
|
||||
return decodeLZMA(dst, src)
|
||||
case FileFormatXz:
|
||||
return decodeXz(dst, src)
|
||||
}
|
||||
return nil, nil, errUnsupportedFileFormat
|
||||
}
|
||||
|
||||
func decodeLZMA(dst []byte, src []byte) (appendedDst []byte, remainingSrc []byte, retErr error) {
|
||||
// LZMA consists of a 13 byte header and then at least a 5 byte payload
|
||||
// (range coded data). The 13 byte header is:
|
||||
// - 1 byte for the (lc, lp, pb) triple with max values (8, 4, 4),
|
||||
@@ -371,12 +403,7 @@ func (f FileFormat) Decode(dst []byte, src []byte) (appendedDst []byte, remainin
|
||||
// - 8 bytes i64le uncompressed size.
|
||||
if (len(src) < 18) || (src[0] >= (9 * 5 * 5)) {
|
||||
return dst, nil, errInvalidLZMAData
|
||||
} else if (src[0] != lzmaHeader5[0]) ||
|
||||
(src[1] != lzmaHeader5[1]) ||
|
||||
(src[2] != lzmaHeader5[2]) ||
|
||||
(src[3] != lzmaHeader5[3]) ||
|
||||
(src[4] != lzmaHeader5[4]) ||
|
||||
(src[13] != 0x00) {
|
||||
} else if string(src[:5]) != lzmaHeader5 {
|
||||
return dst, nil, ErrUnsupportedLZMAData
|
||||
}
|
||||
|
||||
@@ -390,12 +417,151 @@ func (f FileFormat) Decode(dst []byte, src []byte) (appendedDst []byte, remainin
|
||||
return dst, nil, ErrUnsupportedLZMAData
|
||||
}
|
||||
|
||||
return decodeRaw(dst, src[13:], size, ErrUnsupportedLZMAData)
|
||||
}
|
||||
|
||||
func decodeXz(dst []byte, src []byte) (appendedDst []byte, remainingSrc []byte, retErr error) {
|
||||
originalDstLen := len(dst)
|
||||
originalSrcLen := len(src)
|
||||
|
||||
// Decode the headers.
|
||||
if (len(src) < 24) || (string(src[:6]) != xzHeader24[:6]) {
|
||||
return dst, src, errInvalidXzData
|
||||
} else if string(src[6:24]) != xzHeader24[6:24] {
|
||||
return dst, src, ErrUnsupportedXzData
|
||||
}
|
||||
src = src[24:]
|
||||
|
||||
// Decode the payload as multiple chunks.
|
||||
for {
|
||||
if len(src) == 0 {
|
||||
return dst, src, errInvalidXzData
|
||||
|
||||
} else if src[0] == 0x00 { // No more chunks.
|
||||
src = src[1:]
|
||||
break
|
||||
|
||||
} else if src[0] == 0x01 { // Independent uncompressed chunk.
|
||||
if len(src) < 3 {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
uncompressedSize := (uint32(src[1]) << 8) + (uint32(src[2]) << 0) + 1
|
||||
src = src[3:]
|
||||
if uint64(uncompressedSize) > uint64(len(src)) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
dst = append(dst, src[:uncompressedSize]...)
|
||||
src = src[uncompressedSize:]
|
||||
|
||||
} else if src[0] == 0xE0 { // Independent LZMA chunk.
|
||||
if len(src) < 6 {
|
||||
return dst, src, errInvalidXzData
|
||||
} else if src[5] != 0x5D { // Like lzmaHeader5[0], this encodes lc=3, lp=0, pb=2.
|
||||
return dst, src, ErrUnsupportedXzData
|
||||
}
|
||||
uncompressedSize := (uint32(src[1]) << 8) + (uint32(src[2]) << 0) + 1
|
||||
compressedSize := (uint32(src[3]) << 8) + (uint32(src[4]) << 0) + 1
|
||||
src = src[6:]
|
||||
if uint64(compressedSize) > uint64(len(src)) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
lenSrc := len(src)
|
||||
dst, src, retErr = decodeRaw(dst, src, uint64(uncompressedSize), ErrUnsupportedXzData)
|
||||
if retErr != nil {
|
||||
return dst, src, retErr
|
||||
} else if lenSrc != (len(src) + int(compressedSize)) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
|
||||
} else {
|
||||
return dst, src, ErrUnsupportedXzData
|
||||
}
|
||||
}
|
||||
unpaddedSizeWant := uint64((originalSrcLen - 12) - len(src) + 4)
|
||||
for i := unpaddedSizeWant & 3; (i & 3) != 0; i++ {
|
||||
if (len(src) == 0) || (src[0] != 0x00) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
src = src[1:]
|
||||
}
|
||||
if len(src) < 4 {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
checksum := crc32.ChecksumIEEE(dst[originalDstLen:])
|
||||
if (src[0] != uint8(checksum>>0)) ||
|
||||
(src[1] != uint8(checksum>>8)) ||
|
||||
(src[2] != uint8(checksum>>16)) ||
|
||||
(src[3] != uint8(checksum>>24)) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
src = src[4:]
|
||||
|
||||
// Decode the index.
|
||||
srcCheckpoint1 := src
|
||||
if (len(src) < 2) || (src[0] != 0x00) || (src[1] != 0x01) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
src = src[2:]
|
||||
src, unpaddedSizeHave, ok := decodeUvarint(src)
|
||||
if !ok || (unpaddedSizeHave != unpaddedSizeWant) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
src, uncompressedSize, ok := decodeUvarint(src)
|
||||
if !ok || (uncompressedSize != uint64(len(dst)-originalDstLen)) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
for i := (len(srcCheckpoint1) - len(src)) & 3; (i & 3) != 0; i++ {
|
||||
if (len(src) == 0) || (src[0] != 0x00) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
src = src[1:]
|
||||
}
|
||||
backwardSize := (len(srcCheckpoint1) - len(src)) >> 2
|
||||
if len(src) < 4 {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
checksum = crc32.ChecksumIEEE(srcCheckpoint1[:len(srcCheckpoint1)-len(src)])
|
||||
if (src[0] != uint8(checksum>>0)) ||
|
||||
(src[1] != uint8(checksum>>8)) ||
|
||||
(src[2] != uint8(checksum>>16)) ||
|
||||
(src[3] != uint8(checksum>>24)) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
src = src[4:]
|
||||
|
||||
// Decode the footer.
|
||||
if len(src) < 12 {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
checksum = crc32.ChecksumIEEE(src[4:10])
|
||||
if (src[0] != uint8(checksum>>0)) || // Checksum.
|
||||
(src[1] != uint8(checksum>>8)) ||
|
||||
(src[2] != uint8(checksum>>16)) ||
|
||||
(src[3] != uint8(checksum>>24)) ||
|
||||
(src[4] != uint8(backwardSize>>0)) || // Backward Size.
|
||||
(src[5] != uint8(backwardSize>>8)) ||
|
||||
(src[6] != uint8(backwardSize>>16)) ||
|
||||
(src[7] != uint8(backwardSize>>24)) ||
|
||||
(src[8] != xzHeader24[6]) || // Stream Flags again.
|
||||
(src[9] != xzHeader24[7]) ||
|
||||
(src[10] != 0x59) || // Stream Footer Magic Bytes.
|
||||
(src[11] != 0x5A) {
|
||||
return dst, src, errInvalidXzData
|
||||
}
|
||||
return dst, src[12:], nil
|
||||
}
|
||||
|
||||
func decodeRaw(dst []byte, src []byte, size uint64, errUnsupported error) (appendedDst []byte, remainingSrc []byte, retErr error) {
|
||||
if (len(src) < 5) || (src[0] != 0x00) {
|
||||
return dst, src, errUnsupported
|
||||
}
|
||||
|
||||
rDec := rangeDecoder{
|
||||
src: src[18:],
|
||||
bits: (uint32(src[14]) << 24) |
|
||||
(uint32(src[15]) << 16) |
|
||||
(uint32(src[16]) << 8) |
|
||||
(uint32(src[17]) << 0),
|
||||
src: src[5:],
|
||||
bits: (uint32(src[1]) << 24) |
|
||||
(uint32(src[2]) << 16) |
|
||||
(uint32(src[3]) << 8) |
|
||||
(uint32(src[4]) << 0),
|
||||
width: 0xFFFF_FFFF,
|
||||
}
|
||||
|
||||
@@ -412,12 +578,12 @@ func (f FileFormat) Decode(dst []byte, src []byte) (appendedDst []byte, remainin
|
||||
curr := byte(0)
|
||||
for ; size > 0; size-- {
|
||||
if bitValue, err := posProbs[pos&pbMask].decodeBit(&rDec); err != nil {
|
||||
return dst, nil, err
|
||||
return dst, rDec.src, err
|
||||
} else if bitValue != 0 {
|
||||
// A full-LZMA decoder would implement Lempel Ziv matches (or the
|
||||
// End of Stream marker) here. Our simpler subset-of-LZMA decoder
|
||||
// only uses literals.
|
||||
return dst, rDec.src, ErrUnsupportedLZMAData
|
||||
return dst, rDec.src, errUnsupported
|
||||
}
|
||||
|
||||
i := (pos & lpMask) << lc
|
||||
@@ -433,26 +599,141 @@ func (f FileFormat) Decode(dst []byte, src []byte) (appendedDst []byte, remainin
|
||||
return dst, rDec.src, nil
|
||||
}
|
||||
|
||||
func decodeUvarint(src []byte) (remainingSrc []byte, x uint64, ok bool) {
|
||||
for i := uint32(0); (i < 63) && (len(src) > 0); i += 7 {
|
||||
s := src[0]
|
||||
src = src[1:]
|
||||
x |= uint64(s&0x7F) << i
|
||||
if (s & 0x80) == 0 {
|
||||
return src, x, true
|
||||
}
|
||||
}
|
||||
return src, 0, false
|
||||
}
|
||||
|
||||
// Encode converts src to the Literal Only LZMA compressed file format,
|
||||
// appending the encoding to dst.
|
||||
//
|
||||
// f should be FileFormatLZMA but future versions of this package may support
|
||||
// other file formats.
|
||||
//
|
||||
// It is valid to pass a nil dst, like the way it's valid to pass nil to the
|
||||
// built-in append function.
|
||||
func (f FileFormat) Encode(dst []byte, src []byte) (appendedDst []byte, retErr error) {
|
||||
if f != FileFormatLZMA {
|
||||
return nil, errUnsupportedFileFormat
|
||||
switch f {
|
||||
case FileFormatLZMA:
|
||||
return encodeLZMA(dst, src)
|
||||
case FileFormatXz:
|
||||
return encodeXz(dst, src)
|
||||
}
|
||||
return nil, errUnsupportedFileFormat
|
||||
}
|
||||
|
||||
func encodeLZMA(dst []byte, src []byte) (appendedDst []byte, retErr error) {
|
||||
dst = append(dst, lzmaHeader5...)
|
||||
size := len(src)
|
||||
for i := 0; i < 8; i++ {
|
||||
dst = append(dst, byte(size))
|
||||
size >>= 8
|
||||
}
|
||||
return encodeRaw(dst, src), nil
|
||||
}
|
||||
|
||||
func encodeXz(dst []byte, src []byte) (appendedDst []byte, retErr error) {
|
||||
// Encode the headers (12 byte stream header then 12 byte block header).
|
||||
// The block's unpaddedSize calculation ignores the stream header.
|
||||
dstLen0 := len(dst) + 12
|
||||
dst = append(dst, xzHeader24...)
|
||||
|
||||
// Encode the payload as multiple chunks.
|
||||
//
|
||||
// Later XZ chunks can depend on earlier ones (and doing so can help
|
||||
// compression ratios) but for simplicity, this encoder emits independent
|
||||
// chunks. Each chunk's maximum compressed and uncompressed size are both
|
||||
// equal to 0x10000 = 65536 bytes, roughly speaking. The encoder partitions
|
||||
// the src into 65536 byte sub-slices. If a sub-slice's LZMA-compressed
|
||||
// form would be longer, the encoder emits an uncompressed chunk instead.
|
||||
rawLZMA := []byte(nil)
|
||||
for remaining := src; len(remaining) > 0; {
|
||||
srcChunk := []byte(nil)
|
||||
if len(remaining) > 0x10000 {
|
||||
srcChunk, remaining = remaining[:0x10000], remaining[0x10000:]
|
||||
} else {
|
||||
srcChunk, remaining = remaining, nil
|
||||
}
|
||||
|
||||
rawLZMA = encodeRaw(rawLZMA[:0], srcChunk)
|
||||
if (len(srcChunk) + 3) <= (len(rawLZMA) + 6) {
|
||||
dst = append(dst,
|
||||
0x01, // Independent uncompressed chunk.
|
||||
uint8((len(srcChunk)-1)>>8),
|
||||
uint8((len(srcChunk)-1)>>0),
|
||||
)
|
||||
dst = append(dst, srcChunk...)
|
||||
} else {
|
||||
dst = append(dst,
|
||||
0xE0, // Independent LZMA chunk.
|
||||
uint8((len(srcChunk)-1)>>8),
|
||||
uint8((len(srcChunk)-1)>>0),
|
||||
uint8((len(rawLZMA)-1)>>8),
|
||||
uint8((len(rawLZMA)-1)>>0),
|
||||
0x5D, // Like lzmaHeader5[0], this encodes lc=3, lp=0, pb=2.
|
||||
)
|
||||
dst = append(dst, rawLZMA...)
|
||||
}
|
||||
}
|
||||
dst = append(dst, 0x00) // No more chunks.
|
||||
unpaddedSize := uint64(len(dst)-dstLen0) + 4 // +4 for the upcoming checksum.
|
||||
for 0 != 3&(len(dst)-dstLen0) {
|
||||
dst = append(dst, 0x00) // Padding
|
||||
}
|
||||
checksum := crc32.ChecksumIEEE(src)
|
||||
dst = append(dst,
|
||||
uint8(checksum>>0),
|
||||
uint8(checksum>>8),
|
||||
uint8(checksum>>16),
|
||||
uint8(checksum>>24),
|
||||
)
|
||||
|
||||
// Encode the index.
|
||||
dstLen1 := len(dst)
|
||||
dst = append(dst,
|
||||
0x00, // Index Indicator.
|
||||
0x01, // Number of Records.
|
||||
)
|
||||
dst = encodeUvarint(dst, unpaddedSize)
|
||||
dst = encodeUvarint(dst, uint64(len(src)))
|
||||
for 0 != 3&(len(dst)-dstLen1) {
|
||||
dst = append(dst, 0x00) // Padding
|
||||
}
|
||||
backwardSize := (len(dst) - dstLen1) >> 2
|
||||
checksum = crc32.ChecksumIEEE(dst[dstLen1:])
|
||||
dst = append(dst,
|
||||
uint8(checksum>>0),
|
||||
uint8(checksum>>8),
|
||||
uint8(checksum>>16),
|
||||
uint8(checksum>>24),
|
||||
)
|
||||
|
||||
// Encode the footer.
|
||||
dstLen2 := len(dst)
|
||||
dst = append(dst,
|
||||
0, 0, 0, 0, // Space for the checksum.
|
||||
uint8(backwardSize>>0), // Backward Size.
|
||||
uint8(backwardSize>>8),
|
||||
uint8(backwardSize>>16),
|
||||
uint8(backwardSize>>24),
|
||||
xzHeader24[6], // Stream Flags again.
|
||||
xzHeader24[7],
|
||||
0x59, // Stream Footer Magic Bytes.
|
||||
0x5A,
|
||||
)
|
||||
checksum = crc32.ChecksumIEEE(dst[dstLen2+4 : dstLen2+10])
|
||||
dst[dstLen2+0] = uint8(checksum >> 0)
|
||||
dst[dstLen2+1] = uint8(checksum >> 8)
|
||||
dst[dstLen2+2] = uint8(checksum >> 16)
|
||||
dst[dstLen2+3] = uint8(checksum >> 24)
|
||||
return dst, nil
|
||||
}
|
||||
|
||||
func encodeRaw(dst []byte, src []byte) (appendedDst []byte) {
|
||||
rEnc := rangeEncoder{
|
||||
dst: dst,
|
||||
width: 0xFFFF_FFFF,
|
||||
@@ -487,5 +768,12 @@ func (f FileFormat) Encode(dst []byte, src []byte) (appendedDst []byte, retErr e
|
||||
rEnc.shiftLow()
|
||||
}
|
||||
|
||||
return rEnc.dst, nil
|
||||
return rEnc.dst
|
||||
}
|
||||
|
||||
func encodeUvarint(dst []byte, x uint64) []byte {
|
||||
for ; x >= 0x80; x >>= 7 {
|
||||
dst = append(dst, byte(x)|0x80)
|
||||
}
|
||||
return append(dst, byte(x))
|
||||
}
|
||||
@@ -43,16 +43,23 @@ func testRoundTrip(tt *testing.T, filename string) {
|
||||
original = o
|
||||
}
|
||||
|
||||
compressed, err := FileFormatLZMA.Encode(nil, original)
|
||||
if err != nil {
|
||||
tt.Fatalf("Encode: %v", err)
|
||||
fileFormats := [...]FileFormat{
|
||||
FileFormatLZMA,
|
||||
FileFormatXz,
|
||||
}
|
||||
recovered, _, err := FileFormatLZMA.Decode(nil, compressed)
|
||||
if err != nil {
|
||||
tt.Fatalf("Decode: %v", err)
|
||||
}
|
||||
if !bytes.Equal(original, recovered) {
|
||||
tt.Fatalf("round trip produced different bytes")
|
||||
|
||||
for _, f := range fileFormats {
|
||||
compressed, err := f.Encode(nil, original)
|
||||
if err != nil {
|
||||
tt.Fatalf("%v.Encode: %v", f, err)
|
||||
}
|
||||
recovered, _, err := f.Decode(nil, compressed)
|
||||
if err != nil {
|
||||
tt.Fatalf("%v.Decode: %v", f, err)
|
||||
}
|
||||
if !bytes.Equal(original, recovered) {
|
||||
tt.Fatalf("%v: round trip produced different bytes", f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22698,7 +22698,7 @@ wuffs_bmp__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -23573,7 +23573,7 @@ wuffs_bmp__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -23615,7 +23615,7 @@ wuffs_bmp__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -23682,7 +23682,7 @@ wuffs_bmp__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -23729,7 +23729,7 @@ wuffs_bmp__decoder__decode_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -23866,7 +23866,7 @@ wuffs_bmp__decoder__decode_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -23899,7 +23899,7 @@ wuffs_bmp__decoder__swizzle_none(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -23969,7 +23969,7 @@ wuffs_bmp__decoder__swizzle_none(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -24006,7 +24006,7 @@ wuffs_bmp__decoder__swizzle_rle(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -24231,7 +24231,7 @@ wuffs_bmp__decoder__swizzle_rle(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -24268,7 +24268,7 @@ wuffs_bmp__decoder__swizzle_bitfields(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -24371,7 +24371,7 @@ wuffs_bmp__decoder__swizzle_bitfields(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -24404,7 +24404,7 @@ wuffs_bmp__decoder__swizzle_low_bit_depth(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -24539,7 +24539,7 @@ wuffs_bmp__decoder__swizzle_low_bit_depth(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -24742,7 +24742,7 @@ wuffs_bmp__decoder__read_palette(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -24856,7 +24856,7 @@ wuffs_bmp__decoder__read_palette(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -25174,7 +25174,7 @@ wuffs_bzip2__decoder__transform_io(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -25388,7 +25388,7 @@ wuffs_bzip2__decoder__transform_io(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -25418,7 +25418,7 @@ wuffs_bzip2__decoder__prepare_block(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -25712,7 +25712,7 @@ wuffs_bzip2__decoder__prepare_block(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -25735,7 +25735,7 @@ wuffs_bzip2__decoder__read_code_lengths(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -25840,7 +25840,7 @@ wuffs_bzip2__decoder__read_code_lengths(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26013,7 +26013,7 @@ wuffs_bzip2__decoder__flush_fast(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -26066,7 +26066,7 @@ wuffs_bzip2__decoder__flush_fast(
|
||||
if (v_block_size <= 900000) {
|
||||
self->private_impl.f_block_size = v_block_size;
|
||||
}
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26093,7 +26093,7 @@ wuffs_bzip2__decoder__flush_slow(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -26187,7 +26187,7 @@ wuffs_bzip2__decoder__flush_slow(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26222,7 +26222,7 @@ wuffs_bzip2__decoder__decode_huffman_fast(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -26317,7 +26317,7 @@ wuffs_bzip2__decoder__decode_huffman_fast(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26346,7 +26346,7 @@ wuffs_bzip2__decoder__decode_huffman_slow(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -26450,7 +26450,7 @@ wuffs_bzip2__decoder__decode_huffman_slow(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26647,7 +26647,7 @@ wuffs_cbor__decoder__decode_tokens(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -26660,7 +26660,7 @@ wuffs_cbor__decoder__decode_tokens(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -27184,10 +27184,10 @@ wuffs_cbor__decoder__decode_tokens(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -28681,7 +28681,7 @@ wuffs_deflate__decoder__transform_io(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -28740,7 +28740,7 @@ wuffs_deflate__decoder__transform_io(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
|
||||
@@ -28768,7 +28768,7 @@ wuffs_deflate__decoder__decode_blocks(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -28897,7 +28897,7 @@ wuffs_deflate__decoder__decode_blocks(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -28920,7 +28920,7 @@ wuffs_deflate__decoder__decode_uncompressed(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -28933,7 +28933,7 @@ wuffs_deflate__decoder__decode_uncompressed(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -29016,10 +29016,10 @@ wuffs_deflate__decoder__decode_uncompressed(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -29103,7 +29103,7 @@ wuffs_deflate__decoder__init_dynamic_huffman(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -29324,7 +29324,7 @@ wuffs_deflate__decoder__init_dynamic_huffman(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -29617,7 +29617,7 @@ wuffs_deflate__decoder__decode_huffman_bmi2(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -29630,7 +29630,7 @@ wuffs_deflate__decoder__decode_huffman_bmi2(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -29791,10 +29791,10 @@ wuffs_deflate__decoder__decode_huffman_bmi2(
|
||||
}
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -29830,7 +29830,7 @@ wuffs_deflate__decoder__decode_huffman_fast32(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -29843,7 +29843,7 @@ wuffs_deflate__decoder__decode_huffman_fast32(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -30049,10 +30049,10 @@ wuffs_deflate__decoder__decode_huffman_fast32(
|
||||
}
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -30094,7 +30094,7 @@ wuffs_deflate__decoder__decode_huffman_fast64__choosy_default(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -30107,7 +30107,7 @@ wuffs_deflate__decoder__decode_huffman_fast64__choosy_default(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -30268,10 +30268,10 @@ wuffs_deflate__decoder__decode_huffman_fast64__choosy_default(
|
||||
}
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -30311,7 +30311,7 @@ wuffs_deflate__decoder__decode_huffman_slow(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -30324,7 +30324,7 @@ wuffs_deflate__decoder__decode_huffman_slow(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -30603,10 +30603,10 @@ wuffs_deflate__decoder__decode_huffman_slow(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -30895,7 +30895,7 @@ wuffs_lzw__decoder__read_from(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -31037,7 +31037,7 @@ wuffs_lzw__decoder__read_from(
|
||||
self->private_impl.f_bits = v_bits;
|
||||
self->private_impl.f_n_bits = v_n_bits;
|
||||
self->private_impl.f_output_wi = v_output_wi;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -31059,7 +31059,7 @@ wuffs_lzw__decoder__write_to(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -31104,7 +31104,7 @@ wuffs_lzw__decoder__write_to(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
|
||||
@@ -31562,7 +31562,7 @@ wuffs_gif__decoder__tell_me_more(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -31662,7 +31662,7 @@ wuffs_gif__decoder__tell_me_more(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -31828,7 +31828,7 @@ wuffs_gif__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -31947,7 +31947,7 @@ wuffs_gif__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -31972,7 +31972,7 @@ wuffs_gif__decoder__skip_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32047,7 +32047,7 @@ wuffs_gif__decoder__skip_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32162,7 +32162,7 @@ wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32238,7 +32238,7 @@ wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32260,7 +32260,7 @@ wuffs_gif__decoder__decode_header(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32311,7 +32311,7 @@ wuffs_gif__decoder__decode_header(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32337,7 +32337,7 @@ wuffs_gif__decoder__decode_lsd(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32513,7 +32513,7 @@ wuffs_gif__decoder__decode_lsd(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32534,7 +32534,7 @@ wuffs_gif__decoder__decode_extension(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32606,7 +32606,7 @@ wuffs_gif__decoder__decode_extension(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32627,7 +32627,7 @@ wuffs_gif__decoder__skip_blocks(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32674,7 +32674,7 @@ wuffs_gif__decoder__skip_blocks(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32700,7 +32700,7 @@ wuffs_gif__decoder__decode_ae(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32897,7 +32897,7 @@ wuffs_gif__decoder__decode_ae(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32920,7 +32920,7 @@ wuffs_gif__decoder__decode_gc(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -33027,7 +33027,7 @@ wuffs_gif__decoder__decode_gc(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -33046,7 +33046,7 @@ wuffs_gif__decoder__decode_id_part0(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -33194,7 +33194,7 @@ wuffs_gif__decoder__decode_id_part0(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -33223,7 +33223,7 @@ wuffs_gif__decoder__decode_id_part1(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -33365,7 +33365,7 @@ wuffs_gif__decoder__decode_id_part1(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -33403,7 +33403,7 @@ wuffs_gif__decoder__decode_id_part2(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -33593,7 +33593,7 @@ wuffs_gif__decoder__decode_id_part2(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -33920,7 +33920,7 @@ wuffs_gzip__decoder__transform_io(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -33933,7 +33933,7 @@ wuffs_gzip__decoder__transform_io(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -34204,10 +34204,10 @@ wuffs_gzip__decoder__transform_io(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -34697,7 +34697,7 @@ wuffs_json__decoder__decode_tokens(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -34710,7 +34710,7 @@ wuffs_json__decoder__decode_tokens(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -35640,10 +35640,10 @@ wuffs_json__decoder__decode_tokens(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -35667,7 +35667,7 @@ wuffs_json__decoder__decode_number(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -35782,7 +35782,7 @@ wuffs_json__decoder__decode_number(
|
||||
goto label__goto_done__break;
|
||||
}
|
||||
label__goto_done__break:;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
return (v_n | v_floating_point);
|
||||
@@ -35802,7 +35802,7 @@ wuffs_json__decoder__decode_digits(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -35832,7 +35832,7 @@ wuffs_json__decoder__decode_digits(
|
||||
if (v_n == a_n) {
|
||||
v_n |= 256;
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
return v_n;
|
||||
@@ -35854,7 +35854,7 @@ wuffs_json__decoder__decode_leading(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -35867,7 +35867,7 @@ wuffs_json__decoder__decode_leading(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -35937,10 +35937,10 @@ wuffs_json__decoder__decode_leading(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -35964,7 +35964,7 @@ wuffs_json__decoder__decode_comment(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -35977,7 +35977,7 @@ wuffs_json__decoder__decode_comment(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36119,10 +36119,10 @@ wuffs_json__decoder__decode_comment(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -36145,7 +36145,7 @@ wuffs_json__decoder__decode_inf_nan(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -36158,7 +36158,7 @@ wuffs_json__decoder__decode_inf_nan(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36276,10 +36276,10 @@ wuffs_json__decoder__decode_inf_nan(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -36302,7 +36302,7 @@ wuffs_json__decoder__decode_trailer(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -36315,7 +36315,7 @@ wuffs_json__decoder__decode_trailer(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36414,10 +36414,10 @@ wuffs_json__decoder__decode_trailer(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -36597,7 +36597,7 @@ wuffs_nie__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36781,7 +36781,7 @@ wuffs_nie__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -36823,7 +36823,7 @@ wuffs_nie__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36890,7 +36890,7 @@ wuffs_nie__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -37026,7 +37026,7 @@ wuffs_nie__decoder__swizzle(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -37078,7 +37078,7 @@ wuffs_nie__decoder__swizzle(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -37504,7 +37504,7 @@ wuffs_zlib__decoder__transform_io(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -37517,7 +37517,7 @@ wuffs_zlib__decoder__transform_io(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -37701,10 +37701,10 @@ wuffs_zlib__decoder__transform_io(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -39636,7 +39636,7 @@ wuffs_png__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -39928,7 +39928,7 @@ wuffs_png__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -39953,7 +39953,7 @@ wuffs_png__decoder__decode_ihdr(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40132,7 +40132,7 @@ wuffs_png__decoder__decode_ihdr(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40301,7 +40301,7 @@ wuffs_png__decoder__decode_other_chunk(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40521,7 +40521,7 @@ wuffs_png__decoder__decode_other_chunk(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40540,7 +40540,7 @@ wuffs_png__decoder__decode_actl(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40634,7 +40634,7 @@ wuffs_png__decoder__decode_actl(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40655,7 +40655,7 @@ wuffs_png__decoder__decode_chrm(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40931,7 +40931,7 @@ wuffs_png__decoder__decode_chrm(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40950,7 +40950,7 @@ wuffs_png__decoder__decode_exif(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40972,7 +40972,7 @@ wuffs_png__decoder__decode_exif(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40996,7 +40996,7 @@ wuffs_png__decoder__decode_fctl(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41309,7 +41309,7 @@ wuffs_png__decoder__decode_fctl(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41328,7 +41328,7 @@ wuffs_png__decoder__decode_gama(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41390,7 +41390,7 @@ wuffs_png__decoder__decode_gama(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41411,7 +41411,7 @@ wuffs_png__decoder__decode_iccp(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41479,7 +41479,7 @@ wuffs_png__decoder__decode_iccp(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41502,7 +41502,7 @@ wuffs_png__decoder__decode_plte(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41582,7 +41582,7 @@ wuffs_png__decoder__decode_plte(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41601,7 +41601,7 @@ wuffs_png__decoder__decode_srgb(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41643,7 +41643,7 @@ wuffs_png__decoder__decode_srgb(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41666,7 +41666,7 @@ wuffs_png__decoder__decode_trns(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41828,7 +41828,7 @@ wuffs_png__decoder__decode_trns(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41869,7 +41869,7 @@ wuffs_png__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -42119,7 +42119,7 @@ wuffs_png__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -42143,7 +42143,7 @@ wuffs_png__decoder__skip_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -42274,7 +42274,7 @@ wuffs_png__decoder__skip_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -42321,7 +42321,7 @@ wuffs_png__decoder__decode_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -42544,7 +42544,7 @@ wuffs_png__decoder__decode_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -42580,7 +42580,7 @@ wuffs_png__decoder__decode_pass(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -42886,7 +42886,7 @@ wuffs_png__decoder__decode_pass(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -43069,7 +43069,7 @@ wuffs_png__decoder__tell_me_more(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -43082,7 +43082,7 @@ wuffs_png__decoder__tell_me_more(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -43533,10 +43533,10 @@ wuffs_png__decoder__tell_me_more(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -44094,7 +44094,7 @@ wuffs_tga__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -44523,7 +44523,7 @@ wuffs_tga__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -44565,7 +44565,7 @@ wuffs_tga__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -44632,7 +44632,7 @@ wuffs_tga__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -44698,7 +44698,7 @@ wuffs_tga__decoder__decode_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -44980,7 +44980,7 @@ wuffs_tga__decoder__decode_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -45328,7 +45328,7 @@ wuffs_wbmp__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -45424,7 +45424,7 @@ wuffs_wbmp__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -45466,7 +45466,7 @@ wuffs_wbmp__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -45533,7 +45533,7 @@ wuffs_wbmp__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -45590,7 +45590,7 @@ wuffs_wbmp__decoder__decode_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -45702,7 +45702,7 @@ wuffs_wbmp__decoder__decode_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
|
||||
+181
-181
@@ -85,15 +85,15 @@ extern "C" {
|
||||
// each major.minor branch, the commit count should increase monotonically.
|
||||
//
|
||||
// WUFFS_VERSION was overridden by "wuffs gen -version" based on revision
|
||||
// fac934b27259f37191285a8d9d1d9629ed2d9f5d committed on 2022-06-29.
|
||||
// b0e9efff3f44dc150edb22a27297bfef668035d2 committed on 2022-10-20.
|
||||
#define WUFFS_VERSION 0x000030000
|
||||
#define WUFFS_VERSION_MAJOR 0
|
||||
#define WUFFS_VERSION_MINOR 3
|
||||
#define WUFFS_VERSION_PATCH 0
|
||||
#define WUFFS_VERSION_PRE_RELEASE_LABEL "rc.1"
|
||||
#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 3360
|
||||
#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 20220629
|
||||
#define WUFFS_VERSION_STRING "0.3.0-rc.1+3360.20220629"
|
||||
#define WUFFS_VERSION_PRE_RELEASE_LABEL "rc.2"
|
||||
#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 3366
|
||||
#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 20221020
|
||||
#define WUFFS_VERSION_STRING "0.3.0-rc.2+3366.20221020"
|
||||
|
||||
// ---------------- Configuration
|
||||
|
||||
@@ -22699,7 +22699,7 @@ wuffs_bmp__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -23574,7 +23574,7 @@ wuffs_bmp__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -23616,7 +23616,7 @@ wuffs_bmp__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -23683,7 +23683,7 @@ wuffs_bmp__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -23730,7 +23730,7 @@ wuffs_bmp__decoder__decode_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -23867,7 +23867,7 @@ wuffs_bmp__decoder__decode_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -23900,7 +23900,7 @@ wuffs_bmp__decoder__swizzle_none(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -23970,7 +23970,7 @@ wuffs_bmp__decoder__swizzle_none(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -24007,7 +24007,7 @@ wuffs_bmp__decoder__swizzle_rle(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -24232,7 +24232,7 @@ wuffs_bmp__decoder__swizzle_rle(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -24269,7 +24269,7 @@ wuffs_bmp__decoder__swizzle_bitfields(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -24372,7 +24372,7 @@ wuffs_bmp__decoder__swizzle_bitfields(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -24405,7 +24405,7 @@ wuffs_bmp__decoder__swizzle_low_bit_depth(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -24540,7 +24540,7 @@ wuffs_bmp__decoder__swizzle_low_bit_depth(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -24743,7 +24743,7 @@ wuffs_bmp__decoder__read_palette(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -24857,7 +24857,7 @@ wuffs_bmp__decoder__read_palette(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -25175,7 +25175,7 @@ wuffs_bzip2__decoder__transform_io(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -25389,7 +25389,7 @@ wuffs_bzip2__decoder__transform_io(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -25419,7 +25419,7 @@ wuffs_bzip2__decoder__prepare_block(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -25713,7 +25713,7 @@ wuffs_bzip2__decoder__prepare_block(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -25736,7 +25736,7 @@ wuffs_bzip2__decoder__read_code_lengths(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -25841,7 +25841,7 @@ wuffs_bzip2__decoder__read_code_lengths(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26014,7 +26014,7 @@ wuffs_bzip2__decoder__flush_fast(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -26067,7 +26067,7 @@ wuffs_bzip2__decoder__flush_fast(
|
||||
if (v_block_size <= 900000) {
|
||||
self->private_impl.f_block_size = v_block_size;
|
||||
}
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26094,7 +26094,7 @@ wuffs_bzip2__decoder__flush_slow(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -26188,7 +26188,7 @@ wuffs_bzip2__decoder__flush_slow(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26223,7 +26223,7 @@ wuffs_bzip2__decoder__decode_huffman_fast(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -26318,7 +26318,7 @@ wuffs_bzip2__decoder__decode_huffman_fast(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26347,7 +26347,7 @@ wuffs_bzip2__decoder__decode_huffman_slow(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -26451,7 +26451,7 @@ wuffs_bzip2__decoder__decode_huffman_slow(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -26648,7 +26648,7 @@ wuffs_cbor__decoder__decode_tokens(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -26661,7 +26661,7 @@ wuffs_cbor__decoder__decode_tokens(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -27185,10 +27185,10 @@ wuffs_cbor__decoder__decode_tokens(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -28682,7 +28682,7 @@ wuffs_deflate__decoder__transform_io(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -28741,7 +28741,7 @@ wuffs_deflate__decoder__transform_io(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
|
||||
@@ -28769,7 +28769,7 @@ wuffs_deflate__decoder__decode_blocks(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -28898,7 +28898,7 @@ wuffs_deflate__decoder__decode_blocks(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -28921,7 +28921,7 @@ wuffs_deflate__decoder__decode_uncompressed(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -28934,7 +28934,7 @@ wuffs_deflate__decoder__decode_uncompressed(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -29017,10 +29017,10 @@ wuffs_deflate__decoder__decode_uncompressed(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -29104,7 +29104,7 @@ wuffs_deflate__decoder__init_dynamic_huffman(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -29325,7 +29325,7 @@ wuffs_deflate__decoder__init_dynamic_huffman(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -29618,7 +29618,7 @@ wuffs_deflate__decoder__decode_huffman_bmi2(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -29631,7 +29631,7 @@ wuffs_deflate__decoder__decode_huffman_bmi2(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -29792,10 +29792,10 @@ wuffs_deflate__decoder__decode_huffman_bmi2(
|
||||
}
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -29831,7 +29831,7 @@ wuffs_deflate__decoder__decode_huffman_fast32(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -29844,7 +29844,7 @@ wuffs_deflate__decoder__decode_huffman_fast32(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -30050,10 +30050,10 @@ wuffs_deflate__decoder__decode_huffman_fast32(
|
||||
}
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -30095,7 +30095,7 @@ wuffs_deflate__decoder__decode_huffman_fast64__choosy_default(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -30108,7 +30108,7 @@ wuffs_deflate__decoder__decode_huffman_fast64__choosy_default(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -30269,10 +30269,10 @@ wuffs_deflate__decoder__decode_huffman_fast64__choosy_default(
|
||||
}
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -30312,7 +30312,7 @@ wuffs_deflate__decoder__decode_huffman_slow(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -30325,7 +30325,7 @@ wuffs_deflate__decoder__decode_huffman_slow(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -30604,10 +30604,10 @@ wuffs_deflate__decoder__decode_huffman_slow(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -30896,7 +30896,7 @@ wuffs_lzw__decoder__read_from(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -31038,7 +31038,7 @@ wuffs_lzw__decoder__read_from(
|
||||
self->private_impl.f_bits = v_bits;
|
||||
self->private_impl.f_n_bits = v_n_bits;
|
||||
self->private_impl.f_output_wi = v_output_wi;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -31060,7 +31060,7 @@ wuffs_lzw__decoder__write_to(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -31105,7 +31105,7 @@ wuffs_lzw__decoder__write_to(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
|
||||
@@ -31563,7 +31563,7 @@ wuffs_gif__decoder__tell_me_more(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -31663,7 +31663,7 @@ wuffs_gif__decoder__tell_me_more(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -31829,7 +31829,7 @@ wuffs_gif__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -31948,7 +31948,7 @@ wuffs_gif__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -31973,7 +31973,7 @@ wuffs_gif__decoder__skip_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32048,7 +32048,7 @@ wuffs_gif__decoder__skip_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32163,7 +32163,7 @@ wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32239,7 +32239,7 @@ wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32261,7 +32261,7 @@ wuffs_gif__decoder__decode_header(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32312,7 +32312,7 @@ wuffs_gif__decoder__decode_header(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32338,7 +32338,7 @@ wuffs_gif__decoder__decode_lsd(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32514,7 +32514,7 @@ wuffs_gif__decoder__decode_lsd(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32535,7 +32535,7 @@ wuffs_gif__decoder__decode_extension(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32607,7 +32607,7 @@ wuffs_gif__decoder__decode_extension(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32628,7 +32628,7 @@ wuffs_gif__decoder__skip_blocks(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32675,7 +32675,7 @@ wuffs_gif__decoder__skip_blocks(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32701,7 +32701,7 @@ wuffs_gif__decoder__decode_ae(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -32898,7 +32898,7 @@ wuffs_gif__decoder__decode_ae(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -32921,7 +32921,7 @@ wuffs_gif__decoder__decode_gc(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -33028,7 +33028,7 @@ wuffs_gif__decoder__decode_gc(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -33047,7 +33047,7 @@ wuffs_gif__decoder__decode_id_part0(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -33195,7 +33195,7 @@ wuffs_gif__decoder__decode_id_part0(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -33224,7 +33224,7 @@ wuffs_gif__decoder__decode_id_part1(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -33366,7 +33366,7 @@ wuffs_gif__decoder__decode_id_part1(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -33404,7 +33404,7 @@ wuffs_gif__decoder__decode_id_part2(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -33594,7 +33594,7 @@ wuffs_gif__decoder__decode_id_part2(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -33921,7 +33921,7 @@ wuffs_gzip__decoder__transform_io(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -33934,7 +33934,7 @@ wuffs_gzip__decoder__transform_io(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -34205,10 +34205,10 @@ wuffs_gzip__decoder__transform_io(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -34698,7 +34698,7 @@ wuffs_json__decoder__decode_tokens(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -34711,7 +34711,7 @@ wuffs_json__decoder__decode_tokens(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -35641,10 +35641,10 @@ wuffs_json__decoder__decode_tokens(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -35668,7 +35668,7 @@ wuffs_json__decoder__decode_number(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -35783,7 +35783,7 @@ wuffs_json__decoder__decode_number(
|
||||
goto label__goto_done__break;
|
||||
}
|
||||
label__goto_done__break:;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
return (v_n | v_floating_point);
|
||||
@@ -35803,7 +35803,7 @@ wuffs_json__decoder__decode_digits(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -35833,7 +35833,7 @@ wuffs_json__decoder__decode_digits(
|
||||
if (v_n == a_n) {
|
||||
v_n |= 256;
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
return v_n;
|
||||
@@ -35855,7 +35855,7 @@ wuffs_json__decoder__decode_leading(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -35868,7 +35868,7 @@ wuffs_json__decoder__decode_leading(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -35938,10 +35938,10 @@ wuffs_json__decoder__decode_leading(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -35965,7 +35965,7 @@ wuffs_json__decoder__decode_comment(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -35978,7 +35978,7 @@ wuffs_json__decoder__decode_comment(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36120,10 +36120,10 @@ wuffs_json__decoder__decode_comment(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -36146,7 +36146,7 @@ wuffs_json__decoder__decode_inf_nan(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -36159,7 +36159,7 @@ wuffs_json__decoder__decode_inf_nan(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36277,10 +36277,10 @@ wuffs_json__decoder__decode_inf_nan(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -36303,7 +36303,7 @@ wuffs_json__decoder__decode_trailer(
|
||||
wuffs_base__token* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
wuffs_base__token* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -36316,7 +36316,7 @@ wuffs_json__decoder__decode_trailer(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36415,10 +36415,10 @@ wuffs_json__decoder__decode_trailer(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -36598,7 +36598,7 @@ wuffs_nie__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36782,7 +36782,7 @@ wuffs_nie__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -36824,7 +36824,7 @@ wuffs_nie__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -36891,7 +36891,7 @@ wuffs_nie__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -37027,7 +37027,7 @@ wuffs_nie__decoder__swizzle(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -37079,7 +37079,7 @@ wuffs_nie__decoder__swizzle(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -37505,7 +37505,7 @@ wuffs_zlib__decoder__transform_io(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -37518,7 +37518,7 @@ wuffs_zlib__decoder__transform_io(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -37702,10 +37702,10 @@ wuffs_zlib__decoder__transform_io(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -39637,7 +39637,7 @@ wuffs_png__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -39929,7 +39929,7 @@ wuffs_png__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -39954,7 +39954,7 @@ wuffs_png__decoder__decode_ihdr(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40133,7 +40133,7 @@ wuffs_png__decoder__decode_ihdr(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40302,7 +40302,7 @@ wuffs_png__decoder__decode_other_chunk(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40522,7 +40522,7 @@ wuffs_png__decoder__decode_other_chunk(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40541,7 +40541,7 @@ wuffs_png__decoder__decode_actl(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40635,7 +40635,7 @@ wuffs_png__decoder__decode_actl(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40656,7 +40656,7 @@ wuffs_png__decoder__decode_chrm(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40932,7 +40932,7 @@ wuffs_png__decoder__decode_chrm(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40951,7 +40951,7 @@ wuffs_png__decoder__decode_exif(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -40973,7 +40973,7 @@ wuffs_png__decoder__decode_exif(
|
||||
ok:
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -40997,7 +40997,7 @@ wuffs_png__decoder__decode_fctl(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41310,7 +41310,7 @@ wuffs_png__decoder__decode_fctl(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41329,7 +41329,7 @@ wuffs_png__decoder__decode_gama(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41391,7 +41391,7 @@ wuffs_png__decoder__decode_gama(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41412,7 +41412,7 @@ wuffs_png__decoder__decode_iccp(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41480,7 +41480,7 @@ wuffs_png__decoder__decode_iccp(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41503,7 +41503,7 @@ wuffs_png__decoder__decode_plte(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41583,7 +41583,7 @@ wuffs_png__decoder__decode_plte(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41602,7 +41602,7 @@ wuffs_png__decoder__decode_srgb(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41644,7 +41644,7 @@ wuffs_png__decoder__decode_srgb(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41667,7 +41667,7 @@ wuffs_png__decoder__decode_trns(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -41829,7 +41829,7 @@ wuffs_png__decoder__decode_trns(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -41870,7 +41870,7 @@ wuffs_png__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -42120,7 +42120,7 @@ wuffs_png__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -42144,7 +42144,7 @@ wuffs_png__decoder__skip_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -42275,7 +42275,7 @@ wuffs_png__decoder__skip_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -42322,7 +42322,7 @@ wuffs_png__decoder__decode_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -42545,7 +42545,7 @@ wuffs_png__decoder__decode_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -42581,7 +42581,7 @@ wuffs_png__decoder__decode_pass(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -42887,7 +42887,7 @@ wuffs_png__decoder__decode_pass(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -43070,7 +43070,7 @@ wuffs_png__decoder__tell_me_more(
|
||||
uint8_t* io0_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io1_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
uint8_t* io2_a_dst WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
io0_a_dst = a_dst->data.ptr;
|
||||
io1_a_dst = io0_a_dst + a_dst->meta.wi;
|
||||
iop_a_dst = io1_a_dst;
|
||||
@@ -43083,7 +43083,7 @@ wuffs_png__decoder__tell_me_more(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -43534,10 +43534,10 @@ wuffs_png__decoder__tell_me_more(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_dst) {
|
||||
if (a_dst && a_dst->data.ptr) {
|
||||
a_dst->meta.wi = ((size_t)(iop_a_dst - a_dst->data.ptr));
|
||||
}
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -44095,7 +44095,7 @@ wuffs_tga__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -44524,7 +44524,7 @@ wuffs_tga__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -44566,7 +44566,7 @@ wuffs_tga__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -44633,7 +44633,7 @@ wuffs_tga__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -44699,7 +44699,7 @@ wuffs_tga__decoder__decode_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -44981,7 +44981,7 @@ wuffs_tga__decoder__decode_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -45329,7 +45329,7 @@ wuffs_wbmp__decoder__decode_image_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -45425,7 +45425,7 @@ wuffs_wbmp__decoder__decode_image_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -45467,7 +45467,7 @@ wuffs_wbmp__decoder__decode_frame_config(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -45534,7 +45534,7 @@ wuffs_wbmp__decoder__decode_frame_config(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
@@ -45591,7 +45591,7 @@ wuffs_wbmp__decoder__decode_frame(
|
||||
const uint8_t* io0_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io1_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
const uint8_t* io2_a_src WUFFS_BASE__POTENTIALLY_UNUSED = NULL;
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
io0_a_src = a_src->data.ptr;
|
||||
io1_a_src = io0_a_src + a_src->meta.ri;
|
||||
iop_a_src = io1_a_src;
|
||||
@@ -45703,7 +45703,7 @@ wuffs_wbmp__decoder__decode_frame(
|
||||
|
||||
goto exit;
|
||||
exit:
|
||||
if (a_src) {
|
||||
if (a_src && a_src->data.ptr) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ type bitVector []uint8
|
||||
// zig packs a pair of non-negative integers (i, j) into a single unique
|
||||
// non-negative integer, in a zig-zagging pattern:
|
||||
//
|
||||
// i=0 i=1 i=2 i=3 i=4 etc
|
||||
// . i=0 i=1 i=2 i=3 i=4 etc
|
||||
// j=0: 0 1 3 6 10 ...
|
||||
// j=1: 2 4 7 11 16 ...
|
||||
// j=2: 5 8 12 17 23 ...
|
||||
|
||||
Reference in new issue
Block a user