Lines Matching refs:ps_codec
435 WORD32 ihevcd_nctb_cnt(codec_t *ps_codec, sps_t *ps_sps) in ihevcd_nctb_cnt() argument
438 UNUSED(ps_codec); in ihevcd_nctb_cnt()
551 IHEVCD_ERROR_T ihevcd_pic_buf_mgr_add_bufs(codec_t *ps_codec) in ihevcd_pic_buf_mgr_add_bufs() argument
567 ps_sps = ps_codec->s_parse.ps_sps; in ihevcd_pic_buf_mgr_add_bufs()
574 level = ps_codec->i4_init_level; in ihevcd_pic_buf_mgr_add_bufs()
589 … max_num_bufs = MIN(max_dpb_size, (ps_codec->i4_init_num_ref + ps_codec->i4_init_num_reorder + 1)); in ihevcd_pic_buf_mgr_add_bufs()
592 pu1_buf = (UWORD8 *)ps_codec->ps_pic_buf; in ihevcd_pic_buf_mgr_add_bufs()
594 ps_pic_buf = (pic_buf_t *)ps_codec->ps_pic_buf; in ihevcd_pic_buf_mgr_add_bufs()
601 if(0 == ps_codec->i4_share_disp_buf) in ihevcd_pic_buf_mgr_add_bufs()
606 pic_buf_size_allocated = ps_codec->i4_total_pic_buf_size - in ihevcd_pic_buf_mgr_add_bufs()
609 luma_samples = (ps_codec->i4_strd) * in ihevcd_pic_buf_mgr_add_bufs()
626 ps_codec->s_parse.i4_error_code = IHEVCD_INSUFFICIENT_MEM_PICBUF; in ihevcd_pic_buf_mgr_add_bufs()
632 ps_pic_buf->pu1_luma = pu1_buf + ps_codec->i4_strd * PAD_TOP + PAD_LEFT; in ihevcd_pic_buf_mgr_add_bufs()
635 ps_pic_buf->pu1_chroma = pu1_buf + ps_codec->i4_strd * (PAD_TOP / 2) + PAD_LEFT; in ihevcd_pic_buf_mgr_add_bufs()
638 buf_ret = ihevc_buf_mgr_add((buf_mgr_t *)ps_codec->pv_pic_buf_mgr, ps_pic_buf, i); in ihevcd_pic_buf_mgr_add_bufs()
642 ps_codec->s_parse.i4_error_code = IHEVCD_BUF_MGR_ERROR; in ihevcd_pic_buf_mgr_add_bufs()
671 IHEVCD_ERROR_T ihevcd_mv_buf_mgr_add_bufs(codec_t *ps_codec) in ihevcd_mv_buf_mgr_add_bufs() argument
685 ps_sps = ps_codec->s_parse.ps_sps; in ihevcd_mv_buf_mgr_add_bufs()
689 level = ps_codec->i4_init_level; in ihevcd_mv_buf_mgr_add_bufs()
700 pu1_buf = (UWORD8 *)ps_codec->pv_mv_bank_buf_base; in ihevcd_mv_buf_mgr_add_bufs()
704 ps_codec->ps_mv_buf = ps_mv_buf; in ihevcd_mv_buf_mgr_add_bufs()
705 … mv_bank_size_allocated = ps_codec->i4_total_mv_bank_size - (MAX_DPB_SIZE + 1) * sizeof(mv_buf_t); in ihevcd_mv_buf_mgr_add_bufs()
729 ps_codec->s_parse.i4_error_code = IHEVCD_INSUFFICIENT_MEM_MVBANK; in ihevcd_mv_buf_mgr_add_bufs()
744 buf_ret = ihevc_buf_mgr_add((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, ps_mv_buf, i); in ihevcd_mv_buf_mgr_add_bufs()
748 ps_codec->s_parse.i4_error_code = IHEVCD_BUF_MGR_ERROR; in ihevcd_mv_buf_mgr_add_bufs()
777 IHEVCD_ERROR_T ihevcd_parse_pic_init(codec_t *ps_codec) in ihevcd_parse_pic_init() argument
790 ps_codec->s_parse.i4_error_code = IHEVCD_SUCCESS; in ihevcd_parse_pic_init()
791 ps_sps = ps_codec->s_parse.ps_sps; in ihevcd_parse_pic_init()
792 ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr; in ihevcd_parse_pic_init()
794 ps_codec->i4_pic_present = 1; in ihevcd_parse_pic_init()
798 memset(ps_codec->s_parse.pu1_pic_intra_flag, 0, num_min_cu); in ihevcd_parse_pic_init()
799 memset(ps_codec->s_parse.pu1_pic_no_loop_filter_flag, 0, num_min_cu); in ihevcd_parse_pic_init()
803 if(0 == ps_codec->s_parse.i4_first_pic_init) in ihevcd_parse_pic_init()
805 ret = ihevcd_mv_buf_mgr_add_bufs(ps_codec); in ihevcd_parse_pic_init()
808 ret = ihevcd_pic_buf_mgr_add_bufs(ps_codec); in ihevcd_parse_pic_init()
811 ps_codec->s_parse.i4_first_pic_init = 1; in ihevcd_parse_pic_init()
819 slice_start_idx = ps_codec->i4_slice_error ? 2 : 1; in ihevcd_parse_pic_init()
823 slice_header_t *ps_slice_hdr_tmp = ps_codec->ps_slice_hdr_base + slice_idx; in ihevcd_parse_pic_init()
832 …ps_mv_buf = (mv_buf_t *)ihevc_buf_mgr_get_next_free((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, &cur_mv_… in ihevcd_parse_pic_init()
840 ps_codec->s_parse.i4_error_code = IHEVCD_NO_FREE_MVBANK; in ihevcd_parse_pic_init()
841 ps_codec->i4_error_code = IHEVCD_NO_FREE_MVBANK; in ihevcd_parse_pic_init()
845 ps_codec->s_parse.ps_cur_mv_buf = ps_mv_buf; in ihevcd_parse_pic_init()
860 …ps_cur_pic = (pic_buf_t *)ihevc_buf_mgr_get_next_free((buf_mgr_t *)ps_codec->pv_pic_buf_mgr, &cur_… in ihevcd_parse_pic_init()
868 ps_codec->s_parse.i4_error_code = IHEVCD_NO_FREE_PICBUF; in ihevcd_parse_pic_init()
869 ps_codec->i4_error_code = IHEVCD_NO_FREE_PICBUF; in ihevcd_parse_pic_init()
874 ps_cur_pic->u4_ts = ps_codec->u4_ts; in ihevcd_parse_pic_init()
885 if(0 == ps_codec->u4_pic_cnt) in ihevcd_parse_pic_init()
897 dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr; in ihevcd_parse_pic_init()
898 buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr; in ihevcd_parse_pic_init()
944 ihevcd_jobq_reset((jobq_t *)ps_codec->pv_proc_jobq); in ihevcd_parse_pic_init()
946 ps_codec->s_parse.i4_pic_pu_idx = 0; in ihevcd_parse_pic_init()
947 ps_codec->s_parse.i4_pic_tu_idx = 0; in ihevcd_parse_pic_init()
949 ps_codec->s_parse.pu1_pic_pu_map = ps_mv_buf->pu1_pic_pu_map; in ihevcd_parse_pic_init()
950 ps_codec->s_parse.ps_pic_pu = ps_mv_buf->ps_pic_pu; in ihevcd_parse_pic_init()
951 ps_codec->s_parse.pu4_pic_pu_idx = ps_mv_buf->pu4_pic_pu_idx; in ihevcd_parse_pic_init()
952 ps_codec->s_parse.pu1_slice_idx = (UWORD16 *)ps_mv_buf->pu1_pic_slice_map; in ihevcd_parse_pic_init()
955 ps_codec->as_process[i].pu1_slice_idx = (UWORD16 *)ps_mv_buf->pu1_pic_slice_map; in ihevcd_parse_pic_init()
957 ps_codec->s_parse.pu1_pu_map = ps_codec->s_parse.pu1_pic_pu_map; in ihevcd_parse_pic_init()
958 ps_codec->s_parse.ps_pu = ps_codec->s_parse.ps_pic_pu; in ihevcd_parse_pic_init()
976 pu1_buf = (UWORD8 *)ps_codec->pv_tu_data; in ihevcd_parse_pic_init()
977 ps_codec->s_parse.pu4_pic_tu_idx = (UWORD32 *)pu1_buf; in ihevcd_parse_pic_init()
980 ps_codec->s_parse.pu1_pic_tu_map = pu1_buf; in ihevcd_parse_pic_init()
983 ps_codec->s_parse.ps_pic_tu = (tu_t *)pu1_buf; in ihevcd_parse_pic_init()
986 ps_codec->s_parse.pv_pic_tu_coeff_data = pu1_buf; in ihevcd_parse_pic_init()
988 ps_codec->s_parse.pu1_tu_map = ps_codec->s_parse.pu1_pic_tu_map; in ihevcd_parse_pic_init()
989 ps_codec->s_parse.ps_tu = ps_codec->s_parse.ps_pic_tu; in ihevcd_parse_pic_init()
990 ps_codec->s_parse.pv_tu_coeff_data = ps_codec->s_parse.pv_pic_tu_coeff_data; in ihevcd_parse_pic_init()
993 ps_codec->s_parse.s_bs_ctxt.ps_pic_pu = ps_codec->s_parse.ps_pic_pu; in ihevcd_parse_pic_init()
994 ps_codec->s_parse.s_bs_ctxt.pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx; in ihevcd_parse_pic_init()
995 ps_codec->s_parse.s_bs_ctxt.pu4_pic_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx; in ihevcd_parse_pic_init()
999 ps_codec->i4_proc_nctb = ihevcd_nctb_cnt(ps_codec, ps_sps); in ihevcd_parse_pic_init()
1008 memset(ps_codec->pu1_parse_map, 0, num_ctb); in ihevcd_parse_pic_init()
1010 memset(ps_codec->pu1_proc_map, 0, num_ctb); in ihevcd_parse_pic_init()
1018 ps_codec->i4_disp_buf_id = -1; in ihevcd_parse_pic_init()
1019 ps_codec->ps_disp_buf = NULL; in ihevcd_parse_pic_init()
1021 ps_codec->i4_disable_deblk_pic = 0; in ihevcd_parse_pic_init()
1022 ps_codec->i4_disable_sao_pic = 0; in ihevcd_parse_pic_init()
1023 ps_codec->i4_fullpel_inter_pred = 0; in ihevcd_parse_pic_init()
1024 ps_codec->i4_mv_frac_mask = 0x7FFFFFFF; in ihevcd_parse_pic_init()
1027 if(ps_codec->i4_degrade_type && ps_codec->i4_degrade_pics) in ihevcd_parse_pic_init()
1030 ps_codec->i4_degrade_pic_cnt++; in ihevcd_parse_pic_init()
1034 switch(ps_codec->i4_degrade_pics) in ihevcd_parse_pic_init()
1053 (ps_codec->i4_degrade_pic_cnt != ps_codec->i4_nondegrade_interval)) in ihevcd_parse_pic_init()
1073 if(ps_codec->i4_degrade_type & 0x1) in ihevcd_parse_pic_init()
1074 ps_codec->i4_disable_sao_pic = 1; in ihevcd_parse_pic_init()
1076 if(ps_codec->i4_degrade_type & 0x2) in ihevcd_parse_pic_init()
1077 ps_codec->i4_disable_deblk_pic = 1; in ihevcd_parse_pic_init()
1083 if(ps_codec->i4_degrade_type & 0x4) in ihevcd_parse_pic_init()
1084 ps_codec->i4_mv_frac_mask = 0; in ihevcd_parse_pic_init()
1086 if(ps_codec->i4_degrade_type & 0x8) in ihevcd_parse_pic_init()
1087 ps_codec->i4_mv_frac_mask = 0; in ihevcd_parse_pic_init()
1091 ps_codec->i4_degrade_pic_cnt = 0; in ihevcd_parse_pic_init()
1099 ps_codec->as_process[i].pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx; in ihevcd_parse_pic_init()
1100 ps_codec->as_process[i].ps_pic_pu = ps_codec->s_parse.ps_pic_pu; in ihevcd_parse_pic_init()
1101 ps_codec->as_process[i].pu1_pic_pu_map = ps_codec->s_parse.pu1_pic_pu_map; in ihevcd_parse_pic_init()
1102 ps_codec->as_process[i].pu4_pic_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx; in ihevcd_parse_pic_init()
1103 ps_codec->as_process[i].ps_pic_tu = ps_codec->s_parse.ps_pic_tu; in ihevcd_parse_pic_init()
1104 ps_codec->as_process[i].pu1_pic_tu_map = ps_codec->s_parse.pu1_pic_tu_map; in ihevcd_parse_pic_init()
1105 ps_codec->as_process[i].pv_pic_tu_coeff_data = ps_codec->s_parse.pv_pic_tu_coeff_data; in ihevcd_parse_pic_init()
1106 ps_codec->as_process[i].i4_cur_mv_bank_buf_id = cur_mv_bank_buf_id; in ihevcd_parse_pic_init()
1107 … ps_codec->as_process[i].s_sao_ctxt.pu1_slice_idx = ps_codec->as_process[i].pu1_slice_idx; in ihevcd_parse_pic_init()
1108 ps_codec->as_process[i].s_sao_ctxt.pu1_tile_idx = ps_codec->as_process[i].pu1_tile_idx; in ihevcd_parse_pic_init()
1113 ps_codec->as_process[i].pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1114 ps_codec->as_process[i].pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1115 ps_codec->as_process[i].ps_cur_pic = ps_cur_pic; in ihevcd_parse_pic_init()
1116 ps_codec->as_process[i].i4_cur_pic_buf_id = cur_pic_buf_id; in ihevcd_parse_pic_init()
1118 ps_codec->as_process[i].ps_out_buffer = ps_codec->ps_out_buffer; in ihevcd_parse_pic_init()
1119 if(1 < ps_codec->i4_num_cores) in ihevcd_parse_pic_init()
1121 ps_codec->as_process[i].i4_check_parse_status = 1; in ihevcd_parse_pic_init()
1122 ps_codec->as_process[i].i4_check_proc_status = 1; in ihevcd_parse_pic_init()
1126 ps_codec->as_process[i].i4_check_parse_status = 0; in ihevcd_parse_pic_init()
1127 ps_codec->as_process[i].i4_check_proc_status = 0; in ihevcd_parse_pic_init()
1129 ps_codec->as_process[i].pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag; in ihevcd_parse_pic_init()
1130 …ps_codec->as_process[i].pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_fla… in ihevcd_parse_pic_init()
1131 ps_codec->as_process[i].i4_init_done = 0; in ihevcd_parse_pic_init()
1133 … ps_codec->as_process[i].s_bs_ctxt.pu4_pic_tu_idx = ps_codec->as_process[i].pu4_pic_tu_idx; in ihevcd_parse_pic_init()
1134 … ps_codec->as_process[i].s_bs_ctxt.pu4_pic_pu_idx = ps_codec->as_process[i].pu4_pic_pu_idx; in ihevcd_parse_pic_init()
1135 ps_codec->as_process[i].s_bs_ctxt.ps_pic_pu = ps_codec->as_process[i].ps_pic_pu; in ihevcd_parse_pic_init()
1136 …ps_codec->as_process[i].s_deblk_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_lo… in ihevcd_parse_pic_init()
1137 ps_codec->as_process[i].s_deblk_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1138 ps_codec->as_process[i].s_deblk_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1139 …ps_codec->as_process[i].s_sao_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop… in ihevcd_parse_pic_init()
1140 ps_codec->as_process[i].s_sao_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1141 ps_codec->as_process[i].s_sao_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1142 if(i < (ps_codec->i4_num_cores - 1)) in ihevcd_parse_pic_init()
1144 ithread_create(ps_codec->apv_process_thread_handle[i], NULL, in ihevcd_parse_pic_init()
1146 (void *)&ps_codec->as_process[i]); in ihevcd_parse_pic_init()
1147 ps_codec->ai4_process_thread_created[i] = 1; in ihevcd_parse_pic_init()
1151 ps_codec->ai4_process_thread_created[i] = 0; in ihevcd_parse_pic_init()
1155 ps_codec->s_parse.s_deblk_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1156 ps_codec->s_parse.s_deblk_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1158 ps_codec->s_parse.s_sao_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1159 ps_codec->s_parse.s_sao_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1173 ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr; in ihevcd_parse_pic_init()
1175 ihevc_disp_mgr_add((disp_mgr_t *)ps_codec->pv_disp_buf_mgr, in ihevcd_parse_pic_init()
1176 ps_codec->as_process[0].i4_cur_pic_buf_id, in ihevcd_parse_pic_init()
1178 ps_codec->as_process[0].ps_cur_pic); in ihevcd_parse_pic_init()
1180 ps_codec->ps_disp_buf = NULL; in ihevcd_parse_pic_init()
1183 …if(((WORD32)(ps_codec->u4_pic_cnt - ps_codec->u4_disp_cnt) >= ps_sps->ai1_sps_max_num_reorder_pics… in ihevcd_parse_pic_init()
1184 ((WORD32)(ps_codec->u4_pic_cnt - ps_codec->u4_disp_cnt) >= ps_codec->i4_init_num_reorder)) in ihevcd_parse_pic_init()
1187 …ps_codec->ps_disp_buf = (pic_buf_t *)ihevc_disp_mgr_get((disp_mgr_t *)ps_codec->pv_disp_buf_mgr, &… in ihevcd_parse_pic_init()
1188 ps_codec->u4_disp_cnt++; in ihevcd_parse_pic_init()
1191 ps_codec->s_fmt_conv.i4_cur_row = 0; in ihevcd_parse_pic_init()
1193 ps_codec->s_fmt_conv.i4_num_rows = 4; in ihevcd_parse_pic_init()
1195 if(ps_codec->u4_enable_fmt_conv_ahead && (ps_codec->i4_num_cores > 1)) in ihevcd_parse_pic_init()
1200 ps_proc = &ps_codec->as_process[ps_codec->i4_num_cores - 1]; in ihevcd_parse_pic_init()
1206 if((ps_codec->ps_disp_buf) && (ps_codec->i4_disp_buf_id != ps_proc->i4_cur_pic_buf_id) && in ihevcd_parse_pic_init()
1207 ((0 == ps_codec->i4_share_disp_buf) || (IV_YUV_420P == ps_codec->e_chroma_fmt))) in ihevcd_parse_pic_init()
1220 ret = ihevcd_jobq_queue((jobq_t *)ps_codec->s_parse.pv_proc_jobq, in ihevcd_parse_pic_init()