std/jpeg: make decode_mcu* num-bits ask consistent

name                                             old speed      new speed      delta

wuffs_jpeg_decode_19k_8bpp/clang11                367MB/s ± 0%   367MB/s ± 0%  -0.13%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/clang11   332MB/s ± 0%   333MB/s ± 0%  +0.41%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/clang11   1.00GB/s ± 0%  1.00GB/s ± 0%  +0.44%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/clang11               821MB/s ± 0%   822MB/s ± 0%  +0.13%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/clang11          896MB/s ± 0%   898MB/s ± 0%  +0.17%  (p=0.032 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/clang11         1.09GB/s ± 0%  1.09GB/s ± 0%    ~     (p=0.095 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/clang11             898MB/s ± 0%   898MB/s ± 0%    ~     (p=0.786 n=5+5)

wuffs_jpeg_decode_19k_8bpp/gcc10                  364MB/s ± 0%   362MB/s ± 0%  -0.45%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/gcc10     293MB/s ± 0%   292MB/s ± 0%  -0.31%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/gcc10      932MB/s ± 0%   934MB/s ± 0%  +0.20%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/gcc10                 762MB/s ± 0%   759MB/s ± 0%  -0.35%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/gcc10            833MB/s ± 0%   828MB/s ± 0%  -0.54%  (p=0.016 n=4+5)
wuffs_jpeg_decode_552k_24bpp_444/gcc10           1.00GB/s ± 0%  1.00GB/s ± 0%  -0.25%  (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/gcc10               841MB/s ± 0%   837MB/s ± 0%  -0.49%  (p=0.016 n=4+5)
This commit is contained in:
Nigel Tao committed 2023-08-27 10:35:05 +10:00
1 parent dfe5bcd36e
commit 00d180ae74
2 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -44900,7 +44900,7 @@ wuffs_jpeg__decoder__decode_mcu__choosy_default(
while (self->private_impl.f_mcu_current_block < self->private_impl.f_mcu_num_blocks) {
while (self->private_impl.f_mcu_zig_index <= 0u) {
wuffs_base__bulk_memset(&self->private_data.f_mcu_blocks[0], 1u * (size_t)128u, 0u);
if (((uint64_t)(io2_v_r - iop_v_r)) < 8u) {
if (((uint64_t)(io2_v_r - iop_v_r)) < 264u) {
v_ret = 1u;
goto label__goto_done__break;
}
+5 -2
View File
@@ -75,8 +75,11 @@ pri func decoder.decode_mcu!(workbuf: slice base.u8, mx: base.u32[..= 0x1FFF], m
{
this.mcu_blocks[.. 1].bulk_memset!(byte_value: 0)
// Load at least 56 bits.
if r.length() < 8 {
// Load at least 56 bits. We only need 8 bytes (for the
// peek_u64be call), but ask for 264 to be consistent with the
// other "another fill_bitstream call" requests, in this method
// (decode_mcu) and its other variants.
if r.length() < 264 {
ret = 1 // Request another fill_bitstream call.
break.goto_done
}