Skip to content

Add SILK noise shape primitives#163

Merged
thomas-vilte merged 1 commit into
pion:mainfrom
thomas-vilte:feat/silk-noise-shape
Jul 23, 2026
Merged

Add SILK noise shape primitives#163
thomas-vilte merged 1 commit into
pion:mainfrom
thomas-vilte:feat/silk-noise-shape

Conversation

@thomas-vilte

Copy link
Copy Markdown
Member

Description

adds two small standalone pieces:

  • noise_shape.go: sigmoid and warpedAutocorrelationFLP — autocorrelation through a chain of first-order all-pass warping sections, used by the noise-shaping analysis stage.
  • control_snr.go: controlSNR — target residual-quantizer SNR as a function of bitrate, plus the NB/MB/WB bitrate→SNR lookup tables

ported from SigProc_FLP.h, warped_autocorrelation_FLP.c, and control_SNR.c. control_snr.go didn't have a test upstream, so I wrote one from scratch (low-rate floor, first reachable table bucket, high-rate clamp, and the 10ms subframe-count rate offset)

this is a smaller slice of noise shaping than originally planned — noise_shape_analysis.go (the actual silk_noise_shape_analysis_FLP/silk_process_gains_FLP orchestration) turned out to be entirely *Encoder methods with no separable pure logic underneath, so the whole file — plus a couple of small helpers only those two functions use — moves to the piece that introduces the encoder struct instead

Co-authored-by: François Allais <francois.allais@hotmail.com>
@thomas-vilte
thomas-vilte requested a review from FrantaBOT July 22, 2026 21:32
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.31%. Comparing base (12f8137) to head (1100487).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #163      +/-   ##
==========================================
+ Coverage   89.27%   89.31%   +0.04%     
==========================================
  Files          44       46       +2     
  Lines        8783     8817      +34     
==========================================
+ Hits         7841     7875      +34     
  Misses        707      707              
  Partials      235      235              
Flag Coverage Δ
go 89.31% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thomas-vilte
thomas-vilte merged commit a3150b6 into pion:main Jul 23, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants