std/jpeg: tighten EXTEND element type s/u32/u16/

I'm not sure of the underlying reason for the gcc benchmark anomaly (the
clang numbers don't change).

name                                             old speed     new speed     delta

wuffs_jpeg_decode_19k_8bpp/clang11               227MB/s ± 0%  227MB/s ± 0%     ~     (p=0.151 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/clang11  209MB/s ± 0%  213MB/s ± 0%   +1.62%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/clang11   379MB/s ± 0%  380MB/s ± 0%   +0.13%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/clang11              329MB/s ± 0%  329MB/s ± 0%   +0.06%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/clang11         342MB/s ± 0%  342MB/s ± 0%     ~     (p=0.690 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/clang11         468MB/s ± 0%  469MB/s ± 0%   +0.10%  (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/clang11            348MB/s ± 0%  348MB/s ± 0%   +0.08%  (p=0.016 n=5+5)

wuffs_jpeg_decode_19k_8bpp/gcc10                 213MB/s ± 0%  213MB/s ± 0%     ~     (p=0.151 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/gcc10    221MB/s ± 0%  246MB/s ± 0%  +11.51%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/gcc10     487MB/s ± 0%  482MB/s ± 0%   -0.98%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/gcc10                392MB/s ± 0%  392MB/s ± 0%     ~     (p=1.000 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/gcc10           413MB/s ± 0%  412MB/s ± 0%     ~     (p=0.190 n=4+5)
wuffs_jpeg_decode_552k_24bpp_444/gcc10           459MB/s ± 0%  460MB/s ± 0%   +0.09%  (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/gcc10              419MB/s ± 0%  419MB/s ± 0%   +0.04%  (p=0.008 n=5+5)
This commit is contained in:
Nigel Tao committed 2023-06-18 21:35:49 +10:00
1 parent e4902dbd45
commit 36323abf87
6 files changed
+59 -59

No files matched your search

@@ -32,7 +32,7 @@ pri func decoder.decode_mcu_progressive_ac_low_bit!(workbuf: slice base.u8, mx:
var ac_code : base.u32
var ac_blm1 : base.u32[..= 15]
var ac_ht_slow : base.u32
var ac_value : base.u32
var ac_value : base.u16
var ac_rrrr : base.u32[..= 15]
var ac_ssss : base.u32[..= 15]
@@ -124,9 +124,9 @@ pri func decoder.decode_mcu_progressive_ac_low_bit!(workbuf: slice base.u8, mx:
// the eob_run in the next ac_rrrr (up to 15) bits.
ac_value = 0
if ac_ssss > 0 {
ac_value = (0x0000_0001 as base.u32) << this.scan_al
ac_value = (0x0001 as base.u16) << this.scan_al
if (bits >> 63) == 0 {
ac_value = (0xFFFF_FFFF as base.u32) ~mod<< this.scan_al
ac_value = (0xFFFF as base.u16) ~mod<< this.scan_al
}
bits ~mod<<= 1
n_bits ~mod-= 1
@@ -179,7 +179,7 @@ pri func decoder.decode_mcu_progressive_ac_low_bit!(workbuf: slice base.u8, mx:
} endwhile.refine_non_zeroes
if ac_value <> 0 {
this.mcu_blocks[0][UNZIG[1 + this.mcu_zig_index]] = (ac_value & 0xFFFF) as base.u16
this.mcu_blocks[0][UNZIG[1 + this.mcu_zig_index]] = ac_value
}
if this.mcu_zig_index >= (this.scan_se as base.u32) {