Comments (10)
I thought a lot about this, and it might not be too awful to hook up. The plan (for read) would be to leave the memory streams and parsing code intact, but add in a layer specifically for avifParse()
and the sample gathering code. Seeing as avifParse()
simply skips over the largest part of the file (mdat
) and the other top-level boxes are "small", a little bit of cleverness at the toplevel parse function should buy quite a lot.
I'd probably make the reader/writer API itself responsible for the buffer it returns to libavif, to facilitate the avifROStream mechanisms that exist, and to allow the current fully-in-memory path to exist. It should be as simple as Dale suggests (please give me x bytes from offset y).
from libavif.
Writing will be trickier, as the current flow requires that I know all of the final sample sizes and offsets in order to generate the correct meta
box. It'd be easy to put in a writer API, but without any kind of significant memory savings, it'd just be "for show". I'll have to think about that one.
from libavif.
Yes.
from libavif.
It would be great if libavif provides API allowing to pass our own reading/writing/seeking i/o functions. Like it does libpng (png_set_read_fn, png_set_write_fn) or libtiff (TIFFClientOpen).
from libavif.
@joedrago I'm less concerned about the output AVIF buffer but would prefer a way to stream the input file (which is uncompressed) into the decoder. Is this already possible?
from libavif.
@joedrago I'm less concerned about the output AVIF buffer but would prefer a way to stream the input file (which is uncompressed) into the decoder. Is this already possible?
Hi Moritz: Did you mean the input file is compressed or uncompressed? The input to the decoder should be a compressed image file.
from libavif.
Right, but let's say I have a 10MB PNG file then preferably I'd be able to feed it to the encoder in chunks instead of loading the image in memory and passing it to the encoder. I assume that's problematic because we also have to go through the RGB -> YUV conversion.
from libavif.
libavif itself has no PNG support; only the command line tool avifenc does. If your goal is to read in a non-AVIF and give it to libavif in your own tool, you can read the image in however you want. I don't see how streaming PNG input is relevant to libavif?
from libavif.
It looks like the recently added avifIO
functionality fixes the issue?
from libavif.
Great! :) I guess this issue could be closed then.
from libavif.
Related Issues (20)
- avifrgbtoyuvtest fails on MacBook Pro M1 (Arm CPU) if local libyuv is used HOT 2
- CICP information lost when decoding to png/jpeg HOT 3
- A PNG image that cannot be converted correctly HOT 1
- Is 0.11.1.3c786d2 builed with dav1d ? HOT 1
- Check the required order of the 'clap', 'irot', and 'imir' transformative item properties
- Add OpenSSF Scorecard workflow HOT 1
- Safari on iPhone8 with iOS 16.5 doesn't show avifenc encoded AVIF HOT 7
- Error while using avifImageYUVToRGB HOT 8
- Lossless monochrome (4:0:0) encoding is broken after commit 6122b014972adb1c6564bc4d82d8baac4b2e8e13
- AVIF encoder totally broken
- AVIF encoder totally broken HOT 9
- cmake failure with -DAVIF_LOCAL options
- cmake -DAVIF_LOCAL_LIBYUV=ON -DAVIF_LOCAL_JPEG=ON -DBUILD_SHARED_LIBS=ON failure
- cmake -DAVIF_LOCAL_ZLIBPNG=ON failure
- AVIF_CHROMA_UPSAMPLING_AUTOMATIC doesn't use kFilterBilinear with libyuv functions after commit 95d96ea6c8428e6c796b94f880b6e7a5979cb3a3
- Chrome doesn't render 4:0:0 with MatrixCoefficients=0 (Identity) correctly HOT 2
- Chrome doesn't render 4:0:0 with MatrixCoefficients=0 (Identity) correctly
- If avifenc encodes grayscale PNG input into 4:0:0 output with a crafted ICC profile, Firefox doesn't render the output correctly. HOT 4
- Does libavif supports the decoding level image size scaling ? HOT 3
- libavif why not set AVIF_LIBYUV_ENABLED default true HOT 1
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 libavif.