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

Function avifEncoderCreate

src/write.c:469–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467static const avifScalingMode noScaling = { { 1, 1 }, { 1, 1 } };
468
469avifEncoder * avifEncoderCreate(void)
470{
471 avifEncoder * encoder = (avifEncoder *)avifAlloc(sizeof(avifEncoder));
472 if (!encoder) {
473 return NULL;
474 }
475 memset(encoder, 0, sizeof(avifEncoder));
476 encoder->codecChoice = AVIF_CODEC_CHOICE_AUTO;
477 encoder->maxThreads = 1;
478 encoder->speed = AVIF_SPEED_DEFAULT;
479 encoder->keyframeInterval = 0;
480 encoder->timescale = 1;
481 encoder->repetitionCount = AVIF_REPETITION_COUNT_INFINITE;
482 encoder->quality = AVIF_QUALITY_DEFAULT;
483 encoder->qualityAlpha = AVIF_QUALITY_DEFAULT;
484 encoder->qualityGainMap = AVIF_QUALITY_DEFAULT;
485 encoder->minQuantizer = AVIF_QUANTIZER_BEST_QUALITY;
486 encoder->maxQuantizer = AVIF_QUANTIZER_WORST_QUALITY;
487 encoder->minQuantizerAlpha = AVIF_QUANTIZER_BEST_QUALITY;
488 encoder->maxQuantizerAlpha = AVIF_QUANTIZER_WORST_QUALITY;
489 encoder->tileRowsLog2 = 0;
490 encoder->tileColsLog2 = 0;
491 encoder->autoTiling = AVIF_FALSE;
492 encoder->scalingMode = noScaling;
493 encoder->data = avifEncoderDataCreate();
494 encoder->csOptions = avifCodecSpecificOptionsCreate();
495 if (!encoder->data || !encoder->csOptions) {
496 avifEncoderDestroy(encoder);
497 return NULL;
498 }
499 encoder->headerFormat = AVIF_HEADER_DEFAULT;
500 encoder->creationTime = 0;
501 encoder->modificationTime = 0;
502 encoder->sampleTransformRecipe = AVIF_SAMPLE_TRANSFORM_NONE;
503 return encoder;
504}
505
506void avifEncoderDestroy(avifEncoder * encoder)
507{

Callers 15

avif_image_saverFunction · 0.85
RunMethod · 0.85
WriteImageFunction · 0.85
RunMethod · 0.85
RunMethod · 0.85
TEST_PFunction · 0.85
TESTFunction · 0.85
GetIoStatsFromEncodeFunction · 0.85
EncodeAsGridFunction · 0.85
TEST_PFunction · 0.85
TEST_PFunction · 0.85

Calls 4

avifAllocFunction · 0.85
avifEncoderDataCreateFunction · 0.85
avifEncoderDestroyFunction · 0.85

Tested by 15

TEST_PFunction · 0.68
TESTFunction · 0.68
GetIoStatsFromEncodeFunction · 0.68
EncodeAsGridFunction · 0.68
TEST_PFunction · 0.68
TEST_PFunction · 0.68
TEST_PFunction · 0.68
TESTFunction · 0.68
EncodeDecodeGridFunction · 0.68
TESTFunction · 0.68
TEST_PFunction · 0.68
TestEncodeDecodeFunction · 0.68