diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index d2ebe759..8fdd0d61 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -5185,9 +5185,6 @@ const char* wuffs_deflate__error__no_huffman_codes = const char* wuffs_deflate__error__internal_error_inconsistent_huffman_decoder_state = "?deflate: internal error: inconsistent Huffman decoder state"; -const char* - wuffs_deflate__error__internal_error_inconsistent_huffman_end_of_block = - "?deflate: internal error: inconsistent Huffman end_of_block"; const char* wuffs_deflate__error__internal_error_inconsistent_i_o = "?deflate: internal error: inconsistent I/O"; const char* wuffs_deflate__error__internal_error_inconsistent_distance = @@ -5587,9 +5584,6 @@ wuffs_deflate__decoder__decode_blocks(wuffs_deflate__decoder* self, if (self->private_impl.f_end_of_block) { goto label_0_continue; } - status = - wuffs_deflate__error__internal_error_inconsistent_huffman_end_of_block; - goto exit; } } @@ -6693,7 +6687,8 @@ wuffs_deflate__decoder__decode_huffman_slow(wuffs_deflate__decoder* self, v_lmask = ((((uint32_t)(1)) << self->private_impl.f_n_huffs_bits[0]) - 1); v_dmask = ((((uint32_t)(1)) << self->private_impl.f_n_huffs_bits[1]) - 1); label_0_continue:; - while (true) { + while ( + !(self->private_impl.c_decode_huffman_slow[0].coro_susp_point != 0)) { while (true) { v_table_entry = self->private_impl.f_huffs[0][(v_bits & v_lmask)]; v_table_entry_n_bits = (v_table_entry & 15); diff --git a/script/bench-c-deflate-fragmentation.c b/script/bench-c-deflate-fragmentation.c index 93d6ac5a..99ab4dae 100644 --- a/script/bench-c-deflate-fragmentation.c +++ b/script/bench-c-deflate-fragmentation.c @@ -32,24 +32,24 @@ // // On ../test/data/hat.png (90 × 112 pixels): // name time/op relative -// FragDstFragIDAT/gcc 286µs ± 1% 1.00x -// FragDstFullIDAT/gcc 286µs ± 0% 1.00x -// FullDstFragIDAT/gcc 214µs ± 1% 1.34x -// FullDstFullIDAT/gcc 146µs ± 1% 1.96x +// FragDstFragIDAT/gcc 289µs ± 1% 1.00x +// FragDstFullIDAT/gcc 288µs ± 0% 1.00x +// FullDstFragIDAT/gcc 149µs ± 1% 1.93x +// FullDstFullIDAT/gcc 148µs ± 1% 1.95x // // On ../test/data/hibiscus.regular.png (312 × 442 pixels): // name time/op relative -// FragDstFragIDAT/gcc 3.58ms ± 1% 1.00x -// FragDstFullIDAT/gcc 3.54ms ± 1% 1.01x -// FullDstFragIDAT/gcc 3.09ms ± 1% 1.16x -// FullDstFullIDAT/gcc 1.99ms ± 1% 1.80x +// FragDstFragIDAT/gcc 2.49ms ± 0% 1.00x +// FragDstFullIDAT/gcc 2.49ms ± 0% 1.00x +// FullDstFragIDAT/gcc 2.08ms ± 0% 1.20x +// FullDstFullIDAT/gcc 2.02ms ± 1% 1.23x // // On ../test/data/harvesters.png (1165 × 859 pixels): // name time/op relative -// FragDstFragIDAT/gcc 25.4ms ± 2% 1.00x -// FragDstFullIDAT/gcc 25.2ms ± 0% 1.01x -// FullDstFragIDAT/gcc 22.2ms ± 0% 1.14x -// FullDstFullIDAT/gcc 14.0ms ± 1% 1.81x +// FragDstFragIDAT/gcc 15.6ms ± 2% 1.00x +// FragDstFullIDAT/gcc 15.4ms ± 0% 1.01x +// FullDstFragIDAT/gcc 14.4ms ± 0% 1.08x +// FullDstFullIDAT/gcc 14.1ms ± 0% 1.10x #include #include diff --git a/std/deflate/decode_deflate.wuffs b/std/deflate/decode_deflate.wuffs index 11c2500d..33a549eb 100644 --- a/std/deflate/decode_deflate.wuffs +++ b/std/deflate/decode_deflate.wuffs @@ -27,7 +27,6 @@ pub status "?missing end-of-block code" pub status "?no Huffman codes" pri status "?internal error: inconsistent Huffman decoder state" -pri status "?internal error: inconsistent Huffman end_of_block" pri status "?internal error: inconsistent I/O" pri status "?internal error: inconsistent distance" pri status "?internal error: inconsistent n_bits" @@ -230,7 +229,6 @@ pri func decoder.decode_blocks?(dst base.io_writer, src base.io_reader) { if this.end_of_block { continue:outer } - return "?internal error: inconsistent Huffman end_of_block" } } } diff --git a/std/deflate/decode_huffman_slow.wuffs b/std/deflate/decode_huffman_slow.wuffs index 89360f40..dd59f7a2 100644 --- a/std/deflate/decode_huffman_slow.wuffs +++ b/std/deflate/decode_huffman_slow.wuffs @@ -48,7 +48,7 @@ pri func decoder.decode_huffman_slow?(dst base.io_writer, src base.io_reader) { lmask = ((1 as base.u32) << this.n_huffs_bits[0]) - 1 dmask = ((1 as base.u32) << this.n_huffs_bits[1]) - 1 - while:loop true { + while:loop not coroutine_resumed { // Decode an lcode symbol from H-L. while true { table_entry = this.huffs[0][bits & lmask]