/** * Requantization, reordering, and stereo reconstruction. * * The Huffman stage produced integers. This stage turns them back into the * floating-point spectrum the encoder started from, undoing three things in * order: * * 1. **Requantization** — the encoder divided each line by a step size chosen * per scalefactor band, then rounded. Reversing it applies `|x|^(4/3)` (the * quantizer is a power law, not linear, because the ear's loudness response * is) and multiplies by the band's step size back. * 2. **Reordering** — short blocks are transmitted grouped by scalefactor band, * but the IMDCT needs them grouped by sub-band. The interleaving has to be * undone before the transform. * 3. **Stereo reconstruction** — joint stereo transmits mid/side or an intensity * position instead of left/right, because the two channels of real music are * highly correlated and the difference signal is cheap to code. */ import type { GranuleInfo } from './sideinfo.js'; import type { Scalefactors } from './huffman.js'; /** * Converts quantized integers into the requantized spectrum. * * @param values 576 quantized lines from the Huffman stage. * @param out 576 requantized floats. */ export declare function requantize(values: Int32Array, granule: GranuleInfo, scalefactors: Scalefactors, sampleRate: number, nonZeroCount: number, out: Float32Array): void; /** * Undoes the short-block interleaving. * * Transmitted order is scalefactor-band-major: band 0's three windows, then band * 1's three windows, and so on. The IMDCT needs sub-band-major order, where each * sub-band's 18 values are window 0's six lines, then window 1's, then window 2's. */ export declare function reorderShortBlock(spectrum: Float32Array, granule: GranuleInfo, sampleRate: number, scratch: Float32Array): void; /** * Reconstructs left and right from a joint-stereo pair. * * Two independent mechanisms, which can both be active: * * - **MS (mid/side)**: the encoder sent `(L+R)/√2` and `(L-R)/√2`. Lossless, and * very effective on centred material where the side signal is near-silent. * - **Intensity**: above some band the encoder discarded the side information * entirely and sent only a stereo *position*. Both channels are rebuilt from * the mid signal scaled by that position — lossy, and audible as a collapsed * image if applied too low. */ export declare function applyJointStereo(left: Float32Array, right: Float32Array, modeExtension: number, granule: GranuleInfo, rightScalefactors: Scalefactors, sampleRate: number, nonZeroRight: number, isMpeg1: boolean): void;