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

Function avifProcessAVMOptionsPreInit

src/codec_avm.c:316–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316static avifBool avifProcessAVMOptionsPreInit(avifCodec * codec, avifBool alpha, struct avm_codec_enc_cfg * cfg)
317{
318 for (uint32_t i = 0; i < codec->csOptions->count; ++i) {
319 const avifCodecSpecificOption * entry = &codec->csOptions->entries[i];
320 int val;
321 if (avifKeyEqualsName(entry->key, "end-usage", alpha)) { // Rate control mode
322 if (!avmOptionParseEnum(entry->value, endUsageEnum, &val)) {
323 avifDiagnosticsPrintf(codec->diag, "Invalid value for end-usage: %s", entry->value);
324 return AVIF_FALSE;
325 }
326 cfg->rc_end_usage = val;
327 }
328 }
329 return AVIF_TRUE;
330}
331
332static avifBool avifProcessAVMOptionsPostInit(avifCodec * codec, avifBool alpha)
333{

Callers 1

avmCodecEncodeImageFunction · 0.85

Calls 3

avmOptionParseEnumFunction · 0.85
avifDiagnosticsPrintfFunction · 0.85
avifKeyEqualsNameFunction · 0.70

Tested by

no test coverage detected