mirror of
https://github.com/webmproject/libwebp.git
synced 2025-04-06 08:56:48 +02:00
Lossless decoder: remove an unneeded param in ReadHuffmanCodeLengths().
Change-Id: I279452fdf38b680737d5ba6e868a219281bc8962
This commit is contained in:
parent
b39e7487a7
commit
a2849bc502
@ -172,7 +172,7 @@ static WEBP_INLINE int ReadSymbol(const HuffmanTree* tree,
|
|||||||
|
|
||||||
static int ReadHuffmanCodeLengths(
|
static int ReadHuffmanCodeLengths(
|
||||||
VP8LDecoder* const dec, const int* const code_length_code_lengths,
|
VP8LDecoder* const dec, const int* const code_length_code_lengths,
|
||||||
int num_codes, int num_symbols, int* const code_lengths) {
|
int num_symbols, int* const code_lengths) {
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
VP8LBitReader* const br = &dec->br_;
|
VP8LBitReader* const br = &dec->br_;
|
||||||
int symbol;
|
int symbol;
|
||||||
@ -180,7 +180,8 @@ static int ReadHuffmanCodeLengths(
|
|||||||
int prev_code_len = DEFAULT_CODE_LENGTH;
|
int prev_code_len = DEFAULT_CODE_LENGTH;
|
||||||
HuffmanTree tree;
|
HuffmanTree tree;
|
||||||
|
|
||||||
if (!HuffmanTreeBuildImplicit(&tree, code_length_code_lengths, num_codes)) {
|
if (!HuffmanTreeBuildImplicit(&tree, code_length_code_lengths,
|
||||||
|
NUM_CODE_LENGTH_CODES)) {
|
||||||
dec->status_ = VP8_STATUS_BITSTREAM_ERROR;
|
dec->status_ = VP8_STATUS_BITSTREAM_ERROR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -278,9 +279,8 @@ static int ReadHuffmanCode(int alphabet_size, VP8LDecoder* const dec,
|
|||||||
for (i = 0; i < num_codes; ++i) {
|
for (i = 0; i < num_codes; ++i) {
|
||||||
code_length_code_lengths[kCodeLengthCodeOrder[i]] = VP8LReadBits(br, 3);
|
code_length_code_lengths[kCodeLengthCodeOrder[i]] = VP8LReadBits(br, 3);
|
||||||
}
|
}
|
||||||
ok = ReadHuffmanCodeLengths(dec, code_length_code_lengths,
|
ok = ReadHuffmanCodeLengths(dec, code_length_code_lengths, alphabet_size,
|
||||||
NUM_CODE_LENGTH_CODES,
|
code_lengths);
|
||||||
alphabet_size, code_lengths);
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ok = HuffmanTreeBuildImplicit(tree, code_lengths, alphabet_size);
|
ok = HuffmanTreeBuildImplicit(tree, code_lengths, alphabet_size);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user