Lines Matching defs:ps_dec_state
158 dec_state_t *ps_dec_state;
167 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
171 if(0 == ps_dec_state->u4_share_disp_buf)
174 if(NULL == ps_dec_state->pv_pic_buf_mg)
178 impeg2_buf_mgr_release(ps_dec_state->pv_pic_buf_mg, dec_rel_disp_ip->u4_disp_buf_id, BUF_MGR_DISP);
212 dec_state_t *ps_dec_state;
228 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
232 if(ps_dec_state->u4_share_disp_buf)
235 ps_pic_buf = (pic_buf_t *)ps_dec_state->pv_pic_buf_base;
267 if(IV_YUV_420P == ps_dec_state->i4_chromaFormat)
274 ps_pic_buf->pu1_u = ps_dec_state->pu1_chroma_ref_buf[i];
275 ps_pic_buf->pu1_v = ps_dec_state->pu1_chroma_ref_buf[i] +
276 ((ps_dec_state->u2_create_max_width * ps_dec_state->u2_create_max_height) >> 2);
285 impeg2_buf_mgr_add(ps_dec_state->pv_pic_buf_mg, ps_pic_buf, i);
286 impeg2_buf_mgr_set_status(ps_dec_state->pv_pic_buf_mg, i, BUF_MGR_DISP);
291 memcpy(&(ps_dec_state->as_disp_buffers[0]),
305 dec_state_t *ps_dec_state;
312 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
320 ps_dec_state_multi_core->ps_dec_state[i]->i4_num_cores = ps_ip->u4_num_cores;
324 ps_dec_state->i4_num_cores = 1;
344 ps_codec = ps_dec_state_multi_core->ps_dec_state[0];
416 ps_codec = ps_dec_state_multi_core->ps_dec_state[0];
788 dec_state_t *ps_dec_state;
799 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
820 if (0 == ps_dec_state->u4_frm_buf_stride)
822 if (1 == ps_dec_state->u2_header_done)
824 u4_stride = ps_dec_state->u2_horizontal_size;
828 u4_stride = ps_dec_state->u2_create_max_width;
833 u4_stride = ps_dec_state->u4_frm_buf_stride;
836 u4_height = ALIGN32(ps_dec_state->u2_frame_height) + 9;
842 ps_dec_state->i4_chromaFormat,
855 if(ps_dec_state->u4_share_disp_buf)
888 dec_state_t *ps_dec_state;
897 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
899 ps_dec_state->u1_flushfrm = 1;
931 dec_state_t *ps_dec_state;
944 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
946 ps_dec_state->u1_flushfrm = 0;
947 ps_dec_state->u2_decode_header = 1;
949 if (1 == ps_dec_state->u2_header_done)
951 ps_dec_state->u4_frm_buf_stride = ps_dec_state->u2_frame_width;
983 dec_state_t *ps_dec_state;
991 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
995 impeg2_buf_mgr_reset(ps_dec_state->pv_pic_buf_mg);
999 impeg2_disp_mgr_init(&ps_dec_state->s_disp_mgr);
1003 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[i4_num_threads];
1009 ps_dec_state->u2_header_done = 0; /* Header decoding not done */
1010 ps_dec_state->u4_frm_buf_stride = 0;
1011 ps_dec_state->i4_pic_count = 0;
1012 ps_dec_state->u2_is_mpeg2 = 0;
1013 ps_dec_state->aps_ref_pics[0] = NULL;
1014 ps_dec_state->aps_ref_pics[1] = NULL;
1015 ps_dec_state->ps_deint_pic = NULL;
1048 dec_state_t *ps_dec_state;
1054 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
1074 if(ps_dec_state->u2_header_done == 1)
1077 ((ps_ctl_dec_ip->s_ivd_ctl_set_config_ip_t.u4_disp_wd != 0) && (ps_ctl_dec_ip->s_ivd_ctl_set_config_ip_t.u4_disp_wd < ps_dec_state->u2_frame_width)))
1086 ps_dec_state->u2_decode_header = (UWORD8)ps_ctl_dec_ip->s_ivd_ctl_set_config_ip_t.e_vid_dec_mode;
1090 ps_dec_state->u4_frm_buf_stride = ps_ctl_dec_ip->s_ivd_ctl_set_config_ip_t.u4_disp_wd;
1095 if(ps_dec_state->u2_header_done == 1)
1097 ps_dec_state->u4_frm_buf_stride = ps_dec_state->u2_frame_width;
1101 ps_dec_state->u4_frm_buf_stride = 0;
1108 ps_dec_state->u1_flushfrm = 0;
1140 dec_state_t *ps_dec_state;
1148 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
1152 ps_ctl_dec_op->s_ivd_ctl_getstatus_op_t.u4_pic_ht = ps_dec_state->u2_frame_height;
1153 ps_ctl_dec_op->s_ivd_ctl_getstatus_op_t.u4_pic_wd = ps_dec_state->u2_frame_width;
1154 ps_ctl_dec_op->s_ivd_ctl_getstatus_op_t.u4_frame_rate = ps_dec_state->u2_framePeriod;
1157 if(ps_dec_state->u2_progressive_sequence == 1)
1163 ps_ctl_dec_op->s_ivd_ctl_getstatus_op_t.e_output_chroma_format = (IV_COLOR_FORMAT_T)ps_dec_state->i4_chromaFormat;
1168 if(ps_dec_state->i4_chromaFormat == IV_YUV_420P)
1172 else if(ps_dec_state->i4_chromaFormat == IV_YUV_422ILE)
1176 else if(ps_dec_state->i4_chromaFormat == IV_RGB_565)
1195 u4_stride = ps_dec_state->u4_frm_buf_stride;
1196 u4_height = ((ps_dec_state->u2_frame_height + 15) >> 4) << 4;
1198 if(ps_dec_state->i4_chromaFormat == IV_YUV_420P)
1204 else if((ps_dec_state->i4_chromaFormat == IV_YUV_420SP_UV) || (ps_dec_state->i4_chromaFormat == IV_YUV_420SP_VU))
1210 else if(ps_dec_state->i4_chromaFormat == IV_YUV_422ILE)
1259 ps_codec = ps_dec_state_multi_core->ps_dec_state[0];
1611 dec_state_t *ps_dec_state;
1714 ps_dec_state = ps_mem_rec->pv_base;
1716 ps_dec_state_multi_core->ps_dec_state[i4_num_threads] = ps_dec_state;
1718 ps_dec_state->ps_dec_state_multi_core = ps_dec_state_multi_core;
1720 ps_dec_state->i4_num_cores = 1;
1726 ps_dec_state->pv_codec_thread_handle = ps_mem_rec->pv_base;
1737 ps_dec_state->s_mc_fw_buf.pu1_y = pv;
1743 ps_dec_state->s_mc_fw_buf.pu1_u = pv;
1750 ps_dec_state->s_mc_fw_buf.pu1_v = pv;
1757 ps_dec_state->s_mc_bk_buf.pu1_y = pv;
1764 ps_dec_state->s_mc_bk_buf.pu1_u = pv;
1771 ps_dec_state->s_mc_bk_buf.pu1_v = pv;
1778 ps_dec_state->s_mc_buf.pu1_y = pv;
1785 ps_dec_state->s_mc_buf.pu1_u = pv;
1792 ps_dec_state->s_mc_buf.pu1_v = pv;
1801 ps_dec_state->pv_pic_buf_mg = 0;
1806 ps_dec_state->pv_stack_cntxt = ps_mem_rec->pv_base;
1819 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
1821 ps_dec_state->pv_pic_buf_mg = ps_mem_rec->pv_base;
1822 ps_dec_state->pv_pic_buf_base = (UWORD8 *)ps_mem_rec->pv_base + sizeof(buf_mgr_t);
1832 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[i4_num_threads];
1838 ps_dec_state->u2_header_done = 0; /* Header decoding not done */
1847 ps_dec_state->u2_create_max_width = u4_max_frm_width;
1848 ps_dec_state->u2_create_max_height = u4_max_frm_height;
1850 ps_dec_state->i4_chromaFormat = ps_dec_init_ip->s_ivd_init_ip_t.e_output_format;
1851 ps_dec_state->u4_frm_buf_stride = 0 ;
1852 ps_dec_state->u2_frame_width = u4_max_frm_width;
1853 ps_dec_state->u2_picture_width = u4_max_frm_width;
1854 ps_dec_state->u2_horizontal_size = u4_max_frm_width;
1856 ps_dec_state->u2_frame_height = u4_max_frm_height;
1857 ps_dec_state->u2_vertical_size = u4_max_frm_height;
1858 ps_dec_state->u4_share_disp_buf = u4_share_disp_buf;
1859 ps_dec_state->u4_deinterlace = u4_deinterlace;
1860 ps_dec_state->ps_deint_pic = NULL;
1864 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
1866 if((ps_dec_state->i4_chromaFormat == IV_YUV_422ILE)
1867 &&((ps_dec_state->u2_vertical_size & 0x1) != 0))
1881 impeg2_disp_mgr_init(&ps_dec_state->s_disp_mgr);
1882 impeg2_buf_mgr_init((buf_mgr_t *)ps_dec_state->pv_pic_buf_mg);
1896 if(0 == ps_dec_state->u4_share_disp_buf)
1899 ps_pic_buf = (pic_buf_t *)ps_dec_state->pv_pic_buf_base;
1920 impeg2_buf_mgr_add(ps_dec_state->pv_pic_buf_mg, ps_pic_buf, i);
1926 else if (ps_dec_state->i4_chromaFormat != IV_YUV_420P)
1930 ps_dec_state->pu1_chroma_ref_buf[i] = ps_mem_rec->pv_base;
1943 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
1945 ps_dec_state->pu1_input_buffer = ps_mem_rec->pv_base;
1949 ps_dec_state->pv_jobq_buf = ps_mem_rec->pv_base;
1950 ps_dec_state->i4_jobq_buf_size = ps_mem_rec->u4_mem_size;
1961 ps_dec_state->u1_flushfrm = 0;
1962 ps_dec_state->u1_flushcnt = 0;
1963 ps_dec_state->pv_jobq = impeg2_jobq_init(ps_dec_state->pv_jobq_buf, ps_dec_state->i4_jobq_buf_size);
1966 ps_dec_state->pv_deinterlacer_ctxt = ps_mem_rec->pv_base;
1970 ps_dec_state->pu1_deint_fmt_buf = ps_mem_rec->pv_base;
1978 ps_dec_state->pv_memTab = (void *)ps_mem_rec->pv_base;
1983 ps_dec_state->u4_num_mem_records = u4_num_mem_rec;
1986 ps_dec_state->u4_num_frames_decoded = 0;
1987 ps_dec_state->aps_ref_pics[0] = NULL;
1988 ps_dec_state->aps_ref_pics[1] = NULL;
1992 impeg2d_init_arch(ps_dec_state);
1994 impeg2d_init_function_ptr(ps_dec_state);
2023 dec_state_t *ps_dec_state;
2038 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
2039 ps_temp_rec = ps_dec_state->pv_memTab;
2041 for(u4_i = 0; u4_i < (ps_dec_state->u4_num_mem_records);u4_i++)
2050 ps_retr_mem_rec_op->s_ivd_retrieve_mem_rec_op_t.u4_num_mem_rec_filled = ps_dec_state->u4_num_mem_records;
2052 impeg2_jobq_deinit(ps_dec_state->pv_jobq);
3147 dec_state_t *ps_dec_state;
3177 ps_dec_state = ps_dec_state_multi_core->ps_dec_state[0];
3179 ps_dec_state->ps_disp_frm_buf = &(ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf);
3180 if(0 == ps_dec_state->u4_share_disp_buf)
3182 ps_dec_state->ps_disp_frm_buf->pv_y_buf = ps_dec_ip->s_ivd_video_decode_ip_t.s_out_buffer.pu1_bufs[0];
3183 ps_dec_state->ps_disp_frm_buf->pv_u_buf = ps_dec_ip->s_ivd_video_decode_ip_t.s_out_buffer.pu1_bufs[1];
3184 ps_dec_state->ps_disp_frm_buf->pv_v_buf = ps_dec_ip->s_ivd_video_decode_ip_t.s_out_buffer.pu1_bufs[2];
3187 ps_dec_state->ps_disp_pic = NULL;
3188 ps_dec_state->i4_frame_decoded = 0;
3194 if((ps_dec_ip->s_ivd_video_decode_ip_t.pv_stream_buffer == NULL)&&(ps_dec_state->u1_flushfrm==0))
3202 if (ps_dec_state->u4_num_frames_decoded > NUM_FRAMES_LIMIT)
3208 if(((0 == ps_dec_state->u2_header_done) || (ps_dec_state->u2_decode_header == 1)) && (ps_dec_state->u1_flushfrm == 0))
3210 impeg2d_dec_hdr(ps_dec_state,ps_dec_ip ,ps_dec_op);
3214 if((1 != ps_dec_state->u2_decode_header) &&
3215 (((bytes_remaining > 0) && (1 == ps_dec_state->u2_header_done)) || ps_dec_state->u1_flushfrm))
3217 if(ps_dec_state->u1_flushfrm)
3219 if(ps_dec_state->aps_ref_pics[1] != NULL)
3221 impeg2_disp_mgr_add(&ps_dec_state->s_disp_mgr, ps_dec_state->aps_ref_pics[1], ps_dec_state->aps_ref_pics[1]->i4_buf_id);
3222 impeg2_buf_mgr_release(ps_dec_state->pv_pic_buf_mg, ps_dec_state->aps_ref_pics[1]->i4_buf_id, BUF_MGR_REF);
3223 impeg2_buf_mgr_release(ps_dec_state->pv_pic_buf_mg, ps_dec_state->aps_ref_pics[0]->i4_buf_id, BUF_MGR_REF);
3225 ps_dec_state->aps_ref_pics[1] = NULL;
3226 ps_dec_state->aps_ref_pics[0] = NULL;
3229 else if(ps_dec_state->aps_ref_pics[0] != NULL)
3231 impeg2_disp_mgr_add(&ps_dec_state->s_disp_mgr, ps_dec_state->aps_ref_pics[0], ps_dec_state->aps_ref_pics[0]->i4_buf_id);
3232 impeg2_buf_mgr_release(ps_dec_state->pv_pic_buf_mg, ps_dec_state->aps_ref_pics[0]->i4_buf_id, BUF_MGR_REF);
3234 ps_dec_state->aps_ref_pics[0] = NULL;
3239 ps_disp_pic = impeg2_disp_mgr_get(&ps_dec_state->s_disp_mgr, &ps_dec_state->i4_disp_buf_id);
3241 ps_dec_state->ps_disp_pic = ps_disp_pic;
3249 if(0 == ps_dec_state->u4_share_disp_buf)
3259 if(IV_YUV_420P == ps_dec_state->i4_chromaFormat)
3269 pu1_buf = ps_dec_state->as_disp_buffers[ps_disp_pic->i4_buf_id].pu1_bufs[1];
3272 pu1_buf = ps_dec_state->as_disp_buffers[ps_disp_pic->i4_buf_id].pu1_bufs[2];
3284 if(ps_dec_state->u4_deinterlace && (0 == ps_dec_state->u2_progressive_frame))
3286 impeg2d_deinterlace(ps_dec_state,
3290 ps_dec_state->u2_vertical_size);
3295 impeg2d_format_convert(ps_dec_state,
3299 ps_dec_state->u2_vertical_size);
3303 if(ps_dec_state->u4_deinterlace)
3305 if(ps_dec_state->ps_deint_pic)
3307 impeg2_buf_mgr_release(ps_dec_state->pv_pic_buf_mg,
3308 ps_dec_state->ps_deint_pic->i4_buf_id,
3311 ps_dec_state->ps_deint_pic = ps_disp_pic;
3313 if(0 == ps_dec_state->u4_share_disp_buf)
3314 impeg2_buf_mgr_release(ps_dec_state->pv_pic_buf_mg, ps_disp_pic->i4_buf_id, BUF_MGR_DISP);
3316 ps_dec_op->s_ivd_video_decode_op_t.u4_pic_ht = ps_dec_state->u2_vertical_size;
3317 ps_dec_op->s_ivd_video_decode_op_t.u4_pic_wd = ps_dec_state->u2_horizontal_size;
3323 ps_dec_op->s_ivd_video_decode_op_t.e_output_format = (IV_COLOR_FORMAT_T)ps_dec_state->i4_chromaFormat;
3325 ps_dec_op->s_ivd_video_decode_op_t.u4_is_ref_flag = (B_PIC != ps_dec_state->e_pic_type);
3329 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_y_wd = ps_dec_state->u2_horizontal_size;
3330 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_y_strd = ps_dec_state->u4_frm_buf_stride;
3331 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_y_ht = ps_dec_state->u2_vertical_size;
3333 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_wd = ps_dec_state->u2_horizontal_size >> 1;
3334 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_strd = ps_dec_state->u4_frm_buf_stride >> 1;
3335 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_ht = ps_dec_state->u2_vertical_size >> 1;
3337 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_v_wd = ps_dec_state->u2_horizontal_size >> 1;
3338 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_v_strd = ps_dec_state->u4_frm_buf_stride >> 1;
3339 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_v_ht = ps_dec_state->u2_vertical_size >> 1;
3342 switch(ps_dec_state->i4_chromaFormat)
3346 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_wd = ps_dec_state->u2_horizontal_size;
3347 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_strd = ps_dec_state->u4_frm_buf_stride;
3368 ps_dec_state->u4_frm_buf_stride,
3369 ps_dec_state->u2_horizontal_size,
3370 ps_dec_state->u2_vertical_size,
3371 ps_dec_state->i4_chromaFormat,
3372 ps_dec_state->u2_horizontal_size,
3373 ps_dec_state->u2_vertical_size);
3379 ps_dec_state->u1_flushfrm = 0;
3385 else if(ps_dec_state->u1_flushfrm==0)
3395 if(1 == ps_dec_state->u4_share_disp_buf)
3397 if(0 == impeg2_buf_mgr_check_free(ps_dec_state->pv_pic_buf_mg))
3406 ps_dec_op->s_ivd_video_decode_op_t.e_output_format = (IV_COLOR_FORMAT_T)ps_dec_state->i4_chromaFormat;
3408 ps_dec_op->s_ivd_video_decode_op_t.u4_is_ref_flag = (B_PIC != ps_dec_state->e_pic_type);
3412 if (0 == ps_dec_state->u4_frm_buf_stride)
3414 ps_dec_state->u4_frm_buf_stride = (ps_dec_state->u2_horizontal_size);
3417 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_y_wd = ps_dec_state->u2_horizontal_size;
3418 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_y_strd = ps_dec_state->u4_frm_buf_stride;
3419 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_y_ht = ps_dec_state->u2_vertical_size;
3421 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_wd = ps_dec_state->u2_horizontal_size >> 1;
3422 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_strd = ps_dec_state->u4_frm_buf_stride >> 1;
3423 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_ht = ps_dec_state->u2_vertical_size >> 1;
3425 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_v_wd = ps_dec_state->u2_horizontal_size >> 1;
3426 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_v_strd = ps_dec_state->u4_frm_buf_stride >> 1;
3427 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_v_ht = ps_dec_state->u2_vertical_size >> 1;
3430 switch(ps_dec_state->i4_chromaFormat)
3434 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_wd = ps_dec_state->u2_horizontal_size;
3435 ps_dec_op->s_ivd_video_decode_op_t.s_disp_frm_buf.u4_u_strd = ps_dec_state->u4_frm_buf_stride;
3447 if( ps_dec_state->u1_flushfrm == 0)
3449 ps_dec_state->u1_flushcnt = 0;
3451 ps_dec_state->ps_out_buf = &ps_dec_ip->s_ivd_video_decode_ip_t.s_out_buffer;
3452 if (IV_SUCCESS != check_app_out_buf_size(ps_dec_state))
3461 ps_dec_state->u4_inp_ts = ps_dec_ip->s_ivd_video_decode_ip_t.u4_ts;
3463 impeg2d_dec_frm(ps_dec_state,ps_dec_ip,ps_dec_op);
3468 if(ps_dec_state->u1_first_frame_done == 0)
3470 ps_dec_state->u1_first_frame_done = 1;
3473 if(ps_dec_state->ps_disp_pic)
3476 switch(ps_dec_state->ps_disp_pic->e_pic_type)
3505 ps_dec_state->u4_num_frames_decoded++;
3510 ps_dec_state->u1_flushcnt++;
3513 if(ps_dec_state->ps_disp_pic)
3515 ps_dec_op->s_ivd_video_decode_op_t.u4_disp_buf_id = ps_dec_state->ps_disp_pic->i4_buf_id;
3516 ps_dec_op->s_ivd_video_decode_op_t.u4_ts = ps_dec_state->ps_disp_pic->u4_ts;
3518 if(0 == ps_dec_state->u4_share_disp_buf)
3520 impeg2_buf_mgr_release(ps_dec_state->pv_pic_buf_mg, ps_dec_state->ps_disp_pic->i4_buf_id, BUF_MGR_DISP);
3524 if(ps_dec_state->u4_deinterlace)
3526 if(ps_dec_state->ps_deint_pic)
3528 impeg2_buf_mgr_release(ps_dec_state->pv_pic_buf_mg,
3529 ps_dec_state->ps_deint_pic->i4_buf_id,
3532 ps_dec_state->ps_deint_pic = ps_dec_state->ps_disp_pic;
3540 ps_dec_state->u4_frm_buf_stride,
3541 ps_dec_state->u2_horizontal_size,
3542 ps_dec_state->u2_vertical_size,
3543 ps_dec_state->i4_chromaFormat,
3544 ps_dec_state->u2_horizontal_size,
3545 ps_dec_state->u2_vertical_size);
3551 ps_dec_op->s_ivd_video_decode_op_t.e4_fld_type = ps_dec_state->s_disp_op.e4_fld_type;