Lines Matching refs:cfg
119 static MPP_RET check_input_cmd(iep2_test_cfg *cfg) in check_input_cmd() argument
123 if (cfg->w < 16 || cfg->w > 1920) { in check_input_cmd()
124 mpp_err("invalid width %d\n", cfg->w); in check_input_cmd()
128 if (cfg->h < 4 || cfg->h > 1088) { in check_input_cmd()
129 mpp_err("invalid height %d\n", cfg->h); in check_input_cmd()
134 cfg->src_fmt, cfg->src_swa, in check_input_cmd()
135 cfg->dst_fmt, cfg->dst_swa); in check_input_cmd()
137 if (cfg->src_fmt < IEP2_FMT_YUV422 || in check_input_cmd()
138 cfg->src_fmt > IEP2_FMT_YUV420 || in check_input_cmd()
139 cfg->src_swa < IEP2_YUV_SWAP_SP_UV || in check_input_cmd()
140 cfg->src_swa > IEP2_YUV_SWAP_P) { in check_input_cmd()
145 if (cfg->fp_src == NULL) { in check_input_cmd()
146 mpp_err("failed to open input file %s\n", cfg->src_url); in check_input_cmd()
150 if (cfg->dst_fmt < IEP2_FMT_YUV422 || in check_input_cmd()
151 cfg->dst_fmt > IEP2_FMT_YUV420 || in check_input_cmd()
152 cfg->dst_swa < IEP2_YUV_SWAP_SP_UV || in check_input_cmd()
153 cfg->dst_swa > IEP2_YUV_SWAP_SP_VU) { in check_input_cmd()
196 void iep2_test(iep2_test_cfg *cfg) in iep2_test() argument
199 size_t srcfrmsize = get_frm_size(cfg->src_fmt, cfg->w, cfg->h); in iep2_test()
200 size_t dstfrmsize = get_frm_size(cfg->dst_fmt, cfg->w, cfg->h); in iep2_test()
254 if (srcfrmsize > fread(psrc[0], 1, srcfrmsize, cfg->fp_src)) { in iep2_test()
259 if (srcfrmsize > fread(psrc[1], 1, srcfrmsize, cfg->fp_src)) { in iep2_test()
278 params.param.mode.dil_order = cfg->field_order; in iep2_test()
284 params.param.com.sfmt = cfg->src_fmt; in iep2_test()
285 params.param.com.dfmt = cfg->dst_fmt; in iep2_test()
286 params.param.com.sswap = cfg->src_swa; in iep2_test()
287 params.param.com.dswap = cfg->dst_swa; in iep2_test()
288 params.param.com.width = cfg->w; in iep2_test()
289 params.param.com.height = cfg->h; in iep2_test()
290 params.param.com.hor_stride = cfg->w; in iep2_test()
294 imgsrc[i].format = cfg->src_fmt; in iep2_test()
297 imgdst[i].format = cfg->dst_fmt; in iep2_test()
304 if (srcfrmsize > fread(psrc[next], 1, srcfrmsize, cfg->fp_src)) { in iep2_test()
310 iep2_test_set_img(iep2, cfg->w, cfg->h, in iep2_test()
312 iep2_test_set_img(iep2, cfg->w, cfg->h, in iep2_test()
314 iep2_test_set_img(iep2, cfg->w, cfg->h, in iep2_test()
316 iep2_test_set_img(iep2, cfg->w, cfg->h, in iep2_test()
318 iep2_test_set_img(iep2, cfg->w, cfg->h, in iep2_test()
325 if (cfg->fp_slt) { in iep2_test()
327 write_data_crc(cfg->fp_slt, &checkcrc); in iep2_test()
329 write_data_crc(cfg->fp_slt, &checkcrc); in iep2_test()
334 if (cfg->fp_dst) { in iep2_test()
335 if (dstfrmsize > fwrite(pdst[out_order], 1, dstfrmsize, cfg->fp_dst)) { in iep2_test()
340 if (dstfrmsize > fwrite(pdst[1 - out_order], 1, dstfrmsize, cfg->fp_dst)) { in iep2_test()
371 iep2_test_cfg cfg; in main() local
379 memset(&cfg, 0, sizeof(cfg)); in main()
380 cfg.src_fmt = IEP2_FMT_YUV420; in main()
381 cfg.src_swa = IEP2_YUV_SWAP_SP_UV; in main()
382 cfg.dst_fmt = IEP2_FMT_YUV420; in main()
383 cfg.dst_swa = IEP2_YUV_SWAP_SP_UV; in main()
390 cfg.w = atoi(optarg); in main()
393 cfg.h = atoi(optarg); in main()
396 cfg.src_fmt = str_to_iep2_fmt(optarg); in main()
397 cfg.src_swa = str_to_iep2_swa(optarg); in main()
400 cfg.dst_fmt = str_to_iep2_fmt(optarg); in main()
401 cfg.dst_swa = str_to_iep2_swa(optarg); in main()
405 strncpy(cfg.src_url, optarg, sizeof(cfg.src_url) - 1); in main()
406 cfg.fp_src = fopen(cfg.src_url, "rb"); in main()
410 strncpy(cfg.dst_url, optarg, sizeof(cfg.dst_url) - 1); in main()
411 cfg.fp_dst = fopen(cfg.dst_url, "w+b"); in main()
415 strncpy(cfg.slt_url, optarg, sizeof(cfg.slt_url) - 1); in main()
416 cfg.fp_slt = fopen(cfg.slt_url, "w+b"); in main()
420 cfg.field_order = IEP2_FIELD_ORDER_TFF; in main()
422 cfg.field_order = IEP2_FIELD_ORDER_BFF; in main()
429 if (check_input_cmd(&cfg)) { in main()
435 iep2_test(&cfg); in main()
437 if (cfg.fp_src) { in main()
438 fclose(cfg.fp_src); in main()
439 cfg.fp_src = NULL; in main()
442 if (cfg.fp_dst) { in main()
443 fclose(cfg.fp_dst); in main()
444 cfg.fp_dst = NULL; in main()
447 if (cfg.fp_slt) { in main()
448 fclose(cfg.fp_slt); in main()
449 cfg.fp_slt = NULL; in main()