Skip to content

Add SILK float pitch/resampler primitives#156

Open
thomas-vilte wants to merge 2 commits into
pion:mainfrom
thomas-vilte:feat/silk-pitch-util
Open

Add SILK float pitch/resampler primitives#156
thomas-vilte wants to merge 2 commits into
pion:mainfrom
thomas-vilte:feat/silk-pitch-util

Conversation

@thomas-vilte

Copy link
Copy Markdown
Member

Description

adds the last few shared floating-point primitives used by the pitch analysis stage: resamplerDown2 (2:1 decimator), float2ShortArray/short2FloatArray, energyFLP, pitchXcorr, and the two insertion sort helpers (insertionSortDecreasingFLP/insertionSortIncreasing). these sit alongside the LPC float primitives from #154 — same "shared DSP building blocks" piece of the split, just the half that didn't make it into that PR

ported from resampler_down2.c (coefficients cross-checked against resampler_rom.h), the float/short conversion inlines in SigProc_FLP.h, energy_FLP.c, and sort_FLP.c/sort.c

one thing worth flagging: pitchXcorr here is a plain loop over innerProductFLP, not libopus's SIMD-optimized celt_pitch_xcorr. Same result, just without the vectorized fast path — fine for a shared primitive, the actual pitch-analysis algorithm that calls it is a separate, later piece of this split

Reference issue

part of the SILK encoder series (#154)

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

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.58%. Comparing base (4221339) to head (c74dad0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
+ Coverage   88.49%   88.58%   +0.09%     
==========================================
  Files          36       37       +1     
  Lines        8074     8141      +67     
==========================================
+ Hits         7145     7212      +67     
  Misses        703      703              
  Partials      226      226              
Flag Coverage Δ
go 88.58% <100.00%> (+0.09%) ⬆️

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.

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