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()
1449 void set_vui_params(app_ctxt_t *ps_app_ctxt) in set_vui_params() argument
1496 status = ih264e_api_function(ps_app_ctxt->ps_enc, &s_vui_params_ip, in set_vui_params()
1509 void synchronous_encode(iv_obj_t *ps_enc, app_ctxt_t *ps_app_ctxt) in synchronous_encode() argument
1545 allocate_input(ps_app_ctxt); in synchronous_encode()
1546 allocate_output(ps_app_ctxt); in synchronous_encode()
1547 allocate_recon(ps_app_ctxt); in synchronous_encode()
1550 init_psnr(ps_app_ctxt); in synchronous_encode()
1553 ps_app_ctxt->fp_ip = fopen(ps_app_ctxt->ac_ip_fname, "rb"); in synchronous_encode()
1554 if(NULL == ps_app_ctxt->fp_ip) in synchronous_encode()
1556 sprintf(ac_error, "Unable to open input file for reading: %s", ps_app_ctxt->ac_ip_fname); in synchronous_encode()
1560 ps_app_ctxt->fp_op = fopen(ps_app_ctxt->ac_op_fname, "wb"); in synchronous_encode()
1561 if(NULL == ps_app_ctxt->fp_op) in synchronous_encode()
1563 sprintf(ac_error, "Unable to open output file for writing: %s", ps_app_ctxt->ac_op_fname); in synchronous_encode()
1567 if(1 == ps_app_ctxt->u4_recon_enable) in synchronous_encode()
1569 ps_app_ctxt->fp_recon = fopen(ps_app_ctxt->ac_recon_fname, "wb"); in synchronous_encode()
1570 if(NULL == ps_app_ctxt->fp_recon) in synchronous_encode()
1572 … sprintf(ac_error, "Unable to open recon file for writing: %s", ps_app_ctxt->ac_recon_fname); in synchronous_encode()
1577 if(1 == ps_app_ctxt->u4_chksum_enable) in synchronous_encode()
1579 ps_app_ctxt->fp_chksum = fopen(ps_app_ctxt->ac_chksum_fname, "wb"); in synchronous_encode()
1580 if(NULL == ps_app_ctxt->fp_chksum) in synchronous_encode()
1582 … sprintf(ac_error, "Unable to open checksum file for writing: %s", ps_app_ctxt->ac_chksum_fname); in synchronous_encode()
1590 if(1 == ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
1592 ps_app_ctxt->fp_psnr_ip = fopen(ps_app_ctxt->ac_ip_fname, "rb"); in synchronous_encode()
1593 if(NULL == ps_app_ctxt->fp_psnr_ip) in synchronous_encode()
1595 … sprintf(ac_error, "Unable to open input file for reading: %s", ps_app_ctxt->ac_ip_fname); in synchronous_encode()
1600 if(0 != ps_app_ctxt->u4_mb_info_type) in synchronous_encode()
1602 ps_app_ctxt->fp_mb_info = fopen(ps_app_ctxt->ac_mb_info_fname, "rb"); in synchronous_encode()
1603 if(NULL == ps_app_ctxt->fp_mb_info) in synchronous_encode()
1605 … sprintf(ac_error, "Unable to open MB info file for reading: %s", ps_app_ctxt->ac_mb_info_fname); in synchronous_encode()
1609 if (ps_app_ctxt->u4_pic_info_type) in synchronous_encode()
1611 ps_app_ctxt->fp_pic_info = fopen(ps_app_ctxt->ac_pic_info_fname, "rb"); in synchronous_encode()
1612 if(NULL == ps_app_ctxt->fp_pic_info) in synchronous_encode()
1614 … sprintf(ac_error, "Unable to open Pic info file for reading: %s", ps_app_ctxt->ac_pic_info_fname); in synchronous_encode()
1619 GETTIME(&ps_app_ctxt->enc_start_time); in synchronous_encode()
1620 ps_app_ctxt->enc_last_time = ps_app_ctxt->enc_start_time; in synchronous_encode()
1631 if(ps_app_ctxt->as_input_buf[i].u4_is_free) in synchronous_encode()
1633 pu1_buf = ps_app_ctxt->as_input_buf[i].pu1_buf; in synchronous_encode()
1634 pv_mb_info = ps_app_ctxt->as_input_buf[i].pv_mb_info; in synchronous_encode()
1635 pv_pic_info = ps_app_ctxt->as_input_buf[i].pv_pic_info; in synchronous_encode()
1636 ps_app_ctxt->as_input_buf[i].u4_is_free = 0; in synchronous_encode()
1654 ps_video_encode_ip->u4_pic_info_type = ps_app_ctxt->u4_pic_info_type; in synchronous_encode()
1660 ps_inp_raw_buf->e_color_fmt = ps_app_ctxt->e_inp_color_fmt; in synchronous_encode()
1663 if(IV_YUV_420SP_UV == ps_app_ctxt->e_inp_color_fmt|| in synchronous_encode()
1664 IV_YUV_420SP_VU == ps_app_ctxt->e_inp_color_fmt) in synchronous_encode()
1670 pu1_buf += ps_app_ctxt->u4_strd * ps_app_ctxt->u4_ht; in synchronous_encode()
1673 ps_inp_raw_buf->au4_wd[0] = ps_app_ctxt->u4_wd; in synchronous_encode()
1674 ps_inp_raw_buf->au4_wd[1] = ps_app_ctxt->u4_wd; in synchronous_encode()
1676 ps_inp_raw_buf->au4_ht[0] = ps_app_ctxt->u4_ht; in synchronous_encode()
1677 ps_inp_raw_buf->au4_ht[1] = ps_app_ctxt->u4_ht / 2; in synchronous_encode()
1679 ps_inp_raw_buf->au4_strd[0] = ps_app_ctxt->u4_strd; in synchronous_encode()
1680 ps_inp_raw_buf->au4_strd[1] = ps_app_ctxt->u4_strd; in synchronous_encode()
1682 else if(IV_YUV_420P == ps_app_ctxt->e_inp_color_fmt) in synchronous_encode()
1686 pu1_buf += (ps_app_ctxt->u4_wd) * ps_app_ctxt->u4_ht; in synchronous_encode()
1688 pu1_buf += (ps_app_ctxt->u4_wd >> 1) * (ps_app_ctxt->u4_ht >> 1); in synchronous_encode()
1691 ps_inp_raw_buf->au4_wd[0] = ps_app_ctxt->u4_wd; in synchronous_encode()
1692 ps_inp_raw_buf->au4_wd[1] = ps_app_ctxt->u4_wd / 2; in synchronous_encode()
1693 ps_inp_raw_buf->au4_wd[2] = ps_app_ctxt->u4_wd / 2; in synchronous_encode()
1695 ps_inp_raw_buf->au4_ht[0] = ps_app_ctxt->u4_ht; in synchronous_encode()
1696 ps_inp_raw_buf->au4_ht[1] = ps_app_ctxt->u4_ht / 2; in synchronous_encode()
1697 ps_inp_raw_buf->au4_ht[2] = ps_app_ctxt->u4_ht / 2; in synchronous_encode()
1699 ps_inp_raw_buf->au4_strd[0] = ps_app_ctxt->u4_strd; in synchronous_encode()
1700 ps_inp_raw_buf->au4_strd[1] = ps_app_ctxt->u4_strd / 2; in synchronous_encode()
1701 ps_inp_raw_buf->au4_strd[2] = ps_app_ctxt->u4_strd / 2; in synchronous_encode()
1704 else if(IV_YUV_422ILE == ps_app_ctxt->e_inp_color_fmt) in synchronous_encode()
1709 ps_inp_raw_buf->au4_wd[0] = ps_app_ctxt->u4_wd * 2; in synchronous_encode()
1711 ps_inp_raw_buf->au4_ht[0] = ps_app_ctxt->u4_ht; in synchronous_encode()
1713 ps_inp_raw_buf->au4_strd[0] = ps_app_ctxt->u4_strd *2; in synchronous_encode()
1727 status = read_input(ps_app_ctxt->fp_ip, ps_inp_raw_buf); in synchronous_encode()
1729 if (ps_app_ctxt->u4_mb_info_type != 0) in synchronous_encode()
1731 mb_info_status = read_mb_info(ps_app_ctxt, pv_mb_info); in synchronous_encode()
1733 if (ps_app_ctxt->u4_pic_info_type != 0) in synchronous_encode()
1735 pic_info_status = read_pic_info(ps_app_ctxt, pv_pic_info); in synchronous_encode()
1740 if(0 == ps_app_ctxt->u4_loopback) in synchronous_encode()
1746 fseek(ps_app_ctxt->fp_ip, 0, SEEK_SET); in synchronous_encode()
1757 if(ps_app_ctxt->as_output_buf[i].u4_is_free) in synchronous_encode()
1759 pu1_buf = ps_app_ctxt->as_output_buf[i].pu1_buf; in synchronous_encode()
1760 buff_size = ps_app_ctxt->as_output_buf[i].u4_buf_size; in synchronous_encode()
1761 ps_app_ctxt->as_output_buf[i].u4_is_free = 0; in synchronous_encode()
1772 …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()
1774 if(ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
1775 …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()
1782 if(0 == ps_app_ctxt->u4_loopback) in synchronous_encode()
1786 if(feof(ps_app_ctxt->fp_ip)) in synchronous_encode()
1794 if ( is_last == 1 || ((ps_app_ctxt->u4_max_num_frms) <= u4_timestamp_low) ) in synchronous_encode()
1803 ps_video_encode_ip->u4_mb_info_type = ps_app_ctxt->u4_mb_info_type; in synchronous_encode()
1804 ps_video_encode_ip->u4_pic_info_type = ps_app_ctxt->u4_pic_info_type;; in synchronous_encode()
1810 GETTIME(&ps_app_ctxt->enc_last_time); in synchronous_encode()
1824 ELAPSEDTIME(ps_app_ctxt->enc_last_time, curtime, timetaken, frequency); in synchronous_encode()
1825 ps_app_ctxt->enc_last_time = curtime; in synchronous_encode()
1856 status = write_output(ps_app_ctxt->fp_op, pu1_buf, num_bytes); in synchronous_encode()
1870 … if(ps_app_ctxt->as_input_buf[i].pu1_buf == ps_video_encode_op->s_inp_buf.apv_bufs[0]) in synchronous_encode()
1872 ps_app_ctxt->as_input_buf[i].u4_is_free = 1; in synchronous_encode()
1883 if(ps_app_ctxt->as_output_buf[i].pu1_buf == ps_video_encode_op->s_out_buf.pv_buf) in synchronous_encode()
1885 ps_app_ctxt->as_output_buf[i].u4_is_free = 1; in synchronous_encode()
1928 ps_app_ctxt->u4_pics_cnt++; in synchronous_encode()
1929 ps_app_ctxt->avg_time = u4_total_time / ps_app_ctxt->u4_pics_cnt; in synchronous_encode()
1930 ps_app_ctxt->u4_total_bytes += num_bytes; in synchronous_encode()
1933 if (ps_app_ctxt->u4_psnr_enable == 0) in synchronous_encode()
1936 u1_pic_type[lookup_idx], ps_app_ctxt->u4_pics_cnt, in synchronous_encode()
1937 num_bytes, timetaken, ps_app_ctxt->avg_time, in synchronous_encode()
1991 if (ps_app_ctxt->u4_recon_enable || ps_app_ctxt->u4_chksum_enable in synchronous_encode()
1992 || ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
1999 if (ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
2000 read_input(ps_app_ctxt->fp_psnr_ip, &s_inp_buf); in synchronous_encode()
2006 if (ps_app_ctxt->u4_recon_enable) in synchronous_encode()
2008 status = write_recon(ps_app_ctxt->fp_recon, &s_recon_buf); in synchronous_encode()
2016 if (ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
2018 compute_psnr(ps_app_ctxt, &s_recon_buf, &s_inp_buf); in synchronous_encode()
2022 if (ps_app_ctxt->u4_chksum_enable) in synchronous_encode()
2037 fwrite(au1_chksum, sizeof(UWORD8), 16, ps_app_ctxt->fp_chksum); in synchronous_encode()
2054 ps_app_ctxt->u4_pics_cnt--; in synchronous_encode()
2056 if(ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
2058 print_average_psnr(ps_app_ctxt); in synchronous_encode()
2062 fclose(ps_app_ctxt->fp_ip); in synchronous_encode()
2063 fclose(ps_app_ctxt->fp_op); in synchronous_encode()
2064 if(1 == ps_app_ctxt->u4_recon_enable) in synchronous_encode()
2066 fclose(ps_app_ctxt->fp_recon); in synchronous_encode()
2068 if(1 == ps_app_ctxt->u4_chksum_enable) in synchronous_encode()
2070 fclose(ps_app_ctxt->fp_chksum); in synchronous_encode()
2072 if(1 == ps_app_ctxt->u4_psnr_enable) in synchronous_encode()
2074 fclose(ps_app_ctxt->fp_psnr_ip); in synchronous_encode()
2077 if(0 != ps_app_ctxt->u4_mb_info_type) in synchronous_encode()
2079 fclose(ps_app_ctxt->fp_mb_info); in synchronous_encode()
2081 if (ps_app_ctxt->u4_pic_info_type) in synchronous_encode()
2083 fclose(ps_app_ctxt->fp_pic_info); in synchronous_encode()
2086 free_input(ps_app_ctxt); in synchronous_encode()
2087 free_output(ps_app_ctxt); in synchronous_encode()
2088 free_recon(ps_app_ctxt); in synchronous_encode()