Prior to 381e186f "std/vp8: swizzle_ycck once, not once per MB row", we
swizzled one row of macroblocks at a time. After 381e186f, we swizzled
the whole image in one pass, but kept the option of, in the future,
amending the swizzle_ycck implementation to allow ((y_min_incl > 0) and
(ycc_upsampling == FANCY_ETC)) at the same time.
However, 381e186f didn't show a performance loss so large that it seems
worth complicating the swizzle_ycck implementation in that way. So we
just drop, in this commit, the option of that amendment.
This prepares us to change std/vp8's YCC upsampling method from "basic"
to "fancy, like libwebp". Wuffs' current implementation of "fancy"
requires the initial Y coordinate to be zero, as fancy upsampling
special cases the top row of the image and it's simpler if the top row
(row zero) is always presented in the upsampling call.
This is not an optimization or pessimization per se, but for the record,
the performance impact is between negligible and a small improvement.
name old speed new speed delta
wuffs_webp_lossy_decode_image_19k_8bpp/clang14 33.7MB/s ± 0% 34.1MB/s ± 0% +1.28% (p=0.008 n=5+5)
wuffs_webp_lossy_decode_image_40k_24bpp/clang14 106MB/s ± 0% 106MB/s ± 0% +0.09% (p=0.008 n=5+5)
wuffs_webp_lossy_decode_image_77k_24bpp/clang14 129MB/s ± 0% 130MB/s ± 0% +0.54% (p=0.008 n=5+5)
wuffs_webp_lossy_decode_image_552k_32bpp/clang14 207MB/s ± 0% 211MB/s ± 0% +1.90% (p=0.008 n=5+5)
wuffs_webp_lossy_decode_image_4002k_24bpp/clang14 137MB/s ± 0% 138MB/s ± 0% +0.40% (p=0.008 n=5+5)
wuffs_webp_lossy_decode_image_19k_8bpp/gcc12 32.9MB/s ± 0% 32.9MB/s ± 0% +0.05% (p=0.008 n=5+5)
wuffs_webp_lossy_decode_image_40k_24bpp/gcc12 98.4MB/s ± 0% 98.8MB/s ± 0% +0.42% (p=0.008 n=5+5)
wuffs_webp_lossy_decode_image_77k_24bpp/gcc12 125MB/s ± 0% 125MB/s ± 0% +0.17% (p=0.008 n=5+5)
wuffs_webp_lossy_decode_image_552k_32bpp/gcc12 211MB/s ± 0% 214MB/s ± 0% +1.21% (p=0.008 n=5+5)
wuffs_webp_lossy_decode_image_4002k_24bpp/gcc12 137MB/s ± 0% 137MB/s ± 0% ~ (p=0.095 n=5+5)
This reverts commit a4ec3f8e, which triggers -Werror=sign-conversion
errors on C code like this:
v_foobar += blah;
instead of the equivalent (as all variables here have u32 type):
v_foobar += ((uint32_t)(0u + blah));
This compiler warning (or compiler error, with -Werror) is arguably a
false postive but it's easier not to fight the C compiler.
"wuffs test -mimic std/webp" now passes.
This commit, part of a series, is inspired by pull request PR #168 by
Damian Kaczmarek (with AI assistance), with some modifications.
Updates PR #168
This commit, part of a series, is inspired by pull request PR #168 by
Damian Kaczmarek (with AI assistance), with some modifications. There
were many stylistic changes but also:
- decoder.workbuf_len was fixed to account for all of the partitions,
not just the first two (the first partition and the first 'other'
partition). The PR's vp8 code, after an update to handle multiple
other partitions (which then implied random access to the partitioned
source bytes), assumed that enough workbuf was available (which it
often is, test/c/std/webp.c tests pass the entire g_work_slice_u8).
But strictly speaking, this isn't guaranteed unless workbuf_len
reports (after decode_image_config is called) what's needed.
- Calculating that workbuf_len (at decode_image_config time) lead to
introducing a new base.QUIRK_SOURCE_LENGTH quirk, to pass that
contextual information from std/webp to std/vp8. This calculation
belongs in std/vp8, not std/webp (or a future std/webm).
- Added support (and a test) for the case when the source bytes are
streamed and some (but not yet all) of the partition data in args.src
can be copied to args.workbuf.
Updates PR #168