Giter VIP home page Giter VIP logo

Comments (3)

smatt123 avatar smatt123 commented on September 22, 2024 1

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.

rillian avatar rillian commented on September 22, 2024

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.

vadimkantorov avatar vadimkantorov commented on September 22, 2024

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

  • 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.