MCPcopy Create free account
hub / github.com/AOMediaCodec/libavif / avifDecoderRead

Function avifDecoderRead

src/read.c:7248–7265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7246}
7247
7248avifResult avifDecoderRead(avifDecoder * decoder, avifImage * image)
7249{
7250 avifResult result = avifDecoderParse(decoder);
7251 if (result != AVIF_RESULT_OK) {
7252 return result;
7253 }
7254 result = avifDecoderNextImage(decoder);
7255 if (result != AVIF_RESULT_OK) {
7256 return result;
7257 }
7258 // If decoder->image->imageOwnsYUVPlanes is true and decoder->image is not used after this call,
7259 // the ownership of the planes in decoder->image could be transferred here instead of copied.
7260 // However most codec_*.c implementations allocate the output buffer themselves and return a
7261 // view, unless some postprocessing is applied (container-level grid reconstruction for
7262 // example), so the first condition rarely holds.
7263 // The second condition does not hold either: it is not required by the documentation in avif.h.
7264 return avifImageCopy(image, decoder->image, AVIF_PLANES_ALL);
7265}
7266
7267avifResult avifDecoderReadMemory(avifDecoder * decoder, avifImage * image, const uint8_t * data, size_t size)
7268{

Callers 3

avifDecoderReadMemoryFunction · 0.85
avifDecoderReadFileFunction · 0.85
DecodeIncrFunction · 0.85

Calls 3

avifDecoderParseFunction · 0.85
avifDecoderNextImageFunction · 0.85
avifImageCopyFunction · 0.85

Tested by 1

DecodeIncrFunction · 0.68