From c8baa3490a6f1fe4ed99f121df5ce18ba3125bf7 Mon Sep 17 00:00:00 2001 From: "sayon.chen" Date: Thu, 25 Jan 2018 16:13:59 +0800 Subject: [PATCH] [h265d]: remove unused malloc code remove rpl buf malloc due to no used in h265parser Change-Id: I8a9a4348b0ae386afe60614e17ab3a108bfb55b5 Signed-off-by: sayon.chen --- mpp/codec/dec/h265/h265d_parser.h | 4 ---- mpp/codec/dec/h265/h265d_refs.c | 23 ----------------------- 2 files changed, 27 deletions(-) diff --git a/mpp/codec/dec/h265/h265d_parser.h b/mpp/codec/dec/h265/h265d_parser.h index 494dd49e..fa0ca93d 100644 --- a/mpp/codec/dec/h265/h265d_parser.h +++ b/mpp/codec/dec/h265/h265d_parser.h @@ -534,16 +534,12 @@ typedef struct DBParams { typedef struct HEVCFrame { MppFrame frame; RefPicList *refPicList; - RefPicListTab **rpl_tab; RK_S32 ctb_count; RK_S32 poc; struct HEVCFrame *collocated_ref; HEVCWindow window; - RK_U8 *rpl_tab_buf; - - RK_U8 *rpl_buf; /** * A sequence counter, so that old frames are output first * after a POC reset diff --git a/mpp/codec/dec/h265/h265d_refs.c b/mpp/codec/dec/h265/h265d_refs.c index 9e780b34..6dfd1caf 100755 --- a/mpp/codec/dec/h265/h265d_refs.c +++ b/mpp/codec/dec/h265/h265d_refs.c @@ -39,9 +39,6 @@ void mpp_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags) frame->flags &= ~flags; if (!frame->flags) { - mpp_free(frame->rpl_buf); - mpp_free(frame->rpl_tab_buf); - frame->rpl_tab = NULL; frame->refPicList = NULL; frame->collocated_ref = NULL; if (frame->slot_index <= 0x7f) { @@ -77,7 +74,6 @@ void mpp_hevc_flush_dpb(HEVCContext *s) static HEVCFrame *alloc_frame(HEVCContext *s) { - RK_S32 j; RK_U32 i; MPP_RET ret = MPP_OK; for (i = 0; i < MPP_ARRAY_ELEMS(s->DPB); i++) { @@ -98,28 +94,9 @@ static HEVCFrame *alloc_frame(HEVCContext *s) mpp_frame_set_color_primaries(frame->frame, s->sps->vui.colour_primaries); mpp_frame_set_color_trc(frame->frame, s->sps->vui.transfer_characteristic); h265d_dbg(H265D_DBG_GLOBAL, "w_stride %d h_stride %d\n", s->h265dctx->coded_width, s->h265dctx->coded_height); - - frame->rpl_buf = mpp_calloc(RK_U8, s->nb_nals * sizeof(RefPicListTab)); - if (!frame->rpl_buf) { - mpp_err( "rpl_buf malloc fail\n"); - goto fail; - } - frame->ctb_count = s->sps->ctb_width * s->sps->ctb_height; - frame->rpl_tab_buf = mpp_malloc(RK_U8, frame->ctb_count * sizeof(RefPicListTab)); - if (!frame->rpl_tab_buf) { - mpp_err( "rpl_tab_buf malloc fail\n"); - goto fail; - } - frame->rpl_tab = (RefPicListTab **)frame->rpl_tab_buf; - for (j = 0; j < frame->ctb_count; j++) - frame->rpl_tab[j] = (RefPicListTab *)frame->rpl_buf; - ret = mpp_buf_slot_get_unused(s->slots, &frame->slot_index); mpp_assert(ret == MPP_OK); return frame; - fail: - mpp_hevc_unref_frame(s, frame, ~0); - return NULL; } mpp_err( "Error allocating frame, DPB full.\n"); return NULL;