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

Function avifSampleTransformExpressionToRecipe

src/sampletransform.c:172–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172avifResult avifSampleTransformExpressionToRecipe(const avifSampleTransformExpression * expression, avifSampleTransformRecipe * recipe)
173{
174 *recipe = AVIF_SAMPLE_TRANSFORM_NONE;
175 const avifSampleTransformRecipe kAllRecipes[] = { AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_8B_8B,
176 AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_12B_4B,
177 AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_EXTENSION_12B_8B_OVERLAP_4B };
178 for (size_t i = 0; i < sizeof(kAllRecipes) / sizeof(kAllRecipes[0]); ++i) {
179 avifSampleTransformRecipe candidateRecipe = kAllRecipes[i];
180 avifSampleTransformExpression candidateExpression = { 0 };
181 AVIF_CHECKRES(avifSampleTransformRecipeToExpression(candidateRecipe, &candidateExpression));
182 const avifBool equivalence = avifSampleTransformExpressionIsEquivalentTo(expression, &candidateExpression);
183 avifArrayDestroy(&candidateExpression);
184 if (equivalence) {
185 *recipe = candidateRecipe;
186 return AVIF_RESULT_OK;
187 }
188 }
189 return AVIF_RESULT_OK;
190}
191
192//------------------------------------------------------------------------------
193// Operators

Callers 1

TESTFunction · 0.85

Tested by 1

TESTFunction · 0.68