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

Function avifCodecConfigurationBoxGetSubsamplingType

src/read.c:393–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391
392#if defined(AVIF_ENABLE_EXPERIMENTAL_EXTENDED_PIXI)
393uint8_t avifCodecConfigurationBoxGetSubsamplingType(const avifCodecConfigurationBox * av1C, uint8_t channelIndex)
394{
395 if (channelIndex == 0) {
396 return AVIF_PIXI_444;
397 }
398 if (av1C->chromaSubsamplingX == 0) {
399 if (av1C->chromaSubsamplingY == 0) {
400 return AVIF_PIXI_444;
401 }
402 return AVIF_PIXI_440;
403 }
404 if (av1C->chromaSubsamplingY == 0) {
405 return AVIF_PIXI_422;
406 }
407 return AVIF_PIXI_420;
408}
409
410// Mapping from PixelInformationBox subsampling_type and subsampling_location as defined in ISO/IEC 23008-12:2024/CDAM 2:2025 section 6.5.6.3
411// to chroma_sample_position as defined in AV1 specification Section 6.4.2.

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected