Add SILK encoder struct#165
Open
thomas-vilte wants to merge 1 commit into
Open
Conversation
Co-authored-by: François Allais <francois.allais@hotmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #165 +/- ##
==========================================
+ Coverage 89.61% 90.85% +1.24%
==========================================
Files 48 54 +6
Lines 9049 9576 +527
==========================================
+ Hits 8109 8700 +591
+ Misses 706 638 -68
- Partials 234 238 +4
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:
|
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
adds the real
Encoderstruct (state fields mirroringDecoder,NewEncoder/resetPredictionState) and everything that was blocked on it existing:find_pred_coefs.go/find_pitch_lags.go: LTP analysis filter, residual energy, NLSF interpolation search, and the pitch-lag whitening stagepulses.go/pitch_ltp.go: the excitation shell-code and pitch/LTP bitstream wiring — these turned out to be almost entirely*Encodermethods with no separable pure logic, so pieces 12/13 from the original split plan land here instead of as their own PRsencodeNLSF/emitNLSFIndices,quantLTPGains,encodeSubframeGains/emitGainIndices, and all ofnoise_shape_analysis.go(noiseShapeAnalysis/processGains). Also movesnlsfToLPCQ12in from where it used to live (the not-yet-written orchestration file) so this piece doesn't depend on that oneported from
NSQ.c's caller-side struct,find_pred_coefs_FLP.c,find_pitch_lags_FLP.c,encode_pulses.c, and the pitch/LTP sections ofencode_indices.cfound and fixed a real bug along the way:
noiseShapeAnalysiswas reading the sparseness measure that picksquantOffsetTypefrom the raw windowed signal instead of the whitened LPC residualfindPitchLagsproduces — libopus passes these as two separate buffers (pitch_resvsx) tosilk_noise_shape_analysis_FLP, and the port had collapsed them into one. Doesn't desync the bitstream (either offset type is valid), but it was silently biasing that choice. Fixed by adding the missingpitchResparameter, with a regression test that forces both branches from the correct bufferone thing I found but didn't fix:
findLPCNLSFruns the NLSF-interpolation search unconditionally, where libopus gates it onuseInterpolatedNLSFs(tied to an encoder complexity setting SILK doesn't have here at all — noSetComplexityequivalent exists yet). Fixing it properly means adding that whole control surface, which felt like its own piece of work rather than something to bolt on here. Left as a known gapReference issue
part of the SILK encoder series (#164)