Comments (3)
If you are operating in CELT-only mode, there is also a slightly hidden encoder control: CELT_SET_PREDICTION (check celt.h). If you set this to 0, frames should be encoded independently.
from opus.
It's somewhat so. You're correct that parallel decoding requires restart points, and Opus doesn't have independently-coded blocks the way FLAC does. Each encoded packet depends on state from previous packets, except where an encoder explicitly inserts such a restart point.
However, the state dependence it designed to decay across of a few packets so it's possible for decoders to join in-progress streams, for example in conferencing applications. The file format spec recommends discarding 80ms of decoded audio after a seek to allow for decoder convergence.
So if your streams are long enough that inserting 80ms overlaps between parallel decode segments won't hurt performance, you should be able to split the stream and re-combine the decoded segments. The result won't be bit-identical, but it will be perceptually indistinguishable, which is all a lossy codec provides in any case.
from opus.
Got it. Just in case, I'll upgrade this issue to be a feature request for a few ideas:
-
to add example programs of parallelized decoding with 2 modes: (1) without scanning for restart points, (2) with scanning for restart points
- maybe also an example of parallelized encoding (even if not production-quality) experimented by @enzo1982 in https://github.com/enzo1982/superfast https://github.com/enzo1982/freac - introduces some overlap frames at the block boundaries (some discussion at enzo1982/freac#505)
-
to add an option to libopus encoder supporting emitting restart points (I guess TBD if they should be emitted every N number of frames or if it should also take into account adaptive frame durations and be depending on actual audio time. Could the encoding mode changes be abused to have sth like restart points? The decoding mode itself wouldn't change, but the codec state would be reset (e.g. CELT->CELT "fake" switch). Maybe the already supported PLC machinery can be helpful for this? In a way regular restart points is related to missing context recovery
(in case I hack something around, I'll post it here but probably not very soon)
from opus.
Related Issues (20)
- opus 1.5.1-1 seems to be incompatible with musescore 4.2.1 HOT 1
- Question about DRED HOT 4
- Undefined reference to opus_select_arch HOT 2
- opus_repacketizer_cat sometimes fails
- Limiting the stack allocation request HOT 2
- Please update opus-tools to support new features
- Deep PLC performance on Android HOT 16
- Compiling with CMake for Windows/MSVC only supports DLL runtime libraries HOT 9
- Added the OPUS_SET_INBAND_FEC(2) option HOT 1
- Please provide an option to not depend on downloading model data HOT 10
- v1.5.2 compile warnings
- Error: Range coder state mismatch between encoder and decoder in frame 1: 0x f3b1240 vs 0x40123b0f HOT 1
- Opus.lib: 1.3.1 version crashing in some windows machines in opus_encoder_create HOT 2
- Opus 1.5.x and main compilation failing with GCC 8.5.0 HOT 3
- Opus not building on Ubuntu 24.04
- No way to turn off the PLC/FEC?
- Floating Point libraries failing to build when targeting Fixed Point support only. MSVC 2017 v141 HOT 3
- Unexpected continuous noise when combining NoLACE with DTX HOT 9
- Bug: The decoded dred_offset < 0 HOT 1
- How can I verify if FEC is working? I am not hearing any changes with fec enabled vs disabled with 30% packet loss HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opus.