Coder Social home page Coder Social logo

Comments (3)

joedrago avatar joedrago commented on July 20, 2024

Yes, definitely.

I am planning to stubbornly keep my basic avifDecoderRead() as a braindead-simple path for people that aren't trying to use image sequences or squeak out extra performance, as it allows for avifImage objects to be decoupled almost entirely from encoders and decoders.

That said, I'm in the process now of putting in image sequence support, and a side effect of that medium-sized code reorg, I'm planning to make avifDecoderRead() simply call 3-4 other avifDecoder functions which ends up with a copy of the first image, with functions that perform something like:

  • Begin the decode/parse
  • "get" the first image, which will be owned by the decoder (decoder->image will be a not-copied avifImage)
  • "copy" decoder->image into the passed in image ptr

I plan to reuse the decoder->image structure as you "get" the next image, so if you want YUV copies of multiple frames, you're going to have to copy it anyways, but I imagine you just want to take the current decoder->image and run it through your own YUV->RGB pipeline, in which decoder->image can be safely reused, right?

from libavif.

dalecurtis avatar dalecurtis commented on July 20, 2024

That break up sounds good.

Yes in the ideal case we can output directly to YUV8 planes, but we can't reuse the buffers from dav1d/libavif for that. We do have to copy into them. In the less ideal case (where RBG8/RGB_F16) is required we have to convert into a new structure.

So I don't think we can ever get to a zero copy solution, but a one copy one would be fine too.

from libavif.

joedrago avatar joedrago commented on July 20, 2024

This is done, see the Advanced Decoding section of the README.

from libavif.

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.