Skip to content

Commit 4273fbd

Browse files
committed
HuffmanTable: make nb_syms_ able to store 256 symbols
Right now, we're not using all of the 256 possible symbols, but with progressive we could. Makeing nb_syms_ be an int will avoid a future bug. Also: remove unused BuildHuffmanCodes() declaration.
1 parent 9990bdc commit 4273fbd

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/sjpegi.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ extern void SetMinQuantMatrix(const uint8_t* const m, uint8_t out[64],
137137
struct HuffmanTable {
138138
uint8_t bits_[16]; // number of symbols per bit count
139139
const uint8_t* syms_; // symbol map, in increasing bit length
140-
uint8_t nb_syms_; // cached value of sum(bits_[])
140+
int nb_syms_; // cached value of sum(bits_[])
141141
};
142142

143143
// quantizer matrices
@@ -276,9 +276,6 @@ struct Encoder {
276276
// Histogram pass
277277
void CollectHistograms();
278278

279-
void BuildHuffmanCodes(const HuffmanTable* const tab,
280-
uint32_t* const codes);
281-
282279
typedef int (*QuantizeBlockFunc)(const int16_t in[64], int idx,
283280
const Quantizer* const Q,
284281
DCTCoeffs* const out, RunLevel* const rl);

0 commit comments

Comments
 (0)