LibGfx/WebPWriter: Remove two obsolete comments

In an early version of the huffman writing code, we always used 8 bits
here, and the comments still reflected that. Since we're now always
writing only as many bits as we need (in practice, still almost always
8), the comments are misleading.
This commit is contained in:
Nico Weber 2024-05-29 18:24:41 -04:00 committed by Jelle Raaijmakers
parent 925bea444b
commit a2ddf054f2
Notes: sideshowbarker 2024-07-17 21:11:12 +09:00

View File

@ -189,8 +189,8 @@ static ErrorOr<CanonicalCode> write_normal_code_lengths(LittleEndianOutputBitStr
unsigned needed_length_nbits = ceil(log2(encoded_lengths_count - 2));
VERIFY(needed_length_nbits <= 16);
needed_length_nbits = ceil_div(needed_length_nbits, 2) * 2;
TRY(bit_stream.write_bits((needed_length_nbits - 2) / 2, 3u)); // length_nbits = 2 + 2 * 3 == 8
TRY(bit_stream.write_bits(encoded_lengths_count - 2, needed_length_nbits)); // max_symbol = 2 + 254
TRY(bit_stream.write_bits((needed_length_nbits - 2) / 2, 3u));
TRY(bit_stream.write_bits(encoded_lengths_count - 2, needed_length_nbits));
}
// The rest is identical to write_dynamic_huffman() again. (Code 16 has different semantics, but that doesn't matter here.)