Rename std/deflate decode_huffman_fast function

This commit is contained in:
Nigel Tao committed 2021-02-08 22:34:28 +11:00
1 parent 97591ee3c9
commit 39e2044102
4 files changed
+11 -11

No files matched your search

+4 -4
View File
@@ -21969,7 +21969,7 @@ wuffs_deflate__decoder__init_huff(
uint32_t a_base_symbol); uint32_t a_base_symbol);
static wuffs_base__status static wuffs_base__status
wuffs_deflate__decoder__decode_huffman_fast( wuffs_deflate__decoder__decode_huffman_fast64(
wuffs_deflate__decoder* self, wuffs_deflate__decoder* self,
wuffs_base__io_buffer* a_dst, wuffs_base__io_buffer* a_dst,
wuffs_base__io_buffer* a_src); wuffs_base__io_buffer* a_src);
@@ -22328,7 +22328,7 @@ wuffs_deflate__decoder__decode_blocks(
if (a_src) { if (a_src) {
a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr)); 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) { if (a_src) {
iop_a_src = a_src->data.ptr + a_src->meta.ri; 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); return wuffs_base__make_status(NULL);
} }
// -------- func deflate.decoder.decode_huffman_fast // -------- func deflate.decoder.decode_huffman_fast64
static wuffs_base__status static wuffs_base__status
wuffs_deflate__decoder__decode_huffman_fast( wuffs_deflate__decoder__decode_huffman_fast64(
wuffs_deflate__decoder* self, wuffs_deflate__decoder* self,
wuffs_base__io_buffer* a_dst, wuffs_base__io_buffer* a_dst,
wuffs_base__io_buffer* a_src) { wuffs_base__io_buffer* a_src) {
+2 -2
View File
@@ -258,7 +258,7 @@ pri func decoder.decode_blocks?(dst: base.io_writer, src: base.io_reader) {
this.end_of_block = false this.end_of_block = false
while true { 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() { if status.is_error() {
return status 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? // 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) { if (this.n_bits >= 8) or ((this.bits >> (this.n_bits & 7)) <> 0) {
return "#internal error: inconsistent n_bits" return "#internal error: inconsistent n_bits"
} }
+4 -4
View File
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// TODO: describe how the xxx_fast version differs from the xxx_slow one, the // TODO: describe how the xxx_fastxx version differs from the xxx_slow one, the
// assumptions that xxx_fast makes, and how that makes it fast. // assumptions that xxx_fastxx makes, and how that makes it fast.
pri func decoder.decode_huffman_fast!(dst: base.io_writer, src: base.io_reader) base.status { 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 // When editing this function, consider making the equivalent change to the
// decode_huffman_slow function. Keep the diff between the two // decode_huffman_slow function. Keep the diff between the two
// decode_huffman_*.wuffs files as small as possible, while retaining both // 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 n_bits ~mod-= table_entry_n_bits
// The "while true { etc; break }" is a redundant version of "etc", but // 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. // decode_huffman_slow.
while true, while true,
pre args.dst.length() >= 258, pre args.dst.length() >= 258,
+1 -1
View File
@@ -34,7 +34,7 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader)
var hdist : base.u32 var hdist : base.u32
// When editing this function, consider making the equivalent change to the // 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 // decode_huffman_*.wuffs files as small as possible, while retaining both
// correctness and performance. // correctness and performance.