Returns true if codec-specific options for AOM contain a tune metric setting. Returns false otherwise. Sets *useTuneIq to true if codec-specific options for AOM contain AOM_TUNE_IQ. Otherwise sets *useTuneIq to false.
| 399 | // Returns true if codec-specific options for AOM contain a tune metric setting. Returns false otherwise. |
| 400 | // Sets *useTuneIq to true if codec-specific options for AOM contain AOM_TUNE_IQ. Otherwise sets *useTuneIq to false. |
| 401 | static avifBool avifAOMOptionsContainExplicitTuning(const avifCodec * codec, avifBool alpha, avifBool * useTuneIq) |
| 402 | { |
| 403 | *useTuneIq = AVIF_FALSE; |
| 404 | avifBool isAnyTuneDefined = AVIF_FALSE; |
| 405 | |
| 406 | // If there are multiple "tune" options specified, honor the last one. |
| 407 | // For consistent behavior, handle both cases where tune was either specified as a string (e.g. tune=iq), |
| 408 | // or as an enum value (e.g. tune=10). |
| 409 | for (uint32_t i = 0; i < codec->csOptions->count; ++i) { |
| 410 | const avifCodecSpecificOption * entry = &codec->csOptions->entries[i]; |
| 411 | if (avifKeyEqualsName(entry->key, "tune", alpha)) { |
| 412 | isAnyTuneDefined = AVIF_TRUE; |
| 413 | |
| 414 | int val; |
| 415 | if (aomOptionParseEnum(entry->value, tuneIqEnum, &val)) { |
| 416 | assert(val == AOM_TUNE_IQ); |
| 417 | *useTuneIq = AVIF_TRUE; |
| 418 | } else { |
| 419 | *useTuneIq = AVIF_FALSE; |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | return isAnyTuneDefined; |
| 424 | } |
| 425 | |
| 426 | static avifBool avifProcessAOMOptionsPreInit(avifCodec * codec, avifBool alpha, struct aom_codec_enc_cfg * cfg) |
| 427 | { |
no test coverage detected