Expand description
Translation of src/utils/quant_levels_dec_utils.c and src/utils/quant_levels_dec_utils.h from libwebp v1.6.0.
Work package: WP4 (pixel ops).
§Deviations from upstream
Changes of representation that the ADRs allow, or behavior that the Rust side cannot reproduce exactly. Each records the reason.
- Uninitialized scratch in
WebPDequantizeLevels.VFilterreads the first2 * radius + 1rows of its ring before any row has been stored there, and the C allocation (WebPSafeMalloc) is not initialized. Reading it is undefined in C, and Rust zero-initializes the scratch (ADR 0003, PORTING rule 8). The probe ran random planes withMallocScribble=1, which fills allocations with0xaa, and the output did not change. The differential test compares the C output as the build prints it. The probe does not fill the heap itself: a fill before the call did not reach the allocation on the development host.
Functions§
- webp_
dequantize_ levels - Smooths a plane that was quantized to a few levels, with a filter whose
radius grows with
strength(0 to 100). Returnsfalsefor a missing plane, a non-positive size, a strength outside[0, 100], or an allocation failure; the plane is then unchanged.