Differences From Artifact [ee397f8bd5]:
- File src/OFLHAArchive_LHStream.m — part of check-in [c1e949a8c6] at 2019-03-09 10:48:04 on branch trunk — Several minor fixes (user: js, size: 12333) [annotate] [blame] [check-ins using]
To Artifact [53f546e890]:
- File
src/OFLHAArchive_LHStream.m
— part of check-in
[6a0bf8be32]
at
2019-03-20 21:04:36
on branch trunk
— Force inline tryReadBits and of_huffman_tree_walk
This gives a significant performance improvement, cutting decompression
time almost in half. (user: js, size: 12360) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
40 41 42 43 44 45 46 | STATE_DIST_TREE_SINGLE, STATE_BLOCK_LITLEN, STATE_BLOCK_DIST_LENGTH, STATE_BLOCK_DIST_LENGTH_EXTRA, STATE_BLOCK_LEN_DIST_PAIR }; | | > | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | STATE_DIST_TREE_SINGLE, STATE_BLOCK_LITLEN, STATE_BLOCK_DIST_LENGTH, STATE_BLOCK_DIST_LENGTH_EXTRA, STATE_BLOCK_LEN_DIST_PAIR }; static OF_INLINE bool tryReadBits(OFLHAArchive_LHStream *stream, uint16_t *bits, uint8_t count) { uint16_t ret = stream->_savedBits; assert(stream->_savedBitsLength < count); for (uint_fast8_t i = stream->_savedBitsLength; i < count; i++) { if OF_UNLIKELY (stream->_bitIndex == 8) { if OF_LIKELY (stream->_bufferIndex < stream->_bufferLength) stream->_byte = stream->_buffer[stream->_bufferIndex++]; else { const size_t bufferLength = OF_LHA_ARCHIVE_LHSTREAM_BUFFER_SIZE; size_t length = [stream->_stream readIntoBuffer: stream->_buffer |
︙ | ︙ |