Skip to content

Add SILK LTP analysis and quantization#161

Merged
thomas-vilte merged 1 commit into
pion:mainfrom
thomas-vilte:feat/silk-ltp
Jul 22, 2026
Merged

Add SILK LTP analysis and quantization#161
thomas-vilte merged 1 commit into
pion:mainfrom
thomas-vilte:feat/silk-ltp

Conversation

@thomas-vilte

Copy link
Copy Markdown
Member

Description

adds the long-term-predictor (LTP) pipeline pieces that don't need the encoder struct yet:

  • ltp_analysis.go: builds the normalized correlation matrices/vectors per subframe (findLTPFLP, silk_find_LTP_FLP)
  • ltp_quant.go: the fixed-point codebook search (vqWMatEC, silk_VQ_WMat_EC) that scores each of the 3 LTP codebooks against a correlation matrix, plus log2lin
  • ltp_scale.go: picks the LTP state-scaling index for independently-coded voiced frames based on prediction gain, target SNR, and expected packet loss (silk_LTP_scale_ctrl_FLP)

ported from find_LTP_FLP.c, VQ_WMat_EC.c, and LTP_scale_ctrl_FLP.c

left quantLTPGains out — same reasoning as find_pitch_lags.go (#158) and encodeNLSF (#160): it's a method on *Encoder (threads a gain budget across frames via sumLogGainQ7), and that type doesn't exist yet. What's here is everything it calls (vqWMatEC and the codebook tables), with a direct test built from a real correlation matrix instead of going through the method

Reference issue

part of the SILK encoder series (#160)

Co-authored-by: François Allais <francois.allais@hotmail.com>
@thomas-vilte
thomas-vilte requested a review from FrantaBOT July 22, 2026 16:10
@thomas-vilte
thomas-vilte merged commit 12f8137 into pion:main Jul 22, 2026
18 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