Add choose

wuffs_png_decode_filter_1_sub/clang9       905MB/s ± 0%  1339MB/s ± 0%  +48.05%  (p=0.008 n=5+5)
wuffs_png_decode_filter_1_sub/gcc10       1.12GB/s ± 0%  1.85GB/s ± 0%  +64.80%  (p=0.016 n=5+4)
This commit is contained in:
Nigel Tao committed 2021-01-06 23:16:16 +11:00
1 parent 364c396ae8
commit beaf3ef11f
11 files changed
+235 -22

No files matched your search

+9
View File
@@ -177,6 +177,7 @@ pub func decoder.decode_image_config?(dst: nptr base.image_config, src: base.io_
return "#unsupported PNG file"
}
this.workbuf_length = (this.height as base.u64) * (1 + this.bytes_per_row)
this.choose_filter_implementations!()
// Compression.
a8 = args.src.read_u8?()
@@ -244,6 +245,14 @@ pub func decoder.decode_image_config?(dst: nptr base.image_config, src: base.io_
this.call_sequence = 3
}
pri func decoder.choose_filter_implementations!() {
if this.filter_distance == 3 {
// TODO.
} else if this.filter_distance == 4 {
choose filter_1 = [filter_1_distance_4_fallback]
}
}
pri func decoder.decode_plte?(src: base.io_reader) {
var num_palette_entries : base.u32[..= 256]
var i : base.u32