Lines Matching refs:cfg
138 static MPP_RET check_input_cmd(VdppTestCfg *cfg) in check_input_cmd() argument
142 if (cfg->fp_src == NULL) { in check_input_cmd()
143 mpp_err("failed to open input file %s\n", cfg->src_url); in check_input_cmd()
221 void vdpp_test(VdppTestCfg *cfg) in vdpp_test() argument
224 size_t srcfrmsize = get_src_frm_size(cfg->src_format, cfg->src_width_vir, cfg->src_height_vir); in vdpp_test()
225 size_t dstfrmsize = get_dst_frm_size(cfg->dst_fmt, cfg->dst_width_vir, cfg->dst_height_vir); in vdpp_test()
226 size_t dstfrmsize_c = cfg->dst_c_width_vir * cfg->dst_c_height_vir * 3; in vdpp_test()
245 RK_U32 yuv_out_diff = (cfg->yuv_out_diff && is_vdpp2); in vdpp_test()
271 cfg->src_width, cfg->src_height, cfg->src_width_vir, cfg->src_height_vir, srcfrmsize); in vdpp_test()
273 cfg->dst_width, cfg->dst_height, cfg->dst_width_vir, cfg->dst_height_vir, dstfrmsize); in vdpp_test()
295 … cfg->dst_c_width, cfg->dst_c_height, cfg->dst_c_width_vir, cfg->dst_c_height_vir, dstfrmsize_c); in vdpp_test()
311 params.param.com2.sfmt = cfg->src_format; in vdpp_test()
312 params.param.com2.src_width = cfg->src_width; in vdpp_test()
313 params.param.com2.src_height = cfg->src_height; in vdpp_test()
314 params.param.com2.src_width_vir = cfg->src_width_vir; in vdpp_test()
315 params.param.com2.src_height_vir = cfg->src_height_vir; in vdpp_test()
316 params.param.com2.sswap = cfg->src_swa; in vdpp_test()
317 params.param.com2.dfmt = cfg->dst_fmt; in vdpp_test()
318 params.param.com2.dst_width = cfg->dst_width; in vdpp_test()
319 params.param.com2.dst_height = cfg->dst_height; in vdpp_test()
320 params.param.com2.dst_width_vir = cfg->dst_width_vir; in vdpp_test()
321 params.param.com2.dst_height_vir = cfg->dst_height_vir; in vdpp_test()
324 params.param.com2.dst_c_width = cfg->dst_c_width; in vdpp_test()
325 params.param.com2.dst_c_height = cfg->dst_c_height; in vdpp_test()
326 params.param.com2.dst_c_width_vir = cfg->dst_c_width_vir; in vdpp_test()
327 params.param.com2.dst_c_height_vir = cfg->dst_c_height_vir; in vdpp_test()
329 params.param.com2.dswap = cfg->dst_swa; in vdpp_test()
330 params.param.com2.hist_mode_en = cfg->hist_mode_en; in vdpp_test()
331 params.param.com2.cfg_set = cfg->cfg_set; in vdpp_test()
336 params.param.com.src_width = cfg->src_width; in vdpp_test()
337 params.param.com.src_height = cfg->src_height; in vdpp_test()
338 params.param.com.sswap = cfg->src_swa; in vdpp_test()
339 params.param.com.dfmt = cfg->dst_fmt; in vdpp_test()
340 params.param.com.dst_width = cfg->dst_width; in vdpp_test()
341 params.param.com.dst_height = cfg->dst_height; in vdpp_test()
342 params.param.com.dswap = cfg->dst_swa; in vdpp_test()
353 if (srcfrmsize > fread(psrc, 1, srcfrmsize, cfg->fp_src)) { in vdpp_test()
357 if (cnt >= cfg->frame_num) in vdpp_test()
361 vdpp_test_set_img(vdpp, cfg->src_width_vir, cfg->src_height_vir, in vdpp_test()
363 vdpp_test_set_img(vdpp, cfg->dst_width_vir, cfg->dst_height_vir, in vdpp_test()
366 vdpp_test_set_img(vdpp, cfg->dst_c_width_vir, cfg->dst_c_height_vir, in vdpp_test()
382 if (cfg->fp_dst) { in vdpp_test()
383 if (dstfrmsize > fwrite(pdst, 1, dstfrmsize, cfg->fp_dst)) { in vdpp_test()
389 if (yuv_out_diff && cfg->fp_dst_c) { in vdpp_test()
390 if (dstfrmsize_c > fwrite(pdst_c, 1, dstfrmsize_c, cfg->fp_dst_c)) { in vdpp_test()
396 if (cfg->fp_hist) { in vdpp_test()
397 if (DCI_HIST_SIZE > fwrite(phist, 1, DCI_HIST_SIZE, cfg->fp_hist)) { in vdpp_test()
408 if (cfg->fp_hist_l) { in vdpp_test()
409 if (local_hist_size > fwrite(phist_l, 1, local_hist_size, cfg->fp_hist_l)) { in vdpp_test()
414 if (cfg->fp_hist_g) { in vdpp_test()
415 if (global_hist_size > fwrite(phist_g, 1, global_hist_size, cfg->fp_hist_g)) { in vdpp_test()
421 if (cfg->fp_slt) { in vdpp_test()
422 if (pdst && !cfg->hist_mode_en) { in vdpp_test()
424 write_data_crc(cfg->fp_slt, &checkcrc); in vdpp_test()
428 if (pdst_c && yuv_out_diff && !cfg->hist_mode_en) { in vdpp_test()
430 write_data_crc(cfg->fp_slt, &checkcrc); in vdpp_test()
436 write_data_crc(cfg->fp_slt, &checkcrc); in vdpp_test()
469 VdppTestCfg cfg; in main() local
478 memset(&cfg, 0, sizeof(cfg)); in main()
479 cfg.src_swa = VDPP_YUV_SWAP_SP_UV; in main()
480 cfg.dst_fmt = VDPP_FMT_YUV444; in main()
481 cfg.dst_swa = VDPP_YUV_SWAP_SP_UV; in main()
482 cfg.hist_mode_en = 0; in main()
509 cfg.src_width_vir = atoi(optarg); in main()
512 cfg.src_height_vir = atoi(optarg); in main()
515 cfg.dst_width_vir = atoi(optarg); in main()
518 cfg.dst_height_vir = atoi(optarg); in main()
521 cfg.dst_c_width = atoi(optarg); in main()
524 cfg.dst_c_height = atoi(optarg); in main()
527 cfg.dst_c_width_vir = atoi(optarg); in main()
530 cfg.dst_c_height_vir = atoi(optarg); in main()
533 cfg.yuv_out_diff = atoi(optarg); in main()
536 cfg.cfg_set = strtol(optarg, NULL, 0); in main()
540 strncpy(cfg.hist_l_url, optarg, sizeof(cfg.hist_l_url) - 1); in main()
541 cfg.fp_hist_l = fopen(cfg.hist_l_url, "w+b"); in main()
545 strncpy(cfg.hist_g_url, optarg, sizeof(cfg.hist_g_url) - 1); in main()
546 cfg.fp_hist_g = fopen(cfg.hist_g_url, "w+b"); in main()
550 strncpy(cfg.slt_url, optarg, sizeof(cfg.slt_url) - 1); in main()
551 cfg.fp_slt = fopen(cfg.slt_url, "w+b"); in main()
560 cfg.src_width = atoi(optarg); in main()
563 cfg.src_height = atoi(optarg); in main()
566 cfg.src_format = atoi(optarg); in main()
569 cfg.src_swa = atoi(optarg); in main()
573 strncpy(cfg.src_url, optarg, sizeof(cfg.src_url) - 1); in main()
574 cfg.fp_src = fopen(cfg.src_url, "rb"); in main()
577 cfg.dst_width = atoi(optarg); in main()
580 cfg.dst_height = atoi(optarg); in main()
583 cfg.dst_fmt = str_to_vdpp_fmt(optarg); in main()
586 cfg.dst_swa = atoi(optarg); in main()
590 strncpy(cfg.dst_url, optarg, sizeof(cfg.dst_url) - 1); in main()
591 cfg.fp_dst = fopen(cfg.dst_url, "w+b"); in main()
595 strncpy(cfg.dst_c_url, optarg, sizeof(cfg.dst_c_url) - 1); in main()
596 cfg.fp_dst_c = fopen(cfg.dst_c_url, "w+b"); in main()
599 cfg.frame_num = atoi(optarg); in main()
602 cfg.hist_mode_en = atoi(optarg); in main()
606 strncpy(cfg.hist_url, optarg, sizeof(cfg.hist_url) - 1); in main()
607 cfg.fp_hist = fopen(cfg.hist_url, "w+b"); in main()
615 if (!cfg.src_width_vir) in main()
616 cfg.src_width_vir = MPP_ALIGN(cfg.src_width, 16); in main()
617 if (!cfg.src_height_vir) in main()
618 cfg.src_height_vir = MPP_ALIGN(cfg.src_height, 8); in main()
619 if (!cfg.dst_width) in main()
620 cfg.dst_width = cfg.src_width; in main()
621 if (!cfg.dst_height) in main()
622 cfg.dst_height = cfg.src_height; in main()
623 if (!cfg.dst_width_vir) in main()
624 cfg.dst_width_vir = MPP_ALIGN(cfg.dst_width, 16); in main()
625 if (!cfg.dst_height_vir) in main()
626 cfg.dst_height_vir = MPP_ALIGN(cfg.dst_height, 2); in main()
627 if (cfg.yuv_out_diff) { in main()
628 if (!cfg.dst_c_width) in main()
629 cfg.dst_c_width = cfg.dst_width; in main()
630 if (!cfg.dst_c_width_vir) in main()
631 cfg.dst_c_width_vir = MPP_ALIGN(cfg.dst_c_width, 16); in main()
632 if (!cfg.dst_c_height) in main()
633 cfg.dst_c_height = cfg.dst_height; in main()
634 if (!cfg.dst_c_height_vir) in main()
635 cfg.dst_c_height_vir = MPP_ALIGN(cfg.dst_c_height, 2); in main()
637 if (check_input_cmd(&cfg)) { in main()
643 vdpp_test(&cfg); in main()
645 if (cfg.fp_src) { in main()
646 fclose(cfg.fp_src); in main()
647 cfg.fp_src = NULL; in main()
650 if (cfg.fp_dst) { in main()
651 fclose(cfg.fp_dst); in main()
652 cfg.fp_dst = NULL; in main()
655 if (cfg.fp_dst_c) { in main()
656 fclose(cfg.fp_dst_c); in main()
657 cfg.fp_dst_c = NULL; in main()
660 if (cfg.fp_hist) { in main()
661 fclose(cfg.fp_hist); in main()
662 cfg.fp_hist = NULL; in main()
665 if (cfg.fp_hist_l) { in main()
666 fclose(cfg.fp_hist_l); in main()
667 cfg.fp_hist_l = NULL; in main()
670 if (cfg.fp_hist_g) { in main()
671 fclose(cfg.fp_hist_g); in main()
672 cfg.fp_hist_g = NULL; in main()
675 if (cfg.fp_slt) { in main()
676 fclose(cfg.fp_slt); in main()
677 cfg.fp_slt = NULL; in main()