MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / main

Function main

libswscale/tests/floatimg_cmp.c:64–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62const char *usage = "floatimg_cmp -pixel_format <pix_fmt> -size <image_size> -ref <testfile>\n";
63
64int main(int argc, char **argv)
65{
66 enum AVPixelFormat inFormat = AV_PIX_FMT_NONE;
67 enum AVPixelFormat dstFormat = AV_PIX_FMT_NONE;
68 const AVPixFmtDescriptor *desc;
69 uint8_t *ptr;
70 uint32_t *in, *out;
71
72 uint8_t *rgbIn[4] = {NULL, NULL, NULL, NULL};
73 uint8_t *rgbOut[4] = {NULL, NULL, NULL, NULL};
74 int rgbStride[4];
75
76 uint8_t *dst[4] = {NULL, NULL, NULL, NULL};
77 int dstStride[4];
78
79 int i, x, y, p, size, count;
80 int res = -1;
81 int w = -1;
82 int h = -1;
83 union av_intfloat32 v0, v1;
84
85 double sum;
86 float minimum, maximum, diff;
87
88 SwsContext *sws = NULL;
89 AVLFG rand;
90 FILE *fp = NULL;
91
92 for (i = 1; i < argc; i += 2) {
93 if (argv[i][0] != '-' || i + 1 == argc)
94 goto bad_option;
95 if (!strcmp(argv[i], "-ref")) {
96 fp = fopen(argv[i + 1], "rb");
97 if (!fp) {
98 fprintf(stderr, "could not open '%s'\n", argv[i + 1]);
99 goto end;
100 }
101 } else if (!strcmp(argv[i], "-size")) {
102 res = av_parse_video_size(&w, &h, argv[i + 1]);
103 if (res < 0) {
104 fprintf(stderr, "invalid video size %s\n", argv[i + 1]);
105 goto end;
106 }
107 } else if (!strcmp(argv[i], "-pixel_format")) {
108 inFormat = av_get_pix_fmt(argv[i + 1]);
109 if (inFormat == AV_PIX_FMT_NONE) {
110 fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]);
111 goto end;
112 }
113 } else {
114bad_option:
115 fprintf(stderr, "%s", usage);
116 fprintf(stderr, "bad option or argument missing (%s)\n", argv[i]);
117 goto end;
118 };
119 }
120
121 if (!fp) {

Callers

nothing calls this directly

Calls 13

av_parse_video_sizeFunction · 0.85
av_get_pix_fmtFunction · 0.85
av_pix_fmt_desc_getFunction · 0.85
av_image_fill_linesizesFunction · 0.85
av_lfg_initFunction · 0.85
av_lfg_getFunction · 0.85
av_freepFunction · 0.85
sws_getContextFunction · 0.85
av_get_pix_fmt_nameFunction · 0.85
sws_scaleFunction · 0.85
sws_freeContextFunction · 0.85
fabsfFunction · 0.85

Tested by

no test coverage detected