mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 12:28:26 +01:00
minor typo and style fix
Change-Id: If4927beb7a8f3c96379eee1fedc687a5046a6951
This commit is contained in:
parent
9f566d1d36
commit
ac8e5e42d1
@ -367,18 +367,17 @@ static void StoreHuffmanTreeOfHuffmanTreeToBitMask(
|
|||||||
// RFC 1951 will calm you down if you are worried about this funny sequence.
|
// RFC 1951 will calm you down if you are worried about this funny sequence.
|
||||||
// This sequence is tuned from that, but more weighted for lower symbol count,
|
// This sequence is tuned from that, but more weighted for lower symbol count,
|
||||||
// and more spiking histograms.
|
// and more spiking histograms.
|
||||||
int i;
|
|
||||||
static const uint8_t kStorageOrder[CODE_LENGTH_CODES] = {
|
static const uint8_t kStorageOrder[CODE_LENGTH_CODES] = {
|
||||||
17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||||
};
|
};
|
||||||
|
int i;
|
||||||
// Throw away trailing zeros:
|
// Throw away trailing zeros:
|
||||||
int codes_to_store = sizeof(kStorageOrder);
|
int codes_to_store = CODE_LENGTH_CODES;
|
||||||
for (; codes_to_store > 4; --codes_to_store) {
|
for (; codes_to_store > 4; --codes_to_store) {
|
||||||
if (code_length_bitdepth[kStorageOrder[codes_to_store - 1]] != 0) {
|
if (code_length_bitdepth[kStorageOrder[codes_to_store - 1]] != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// How many code length codes we write above the first four (see RFC 1951).
|
|
||||||
VP8LWriteBits(bw, 4, codes_to_store - 4);
|
VP8LWriteBits(bw, 4, codes_to_store - 4);
|
||||||
for (i = 0; i < codes_to_store; ++i) {
|
for (i = 0; i < codes_to_store; ++i) {
|
||||||
VP8LWriteBits(bw, 3, code_length_bitdepth[kStorageOrder[i]]);
|
VP8LWriteBits(bw, 3, code_length_bitdepth[kStorageOrder[i]]);
|
||||||
|
@ -26,7 +26,7 @@ extern "C" {
|
|||||||
// tree_limit: maximum bit depth (inclusive) of the codes.
|
// tree_limit: maximum bit depth (inclusive) of the codes.
|
||||||
// bit_depths[]: how many bits are used for the symbol.
|
// bit_depths[]: how many bits are used for the symbol.
|
||||||
//
|
//
|
||||||
// Returns 0 when an error has occured.
|
// Returns 0 when an error has occurred.
|
||||||
int VP8LCreateHuffmanTree(const int* data, const int length,
|
int VP8LCreateHuffmanTree(const int* data, const int length,
|
||||||
const int tree_limit, uint8_t* bit_depths);
|
const int tree_limit, uint8_t* bit_depths);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user