mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Rename std/deflate decode_huffman_fast function
This commit is contained in:
1 parent
97591ee3c9
commit
39e2044102
4 files changed
+11
-11
No files matched your search
@@ -21969,7 +21969,7 @@ wuffs_deflate__decoder__init_huff(
|
||||
uint32_t a_base_symbol);
|
||||
|
||||
static wuffs_base__status
|
||||
wuffs_deflate__decoder__decode_huffman_fast(
|
||||
wuffs_deflate__decoder__decode_huffman_fast64(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_buffer* a_dst,
|
||||
wuffs_base__io_buffer* a_src);
|
||||
@@ -22328,7 +22328,7 @@ wuffs_deflate__decoder__decode_blocks(
|
||||
if (a_src) {
|
||||
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr));
|
||||
}
|
||||
v_status = wuffs_deflate__decoder__decode_huffman_fast(self, a_dst, a_src);
|
||||
v_status = wuffs_deflate__decoder__decode_huffman_fast64(self, a_dst, a_src);
|
||||
if (a_src) {
|
||||
iop_a_src = a_src->data.ptr + a_src->meta.ri;
|
||||
}
|
||||
@@ -23059,10 +23059,10 @@ wuffs_deflate__decoder__init_huff(
|
||||
return wuffs_base__make_status(NULL);
|
||||
}
|
||||
|
||||
// -------- func deflate.decoder.decode_huffman_fast
|
||||
// -------- func deflate.decoder.decode_huffman_fast64
|
||||
|
||||
static wuffs_base__status
|
||||
wuffs_deflate__decoder__decode_huffman_fast(
|
||||
wuffs_deflate__decoder__decode_huffman_fast64(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_buffer* a_dst,
|
||||
wuffs_base__io_buffer* a_src) {
|
||||
|
||||
@@ -258,7 +258,7 @@ pri func decoder.decode_blocks?(dst: base.io_writer, src: base.io_reader) {
|
||||
|
||||
this.end_of_block = false
|
||||
while true {
|
||||
status = this.decode_huffman_fast!(dst: args.dst, src: args.src)
|
||||
status = this.decode_huffman_fast64!(dst: args.dst, src: args.src)
|
||||
if status.is_error() {
|
||||
return status
|
||||
}
|
||||
@@ -281,7 +281,7 @@ pri func decoder.decode_uncompressed?(dst: base.io_writer, src: base.io_reader)
|
||||
|
||||
// TODO: make this "if" into a function invariant?
|
||||
//
|
||||
// Ditto for decode_huffman_slow and decode_huffman_fast.
|
||||
// Ditto for decode_huffman_slow and decode_huffman_fastxx.
|
||||
if (this.n_bits >= 8) or ((this.bits >> (this.n_bits & 7)) <> 0) {
|
||||
return "#internal error: inconsistent n_bits"
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// TODO: describe how the xxx_fast version differs from the xxx_slow one, the
|
||||
// assumptions that xxx_fast makes, and how that makes it fast.
|
||||
pri func decoder.decode_huffman_fast!(dst: base.io_writer, src: base.io_reader) base.status {
|
||||
// TODO: describe how the xxx_fastxx version differs from the xxx_slow one, the
|
||||
// assumptions that xxx_fastxx makes, and how that makes it fast.
|
||||
pri func decoder.decode_huffman_fast64!(dst: base.io_writer, src: base.io_reader) base.status {
|
||||
// When editing this function, consider making the equivalent change to the
|
||||
// decode_huffman_slow function. Keep the diff between the two
|
||||
// decode_huffman_*.wuffs files as small as possible, while retaining both
|
||||
@@ -175,7 +175,7 @@ pri func decoder.decode_huffman_fast!(dst: base.io_writer, src: base.io_reader)
|
||||
n_bits ~mod-= table_entry_n_bits
|
||||
|
||||
// The "while true { etc; break }" is a redundant version of "etc", but
|
||||
// its presence minimizes the diff between decode_huffman_fast and
|
||||
// its presence minimizes the diff between decode_huffman_fastxx and
|
||||
// decode_huffman_slow.
|
||||
while true,
|
||||
pre args.dst.length() >= 258,
|
||||
|
||||
@@ -34,7 +34,7 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader)
|
||||
var hdist : base.u32
|
||||
|
||||
// When editing this function, consider making the equivalent change to the
|
||||
// decode_huffman_fast function. Keep the diff between the two
|
||||
// decode_huffman_fastxx functions. Keep the diff between the two
|
||||
// decode_huffman_*.wuffs files as small as possible, while retaining both
|
||||
// correctness and performance.
|
||||
|
||||
|
||||
Reference in new issue
Block a user