Lines Matching refs:ps_app_ctxt

499 void parse_argument(app_ctxt_t *ps_app_ctxt, CHAR *argument, CHAR *value)  in parse_argument()  argument
511 sscanf(value, "%d", &ps_app_ctxt->u4_slice_mode); in parse_argument()
514 sscanf(value, "%d", &ps_app_ctxt->u4_slice_param); in parse_argument()
517 sscanf(value, "%s", ps_app_ctxt->ac_ip_fname); in parse_argument()
521 sscanf(value, "%s", ps_app_ctxt->ac_op_fname); in parse_argument()
525 sscanf(value, "%s", ps_app_ctxt->ac_recon_fname); in parse_argument()
529 sscanf(value, "%d", &ps_app_ctxt->u4_recon_enable); in parse_argument()
533 sscanf(value, "%s", ps_app_ctxt->ac_chksum_fname); in parse_argument()
537 sscanf(value, "%d", &ps_app_ctxt->u4_chksum_enable); in parse_argument()
541 sscanf(value, "%s", ps_app_ctxt->ac_mb_info_fname); in parse_argument()
545 sscanf(value, "%d", &ps_app_ctxt->u4_mb_info_type); in parse_argument()
549 sscanf(value, "%s", ps_app_ctxt->ac_pic_info_fname); in parse_argument()
553 sscanf(value, "%d", &ps_app_ctxt->u4_pic_info_type); in parse_argument()
557 ps_app_ctxt->e_inp_color_fmt = get_chroma_fmt(value); in parse_argument()
561 ps_app_ctxt->e_recon_color_fmt = get_chroma_fmt(value); in parse_argument()
565 sscanf(value, "%d", &ps_app_ctxt->u4_max_wd); in parse_argument()
569 sscanf(value, "%d", &ps_app_ctxt->u4_max_ht); in parse_argument()
573 sscanf(value, "%d", &ps_app_ctxt->u4_wd); in parse_argument()
577 sscanf(value, "%d", &ps_app_ctxt->u4_ht); in parse_argument()
581 sscanf(value, "%d", &ps_app_ctxt->u4_max_level); in parse_argument()
585 ps_app_ctxt->u4_enc_speed = get_speed_preset(value); in parse_argument()
589 sscanf(value, "%d", &ps_app_ctxt->u4_me_speed); in parse_argument()
593 sscanf(value, "%d", &ps_app_ctxt->u4_start_frm); in parse_argument()
597 sscanf(value, "%d", &ps_app_ctxt->u4_max_num_frms); in parse_argument()
601 sscanf(value, "%d", &ps_app_ctxt->u4_max_frame_rate); in parse_argument()
602 if(ps_app_ctxt->u4_max_frame_rate <= 0) in parse_argument()
603 ps_app_ctxt->u4_max_frame_rate = DEFAULT_MAX_FRAMERATE; in parse_argument()
607 sscanf(value, "%d", &ps_app_ctxt->u4_src_frame_rate); in parse_argument()
608 if(ps_app_ctxt->u4_src_frame_rate <= 0) in parse_argument()
609 ps_app_ctxt->u4_src_frame_rate = DEFAULT_SRC_FRAME_RATE; in parse_argument()
613 sscanf(value, "%d", &ps_app_ctxt->u4_tgt_frame_rate); in parse_argument()
614 if(ps_app_ctxt->u4_tgt_frame_rate <= 0) in parse_argument()
615 ps_app_ctxt->u4_tgt_frame_rate = DEFAULT_TGT_FRAME_RATE; in parse_argument()
619 sscanf(value, "%d", &ps_app_ctxt->u4_rc); in parse_argument()
623 sscanf(value, "%d", &ps_app_ctxt->u4_max_bitrate); in parse_argument()
627 sscanf(value, "%d", &ps_app_ctxt->u4_bitrate); in parse_argument()
631 sscanf(value, "%d", &ps_app_ctxt->u4_i_qp); in parse_argument()
635 sscanf(value, "%d", &ps_app_ctxt->u4_i_qp_max); in parse_argument()
639 sscanf(value, "%d", &ps_app_ctxt->u4_i_qp_min); in parse_argument()
643 sscanf(value, "%d", &ps_app_ctxt->u4_p_qp); in parse_argument()
647 sscanf(value, "%d", &ps_app_ctxt->u4_p_qp_max); in parse_argument()
651 sscanf(value, "%d", &ps_app_ctxt->u4_p_qp_min); in parse_argument()
655 sscanf(value, "%d", &ps_app_ctxt->u4_b_qp); in parse_argument()
659 sscanf(value, "%d", &ps_app_ctxt->u4_b_qp_max); in parse_argument()
663 sscanf(value, "%d", &ps_app_ctxt->u4_b_qp_min); in parse_argument()
667 sscanf(value, "%d", &ps_app_ctxt->u4_entropy_coding_mode); in parse_argument()
671 sscanf(value, "%d", &ps_app_ctxt->u4_air); in parse_argument()
676 ps_app_ctxt->e_arch = ARCH_ARM_NONEON; in parse_argument()
678 ps_app_ctxt->e_arch = ARCH_ARM_A9Q; in parse_argument()
680 ps_app_ctxt->e_arch = ARCH_ARM_A7; in parse_argument()
682 ps_app_ctxt->e_arch = ARCH_ARM_A5; in parse_argument()
684 ps_app_ctxt->e_arch = ARCH_ARM_NEONINTR; in parse_argument()
686 ps_app_ctxt->e_arch = ARCH_X86_GENERIC; in parse_argument()
688 ps_app_ctxt->e_arch = ARCH_X86_SSSE3; in parse_argument()
690 ps_app_ctxt->e_arch = ARCH_X86_SSE42; in parse_argument()
692 ps_app_ctxt->e_arch = ARCH_ARM_A53; in parse_argument()
694 ps_app_ctxt->e_arch = ARCH_ARM_A57; in parse_argument()
696 ps_app_ctxt->e_arch = ARCH_ARM_V8_NEON; in parse_argument()
700 ps_app_ctxt->e_arch = ARCH_ARM_A9Q; in parse_argument()
706 ps_app_ctxt->e_soc = SOC_GENERIC; in parse_argument()
708 ps_app_ctxt->e_soc = SOC_HISI_37X; in parse_argument()
711 ps_app_ctxt->e_soc = SOC_GENERIC; in parse_argument()
716 sscanf(value, "%d", &ps_app_ctxt->u4_num_cores); in parse_argument()
720 sscanf(value, "%d", &ps_app_ctxt->u4_loopback); in parse_argument()
724 sscanf(value, "%d", &ps_app_ctxt->u4_pre_enc_me); in parse_argument()
728 sscanf(value, "%d", &ps_app_ctxt->u4_pre_enc_ipe); in parse_argument()
732 sscanf(value, "%d", &ps_app_ctxt->u4_hpel); in parse_argument()
736 sscanf(value, "%d", &ps_app_ctxt->u4_qpel); in parse_argument()
740 sscanf(value, "%d", &ps_app_ctxt->u4_srch_rng_x); in parse_argument()
744 sscanf(value, "%d", &ps_app_ctxt->u4_srch_rng_y); in parse_argument()
748 sscanf(value, "%d", &ps_app_ctxt->u4_i_interval); in parse_argument()
752 sscanf(value, "%d", &ps_app_ctxt->u4_idr_interval); in parse_argument()
756 sscanf(value, "%d", &ps_app_ctxt->u4_constrained_intra_pred); in parse_argument()
760 sscanf(value, "%d", &ps_app_ctxt->u4_num_bframes); in parse_argument()
764 sscanf(value, "%d", &ps_app_ctxt->u4_disable_deblk_level); in parse_argument()
768 sscanf(value, "%d", &ps_app_ctxt->u4_vbv_buffer_delay); in parse_argument()
772 sscanf(value, "%d", &ps_app_ctxt->u4_vbv_buf_size); in parse_argument()
776 sscanf(value, "%d", &ps_app_ctxt->u4_enable_fast_sad); in parse_argument()
780 sscanf(value, "%d", &ps_app_ctxt->u4_enable_alt_ref); in parse_argument()
784 sscanf(value, "%d", &ps_app_ctxt->u4_air_refresh_period); in parse_argument()
789 ps_app_ctxt->e_profile = IV_PROFILE_BASE; in parse_argument()
791 ps_app_ctxt->e_profile = IV_PROFILE_MAIN; in parse_argument()
793 ps_app_ctxt->e_profile = IV_PROFILE_HIGH; in parse_argument()
797 ps_app_ctxt->e_profile = IV_PROFILE_BASE; in parse_argument()
802 sscanf(value, "%d", &ps_app_ctxt->u4_psnr_enable); in parse_argument()
806 sscanf(value, "%d", &ps_app_ctxt->u4_enable_intra_4x4); in parse_argument()
840 void read_cfg_file(app_ctxt_t *ps_app_ctxt, FILE *fp_cfg) in read_cfg_file() argument
857 parse_argument(ps_app_ctxt, argument, value); in read_cfg_file()
867 void validate_params(app_ctxt_t *ps_app_ctxt) in validate_params() argument
871 if(ps_app_ctxt->ac_ip_fname[0] == '\0') in validate_params()
875 if(ps_app_ctxt->ac_op_fname[0] == '\0') in validate_params()
879 if((1 == ps_app_ctxt->u4_recon_enable) && (ps_app_ctxt->ac_recon_fname[0] == '\0')) in validate_params()
883 if((1 == ps_app_ctxt->u4_chksum_enable) && (ps_app_ctxt->ac_chksum_fname[0] == '\0')) in validate_params()
887 if(0 >= (WORD32)ps_app_ctxt->u4_wd) in validate_params()
889 sprintf(ac_error, "Invalid width: %d", ps_app_ctxt->u4_wd); in validate_params()
892 if(0 >= (WORD32)ps_app_ctxt->u4_ht) in validate_params()
894 sprintf(ac_error, "Invalid height: %d", ps_app_ctxt->u4_ht); in validate_params()
898 if(0 == (WORD32)ps_app_ctxt->u4_max_num_frms) in validate_params()
900 … sprintf(ac_error, "Invalid number of frames to be encoded: %d", ps_app_ctxt->u4_max_num_frms); in validate_params()
903 if ((0 != (WORD32)ps_app_ctxt->u4_entropy_coding_mode) in validate_params()
904 && (1 != (WORD32)ps_app_ctxt->u4_entropy_coding_mode)) in validate_params()
907 ps_app_ctxt->u4_entropy_coding_mode); in validate_params()
913 void init_default_params(app_ctxt_t *ps_app_ctxt) in init_default_params() argument
916 ps_app_ctxt->ps_enc = NULL; in init_default_params()
917 ps_app_ctxt->ps_mem_rec = NULL; in init_default_params()
918 ps_app_ctxt->u4_num_mem_rec = DEFAULT_MEM_REC_CNT; in init_default_params()
919 ps_app_ctxt->u4_recon_enable = DEFAULT_RECON_ENABLE; in init_default_params()
920 ps_app_ctxt->u4_chksum_enable = DEFAULT_CHKSUM_ENABLE; in init_default_params()
921 ps_app_ctxt->u4_mb_info_type = 0; in init_default_params()
922 ps_app_ctxt->u4_pic_info_type = 0; in init_default_params()
923 ps_app_ctxt->u4_mb_info_size = 0; in init_default_params()
924 ps_app_ctxt->u4_pic_info_size = 0; in init_default_params()
925 ps_app_ctxt->u4_start_frm = DEFAULT_START_FRM; in init_default_params()
926 ps_app_ctxt->u4_max_num_frms = DEFAULT_NUM_FRMS; in init_default_params()
927 ps_app_ctxt->avg_time = 0; in init_default_params()
928 ps_app_ctxt->u4_total_bytes = 0; in init_default_params()
929 ps_app_ctxt->u4_pics_cnt = 0; in init_default_params()
930 ps_app_ctxt->e_inp_color_fmt = DEFAULT_INP_COLOR_FMT; in init_default_params()
931 ps_app_ctxt->e_recon_color_fmt = DEFAULT_RECON_COLOR_FMT; in init_default_params()
932 ps_app_ctxt->e_arch = ARCH_ARM_A9Q; in init_default_params()
933 ps_app_ctxt->e_soc = SOC_GENERIC; in init_default_params()
934 ps_app_ctxt->header_generated = 0; in init_default_params()
935 ps_app_ctxt->pv_codec_obj = NULL; in init_default_params()
936 ps_app_ctxt->u4_num_cores = DEFAULT_NUM_CORES; in init_default_params()
937 ps_app_ctxt->u4_pre_enc_me = 0; in init_default_params()
938 ps_app_ctxt->u4_pre_enc_ipe = 0; in init_default_params()
939 ps_app_ctxt->ac_ip_fname[0] = '\0'; in init_default_params()
940 ps_app_ctxt->ac_op_fname[0] = '\0'; in init_default_params()
941 ps_app_ctxt->ac_recon_fname[0] = '\0'; in init_default_params()
942 ps_app_ctxt->ac_chksum_fname[0] = '\0'; in init_default_params()
943 ps_app_ctxt->ac_mb_info_fname[0] = '\0'; in init_default_params()
944 ps_app_ctxt->fp_ip = NULL; in init_default_params()
945 ps_app_ctxt->fp_op = NULL; in init_default_params()
946 ps_app_ctxt->fp_recon = NULL; in init_default_params()
947 ps_app_ctxt->fp_chksum = NULL; in init_default_params()
948 ps_app_ctxt->fp_psnr_ip = NULL; in init_default_params()
949 ps_app_ctxt->fp_mb_info = NULL; in init_default_params()
950 ps_app_ctxt->fp_pic_info = NULL; in init_default_params()
951 ps_app_ctxt->u4_loopback = DEFAULT_LOOPBACK; in init_default_params()
952 ps_app_ctxt->u4_max_frame_rate = DEFAULT_MAX_FRAMERATE; in init_default_params()
953 ps_app_ctxt->u4_src_frame_rate = DEFAULT_SRC_FRAME_RATE; in init_default_params()
954 ps_app_ctxt->u4_tgt_frame_rate = DEFAULT_TGT_FRAME_RATE; in init_default_params()
955 ps_app_ctxt->u4_max_wd = DEFAULT_MAX_WD; in init_default_params()
956 ps_app_ctxt->u4_max_ht = DEFAULT_MAX_HT; in init_default_params()
957 ps_app_ctxt->u4_max_level = DEFAULT_MAX_LEVEL; in init_default_params()
958 ps_app_ctxt->u4_strd = DEFAULT_STRIDE; in init_default_params()
959 ps_app_ctxt->u4_wd = DEFAULT_WD; in init_default_params()
960 ps_app_ctxt->u4_ht = DEFAULT_HT; in init_default_params()
961 ps_app_ctxt->u4_psnr_enable = DEFAULT_PSNR_ENABLE; in init_default_params()
962 ps_app_ctxt->u4_enc_speed = IVE_FASTEST; in init_default_params()
963 ps_app_ctxt->u4_me_speed = DEFAULT_ME_SPEED; in init_default_params()
964 ps_app_ctxt->u4_enable_fast_sad = DEFAULT_ENABLE_FAST_SAD; in init_default_params()
965 ps_app_ctxt->u4_enable_alt_ref = DEFAULT_ENABLE_ALT_REF; in init_default_params()
966 ps_app_ctxt->u4_rc = DEFAULT_RC; in init_default_params()
967 ps_app_ctxt->u4_max_bitrate = DEFAULT_MAX_BITRATE; in init_default_params()
968 ps_app_ctxt->u4_num_bframes = DEFAULT_NUM_BFRAMES; in init_default_params()
969 ps_app_ctxt->u4_bitrate = DEFAULT_BITRATE; in init_default_params()
970 ps_app_ctxt->u4_i_qp = DEFAULT_I_QP; in init_default_params()
971 ps_app_ctxt->u4_p_qp = DEFAULT_P_QP; in init_default_params()
972 ps_app_ctxt->u4_b_qp = DEFAULT_B_QP; in init_default_params()
973 ps_app_ctxt->u4_i_qp_min = DEFAULT_QP_MIN; in init_default_params()
974 ps_app_ctxt->u4_i_qp_max = DEFAULT_QP_MAX; in init_default_params()
975 ps_app_ctxt->u4_p_qp_min = DEFAULT_QP_MIN; in init_default_params()
976 ps_app_ctxt->u4_p_qp_max = DEFAULT_QP_MAX; in init_default_params()
977 ps_app_ctxt->u4_b_qp_min = DEFAULT_QP_MIN; in init_default_params()
978 ps_app_ctxt->u4_b_qp_max = DEFAULT_QP_MAX; in init_default_params()
979 ps_app_ctxt->u4_air = DEFAULT_AIR; in init_default_params()
980 ps_app_ctxt->u4_air_refresh_period = DEFAULT_AIR_REFRESH_PERIOD; in init_default_params()
981 ps_app_ctxt->u4_srch_rng_x = DEFAULT_SRCH_RNG_X; in init_default_params()
982 ps_app_ctxt->u4_srch_rng_y = DEFAULT_SRCH_RNG_Y; in init_default_params()
983 ps_app_ctxt->u4_i_interval = DEFAULT_I_INTERVAL; in init_default_params()
984 ps_app_ctxt->u4_idr_interval = DEFAULT_IDR_INTERVAL; in init_default_params()
985 ps_app_ctxt->u4_constrained_intra_pred = DEFAULT_CONSTRAINED_INTRAPRED; in init_default_params()
986 ps_app_ctxt->u4_disable_deblk_level = DEFAULT_DISABLE_DEBLK_LEVEL; in init_default_params()
987 ps_app_ctxt->u4_hpel = DEFAULT_HPEL; in init_default_params()
988 ps_app_ctxt->u4_qpel = DEFAULT_QPEL; in init_default_params()
989 ps_app_ctxt->u4_enable_intra_4x4 = DEFAULT_I4; in init_default_params()
990 ps_app_ctxt->e_profile = DEFAULT_EPROFILE; in init_default_params()
991 ps_app_ctxt->u4_slice_mode = DEFAULT_SLICE_MODE; in init_default_params()
992 ps_app_ctxt->u4_slice_param = DEFAULT_SLICE_PARAM; in init_default_params()
993 ps_app_ctxt->pv_input_thread_handle = NULL; in init_default_params()
994 ps_app_ctxt->pv_output_thread_handle = NULL; in init_default_params()
995 ps_app_ctxt->pv_recon_thread_handle = NULL; in init_default_params()
996 ps_app_ctxt->u4_vbv_buf_size = 0; in init_default_params()
997 ps_app_ctxt->u4_vbv_buffer_delay = 1000; in init_default_params()
998 ps_app_ctxt->adbl_psnr[0] = 0.0; in init_default_params()
999 ps_app_ctxt->adbl_psnr[1] = 0.0; in init_default_params()
1000 ps_app_ctxt->adbl_psnr[2] = 0.0; in init_default_params()
1001 ps_app_ctxt->u4_psnr_cnt = 0; in init_default_params()
1002 ps_app_ctxt->pu1_psnr_buf = NULL; in init_default_params()
1003 ps_app_ctxt->u4_psnr_buf_size = 0; in init_default_params()
1004 ps_app_ctxt->u4_entropy_coding_mode = DEFAULT_ENTROPY_CODING_MODE; in init_default_params()
1009 void set_dimensions(app_ctxt_t *ps_app_ctxt, in set_dimensions() argument
1020 s_frame_dimensions_ip.s_ive_ip.u4_ht = ps_app_ctxt->u4_ht; in set_dimensions()
1021 s_frame_dimensions_ip.s_ive_ip.u4_wd = ps_app_ctxt->u4_wd; in set_dimensions()
1031 status = ih264e_api_function(ps_app_ctxt->ps_enc, in set_dimensions()
1044 void set_frame_rate(app_ctxt_t *ps_app_ctxt, in set_frame_rate() argument
1056 ps_app_ctxt->u4_src_frame_rate; in set_frame_rate()
1058 ps_app_ctxt->u4_tgt_frame_rate; in set_frame_rate()
1066 status = ih264e_api_function(ps_app_ctxt->ps_enc,&s_frame_rate_ip,&s_frame_rate_op); in set_frame_rate()
1078 void set_ipe_params(app_ctxt_t *ps_app_ctxt, in set_ipe_params() argument
1089 s_ipe_params_ip.s_ive_ip.u4_enable_intra_4x4 = ps_app_ctxt->u4_enable_intra_4x4; in set_ipe_params()
1090 s_ipe_params_ip.s_ive_ip.u4_enc_speed_preset = ps_app_ctxt->u4_enc_speed; in set_ipe_params()
1099 ps_app_ctxt->u4_constrained_intra_pred; in set_ipe_params()
1101 status = ih264e_api_function(ps_app_ctxt->ps_enc,&s_ipe_params_ip,&s_ipe_params_op); in set_ipe_params()
1112 void set_bit_rate(app_ctxt_t *ps_app_ctxt, in set_bit_rate() argument
1122 s_bitrate_ip.s_ive_ip.u4_target_bitrate = ps_app_ctxt->u4_bitrate; in set_bit_rate()
1130 status = ih264e_api_function(ps_app_ctxt->ps_enc,&s_bitrate_ip,&s_bitrate_op); in set_bit_rate()
1142 void set_frame_type(app_ctxt_t *ps_app_ctxt, in set_frame_type() argument
1162 status = ih264e_api_function(ps_app_ctxt->ps_enc,&s_frame_type_ip,&s_frame_type_op); in set_frame_type()
1173 void set_qp(app_ctxt_t *ps_app_ctxt, in set_qp() argument
1183 s_qp_ip.s_ive_ip.u4_i_qp = ps_app_ctxt->u4_i_qp; in set_qp()
1184 s_qp_ip.s_ive_ip.u4_i_qp_max = ps_app_ctxt->u4_i_qp_max; in set_qp()
1185 s_qp_ip.s_ive_ip.u4_i_qp_min = ps_app_ctxt->u4_i_qp_min; in set_qp()
1187 s_qp_ip.s_ive_ip.u4_p_qp = ps_app_ctxt->u4_p_qp; in set_qp()
1188 s_qp_ip.s_ive_ip.u4_p_qp_max = ps_app_ctxt->u4_p_qp_max; in set_qp()
1189 s_qp_ip.s_ive_ip.u4_p_qp_min = ps_app_ctxt->u4_p_qp_min; in set_qp()
1191 s_qp_ip.s_ive_ip.u4_b_qp = ps_app_ctxt->u4_b_qp; in set_qp()
1192 s_qp_ip.s_ive_ip.u4_b_qp_max = ps_app_ctxt->u4_b_qp_max; in set_qp()
1193 s_qp_ip.s_ive_ip.u4_b_qp_min = ps_app_ctxt->u4_b_qp_min; in set_qp()
1201 status = ih264e_api_function(ps_app_ctxt->ps_enc,&s_qp_ip,&s_qp_op); in set_qp()
1212 void set_enc_mode(app_ctxt_t *ps_app_ctxt, in set_enc_mode() argument
1232 status = ih264e_api_function(ps_app_ctxt->ps_enc, &s_enc_mode_ip, in set_enc_mode()
1245 void set_vbv_params(app_ctxt_t *ps_app_ctxt, in set_vbv_params() argument
1256 s_vbv_ip.s_ive_ip.u4_vbv_buf_size = ps_app_ctxt->u4_vbv_buf_size; in set_vbv_params()
1258 ps_app_ctxt->u4_vbv_buffer_delay; in set_vbv_params()
1266 status = ih264e_api_function(ps_app_ctxt->ps_enc,&s_vbv_ip,&s_vbv_op); in set_vbv_params()
1277 void set_air_params(app_ctxt_t *ps_app_ctxt, in set_air_params() argument
1288 s_air_ip.s_ive_ip.e_air_mode = ps_app_ctxt->u4_air; in set_air_params()
1289 s_air_ip.s_ive_ip.u4_air_refresh_period = ps_app_ctxt->u4_air_refresh_period; in set_air_params()
1297 status = ih264e_api_function(ps_app_ctxt->ps_enc,&s_air_ip,&s_air_op); in set_air_params()
1308 void set_me_params(app_ctxt_t *ps_app_ctxt, in set_me_params() argument
1320 s_me_params_ip.s_ive_ip.u4_enable_fast_sad = ps_app_ctxt->u4_enable_fast_sad; in set_me_params()
1321 s_me_params_ip.s_ive_ip.u4_enable_alt_ref = ps_app_ctxt->u4_enable_alt_ref; in set_me_params()
1323 s_me_params_ip.s_ive_ip.u4_enable_hpel = ps_app_ctxt->u4_hpel; in set_me_params()
1324 s_me_params_ip.s_ive_ip.u4_enable_qpel = ps_app_ctxt->u4_qpel; in set_me_params()
1325 s_me_params_ip.s_ive_ip.u4_me_speed_preset = ps_app_ctxt->u4_me_speed; in set_me_params()
1326 s_me_params_ip.s_ive_ip.u4_srch_rng_x = ps_app_ctxt->u4_srch_rng_x; in set_me_params()
1327 s_me_params_ip.s_ive_ip.u4_srch_rng_y = ps_app_ctxt->u4_srch_rng_y; in set_me_params()
1335 status = ih264e_api_function(ps_app_ctxt->ps_enc, &s_me_params_ip, in set_me_params()
1348 void set_gop_params(app_ctxt_t *ps_app_ctxt, in set_gop_params() argument
1360 s_gop_params_ip.s_ive_ip.u4_i_frm_interval = ps_app_ctxt->u4_i_interval; in set_gop_params()
1361 s_gop_params_ip.s_ive_ip.u4_idr_frm_interval = ps_app_ctxt->u4_idr_interval; in set_gop_params()
1369 status = ih264e_api_function(ps_app_ctxt->ps_enc, &s_gop_params_ip, in set_gop_params()
1381 void set_profile_params(app_ctxt_t *ps_app_ctxt, in set_profile_params() argument
1393 s_profile_params_ip.s_ive_ip.e_profile = ps_app_ctxt->e_profile; in set_profile_params()
1395 s_profile_params_ip.s_ive_ip.u4_entropy_coding_mode = ps_app_ctxt->u4_entropy_coding_mode; in set_profile_params()
1403 status = ih264e_api_function(ps_app_ctxt->ps_enc, &s_profile_params_ip, in set_profile_params()
1415 void set_deblock_params(app_ctxt_t *ps_app_ctxt, in set_deblock_params() argument
1428 ps_app_ctxt->u4_disable_deblk_level; in set_deblock_params()
1436 status = ih264e_api_function(ps_app_ctxt->ps_enc, &s_deblock_params_ip, in set_deblock_params()
1450 void synchronous_encode(iv_obj_t *ps_enc, app_ctxt_t *ps_app_ctxt) in synchronous_encode() argument
1486 allocate_input(ps_app_ctxt); in synchronous_encode()
1487 allocate_output(ps_app_ctxt); in synchronous_encode()
1488 allocate_recon(ps_app_ctxt); in synchronous_encode()
1491 init_psnr(ps_app_ctxt); in synchronous_encode()
1494 ps_app_ctxt->fp_ip = fopen(ps_app_ctxt->ac_ip_fname, "rb"); in synchronous_encode()
1495 if(NULL == ps_app_ctxt->fp_ip) in synchronous_encode()
1497 sprintf(ac_error, "Unable to open input file for reading: %s", ps_app_ctxt->ac_ip_fname); in synchronous_encode()
1501 ps_app_ctxt->fp_op = fopen(ps_app_ctxt->ac_op_fname, "wb"); in synchronous_encode()
1502 if(NULL == ps_app_ctxt->fp_op) in synchronous_encode()
1504 sprintf(ac_error, "Unable to open output file for writing: %s", ps_app_ctxt->ac_op_fname); in synchronous_encode()
1508 if(1 == ps_app_ctxt->u4_recon_enable) in synchronous_encode()
1510 ps_app_ctxt->fp_recon = fopen(ps_app_ctxt->ac_recon_fname, "wb"); in synchronous_encode()
1511 if(NULL == ps_app_ctxt->fp_recon) in synchronous_encode()
1513 … sprintf(ac_error, "Unable to open recon file for writing: %s", ps_app_ctxt->ac_recon_fname); in synchronous_encode()
1518 if(1 == ps_app_ctxt->u4_chksum_enable) in synchronous_encode()
1520 ps_app_ctxt->fp_chksum = fopen(ps_app_ctxt->ac_chksum_fname, "wb"); in synchronous_encode()
1521 if(NULL == ps_app_ctxt->fp_chksum) in synchronous_encode()
1523 … sprintf(ac_error, "Unable to open checksum file for writing: %s", ps_app_ctxt->ac_chksum_fname); in synchronous_encode()
1531 if(1 == ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
1533 ps_app_ctxt->fp_psnr_ip = fopen(ps_app_ctxt->ac_ip_fname, "rb"); in synchronous_encode()
1534 if(NULL == ps_app_ctxt->fp_psnr_ip) in synchronous_encode()
1536 … sprintf(ac_error, "Unable to open input file for reading: %s", ps_app_ctxt->ac_ip_fname); in synchronous_encode()
1541 if(0 != ps_app_ctxt->u4_mb_info_type) in synchronous_encode()
1543 ps_app_ctxt->fp_mb_info = fopen(ps_app_ctxt->ac_mb_info_fname, "rb"); in synchronous_encode()
1544 if(NULL == ps_app_ctxt->fp_mb_info) in synchronous_encode()
1546 … sprintf(ac_error, "Unable to open MB info file for reading: %s", ps_app_ctxt->ac_mb_info_fname); in synchronous_encode()
1550 if (ps_app_ctxt->u4_pic_info_type) in synchronous_encode()
1552 ps_app_ctxt->fp_pic_info = fopen(ps_app_ctxt->ac_pic_info_fname, "rb"); in synchronous_encode()
1553 if(NULL == ps_app_ctxt->fp_pic_info) in synchronous_encode()
1555 … sprintf(ac_error, "Unable to open Pic info file for reading: %s", ps_app_ctxt->ac_pic_info_fname); in synchronous_encode()
1560 GETTIME(&ps_app_ctxt->enc_start_time); in synchronous_encode()
1561 ps_app_ctxt->enc_last_time = ps_app_ctxt->enc_start_time; in synchronous_encode()
1572 if(ps_app_ctxt->as_input_buf[i].u4_is_free) in synchronous_encode()
1574 pu1_buf = ps_app_ctxt->as_input_buf[i].pu1_buf; in synchronous_encode()
1575 pv_mb_info = ps_app_ctxt->as_input_buf[i].pv_mb_info; in synchronous_encode()
1576 pv_pic_info = ps_app_ctxt->as_input_buf[i].pv_pic_info; in synchronous_encode()
1577 ps_app_ctxt->as_input_buf[i].u4_is_free = 0; in synchronous_encode()
1595 ps_video_encode_ip->u4_pic_info_type = ps_app_ctxt->u4_pic_info_type; in synchronous_encode()
1601 ps_inp_raw_buf->e_color_fmt = ps_app_ctxt->e_inp_color_fmt; in synchronous_encode()
1604 if(IV_YUV_420SP_UV == ps_app_ctxt->e_inp_color_fmt|| in synchronous_encode()
1605 IV_YUV_420SP_VU == ps_app_ctxt->e_inp_color_fmt) in synchronous_encode()
1611 pu1_buf += ps_app_ctxt->u4_strd * ps_app_ctxt->u4_ht; in synchronous_encode()
1614 ps_inp_raw_buf->au4_wd[0] = ps_app_ctxt->u4_wd; in synchronous_encode()
1615 ps_inp_raw_buf->au4_wd[1] = ps_app_ctxt->u4_wd; in synchronous_encode()
1617 ps_inp_raw_buf->au4_ht[0] = ps_app_ctxt->u4_ht; in synchronous_encode()
1618 ps_inp_raw_buf->au4_ht[1] = ps_app_ctxt->u4_ht / 2; in synchronous_encode()
1620 ps_inp_raw_buf->au4_strd[0] = ps_app_ctxt->u4_strd; in synchronous_encode()
1621 ps_inp_raw_buf->au4_strd[1] = ps_app_ctxt->u4_strd; in synchronous_encode()
1623 else if(IV_YUV_420P == ps_app_ctxt->e_inp_color_fmt) in synchronous_encode()
1627 pu1_buf += (ps_app_ctxt->u4_wd) * ps_app_ctxt->u4_ht; in synchronous_encode()
1629 pu1_buf += (ps_app_ctxt->u4_wd >> 1) * (ps_app_ctxt->u4_ht >> 1); in synchronous_encode()
1632 ps_inp_raw_buf->au4_wd[0] = ps_app_ctxt->u4_wd; in synchronous_encode()
1633 ps_inp_raw_buf->au4_wd[1] = ps_app_ctxt->u4_wd / 2; in synchronous_encode()
1634 ps_inp_raw_buf->au4_wd[2] = ps_app_ctxt->u4_wd / 2; in synchronous_encode()
1636 ps_inp_raw_buf->au4_ht[0] = ps_app_ctxt->u4_ht; in synchronous_encode()
1637 ps_inp_raw_buf->au4_ht[1] = ps_app_ctxt->u4_ht / 2; in synchronous_encode()
1638 ps_inp_raw_buf->au4_ht[2] = ps_app_ctxt->u4_ht / 2; in synchronous_encode()
1640 ps_inp_raw_buf->au4_strd[0] = ps_app_ctxt->u4_strd; in synchronous_encode()
1641 ps_inp_raw_buf->au4_strd[1] = ps_app_ctxt->u4_strd / 2; in synchronous_encode()
1642 ps_inp_raw_buf->au4_strd[2] = ps_app_ctxt->u4_strd / 2; in synchronous_encode()
1645 else if(IV_YUV_422ILE == ps_app_ctxt->e_inp_color_fmt) in synchronous_encode()
1650 ps_inp_raw_buf->au4_wd[0] = ps_app_ctxt->u4_wd * 2; in synchronous_encode()
1652 ps_inp_raw_buf->au4_ht[0] = ps_app_ctxt->u4_ht; in synchronous_encode()
1654 ps_inp_raw_buf->au4_strd[0] = ps_app_ctxt->u4_strd *2; in synchronous_encode()
1668 status = read_input(ps_app_ctxt->fp_ip, ps_inp_raw_buf); in synchronous_encode()
1670 if (ps_app_ctxt->u4_mb_info_type != 0) in synchronous_encode()
1672 mb_info_status = read_mb_info(ps_app_ctxt, pv_mb_info); in synchronous_encode()
1674 if (ps_app_ctxt->u4_pic_info_type != 0) in synchronous_encode()
1676 pic_info_status = read_pic_info(ps_app_ctxt, pv_pic_info); in synchronous_encode()
1681 if(0 == ps_app_ctxt->u4_loopback) in synchronous_encode()
1687 fseek(ps_app_ctxt->fp_ip, 0, SEEK_SET); in synchronous_encode()
1698 if(ps_app_ctxt->as_output_buf[i].u4_is_free) in synchronous_encode()
1700 pu1_buf = ps_app_ctxt->as_output_buf[i].pu1_buf; in synchronous_encode()
1701 buff_size = ps_app_ctxt->as_output_buf[i].u4_buf_size; in synchronous_encode()
1702 ps_app_ctxt->as_output_buf[i].u4_is_free = 0; in synchronous_encode()
1713 …init_raw_buf_descr(ps_app_ctxt, &s_recon_buf, ps_app_ctxt->as_recon_buf[0].pu1_buf, ps_app_ctxt->e… in synchronous_encode()
1715 if(ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
1716 …init_raw_buf_descr(ps_app_ctxt, &s_inp_buf, ps_app_ctxt->pu1_psnr_buf, ps_app_ctxt->e_inp_color_fm… in synchronous_encode()
1723 if(0 == ps_app_ctxt->u4_loopback) in synchronous_encode()
1727 if(feof(ps_app_ctxt->fp_ip)) in synchronous_encode()
1735 if ( is_last == 1 || ((ps_app_ctxt->u4_max_num_frms) <= u4_timestamp_low) ) in synchronous_encode()
1744 ps_video_encode_ip->u4_mb_info_type = ps_app_ctxt->u4_mb_info_type; in synchronous_encode()
1745 ps_video_encode_ip->u4_pic_info_type = ps_app_ctxt->u4_pic_info_type;; in synchronous_encode()
1751 GETTIME(&ps_app_ctxt->enc_last_time); in synchronous_encode()
1765 ELAPSEDTIME(ps_app_ctxt->enc_last_time, curtime, timetaken, frequency); in synchronous_encode()
1766 ps_app_ctxt->enc_last_time = curtime; in synchronous_encode()
1797 status = write_output(ps_app_ctxt->fp_op, pu1_buf, num_bytes); in synchronous_encode()
1811 … if(ps_app_ctxt->as_input_buf[i].pu1_buf == ps_video_encode_op->s_inp_buf.apv_bufs[0]) in synchronous_encode()
1813 ps_app_ctxt->as_input_buf[i].u4_is_free = 1; in synchronous_encode()
1824 if(ps_app_ctxt->as_output_buf[i].pu1_buf == ps_video_encode_op->s_out_buf.pv_buf) in synchronous_encode()
1826 ps_app_ctxt->as_output_buf[i].u4_is_free = 1; in synchronous_encode()
1869 ps_app_ctxt->u4_pics_cnt++; in synchronous_encode()
1870 ps_app_ctxt->avg_time = u4_total_time / ps_app_ctxt->u4_pics_cnt; in synchronous_encode()
1871 ps_app_ctxt->u4_total_bytes += num_bytes; in synchronous_encode()
1874 if (ps_app_ctxt->u4_psnr_enable == 0) in synchronous_encode()
1877 u1_pic_type[lookup_idx], ps_app_ctxt->u4_pics_cnt, in synchronous_encode()
1878 num_bytes, timetaken, ps_app_ctxt->avg_time, in synchronous_encode()
1932 if (ps_app_ctxt->u4_recon_enable || ps_app_ctxt->u4_chksum_enable in synchronous_encode()
1933 || ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
1940 if (ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
1941 read_input(ps_app_ctxt->fp_psnr_ip, &s_inp_buf); in synchronous_encode()
1947 if (ps_app_ctxt->u4_recon_enable) in synchronous_encode()
1949 status = write_recon(ps_app_ctxt->fp_recon, &s_recon_buf); in synchronous_encode()
1957 if (ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
1959 compute_psnr(ps_app_ctxt, &s_recon_buf, &s_inp_buf); in synchronous_encode()
1963 if (ps_app_ctxt->u4_chksum_enable) in synchronous_encode()
1978 fwrite(au1_chksum, sizeof(UWORD8), 16, ps_app_ctxt->fp_chksum); in synchronous_encode()
1995 ps_app_ctxt->u4_pics_cnt--; in synchronous_encode()
1997 if(ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
1999 print_average_psnr(ps_app_ctxt); in synchronous_encode()
2003 fclose(ps_app_ctxt->fp_ip); in synchronous_encode()
2004 fclose(ps_app_ctxt->fp_op); in synchronous_encode()
2005 if(1 == ps_app_ctxt->u4_recon_enable) in synchronous_encode()
2007 fclose(ps_app_ctxt->fp_recon); in synchronous_encode()
2009 if(1 == ps_app_ctxt->u4_chksum_enable) in synchronous_encode()
2011 fclose(ps_app_ctxt->fp_chksum); in synchronous_encode()
2013 if(1 == ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
2015 fclose(ps_app_ctxt->fp_psnr_ip); in synchronous_encode()
2018 if(0 != ps_app_ctxt->u4_mb_info_type) in synchronous_encode()
2020 fclose(ps_app_ctxt->fp_mb_info); in synchronous_encode()
2022 if (ps_app_ctxt->u4_pic_info_type) in synchronous_encode()
2024 fclose(ps_app_ctxt->fp_pic_info); in synchronous_encode()
2027 free_input(ps_app_ctxt); in synchronous_encode()
2028 free_output(ps_app_ctxt); in synchronous_encode()
2029 free_recon(ps_app_ctxt); in synchronous_encode()