Skip to main content

dequant_block_dct8

Function dequant_block_dct8 

Source
pub fn dequant_block_dct8(
    quant_ac_x: &[i32; 64],
    quant_ac_y: &[i32; 64],
    quant_ac_b: &[i32; 64],
    weights_x: &[f32; 64],
    weights_y: &[f32; 64],
    weights_b: &[f32; 64],
    qac_qm: [f32; 3],
    x_factor: f32,
    b_factor: f32,
    output_x: &mut [f32; 64],
    output_y: &mut [f32; 64],
    output_b: &mut [f32; 64],
)
Expand description

Dequantize a DCT8 block and apply CfL (chroma-from-luma) in one pass.

For each channel c and coefficient i (except DC at index 0): biased = adjust_quant_bias(quant_ac[c][i], c) dequant[c][i] = biased * weights[c][i] / (qac * qm_mul[c])

Then CfL restore (AC positions only): dequant[X][i] += x_factor * dequant[Y][i] dequant[B][i] += b_factor * dequant[Y][i]

DC (index 0) is left as-is in the output (caller must restore LLF from DC).

ยงParameters

  • quant_ac_x/y/b: Quantized AC coefficients per channel, [i32; 64]
  • weights_x/y/b: Dequantization weights per channel, [f32; 64]
  • qac_qm: Per-channel qac * qm_mul values [x, y, b]
  • x_factor: CfL ytox ratio for this tile
  • b_factor: CfL ytob ratio for this tile
  • output_x/y/b: Output dequantized coefficients per channel, [f32; 64]