Support CELT and hybrid API-rate output#110
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #110 +/- ##
==========================================
- Coverage 82.74% 82.73% -0.02%
==========================================
Files 21 21
Lines 4289 4518 +229
==========================================
+ Hits 3549 3738 +189
- Misses 566 598 +32
- Partials 174 182 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
RFC 6716 / 8251 conformationStatus: pass The action extracts the RFC 6716 reference implementation, applies the RFC 8251 decoder update patch, and then builds the patched reference tools. Legend: numeric cells are Inputs use the shared RFC 6716 / RFC 8251 bitstream corpus; accepted references follow RFC 8251 Section 11.
Run output |
There was a problem hiding this comment.
Pull request overview
This PR updates the Opus decoder to support CELT-only and hybrid decoding at the caller-requested API output sample rate (while keeping CELT’s internal synthesis path at 48 kHz), and improves bitstream conformance handling (SILK LBRR acceptance + RFC 8251-style padding parsing hardening).
Changes:
- Emit CELT-only and hybrid PCM at the decoder’s configured output sample rate, including bandwidth limiting and transition fading at API rate.
- Accept SILK packets carrying LBRR syntax by consuming/discarding redundant frames instead of rejecting valid packets.
- Update conformance plumbing (alternate reference outputs + final range selection) and add a conformance timeout in the helper script.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
decoder.go |
Core changes to decode CELT/hybrid at API rate, adjust padding parsing, resampling decisions, and transition fade logic for non-48k output. |
decoder_test.go |
Updates for new decode return signature and adds tests ensuring CELT/hybrid-at-bandwidth-rate skips SILK resampler init. |
packet_test.go |
Adds a malformed padding test for RFC 8251-style “remaining length decrement” parsing; updates for decode signature. |
internal/celt/decoder.go |
Adds DecodeToSampleRate / DecodeWithRangeToSampleRate and adjusts buffer sizing for output-rate PCM. |
internal/celt/frame.go |
Adds outputSampleRate to frame config/side-info and validates frame sizing against output rate. |
internal/celt/synthesis.go |
Implements output-rate fade indexing, output-bandwidth limiting before synthesis, and downsampled deemphasis/interleave. |
internal/celt/synthesis_test.go |
Updates helper invocation to include output sample rate. |
internal/silk/decoder.go |
Decodes/consumes SILK LBRR flags + redundant frame payloads to keep valid packets decodable. |
internal/silk/icdf.go |
Adds ICDF tables for per-frame LBRR flags. |
internal/silk/errors.go |
Removes the “unsupported LBRR” error since LBRR is now consumed instead of rejected. |
conformance_test.go |
Allows multiple alternate reference PCM oracles (incl. RFC 8251 output for RFC 6716 vectors) and selects final range by decoded mode. |
.github/scripts/run-rfc6716-conformance.sh |
Adds a longer go test timeout for conformance runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
94dc81f to
95bfc2c
Compare
95bfc2c to
1e4c68b
Compare
Summary
Details
Validation
go test ./....github/scripts/run-rfc6716-conformance.shNotes