1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

LibGfx: Remove some noisy dbgln_if()s in webp decoder

Pixel decoding mostly works, so there's no need to log all this data.
This commit is contained in:
Nico Weber 2023-04-03 19:25:45 -04:00 committed by Linus Groh
parent cc33a57620
commit 8e6911c8f6

View file

@ -550,7 +550,6 @@ static ErrorOr<void> decode_webp_chunk_VP8L(WebPLoadingContext& context, Chunk c
while (pixel < end) {
auto symbol = TRY(group[0].read_symbol(bit_stream));
dbgln_if(WEBP_DEBUG, " pixel sym {}", symbol);
if (symbol >= 256u + 24u + color_cache_size)
return context.error("WebPImageDecoderPlugin: Symbol out of bounds");
@ -600,8 +599,6 @@ static ErrorOr<void> decode_webp_chunk_VP8L(WebPLoadingContext& context, Chunk c
// https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#522_lz77_backward_reference
// "Distance codes larger than 120 denote the pixel-distance in scan-line order, offset by 120."
// "The smallest distance codes [1..120] are special, and are reserved for a close neighborhood of the current pixel."
dbgln_if(WEBP_DEBUG, " backref L {} D {}", length, distance);
if (distance <= 120) {
auto offset = distance_map[distance - 1];
distance = offset.x + offset.y * context.size->width();
@ -610,7 +607,6 @@ static ErrorOr<void> decode_webp_chunk_VP8L(WebPLoadingContext& context, Chunk c
} else {
distance = distance - 120;
}
dbgln_if(WEBP_DEBUG, " effective distance {}", distance);
if (pixel - context.bitmap->begin() < distance)
return context.error("WebPImageDecoderPlugin: Backward reference distance out of bounds");
@ -626,7 +622,6 @@ static ErrorOr<void> decode_webp_chunk_VP8L(WebPLoadingContext& context, Chunk c
else {
// "a. Use S - (256 + 24) as the index into the color cache."
unsigned index = symbol - (256 + 24);
dbgln_if(WEBP_DEBUG, " use color cache {}", index);
// "b. Get ARGB color from the color cache at that index."
if (index >= color_cache_size)