mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-30 21:16:52 -06:00
opusenc: halve the a2nlsf bisection steps
Each root was refined with 40 bisection steps, which shrinks the bracket to about 3e-15 rad. A Q15 NLSF step is 9.6e-5 rad, so 20 steps (3e-9 rad) are far more than the quantiser can see. The saved cos calls are the remaining bulk of the root search after the grid table. The coded packet streams are byte-identical to the 40-step search on 24 configurations of 90 s: speech-like and music-like input, mono and stereo, SILK NB 8k, MB 12k, WB 16k and 32k, hybrid SWB 32k and FB 64k. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
587d8bdf5b
commit
fd84350122
@@ -88,8 +88,8 @@ fn cos_series(p: &[f64], w: f64) -> f64 {
|
||||
const GRID: usize = 1024;
|
||||
/// Largest multiple of ω in the series (half the LPC order, at most 16 / 2).
|
||||
const MAX_H: usize = 8;
|
||||
/// Bisection steps per root.
|
||||
const BISECT_STEPS: usize = 40;
|
||||
/// Bisection steps per root: the bracket shrinks to 3e-9 rad, far below one Q15 NLSF step (9.6e-5 rad).
|
||||
const BISECT_STEPS: usize = 20;
|
||||
|
||||
/// `cos(m · π g / GRID)` for every grid point `g` and `m` in `0..=MAX_H`, computed with the same
|
||||
/// expression as [`cos_series`], so the table values are bit-identical to calling `cos` there.
|
||||
|
||||
Reference in New Issue
Block a user