class

Hwaro::Content::Processors::WebpEncoder::Quantizer

Inherits Reference < Object

One quantizer (RFC 6386 ยง14.1 steps) with libwebp's rounding bias and the dead-zone threshold derived from it, for the DC (index 0) and AC (index 1) positions.

Constants

MAX_LEVEL = 2047
SHARPEN = Slice[0, 30, 60, 90, 30, 60, 90, 90, 60, 90, 90, 90, 90, 90, 90, 90]

Slight boost of the high-frequency luma coefficients (libwebp's kFreqSharpening, in raster order).

Constructors

new(q : Tuple(Int32, Int32), bias : Tuple(Int32, Int32), sharpen : Bool)
Source

Instance methods

quantize(coeffs : Slice(Int32), off : Int32, first : Int32, levels : Slice(Int16), loff : Int32) : Nil

Quantize the raster-order block at coeffs[off] from zigzag position first: levels go to levels[loff] in zigzag order and coeffs is replaced by what the decoder will dequantize.

Source