Add SILK frame orchestration and public EncodeSILK API - #166
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #166 +/- ##
==========================================
+ Coverage 90.85% 92.07% +1.22%
==========================================
Files 54 55 +1
Lines 9576 9792 +216
==========================================
+ Hits 8700 9016 +316
+ Misses 638 547 -91
+ Partials 238 229 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: François Allais <francois.allais@hotmail.com>
thomas-vilte
force-pushed
the
feat/silk-enc-frame
branch
from
July 25, 2026 21:26
a665b6c to
486cf3f
Compare
FrantaBOT
approved these changes
Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
this closes out the SILK encoder split from #147 — the last piece. It's the orchestrator that wires everything already merged in internal/silk/ into a full frame encode (VAD → pitch analysis → noise shaping → prediction coefs → NSQ → range-coded bitstream, in decode order) plus a public EncodeSILK method on the root Encoder
also lands the useInterpolatedNLSFs fix flagged as a known gap in #165:
findLPCNLSF 's interpolation search now only runs when complexity >= 4 , matching silk_setup_complexity in libopus. The root Encoder already had a complexity field wired to CELT, so this just threads it through to the SILK encoder too
EncodeSILK is a separate entry point from Encode / EncodeFloat32 , not an automatic CELT/SILK switch — bitrate based auto-selection still always picks CELT. This is for callers who specifically want a SILK-only voice packet
also applies a DC-block high-pass to EncodeSILK 's input ( applySILKDCBlock, reusing the same fixed 3Hz filter CELT's path already had from #137) — libopus applies this to the shared PCM ahead of both CELT and SILK, and EncodeSILK was skipping it entirely. The pitch-adaptive VoIP cutoff variant ( hp_cutoff in libopus) is not implemented; this only ports the fixed-cutoff dc_reject path
not implemented (disclosed, follow-up work): the rate-control bisection loop, LBRR, and DTX. This port is single-pass, same philosophy as the CELT encoder series (correct simple v1 first)
round-trip tested end to end: encode with both the internal silk.Encoder and the public EncodeSILK , decode with the real decoder, for all three SILK bandwidths (NB/MB/WB)
Reference issue
part of the #147 split. Closes out the split entirely — last piece