diff --git a/mpp/codec/enc/h265/h265e_api_v2.c b/mpp/codec/enc/h265/h265e_api_v2.c index f102d2ce..73e393e6 100644 --- a/mpp/codec/enc/h265/h265e_api_v2.c +++ b/mpp/codec/enc/h265/h265e_api_v2.c @@ -247,11 +247,6 @@ static MPP_RET h265e_proc_dpb(void *ctx, HalEncTask *task) h265e_dbg_func("enter\n"); - if (rc_task->frm.reencode) { - - return MPP_OK; - } - mb_wd64 = (p->cfg->prep.width + 63) / 64; mb_h64 = (p->cfg->prep.height + 63) / 64; diff --git a/mpp/codec/mpp_enc_v2.cpp b/mpp/codec/mpp_enc_v2.cpp index 8cf8a26a..6ac00dfa 100644 --- a/mpp/codec/mpp_enc_v2.cpp +++ b/mpp/codec/mpp_enc_v2.cpp @@ -640,13 +640,18 @@ void *mpp_enc_thread(void *data) TASK_REENCODE: // 14. restore and process dpb - enc_dbg_detail("task %d enc proc dpb\n", frm->seq_idx); - RUN_ENC_IMPL_FUNC(enc_impl_proc_dpb, impl, hal_task, mpp, ret); + if (!frm->reencode || frm->re_dpb_proc) { + enc_dbg_detail("task %d enc proc dpb\n", frm->seq_idx); + RUN_ENC_IMPL_FUNC(enc_impl_proc_dpb, impl, hal_task, mpp, ret); + } - enc_dbg_detail("task %d rc frame start\n", frm->seq_idx); - RUN_ENC_RC_FUNC(rc_frm_start, enc->rc_ctx, rc_task, mpp, ret); - if (frm->re_dpb_proc) - goto TASK_REENCODE; + if (!frm->reencode) { + enc_dbg_detail("task %d rc frame start\n", frm->seq_idx); + RUN_ENC_RC_FUNC(rc_frm_start, enc->rc_ctx, rc_task, mpp, ret); + if (frm->re_dpb_proc) + goto TASK_REENCODE; + } + frm->reencode = 0; enc_dbg_detail("task %d enc proc hal\n", frm->seq_idx); RUN_ENC_IMPL_FUNC(enc_impl_proc_hal, impl, hal_task, mpp, ret); diff --git a/mpp/codec/rc/rc_model_v2.c b/mpp/codec/rc/rc_model_v2.c index 9b37ccb3..d5ab0910 100644 --- a/mpp/codec/rc/rc_model_v2.c +++ b/mpp/codec/rc/rc_model_v2.c @@ -665,11 +665,8 @@ MPP_RET rc_model_v2_start(void *ctx, EncRcTask *task) rc_dbg_func("enter %p\n", ctx); - - if (frm->reencode || p->usr_cfg.mode == RC_FIXQP) { - frm->reencode = 0; + if (p->usr_cfg.mode == RC_FIXQP) return MPP_OK; - } p->frame_type = (frm->is_intra) ? (INTRA_FRAME) : (INTER_P_FRAME);