Lines Matching refs:p_dec

40 static RK_U32 dpb_get_size(Avs2dCtx_t *p_dec)  in dpb_get_size()  argument
47 Avs2dSeqHeader_t *vsh = &p_dec->vsh; in dpb_get_size()
132 MPP_RET avs2d_dpb_create(Avs2dCtx_t *p_dec) in avs2d_dpb_create() argument
136 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in avs2d_dpb_create()
139 mgr->dpb_specific_size = dpb_get_size(p_dec); in avs2d_dpb_create()
158 MPP_RET avs2d_dpb_destroy(Avs2dCtx_t *p_dec) in avs2d_dpb_destroy() argument
162 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in avs2d_dpb_destroy()
203 static void compute_frame_order_index(Avs2dCtx_t *p_dec) in compute_frame_order_index() argument
205 Avs2dSeqHeader_t *vsh = &p_dec->vsh; in compute_frame_order_index()
206 Avs2dPicHeader_t *ph = &p_dec->ph; in compute_frame_order_index()
207 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in compute_frame_order_index()
304 static MPP_RET output_display_frame(Avs2dCtx_t *p_dec, Avs2dFrame_t *p) in output_display_frame() argument
314 p_dec->frm_mgr.output_poi = p->poi; in output_display_frame()
315 mpp_buf_slot_set_flag(p_dec->frame_slots, p->slot_idx, SLOT_QUEUE_USE); in output_display_frame()
316 mpp_buf_slot_enqueue(p_dec->frame_slots, p->slot_idx, QUEUE_DISPLAY); in output_display_frame()
332 static MPP_RET dpb_remove_frame(Avs2dCtx_t *p_dec, Avs2dFrame_t *p) in dpb_remove_frame() argument
334 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in dpb_remove_frame()
341 mpp_buf_slot_get_prop(p_dec->frame_slots, p->slot_idx, SLOT_BUFFER, &buffer); in dpb_remove_frame()
345 mpp_buf_slot_clr_flag(p_dec->frame_slots, p->slot_idx, SLOT_CODEC_USE); in dpb_remove_frame()
382 static MPP_RET dpb_remove_scene_frame(Avs2dCtx_t *p_dec) in dpb_remove_scene_frame() argument
386 Avs2dPicHeader_t *ph = &p_dec->ph; in dpb_remove_scene_frame()
387 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in dpb_remove_scene_frame()
396 FUN_CHECK(ret = dpb_remove_frame(p_dec, p)); in dpb_remove_scene_frame()
407 MPP_RET dpb_remove_unused_frame(Avs2dCtx_t *p_dec) in dpb_remove_unused_frame() argument
412 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in dpb_remove_unused_frame()
421 if ((MPP_ABS(p->poi - p_dec->ph.poi) >= AVS2_MAX_POC_DISTANCE)) { in dpb_remove_unused_frame()
427 FUN_CHECK(ret = dpb_remove_frame(p_dec, p)); in dpb_remove_unused_frame()
466 static Avs2dFrame_t *dpb_alloc_frame(Avs2dCtx_t *p_dec, HalDecTask *task) in dpb_alloc_frame() argument
471 Avs2dSeqHeader_t *vsh = &p_dec->vsh; in dpb_alloc_frame()
472 Avs2dPicHeader_t *ph = &p_dec->ph; in dpb_alloc_frame()
473 Avs2dSeqExtHeader_t *exh = &p_dec->exh; in dpb_alloc_frame()
474 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in dpb_alloc_frame()
500 if (MPP_FRAME_FMT_IS_FBC(p_dec->init.cfg->base.out_fmt)) { in dpb_alloc_frame()
504 …mpp_frame_set_fmt(mframe, mpp_frame_get_fmt(mframe) | (p_dec->init.cfg->base.out_fmt & (MPP_FRAME_… in dpb_alloc_frame()
512 RK_U32 ctu_size = 1 << (p_dec->vsh.lcu_size); in dpb_alloc_frame()
517 } else if (MPP_FRAME_FMT_IS_TILE(p_dec->init.cfg->base.out_fmt)) in dpb_alloc_frame()
518 …mpp_frame_set_fmt(mframe, mpp_frame_get_fmt(mframe) | (p_dec->init.cfg->base.out_fmt & (MPP_FRAME_… in dpb_alloc_frame()
520 if (p_dec->is_hdr) in dpb_alloc_frame()
523 if (p_dec->init.cfg->base.enable_thumbnail && p_dec->init.hw_info->cap_down_scale) in dpb_alloc_frame()
524 mpp_frame_set_thumbnail_en(mframe, p_dec->init.cfg->base.enable_thumbnail); in dpb_alloc_frame()
535 if (p_dec->got_exh) { in dpb_alloc_frame()
540 mpp_frame_set_content_light(mframe, p_dec->content_light); in dpb_alloc_frame()
541 mpp_frame_set_mastering_display(mframe, p_dec->display_meta); in dpb_alloc_frame()
542 if (p_dec->hdr_dynamic_meta && p_dec->hdr_dynamic) { in dpb_alloc_frame()
543 mpp_frame_set_hdr_dynamic_meta(mframe, p_dec->hdr_dynamic_meta); in dpb_alloc_frame()
544 p_dec->hdr_dynamic = 0; in dpb_alloc_frame()
550 if (p_dec->init.cfg->base.enable_vproc & MPP_VPROC_MODE_DETECTION) { in dpb_alloc_frame()
575 ret = mpp_buf_slot_get_unused(p_dec->frame_slots, &frm->slot_idx); in dpb_alloc_frame()
583 static MPP_RET dpb_output_next_frame(Avs2dCtx_t *p_dec, RK_S32 continuous) in dpb_output_next_frame() argument
587 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in dpb_output_next_frame()
597 FUN_CHECK(ret = output_display_frame(p_dec, mgr->dpb[pos])); in dpb_output_next_frame()
599 FUN_CHECK(ret = dpb_remove_frame(p_dec, mgr->dpb[pos])); in dpb_output_next_frame()
638 MPP_RET dpb_update_refs(Avs2dCtx_t *p_dec) in dpb_update_refs() argument
644 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in dpb_update_refs()
676 static MPP_RET dpb_set_frame_refs(Avs2dCtx_t *p_dec, Avs2dFrameMgr_t *mgr, HalDecTask *task) in dpb_set_frame_refs() argument
705 mpp_buf_slot_set_flag(p_dec->frame_slots, p->slot_idx, SLOT_CODEC_USE); in dpb_set_frame_refs()
706 mpp_buf_slot_set_flag(p_dec->frame_slots, p->slot_idx, SLOT_HAL_INPUT); in dpb_set_frame_refs()
722 p_dec->syntax.refp.scene_ref_replace_pos = 0; in dpb_set_frame_refs()
725 p_dec->ph.background_reference_flag) { in dpb_set_frame_refs()
731 p_dec->syntax.refp.scene_ref_replace_pos = mgr->num_of_ref - 1; in dpb_set_frame_refs()
740 p_dec->syntax.refp.scene_ref_enable = 1; in dpb_set_frame_refs()
741 p_dec->syntax.refp.scene_ref_slot_idx = mgr->scene_ref->slot_idx; in dpb_set_frame_refs()
743 p_dec->syntax.refp.scene_ref_enable = 0; in dpb_set_frame_refs()
758 MPP_RET avs2d_dpb_insert(Avs2dCtx_t *p_dec, HalDecTask *task) in avs2d_dpb_insert() argument
763 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in avs2d_dpb_insert()
767 compute_frame_order_index(p_dec); in avs2d_dpb_insert()
770 dpb_output_next_frame(p_dec, 1); in avs2d_dpb_insert()
773 dpb_remove_scene_frame(p_dec); in avs2d_dpb_insert()
776 dpb_remove_unused_frame(p_dec); in avs2d_dpb_insert()
779 p = dpb_alloc_frame(p_dec, task); in avs2d_dpb_insert()
780 p_dec->frame_no++; in avs2d_dpb_insert()
789 mpp_buf_slot_set_prop(p_dec->frame_slots, p->slot_idx, SLOT_FRAME, p->frame); in avs2d_dpb_insert()
790 mpp_buf_slot_set_flag(p_dec->frame_slots, p->slot_idx, SLOT_CODEC_USE); in avs2d_dpb_insert()
791 mpp_buf_slot_set_flag(p_dec->frame_slots, p->slot_idx, SLOT_HAL_OUTPUT); in avs2d_dpb_insert()
798 ret = dpb_set_frame_refs(p_dec, mgr, task); in avs2d_dpb_insert()
814 dpb_update_refs(p_dec); in avs2d_dpb_insert()
832 MPP_RET avs2d_dpb_flush(Avs2dCtx_t *p_dec) in avs2d_dpb_flush() argument
837 Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr; in avs2d_dpb_flush()
849 dpb_remove_unused_frame(p_dec); in avs2d_dpb_flush()
853 if ((ret = dpb_output_next_frame(p_dec, 0)) != MPP_OK) { in avs2d_dpb_flush()