mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
WebP/Lossy: Allow negative values from segment adjustment too
The spec doesn't talk about this happening in the text, but `dequant_init()` in 20.4 processes segment adjustment and quantization index adjustment in the same variable `q` before clamping. Since we had to adjust the latter step in the previous commit, do it for the former step too. I haven't seen this happen in the wild yet (and now, I hopefully never will notice it if it happens).
This commit is contained in:
parent
661b2d394d
commit
2452cf6b55
Notes:
sideshowbarker
2024-07-16 20:39:14 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/2452cf6b55 Pull-request: https://github.com/SerenityOS/serenity/pull/19203
@ -613,7 +613,7 @@ i16 dequantize_value(i16 value, bool is_dc, QuantizationIndices const& quantizat
|
||||
// * For uv, the dc_qlookup index is clamped to 117 (instead of 127 for everything else)
|
||||
// (or, alternatively, the value is clamped to 132 at most)
|
||||
|
||||
u8 y_ac_base = quantization_indices.y_ac;
|
||||
int y_ac_base = quantization_indices.y_ac;
|
||||
if (segmentation.update_macroblock_segmentation_map) {
|
||||
if (segmentation.segment_feature_mode == SegmentFeatureMode::DeltaValueMode)
|
||||
y_ac_base += segmentation.quantizer_update_value[segment_id];
|
||||
|
Loading…
Reference in New Issue
Block a user