mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 10:19:20 +00:00
LibGfx/JPEG: Write quantization tables in the zigzag ordering
This is clearly something I missed during the first implementation. The specification is crystal clear about it: "The quantization elements shall be specified in zig-zag scan order." This patch fixes the weird behavior we had when using the quantization table.
This commit is contained in:
parent
c63d66e32f
commit
05c8ad4e91
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/LucasChollet
Commit: 05c8ad4e91
Pull-request: https://github.com/SerenityOS/serenity/pull/19741
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/gmta ✅
1 changed files with 2 additions and 2 deletions
|
@ -398,8 +398,8 @@ ErrorOr<void> add_quantization_table(Stream& stream, QuantizationTable const& ta
|
|||
// Pq and Tq
|
||||
TRY(stream.write_value<u8>((0 << 4) | table.id));
|
||||
|
||||
for (auto coefficient : table.table)
|
||||
TRY(stream.write_value<u8>(coefficient));
|
||||
for (u8 i = 0; i < 64; ++i)
|
||||
TRY(stream.write_value<u8>(table.table[zigzag_map[i]]));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue