40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
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(OFLHADecompressingStream *stream, uint16_t *bits, uint8_t count)
{
uint16_t ret = stream->_savedBits;
assert(stream->_savedBitsLength < count);
|
>
>
>
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
STATE_DIST_TREE_SINGLE,
STATE_BLOCK_LITLEN,
STATE_BLOCK_DIST_LENGTH,
STATE_BLOCK_DIST_LENGTH_EXTRA,
STATE_BLOCK_LEN_DIST_PAIR
};
@implementation OFLHADecompressingStream
@synthesize bytesConsumed = _bytesConsumed;
static OF_INLINE bool
tryReadBits(OFLHADecompressingStream *stream, uint16_t *bits, uint8_t count)
{
uint16_t ret = stream->_savedBits;
assert(stream->_savedBitsLength < count);
|
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
stream->_savedBits = 0;
stream->_savedBitsLength = 0;
*bits = ret;
return true;
}
@implementation OFLHADecompressingStream
- (instancetype)of_initWithStream: (OFStream *)stream
distanceBits: (uint8_t)distanceBits
dictionaryBits: (uint8_t)dictionaryBits
{
self = [super init];
@try {
|
<
|
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
stream->_savedBits = 0;
stream->_savedBitsLength = 0;
*bits = ret;
return true;
}
- (instancetype)of_initWithStream: (OFStream *)stream
distanceBits: (uint8_t)distanceBits
dictionaryBits: (uint8_t)dictionaryBits
{
self = [super init];
@try {
|