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

Function avifEncoderVerifyImageCompatibility

apps/avifenc.c:855–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

853}
854
855static avifBool avifEncoderVerifyImageCompatibility(const avifImage * refImage,
856 const avifImage * testImage,
857 const char * seriesType,
858 const char * filename)
859{
860 // Verify that this frame's properties matches the first frame's properties
861 if ((refImage->width != testImage->width) || (refImage->height != testImage->height)) {
862 fprintf(stderr,
863 "ERROR: Image %s dimensions mismatch, [%ux%u] vs [%ux%u]: %s\n",
864 seriesType,
865 refImage->width,
866 refImage->height,
867 testImage->width,
868 testImage->height,
869 filename);
870 return AVIF_FALSE;
871 }
872 if (refImage->depth != testImage->depth) {
873 fprintf(stderr, "ERROR: Image %s depth mismatch, [%u] vs [%u]: %s\n", seriesType, refImage->depth, testImage->depth, filename);
874 return AVIF_FALSE;
875 }
876 if ((refImage->colorPrimaries != testImage->colorPrimaries) ||
877 (refImage->transferCharacteristics != testImage->transferCharacteristics) ||
878 (refImage->matrixCoefficients != testImage->matrixCoefficients)) {
879 fprintf(stderr,
880 "ERROR: Image %s CICP mismatch, [%u/%u/%u] vs [%u/%u/%u]: %s\n",
881 seriesType,
882 refImage->colorPrimaries,
883 refImage->matrixCoefficients,
884 refImage->transferCharacteristics,
885 testImage->colorPrimaries,
886 testImage->transferCharacteristics,
887 testImage->matrixCoefficients,
888 filename);
889 return AVIF_FALSE;
890 }
891 if (refImage->yuvRange != testImage->yuvRange) {
892 fprintf(stderr,
893 "ERROR: Image %s range mismatch, [%s] vs [%s]: %s\n",
894 seriesType,
895 (refImage->yuvRange == AVIF_RANGE_FULL) ? "Full" : "Limited",
896 (testImage->yuvRange == AVIF_RANGE_FULL) ? "Full" : "Limited",
897 filename);
898 return AVIF_FALSE;
899 }
900
901 return AVIF_TRUE;
902}
903
904static avifBool avifEncodeRestOfImageSequence(avifEncoder * encoder,
905 const avifSettings * settings,

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected