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

Function avifDecoderIsKeyframe

src/read.c:7153–7171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7151}
7152
7153avifBool avifDecoderIsKeyframe(const avifDecoder * decoder, uint32_t frameIndex)
7154{
7155 if (!decoder->data || (decoder->data->tiles.count == 0)) {
7156 // Nothing has been parsed yet
7157 return AVIF_FALSE;
7158 }
7159
7160 // *All* tiles for the requested frameIndex must be keyframes in order for
7161 // avifDecoderIsKeyframe() to return true, otherwise we may seek to a frame in which the color
7162 // planes are a keyframe but the alpha plane isn't a keyframe, which will cause an alpha plane
7163 // decode failure.
7164 for (unsigned int i = 0; i < decoder->data->tiles.count; ++i) {
7165 const avifTile * tile = &decoder->data->tiles.tile[i];
7166 if ((frameIndex >= tile->input->samples.count) || !tile->input->samples.sample[frameIndex].sync) {
7167 return AVIF_FALSE;
7168 }
7169 }
7170 return AVIF_TRUE;
7171}
7172
7173uint32_t avifDecoderNearestKeyframe(const avifDecoder * decoder, uint32_t frameIndex)
7174{

Callers 3

TESTFunction · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by 2

TESTFunction · 0.68
TESTFunction · 0.68