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

Function avifSampleTableGetImageDelta

src/read.c:356–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356static uint32_t avifSampleTableGetImageDelta(const avifSampleTable * sampleTable, uint32_t imageIndex)
357{
358 uint32_t maxSampleIndex = 0;
359 for (uint32_t i = 0; i < sampleTable->timeToSamples.count; ++i) {
360 const avifSampleTableTimeToSample * timeToSample = &sampleTable->timeToSamples.timeToSample[i];
361 maxSampleIndex += timeToSample->sampleCount;
362 if ((imageIndex < maxSampleIndex) || (i == (sampleTable->timeToSamples.count - 1))) {
363 return timeToSample->sampleDelta;
364 }
365 }
366
367 // TODO: fail here?
368 return 1;
369}
370
371static avifCodecType avifSampleTableGetCodecType(const avifSampleTable * sampleTable)
372{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected