#endif
#include "wimlib/assert.h"
+#include "wimlib/endianness.h"
#include "wimlib/compiler.h"
#include "wimlib/compress.h"
#include "wimlib/util.h"
bitstream_put_bits(struct output_bitstream *ostream, u32 bits,
unsigned num_bits)
{
+ bits &= (1U << num_bits) - 1;
while (num_bits > ostream->free_bits) {
/* Buffer variable does not have space for the new bits. It
* needs to be flushed as a 16-bit integer. Bits in the second
}
typedef struct {
- freq_t freq;
+ input_idx_t freq;
u16 sym;
union {
u16 path_len;
void
make_canonical_huffman_code(unsigned num_syms,
unsigned max_codeword_len,
- const freq_t freq_tab[restrict],
+ const input_idx_t freq_tab[restrict],
u8 lens[restrict],
u16 codewords[restrict])
{