Enable tf_analysis
Browse files at this commit187bef2dc4e1175751df038d7230120b42570587Parent: 7a1f515- feat
- enable tf_analysis
- lane report + 14-row sweep
3 changed files +35 -1
- crates/ec-opus/src/celt_enc.rs +1 -1
- lanes/opus-sp-r1.report.md +18 -0
- lanes/opus-sp-r1.sweep.txt +16 -0
crates/ec-opus/src/celt_enc.rsmodified+1 -1
| @@ -678,7 +678,7 @@ impl CeltEncoder { | ||
| 678 | 678 | // `TF_ANALYSIS`: run the libopus Viterbi tf search when there are |
| 679 | 679 | // enough bits; otherwise fall back to the no-analysis default (raw |
| 680 | 680 | // `is_transient` per band codes "no tf change" under tf_select=0). |
| 681 | - const TF_ANALYSIS: bool = false; | |
| 681 | + const TF_ANALYSIS: bool = true; | |
| 682 | 682 | let tf_select = if TF_ANALYSIS && effective_bytes >= 15 * c as i32 { |
| 683 | 683 | let lambda = (80i32).max(20480 / effective_bytes + 2); |
| 684 | 684 | let mut importance = [0i32; NB_BANDS]; |
lanes/opus-sp-r1.report.mdadded+18 -0
| @@ -0,0 +1,18 @@ | ||
| 1 | +# lane-opus-sp r1 — spreading_decision port + TF analysis on | |
| 2 | + | |
| 3 | +## What | |
| 4 | +- `celt_enc.rs`: port of libopus `spreading_decision` (tonal_average / hf_average / tapset state, `spread_weight` from dynalloc mask). Spread histogram now matches libopus on the 14-row sweep. | |
| 5 | +- `TF_ANALYSIS = true` (was false): libopus-style tf_analysis drives tf_res instead of the `tf_res = is_transient` default. | |
| 6 | + | |
| 7 | +## Gate (14 rows, equal size, vs lanes/opus-sb-r1.sweep.txt) | |
| 8 | +- corr gap delta per row: |Δ| ≤ .0002 (reelm@64 +.0037 → +.0039; hein@96 −.0003 → −.0002); all others unchanged to 4 dp. | |
| 9 | +- err_ratio down where it mattered: reelm@64 .69 → .63, her@96 1.21 → 1.07. | |
| 10 | +- RATE GATE: all rows within ±5% (max −1.8%). DROPOUT GATE: 0 ours-only. | |
| 11 | +- Rows: lanes/opus-sp-r1.sweep.txt (EVIDENCE: scratchpad lanes/opus-sp-r2.gate14.log, 723 s). | |
| 12 | + | |
| 13 | +## Suite | |
| 14 | +`cargo test -p ec-opus --release`: 34 + 27 passed, 9 ignored (sweep tests). | |
| 15 | + | |
| 16 | +## Residue (unchanged) | |
| 17 | +- reelm@64 +.0039, hein@64 +.0022 corr behind libopus. | |
| 18 | +- Next divergence: intensity band (ours 8160 Hz vs libopus 6720 Hz); short-frame trim ours 0–2 vs libopus 0. |
lanes/opus-sp-r1.sweep.txtadded+16 -0
| @@ -0,0 +1,16 @@ | ||
| 1 | +nik@64k: ref 69.2 ours 68.7 kbps (-0.7%), corr o=0.9883 r=0.9864 gap=-0.0020, Q o=-126.20 r=-154.78, err_ratio 0.854, minsec o=0.9765 r=0.9745, drop o=0 r=0 | |
| 2 | +nik@96k: ref 101.0 ours 100.6 kbps (-0.4%), corr o=0.9947 r=0.9940 gap=-0.0006, Q o=-49.40 r=-31.55, err_ratio 1.162, minsec o=0.9888 r=0.9888, drop o=0 r=0 | |
| 3 | +reelo@64k: ref 63.6 ours 63.5 kbps (-0.1%), corr o=0.9884 r=0.9866 gap=-0.0017, Q o=-211.09 r=-123.36, err_ratio 1.569, minsec o=0.9629 r=0.9686, drop o=0 r=0 | |
| 4 | +reelo@96k: ref 93.9 ours 93.8 kbps (-0.1%), corr o=0.9945 r=0.9937 gap=-0.0008, Q o=-127.38 r=-125.18, err_ratio 1.013, minsec o=0.9855 r=0.9854, drop o=0 r=0 | |
| 5 | +her@64k: ref 67.9 ours 67.4 kbps (-0.8%), corr o=0.9826 r=0.9794 gap=-0.0031, Q o=-365.27 r=-339.00, err_ratio 1.101, minsec o=0.9450 r=0.9406, drop o=0 r=0 | |
| 6 | +her@96k: ref 101.5 ours 100.6 kbps (-0.9%), corr o=0.9911 r=0.9902 gap=-0.0008, Q o=-206.04 r=-191.50, err_ratio 1.071, minsec o=0.9715 r=0.9728, drop o=0 r=0 | |
| 7 | +reell@64k: ref 71.3 ours 71.3 kbps (-0.1%), corr o=0.9907 r=0.9880 gap=-0.0028, Q o=-323.58 r=-128.39, err_ratio 2.429, minsec o=0.9704 r=0.9644, drop o=0 r=0 | |
| 8 | +reell@96k: ref 105.4 ours 105.3 kbps (-0.0%), corr o=0.9956 r=0.9948 gap=-0.0008, Q o=-156.53 r=-29.16, err_ratio 2.349, minsec o=0.9858 r=0.9804, drop o=0 r=0 | |
| 9 | +reelm@64k: ref 63.3 ours 62.3 kbps (-1.6%), corr o=0.9821 r=0.9859 gap=+0.0039, Q o=-270.53 r=-392.46, err_ratio 0.632, minsec o=0.9101 r=0.9100, drop o=0 r=0 | |
| 10 | +reelm@96k: ref 84.8 ours 83.6 kbps (-1.5%), corr o=0.9920 r=0.9920 gap=-0.0000, Q o=-139.95 r=-231.16, err_ratio 0.640, minsec o=0.9617 r=0.9511, drop o=0 r=0 | |
| 11 | +dl8a@64k: ref 65.8 ours 65.6 kbps (-0.3%), corr o=0.9881 r=0.9865 gap=-0.0016, Q o=-276.58 r=-378.84, err_ratio 0.679, minsec o=0.9744 r=0.9723, drop o=0 r=0 | |
| 12 | +dl8a@96k: ref 96.8 ours 96.1 kbps (-0.8%), corr o=0.9940 r=0.9934 gap=-0.0006, Q o=-193.52 r=-423.47, err_ratio 0.404, minsec o=0.9860 r=0.9864, drop o=0 r=0 | |
| 13 | +hein@64k: ref 64.9 ours 63.8 kbps (-1.7%), corr o=0.9852 r=0.9874 gap=+0.0022, Q o=-284.04 r=-388.31, err_ratio 0.677, minsec o=0.9124 r=0.9148, drop o=0 r=0 | |
| 14 | +hein@96k: ref 86.9 ours 85.4 kbps (-1.8%), corr o=0.9933 r=0.9930 gap=-0.0002, Q o=-153.23 r=-246.46, err_ratio 0.643, minsec o=0.9618 r=0.9499, drop o=0 r=0 | |
| 15 | +RATE GATE: all rows within ±5% | |
| 16 | +DROPOUT GATE: passed (no ours-only dropouts) |