Lines Matching refs:p_Dec

159     free_storable_picture(p_Vid->p_Dec, p_Vid->dec_pic);  in free_vid_ctx()
235 static MPP_RET free_dec_ctx(H264_DecCtx_t *p_Dec) in free_dec_ctx() argument
239 INP_CHECK(ret, NULL == p_Dec); in free_dec_ctx()
241 if (p_Dec->mem) { in free_dec_ctx()
242 free_dxva_ctx(&p_Dec->mem->dxva_ctx); in free_dec_ctx()
243 MPP_FREE(p_Dec->mem); in free_dec_ctx()
246 mpp_packet_deinit(&p_Dec->task_pkt); in free_dec_ctx()
251 static MPP_RET init_dec_ctx(H264_DecCtx_t *p_Dec) in init_dec_ctx() argument
256 INP_CHECK(ret, !p_Dec); in init_dec_ctx()
258 p_Dec->mem = mpp_calloc(H264_DecMem_t, 1); in init_dec_ctx()
259 MEM_CHECK(ret, p_Dec->mem); in init_dec_ctx()
260 p_Dec->dpb_mark = p_Dec->mem->dpb_mark; //!< for write out, MAX_DPB_SIZE in init_dec_ctx()
261 p_Dec->dpb_info = p_Dec->mem->dpb_info; //!< 16 in init_dec_ctx()
262 p_Dec->refpic_info_p = p_Dec->mem->refpic_info_p; //!< 32 in init_dec_ctx()
263 p_Dec->refpic_info_b[0] = p_Dec->mem->refpic_info_b[0]; //!< [2][32] in init_dec_ctx()
264 p_Dec->refpic_info_b[1] = p_Dec->mem->refpic_info_b[1]; //!< [2][32] in init_dec_ctx()
266 p_Dec->mem->dxva_ctx.p_Dec = p_Dec; in init_dec_ctx()
267 FUN_CHECK(ret = init_dxva_ctx(&p_Dec->mem->dxva_ctx)); in init_dec_ctx()
268 p_Dec->dxva_ctx = &p_Dec->mem->dxva_ctx; in init_dec_ctx()
271 reset_dpb_mark(&p_Dec->dpb_mark[i]); in init_dec_ctx()
272 p_Dec->dpb_mark[i].mark_idx = i; in init_dec_ctx()
274 mpp_buf_slot_setup(p_Dec->frame_slots, MAX_MARK_SIZE); in init_dec_ctx()
276 mpp_packet_init(&p_Dec->task_pkt, p_Dec->dxva_ctx->bitstream, p_Dec->dxva_ctx->max_strm_size); in init_dec_ctx()
277 MEM_CHECK(ret, p_Dec->task_pkt); in init_dec_ctx()
279 p_Dec->spt_decode_mtds = MPP_DEC_BY_FRAME; in init_dec_ctx()
280 p_Dec->next_state = SliceSTATE_ResetSlice; in init_dec_ctx()
281 p_Dec->nalu_ret = NALU_NULL; in init_dec_ctx()
282 p_Dec->have_slice_data = 0; in init_dec_ctx()
283 p_Dec->last_frame_slot_idx = -1; in init_dec_ctx()
284 memset(&p_Dec->errctx, 0, sizeof(H264dErrCtx_t)); in init_dec_ctx()
289 free_dec_ctx(p_Dec); in init_dec_ctx()
294 static MPP_RET h264d_flush_dpb_eos(H264_DecCtx_t *p_Dec) in h264d_flush_dpb_eos() argument
297 INP_CHECK(ret, !p_Dec->p_Vid); in h264d_flush_dpb_eos()
299 FUN_CHECK(ret = flush_dpb(p_Dec->p_Vid->p_Dpb_layer[0], 1)); in h264d_flush_dpb_eos()
300 FUN_CHECK(ret = init_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[0], 1)); in h264d_flush_dpb_eos()
301 if (p_Dec->mvc_valid) { in h264d_flush_dpb_eos()
303 FUN_CHECK(ret = flush_dpb(p_Dec->p_Vid->p_Dpb_layer[1], 1)); in h264d_flush_dpb_eos()
304 FUN_CHECK(ret = init_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[1], 2)); in h264d_flush_dpb_eos()
305 …FUN_CHECK(ret = check_mvc_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[0], p_Dec->p_Vid->p_Dpb_laye… in h264d_flush_dpb_eos()
308 flush_dpb_buf_slot(p_Dec); in h264d_flush_dpb_eos()
325 H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; in h264d_init() local
326 INP_CHECK(ret, !p_Dec); in h264d_init()
327 memset(p_Dec, 0, sizeof(H264_DecCtx_t)); in h264d_init()
332 p_Dec->frame_slots = init->frame_slots; in h264d_init()
333 p_Dec->packet_slots = init->packet_slots; in h264d_init()
334 p_Dec->cfg = init->cfg; in h264d_init()
335 mpp_frame_init(&p_Dec->curframe); in h264d_init()
337 p_Dec->p_Inp = mpp_calloc(H264dInputCtx_t, 1); in h264d_init()
338 p_Dec->p_Cur = mpp_calloc(H264dCurCtx_t, 1); in h264d_init()
339 p_Dec->p_Vid = mpp_calloc(H264dVideoCtx_t, 1); in h264d_init()
340 MEM_CHECK(ret, p_Dec->p_Inp && p_Dec->p_Cur && p_Dec->p_Vid); in h264d_init()
341 p_Dec->p_Inp->p_Dec = p_Dec; in h264d_init()
342 p_Dec->p_Inp->p_Cur = p_Dec->p_Cur; in h264d_init()
343 p_Dec->p_Inp->p_Vid = p_Dec->p_Vid; in h264d_init()
345 p_Dec->p_Cur->p_Dec = p_Dec; in h264d_init()
346 p_Dec->p_Cur->p_Inp = p_Dec->p_Inp; in h264d_init()
347 p_Dec->p_Cur->p_Vid = p_Dec->p_Vid; in h264d_init()
349 p_Dec->p_Vid->p_Dec = p_Dec; in h264d_init()
350 p_Dec->p_Vid->p_Inp = p_Dec->p_Inp; in h264d_init()
351 p_Dec->p_Vid->p_Cur = p_Dec->p_Cur; in h264d_init()
352 p_Dec->hw_info = init->hw_info; in h264d_init()
353 FUN_CHECK(ret = init_input_ctx(p_Dec->p_Inp, init)); in h264d_init()
354 FUN_CHECK(ret = init_cur_ctx(p_Dec->p_Cur)); in h264d_init()
355 FUN_CHECK(ret = init_vid_ctx(p_Dec->p_Vid)); in h264d_init()
356 FUN_CHECK(ret = init_dec_ctx(p_Dec)); in h264d_init()
357 p_Dec->immediate_out = p_Dec->cfg->base.fast_out; in h264d_init()
358 mpp_env_get_u32("force_fast_play_mode", &p_Dec->cfg->base.enable_fast_play, in h264d_init()
359 p_Dec->cfg->base.enable_fast_play); in h264d_init()
360 p_Dec->p_Vid->dpb_fast_out = p_Dec->cfg->base.enable_fast_play; in h264d_init()
361 H264D_LOG("fast play mode: %d", p_Dec->cfg->base.enable_fast_play); in h264d_init()
362 p_Dec->p_Vid->dpb_first_fast_played = 0; in h264d_init()
363 mpp_slots_set_prop(p_Dec->frame_slots, SLOTS_WIDTH_ALIGN, rkv_mblock_width_align); in h264d_init()
380 H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; in h264d_deinit() local
384 mpp_frame_deinit(&p_Dec->curframe); in h264d_deinit()
385 free_input_ctx(p_Dec->p_Inp); in h264d_deinit()
386 MPP_FREE(p_Dec->p_Inp); in h264d_deinit()
387 free_cur_ctx(p_Dec->p_Cur); in h264d_deinit()
388 MPP_FREE(p_Dec->p_Cur); in h264d_deinit()
389 free_vid_ctx(p_Dec->p_Vid); in h264d_deinit()
390 MPP_FREE(p_Dec->p_Vid); in h264d_deinit()
391 free_dec_ctx(p_Dec); in h264d_deinit()
405 H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; in h264d_reset() local
410 flush_dpb(p_Dec->p_Vid->p_Dpb_layer[0], 1); in h264d_reset()
411 init_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[0], 1); in h264d_reset()
412 if (p_Dec->mvc_valid) { in h264d_reset()
414 flush_dpb(p_Dec->p_Vid->p_Dpb_layer[1], 1); in h264d_reset()
415 init_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[1], 2); in h264d_reset()
416 check_mvc_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[0], p_Dec->p_Vid->p_Dpb_layer[1]); in h264d_reset()
418 flush_dpb_buf_slot(p_Dec); in h264d_reset()
420 p_Dec->p_Inp->in_buf = NULL; in h264d_reset()
421 p_Dec->p_Inp->pkt_eos = 0; in h264d_reset()
422 p_Dec->p_Inp->task_eos = 0; in h264d_reset()
423 p_Dec->p_Inp->in_pts = 0; in h264d_reset()
424 p_Dec->p_Inp->in_dts = 0; in h264d_reset()
425 p_Dec->p_Inp->has_get_eos = 0; in h264d_reset()
427 p_Dec->p_Vid->have_outpicture_flag = 0; in h264d_reset()
428 p_Dec->p_Vid->exit_picture_flag = 0; in h264d_reset()
429 p_Dec->p_Vid->active_mvc_sps_flag = 0; in h264d_reset()
430 p_Dec->p_Vid->g_framecnt = 0; in h264d_reset()
431 p_Dec->p_Vid->dec_pic = NULL; in h264d_reset()
432 p_Dec->p_Vid->last_pic = NULL; in h264d_reset()
433 memset(&p_Dec->p_Vid->recovery, 0, sizeof(RecoveryPoint)); in h264d_reset()
434 memset(&p_Dec->p_Vid->old_pic, 0, sizeof(H264_StorePic_t)); in h264d_reset()
435 memset(&p_Dec->errctx, 0, sizeof(H264dErrCtx_t)); in h264d_reset()
437 p_Dec->p_Cur->last_dts = 0; in h264d_reset()
438 p_Dec->p_Cur->last_pts = 0; in h264d_reset()
439 p_Dec->p_Cur->curr_dts = 0; in h264d_reset()
440 p_Dec->p_Cur->curr_pts = 0; in h264d_reset()
442 p_strm = &p_Dec->p_Cur->strm; in h264d_reset()
451 p_strm->startcode_found = p_Dec->p_Inp->is_nalff; in h264d_reset()
453 p_Dec->next_state = SliceSTATE_ResetSlice; in h264d_reset()
454 p_Dec->nalu_ret = NALU_NULL; in h264d_reset()
455 p_Dec->have_slice_data = 0; in h264d_reset()
456 p_Dec->is_new_frame = 0; in h264d_reset()
457 p_Dec->is_parser_end = 0; in h264d_reset()
458 p_Dec->dxva_ctx->strm_offset = 0; in h264d_reset()
459 p_Dec->dxva_ctx->slice_count = 0; in h264d_reset()
460 p_Dec->last_frame_slot_idx = -1; in h264d_reset()
461 mpp_env_get_u32("force_fast_play_mode", &p_Dec->cfg->base.enable_fast_play, in h264d_reset()
462 p_Dec->cfg->base.enable_fast_play); in h264d_reset()
463 p_Dec->p_Vid->dpb_fast_out = p_Dec->cfg->base.enable_fast_play; in h264d_reset()
464 H264D_LOG("fast play mode: %d", p_Dec->cfg->base.enable_fast_play); in h264d_reset()
465 p_Dec->p_Vid->dpb_first_fast_played = 0; in h264d_reset()
480 H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; in h264d_flush() local
483 INP_CHECK(ret, !p_Dec->p_Inp); in h264d_flush()
484 INP_CHECK(ret, !p_Dec->p_Vid); in h264d_flush()
486 FUN_CHECK(ret = output_dpb(p_Dec, p_Dec->p_Vid->p_Dpb_layer[0])); in h264d_flush()
487 if (p_Dec->mvc_valid) { in h264d_flush()
488 FUN_CHECK(ret = output_dpb(p_Dec, p_Dec->p_Vid->p_Dpb_layer[1])); in h264d_flush()
505 H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; in h264d_control() local
509 p_Dec->cfg->base.enable_fast_play = (param) ? (*((RK_U32 *)param)) : (1); in h264d_control()
510 mpp_env_get_u32("force_fast_play_mode", &p_Dec->cfg->base.enable_fast_play, in h264d_control()
511 p_Dec->cfg->base.enable_fast_play); in h264d_control()
512 p_Dec->p_Vid->dpb_fast_out = p_Dec->cfg->base.enable_fast_play; in h264d_control()
513 H264D_LOG("fast play mode: %d", p_Dec->cfg->base.enable_fast_play); in h264d_control()
516 p_Dec->p_Inp->max_buf_size = (param) ? (*((RK_U32 *)param)) : (0); in h264d_control()
537 H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; in h264d_prepare() local
541 p_Inp = p_Dec->p_Inp; in h264d_prepare()
564 p_Inp->in_pts, p_Inp->pkt_eos, p_Inp->in_length, p_Dec->p_Vid->g_framecnt); in h264d_prepare()
576 (ret = parse_prepare_avcC_header(p_Inp, p_Dec->p_Cur)); in h264d_prepare()
581 … p_Inp->is_nalff, p_Inp->in_pts, p_Inp->pkt_eos, p_Inp->in_length, p_Dec->p_Vid->g_framecnt); in h264d_prepare()
583 (ret = parse_prepare_avcC_data(p_Inp, p_Dec->p_Cur)); in h264d_prepare()
588 if (p_Dec->cfg->base.split_parse) { in h264d_prepare()
589 ret = parse_prepare(p_Inp, p_Dec->p_Cur); in h264d_prepare()
591 ret = parse_prepare_fast(p_Inp, p_Dec->p_Cur); in h264d_prepare()
599 memset(p_Dec->dxva_ctx->bitstream + p_Dec->dxva_ctx->strm_offset, 0, in h264d_prepare()
600 MPP_ALIGN(p_Dec->dxva_ctx->strm_offset, 16) - p_Dec->dxva_ctx->strm_offset); in h264d_prepare()
601 mpp_packet_set_data(p_Dec->task_pkt, p_Dec->dxva_ctx->bitstream); in h264d_prepare()
602 mpp_packet_set_length(p_Dec->task_pkt, MPP_ALIGN(p_Dec->dxva_ctx->strm_offset, 16)); in h264d_prepare()
603 mpp_packet_set_size(p_Dec->task_pkt, p_Dec->dxva_ctx->max_strm_size); in h264d_prepare()
604 task->input_packet = p_Dec->task_pkt; in h264d_prepare()
614 h264d_flush_dpb_eos(p_Dec); in h264d_prepare()
633 H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; in h264d_parse() local
634 H264dErrCtx_t *p_err = &p_Dec->errctx; in h264d_parse()
637 p_Dec->in_task = in_task; in h264d_parse()
640 p_Dec->is_parser_end = 0; in h264d_parse()
641 if (p_Dec->p_Cur->sei) in h264d_parse()
642 memset(p_Dec->p_Cur->sei, 0, sizeof(*p_Dec->p_Cur->sei)); in h264d_parse()
644 ret = parse_loop(p_Dec); in h264d_parse()
649 if (p_Dec->is_parser_end) { in h264d_parse()
650 p_Dec->is_parser_end = 0; in h264d_parse()
651 p_Dec->p_Vid->g_framecnt++; in h264d_parse()
652 ret = update_dpb(p_Dec); in h264d_parse()
657 h264d_flush_dpb_eos(p_Dec); in h264d_parse()
662 in_task->syntax.number = p_Dec->dxva_ctx->syn.num; in h264d_parse()
663 in_task->syntax.data = (void *)p_Dec->dxva_ctx->syn.buf; in h264d_parse()
680 H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; in h264d_callback() local
693 mpp_buf_slot_get_prop(p_Dec->frame_slots, output, SLOT_FRAME_PTR, &frame); in h264d_callback()
723 mpp_buf_slot_get_prop(p_Dec->frame_slots, refer[i], in h264d_callback()
752 p_Dec->p_Vid->g_framecnt, output, task_err, ctx->hard_err, in h264d_callback()