29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
typedef struct _OFHuffmanTree {
struct _OFHuffmanTree *_Nullable leaves[2];
uint16_t value;
} *OFHuffmanTree;
/* Inlined for performance. */
static OF_INLINE bool
OFHuffmanTreeWalk(id _Nullable stream,
bool (*bitReader)(id _Nullable, uint16_t *_Nonnull, uint8_t),
OFHuffmanTree _Nonnull *_Nonnull tree, uint16_t *_Nonnull value)
{
OFHuffmanTree iter = *tree;
uint16_t bits;
while (iter->value == 0xFFFF) {
|
|
|
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
typedef struct _OFHuffmanTree {
struct _OFHuffmanTree *_Nullable leaves[2];
uint16_t value;
} *OFHuffmanTree;
/* Inlined for performance. */
static OF_INLINE bool
_OFHuffmanTreeWalk(id _Nullable stream,
bool (*bitReader)(id _Nullable, uint16_t *_Nonnull, uint8_t),
OFHuffmanTree _Nonnull *_Nonnull tree, uint16_t *_Nonnull value)
{
OFHuffmanTree iter = *tree;
uint16_t bits;
while (iter->value == 0xFFFF) {
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
*value = iter->value;
return true;
}
#ifdef __cplusplus
extern "C" {
#endif
extern OFHuffmanTree _Nonnull OFHuffmanTreeNew(uint8_t lengths[_Nonnull],
uint16_t count);
extern OFHuffmanTree _Nonnull OFHuffmanTreeNewSingle(uint16_t value);
extern void OFHuffmanTreeFree(OFHuffmanTree _Nonnull tree);
#ifdef __cplusplus
}
#endif
OF_ASSUME_NONNULL_END
|
|
|
|
>
|
>
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
*value = iter->value;
return true;
}
#ifdef __cplusplus
extern "C" {
#endif
extern OFHuffmanTree _Nonnull _OFHuffmanTreeNew(uint8_t lengths[_Nonnull],
uint16_t count) OF_VISIBILITY_HIDDEN;
extern OFHuffmanTree _Nonnull _OFHuffmanTreeNewSingle(uint16_t value)
OF_VISIBILITY_HIDDEN;
extern void _OFHuffmanTreeFree(OFHuffmanTree _Nonnull tree)
OF_VISIBILITY_HIDDEN;
#ifdef __cplusplus
}
#endif
OF_ASSUME_NONNULL_END
|