mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Have lzw rewind in and flush out on a bad code
name old speed new speed delta wuffs_lzw_decode_20k/clang 214MB/s ± 0% 204MB/s ± 2% -4.62% (p=0.008 n=5+5) wuffs_lzw_decode_100k/clang 369MB/s ± 0% 337MB/s ± 2% -8.72% (p=0.008 n=5+5) wuffs_lzw_decode_20k/gcc 232MB/s ± 1% 236MB/s ± 0% +1.99% (p=0.008 n=5+5) wuffs_lzw_decode_100k/gcc 384MB/s ± 1% 396MB/s ± 1% +3.00% (p=0.008 n=5+5) wuffs_gif_decode_1k_bw/clang 236MB/s ± 0% 230MB/s ± 0% -2.67% (p=0.008 n=5+5) wuffs_gif_decode_1k_color/clang 118MB/s ± 1% 120MB/s ± 0% +1.10% (p=0.008 n=5+5) wuffs_gif_decode_10k_bgra/clang 562MB/s ± 0% 562MB/s ± 0% ~ (p=0.690 n=5+5) wuffs_gif_decode_10k_indexed/clang 149MB/s ± 0% 149MB/s ± 0% ~ (p=0.421 n=5+5) wuffs_gif_decode_100k_artificial/clang 487MB/s ± 0% 459MB/s ± 1% -5.63% (p=0.008 n=5+5) wuffs_gif_decode_100k_realistic/clang 183MB/s ± 0% 174MB/s ± 0% -4.52% (p=0.008 n=5+5) wuffs_gif_decode_1000k/clang 185MB/s ± 0% 177MB/s ± 1% -4.61% (p=0.008 n=5+5) wuffs_gif_decode_anim_screencap/clang 1.02GB/s ± 0% 0.97GB/s ± 0% -5.30% (p=0.008 n=5+5) wuffs_gif_decode_1k_bw/gcc 250MB/s ± 0% 249MB/s ± 0% -0.63% (p=0.016 n=5+5) wuffs_gif_decode_1k_color/gcc 133MB/s ± 0% 133MB/s ± 1% ~ (p=0.151 n=5+5) wuffs_gif_decode_10k_bgra/gcc 543MB/s ± 1% 543MB/s ± 0% ~ (p=0.548 n=5+5) wuffs_gif_decode_10k_indexed/gcc 167MB/s ± 1% 166MB/s ± 1% -0.83% (p=0.032 n=5+5) wuffs_gif_decode_100k_artificial/gcc 465MB/s ± 1% 465MB/s ± 1% ~ (p=0.841 n=5+5) wuffs_gif_decode_100k_realistic/gcc 190MB/s ± 0% 190MB/s ± 1% ~ (p=0.222 n=5+5) wuffs_gif_decode_1000k/gcc 192MB/s ± 1% 193MB/s ± 0% ~ (p=0.421 n=5+5) wuffs_gif_decode_anim_screencap/gcc 1.00GB/s ± 1% 1.00GB/s ± 1% ~ (p=0.841 n=5+5)
This commit is contained in:
1 parent
010df42d75
commit
179f7afb9b
3 files changed
+68
-4
No files matched your search
@@ -49,6 +49,8 @@ pub func decoder.decode!??(dst base.io_writer, src base.io_reader) {
|
||||
var prev_code base.u32[..4095] = end_code
|
||||
var width base.u32[..12] = literal_width + 1
|
||||
|
||||
var bad base.bool
|
||||
|
||||
// First, use the j variable to initialize some state.
|
||||
var j base.u32[..8191]
|
||||
while j < clear_code {
|
||||
@@ -208,7 +210,8 @@ pub func decoder.decode!??(dst base.io_writer, src base.io_reader) {
|
||||
}
|
||||
|
||||
} else {
|
||||
return "?bad code"
|
||||
bad = true
|
||||
break
|
||||
}
|
||||
|
||||
// Flush the output if it could be too full to contain the entire
|
||||
@@ -247,6 +250,10 @@ pub func decoder.decode!??(dst base.io_writer, src base.io_reader) {
|
||||
this.flush_j = j
|
||||
this.auto_flush!??(dst:args.dst)
|
||||
}
|
||||
|
||||
if bad {
|
||||
return "?bad code"
|
||||
}
|
||||
}
|
||||
|
||||
pri func decoder.auto_flush!??(dst base.io_writer) {
|
||||
|
||||
Reference in new issue
Block a user