Lines Matching refs:ps_codec
192 WORD32 ihevcd_get_total_pic_buf_size(codec_t *ps_codec, in ihevcd_get_total_pic_buf_size() argument
202 sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id); in ihevcd_get_total_pic_buf_size()
207 if(ps_codec->e_frm_out_mode != IVD_DECODE_FRAME_OUT) in ihevcd_get_total_pic_buf_size()
337 WORD32 ihevcd_nctb_cnt(codec_t *ps_codec, sps_t *ps_sps) in ihevcd_nctb_cnt() argument
340 UNUSED(ps_codec); in ihevcd_nctb_cnt()
453 IHEVCD_ERROR_T ihevcd_pic_buf_mgr_add_bufs(codec_t *ps_codec) in ihevcd_pic_buf_mgr_add_bufs() argument
467 ps_sps = ps_codec->s_parse.ps_sps; in ihevcd_pic_buf_mgr_add_bufs()
472 if(ps_codec->e_frm_out_mode != IVD_DECODE_FRAME_OUT) in ihevcd_pic_buf_mgr_add_bufs()
482 pu1_buf = (UWORD8 *)ps_codec->pu1_ref_pic_buf_base; in ihevcd_pic_buf_mgr_add_bufs()
484 ps_pic_buf = (pic_buf_t *)ps_codec->ps_pic_buf; in ihevcd_pic_buf_mgr_add_bufs()
489 if(0 == ps_codec->i4_share_disp_buf) in ihevcd_pic_buf_mgr_add_bufs()
494 pic_buf_size_allocated = ps_codec->i4_total_pic_buf_size; in ihevcd_pic_buf_mgr_add_bufs()
496 luma_samples = (ps_codec->i4_strd) * in ihevcd_pic_buf_mgr_add_bufs()
511 ps_codec->s_parse.i4_error_code = IHEVCD_INSUFFICIENT_MEM_PICBUF; in ihevcd_pic_buf_mgr_add_bufs()
515 ps_pic_buf->pu1_luma = pu1_buf + ps_codec->i4_strd * PAD_TOP + PAD_LEFT; in ihevcd_pic_buf_mgr_add_bufs()
518 ps_pic_buf->pu1_chroma = pu1_buf + ps_codec->i4_strd * (PAD_TOP / 2) + PAD_LEFT; in ihevcd_pic_buf_mgr_add_bufs()
528 strd = ps_codec->i4_strd; in ihevcd_pic_buf_mgr_add_bufs()
529 wd = ps_codec->i4_wd; in ihevcd_pic_buf_mgr_add_bufs()
530 ht = ps_codec->i4_ht; in ihevcd_pic_buf_mgr_add_bufs()
562 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()
567 ps_codec->s_parse.i4_error_code = IHEVCD_BUF_MGR_ERROR; in ihevcd_pic_buf_mgr_add_bufs()
582 ps_pic_buf = ihevc_buf_mgr_get_buf((buf_mgr_t *)ps_codec->pv_pic_buf_mgr, i); in ihevcd_pic_buf_mgr_add_bufs()
589 ps_pic_buf->pu1_luma += ps_codec->i4_strd * PAD_TOP + PAD_LEFT; in ihevcd_pic_buf_mgr_add_bufs()
590 ps_pic_buf->pu1_chroma += ps_codec->i4_strd * (PAD_TOP / 2) + PAD_LEFT; in ihevcd_pic_buf_mgr_add_bufs()
616 IHEVCD_ERROR_T ihevcd_mv_buf_mgr_add_bufs(codec_t *ps_codec) in ihevcd_mv_buf_mgr_add_bufs() argument
630 ps_sps = ps_codec->s_parse.ps_sps; in ihevcd_mv_buf_mgr_add_bufs()
642 ps_codec->i4_max_dpb_size = max_dpb_size; in ihevcd_mv_buf_mgr_add_bufs()
644 pu1_buf = (UWORD8 *)ps_codec->pv_mv_bank_buf_base; in ihevcd_mv_buf_mgr_add_bufs()
648 ps_codec->ps_mv_buf = ps_mv_buf; in ihevcd_mv_buf_mgr_add_bufs()
649 mv_bank_size_allocated = ps_codec->i4_total_mv_bank_size - max_dpb_size * sizeof(mv_buf_t); in ihevcd_mv_buf_mgr_add_bufs()
673 ps_codec->s_parse.i4_error_code = IHEVCD_INSUFFICIENT_MEM_MVBANK; in ihevcd_mv_buf_mgr_add_bufs()
689 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()
693 ps_codec->s_parse.i4_error_code = IHEVCD_BUF_MGR_ERROR; in ihevcd_mv_buf_mgr_add_bufs()
721 IHEVCD_ERROR_T ihevcd_check_out_buf_size(codec_t *ps_codec) in ihevcd_check_out_buf_size() argument
723 ivd_out_bufdesc_t *ps_out_buffer = ps_codec->ps_out_buffer; in ihevcd_check_out_buf_size()
728 if(0 == ps_codec->i4_share_disp_buf) in ihevcd_check_out_buf_size()
730 wd = ps_codec->i4_disp_wd; in ihevcd_check_out_buf_size()
731 ht = ps_codec->i4_disp_ht; in ihevcd_check_out_buf_size()
739 if(ps_codec->i4_disp_strd > (WORD32)wd) in ihevcd_check_out_buf_size()
740 wd = ps_codec->i4_disp_strd; in ihevcd_check_out_buf_size()
742 if(ps_codec->e_chroma_fmt == IV_YUV_420P) in ihevcd_check_out_buf_size()
744 else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE) in ihevcd_check_out_buf_size()
746 else if(ps_codec->e_chroma_fmt == IV_RGB_565) in ihevcd_check_out_buf_size()
748 else if(ps_codec->e_chroma_fmt == IV_RGBA_8888) in ihevcd_check_out_buf_size()
750 else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV) in ihevcd_check_out_buf_size()
751 || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU)) in ihevcd_check_out_buf_size()
754 if(ps_codec->e_chroma_fmt == IV_YUV_420P) in ihevcd_check_out_buf_size()
760 else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE) in ihevcd_check_out_buf_size()
766 else if(ps_codec->e_chroma_fmt == IV_RGB_565) in ihevcd_check_out_buf_size()
772 else if(ps_codec->e_chroma_fmt == IV_RGBA_8888) in ihevcd_check_out_buf_size()
778 else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV) in ihevcd_check_out_buf_size()
779 || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU)) in ihevcd_check_out_buf_size()
822 IHEVCD_ERROR_T ihevcd_parse_pic_init(codec_t *ps_codec) in ihevcd_parse_pic_init() argument
835 ps_codec->s_parse.i4_error_code = IHEVCD_SUCCESS; in ihevcd_parse_pic_init()
836 ps_sps = ps_codec->s_parse.ps_sps; in ihevcd_parse_pic_init()
837 ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr; in ihevcd_parse_pic_init()
841 memset(ps_codec->s_parse.pu1_pic_intra_flag, 0, num_min_cu); in ihevcd_parse_pic_init()
842 memset(ps_codec->s_parse.pu1_pic_no_loop_filter_flag, 0, num_min_cu); in ihevcd_parse_pic_init()
846 if(0 == ps_codec->s_parse.i4_first_pic_init) in ihevcd_parse_pic_init()
848 ret = ihevcd_mv_buf_mgr_add_bufs(ps_codec); in ihevcd_parse_pic_init()
851 ret = ihevcd_pic_buf_mgr_add_bufs(ps_codec); in ihevcd_parse_pic_init()
854 ps_codec->s_parse.i4_first_pic_init = 1; in ihevcd_parse_pic_init()
858 ret = ihevcd_check_out_buf_size(ps_codec); in ihevcd_parse_pic_init()
866 slice_start_idx = ps_codec->i4_slice_error ? 2 : 1; in ihevcd_parse_pic_init()
870 slice_header_t *ps_slice_hdr_tmp = ps_codec->ps_slice_hdr_base + slice_idx; in ihevcd_parse_pic_init()
879 …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()
887 ps_codec->s_parse.i4_error_code = IHEVCD_NO_FREE_MVBANK; in ihevcd_parse_pic_init()
888 ps_codec->i4_error_code = IHEVCD_NO_FREE_MVBANK; in ihevcd_parse_pic_init()
892 ps_codec->s_parse.ps_cur_mv_buf = ps_mv_buf; in ihevcd_parse_pic_init()
907 …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()
915 ps_codec->s_parse.i4_error_code = IHEVCD_NO_FREE_PICBUF; in ihevcd_parse_pic_init()
916 ps_codec->i4_error_code = IHEVCD_NO_FREE_PICBUF; in ihevcd_parse_pic_init()
921 ps_cur_pic->u4_ts = ps_codec->u4_ts; in ihevcd_parse_pic_init()
932 if(ps_codec->s_parse.s_sei_params.i1_sei_parameters_present_flag) in ihevcd_parse_pic_init()
934 sei_params_t *ps_sei = &ps_codec->s_parse.s_sei_params; in ihevcd_parse_pic_init()
935 ps_cur_pic->s_sei_params = ps_codec->s_parse.s_sei_params; in ihevcd_parse_pic_init()
953 if(0 == ps_codec->u4_pic_cnt) in ihevcd_parse_pic_init()
965 dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr; in ihevcd_parse_pic_init()
966 buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr; in ihevcd_parse_pic_init()
1041 ihevcd_jobq_reset((jobq_t *)ps_codec->pv_proc_jobq); in ihevcd_parse_pic_init()
1043 ps_codec->s_parse.i4_pic_pu_idx = 0; in ihevcd_parse_pic_init()
1044 ps_codec->s_parse.i4_pic_tu_idx = 0; in ihevcd_parse_pic_init()
1046 ps_codec->s_parse.pu1_pic_pu_map = ps_mv_buf->pu1_pic_pu_map; in ihevcd_parse_pic_init()
1047 ps_codec->s_parse.ps_pic_pu = ps_mv_buf->ps_pic_pu; in ihevcd_parse_pic_init()
1048 ps_codec->s_parse.pu4_pic_pu_idx = ps_mv_buf->pu4_pic_pu_idx; in ihevcd_parse_pic_init()
1049 ps_codec->s_parse.pu1_slice_idx = (UWORD16 *)ps_mv_buf->pu1_pic_slice_map; in ihevcd_parse_pic_init()
1052 ps_codec->as_process[i].pu1_slice_idx = (UWORD16 *)ps_mv_buf->pu1_pic_slice_map; in ihevcd_parse_pic_init()
1054 ps_codec->s_parse.pu1_pu_map = ps_codec->s_parse.pu1_pic_pu_map; in ihevcd_parse_pic_init()
1055 ps_codec->s_parse.ps_pu = ps_codec->s_parse.ps_pic_pu; in ihevcd_parse_pic_init()
1073 pu1_buf = (UWORD8 *)ps_codec->pv_tu_data; in ihevcd_parse_pic_init()
1074 ps_codec->s_parse.pu4_pic_tu_idx = (UWORD32 *)pu1_buf; in ihevcd_parse_pic_init()
1077 ps_codec->s_parse.pu1_pic_tu_map = pu1_buf; in ihevcd_parse_pic_init()
1080 ps_codec->s_parse.ps_pic_tu = (tu_t *)pu1_buf; in ihevcd_parse_pic_init()
1083 ps_codec->s_parse.pv_pic_tu_coeff_data = pu1_buf; in ihevcd_parse_pic_init()
1085 ps_codec->s_parse.pu1_tu_map = ps_codec->s_parse.pu1_pic_tu_map; in ihevcd_parse_pic_init()
1086 ps_codec->s_parse.ps_tu = ps_codec->s_parse.ps_pic_tu; in ihevcd_parse_pic_init()
1087 ps_codec->s_parse.pv_tu_coeff_data = ps_codec->s_parse.pv_pic_tu_coeff_data; in ihevcd_parse_pic_init()
1090 ps_codec->s_parse.s_bs_ctxt.ps_pic_pu = ps_codec->s_parse.ps_pic_pu; in ihevcd_parse_pic_init()
1091 ps_codec->s_parse.s_bs_ctxt.pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx; in ihevcd_parse_pic_init()
1092 ps_codec->s_parse.s_bs_ctxt.pu4_pic_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx; in ihevcd_parse_pic_init()
1096 ps_codec->i4_proc_nctb = ihevcd_nctb_cnt(ps_codec, ps_sps); in ihevcd_parse_pic_init()
1105 memset(ps_codec->pu1_parse_map, 0, num_ctb); in ihevcd_parse_pic_init()
1107 memset(ps_codec->pu1_proc_map, 0, num_ctb); in ihevcd_parse_pic_init()
1115 ps_codec->i4_disp_buf_id = -1; in ihevcd_parse_pic_init()
1116 ps_codec->ps_disp_buf = NULL; in ihevcd_parse_pic_init()
1118 ps_codec->i4_disable_deblk_pic = 0; in ihevcd_parse_pic_init()
1119 ps_codec->i4_disable_sao_pic = 0; in ihevcd_parse_pic_init()
1120 ps_codec->i4_fullpel_inter_pred = 0; in ihevcd_parse_pic_init()
1121 ps_codec->i4_mv_frac_mask = 0x7FFFFFFF; in ihevcd_parse_pic_init()
1124 if(ps_codec->i4_degrade_type && ps_codec->i4_degrade_pics) in ihevcd_parse_pic_init()
1127 ps_codec->i4_degrade_pic_cnt++; in ihevcd_parse_pic_init()
1131 switch(ps_codec->i4_degrade_pics) in ihevcd_parse_pic_init()
1150 (ps_codec->i4_degrade_pic_cnt != ps_codec->i4_nondegrade_interval)) in ihevcd_parse_pic_init()
1170 if(ps_codec->i4_degrade_type & 0x1) in ihevcd_parse_pic_init()
1171 ps_codec->i4_disable_sao_pic = 1; in ihevcd_parse_pic_init()
1173 if(ps_codec->i4_degrade_type & 0x2) in ihevcd_parse_pic_init()
1174 ps_codec->i4_disable_deblk_pic = 1; in ihevcd_parse_pic_init()
1180 if(ps_codec->i4_degrade_type & 0x4) in ihevcd_parse_pic_init()
1181 ps_codec->i4_mv_frac_mask = 0; in ihevcd_parse_pic_init()
1183 if(ps_codec->i4_degrade_type & 0x8) in ihevcd_parse_pic_init()
1184 ps_codec->i4_mv_frac_mask = 0; in ihevcd_parse_pic_init()
1188 ps_codec->i4_degrade_pic_cnt = 0; in ihevcd_parse_pic_init()
1196 ps_codec->as_process[i].pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx; in ihevcd_parse_pic_init()
1197 ps_codec->as_process[i].ps_pic_pu = ps_codec->s_parse.ps_pic_pu; in ihevcd_parse_pic_init()
1198 ps_codec->as_process[i].pu1_pic_pu_map = ps_codec->s_parse.pu1_pic_pu_map; in ihevcd_parse_pic_init()
1199 ps_codec->as_process[i].pu4_pic_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx; in ihevcd_parse_pic_init()
1200 ps_codec->as_process[i].ps_pic_tu = ps_codec->s_parse.ps_pic_tu; in ihevcd_parse_pic_init()
1201 ps_codec->as_process[i].pu1_pic_tu_map = ps_codec->s_parse.pu1_pic_tu_map; in ihevcd_parse_pic_init()
1202 ps_codec->as_process[i].pv_pic_tu_coeff_data = ps_codec->s_parse.pv_pic_tu_coeff_data; in ihevcd_parse_pic_init()
1203 ps_codec->as_process[i].i4_cur_mv_bank_buf_id = cur_mv_bank_buf_id; in ihevcd_parse_pic_init()
1204 … ps_codec->as_process[i].s_sao_ctxt.pu1_slice_idx = ps_codec->as_process[i].pu1_slice_idx; in ihevcd_parse_pic_init()
1205 ps_codec->as_process[i].s_sao_ctxt.pu1_tile_idx = ps_codec->as_process[i].pu1_tile_idx; in ihevcd_parse_pic_init()
1210 ps_codec->as_process[i].pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1211 ps_codec->as_process[i].pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1212 ps_codec->as_process[i].ps_cur_pic = ps_cur_pic; in ihevcd_parse_pic_init()
1213 ps_codec->as_process[i].i4_cur_pic_buf_id = cur_pic_buf_id; in ihevcd_parse_pic_init()
1215 ps_codec->as_process[i].ps_out_buffer = ps_codec->ps_out_buffer; in ihevcd_parse_pic_init()
1216 if(1 < ps_codec->i4_num_cores) in ihevcd_parse_pic_init()
1218 ps_codec->as_process[i].i4_check_parse_status = 1; in ihevcd_parse_pic_init()
1219 ps_codec->as_process[i].i4_check_proc_status = 1; in ihevcd_parse_pic_init()
1223 ps_codec->as_process[i].i4_check_parse_status = 0; in ihevcd_parse_pic_init()
1224 ps_codec->as_process[i].i4_check_proc_status = 0; in ihevcd_parse_pic_init()
1226 ps_codec->as_process[i].pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag; in ihevcd_parse_pic_init()
1227 …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()
1228 ps_codec->as_process[i].i4_init_done = 0; in ihevcd_parse_pic_init()
1230 … 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()
1231 … 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()
1232 ps_codec->as_process[i].s_bs_ctxt.ps_pic_pu = ps_codec->as_process[i].ps_pic_pu; in ihevcd_parse_pic_init()
1233 …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()
1234 ps_codec->as_process[i].s_deblk_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1235 ps_codec->as_process[i].s_deblk_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1236 …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()
1237 ps_codec->as_process[i].s_sao_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1238 ps_codec->as_process[i].s_sao_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1239 if(i < (ps_codec->i4_num_cores - 1)) in ihevcd_parse_pic_init()
1241 ithread_create(ps_codec->apv_process_thread_handle[i], NULL, in ihevcd_parse_pic_init()
1243 (void *)&ps_codec->as_process[i]); in ihevcd_parse_pic_init()
1244 ps_codec->ai4_process_thread_created[i] = 1; in ihevcd_parse_pic_init()
1248 ps_codec->ai4_process_thread_created[i] = 0; in ihevcd_parse_pic_init()
1252 ps_codec->s_parse.s_deblk_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1253 ps_codec->s_parse.s_deblk_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1255 ps_codec->s_parse.s_sao_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma; in ihevcd_parse_pic_init()
1256 ps_codec->s_parse.s_sao_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma; in ihevcd_parse_pic_init()
1270 ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr; in ihevcd_parse_pic_init()
1272 ihevc_disp_mgr_add((disp_mgr_t *)ps_codec->pv_disp_buf_mgr, in ihevcd_parse_pic_init()
1273 ps_codec->as_process[0].i4_cur_pic_buf_id, in ihevcd_parse_pic_init()
1275 ps_codec->as_process[0].ps_cur_pic); in ihevcd_parse_pic_init()
1277 ps_codec->ps_disp_buf = NULL; in ihevcd_parse_pic_init()
1280 …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()
1281 (ps_codec->e_frm_out_mode == IVD_DECODE_FRAME_OUT)) in ihevcd_parse_pic_init()
1284 …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()
1285 ps_codec->u4_disp_cnt++; in ihevcd_parse_pic_init()
1288 ps_codec->s_fmt_conv.i4_cur_row = 0; in ihevcd_parse_pic_init()
1290 ps_codec->s_fmt_conv.i4_num_rows = 4; in ihevcd_parse_pic_init()
1292 if(ps_codec->u4_enable_fmt_conv_ahead && (ps_codec->i4_num_cores > 1)) in ihevcd_parse_pic_init()
1297 ps_proc = &ps_codec->as_process[ps_codec->i4_num_cores - 1]; in ihevcd_parse_pic_init()
1303 if((ps_codec->ps_disp_buf) && (ps_codec->i4_disp_buf_id != ps_proc->i4_cur_pic_buf_id) && in ihevcd_parse_pic_init()
1304 ((0 == ps_codec->i4_share_disp_buf) || (IV_YUV_420P == ps_codec->e_chroma_fmt))) in ihevcd_parse_pic_init()
1317 ret = ihevcd_jobq_queue((jobq_t *)ps_codec->s_parse.pv_proc_jobq, in ihevcd_parse_pic_init()
1326 ps_codec->i4_pic_present = 1; in ihevcd_parse_pic_init()