diff --git a/inc/rk_mpi_cmd.h b/inc/rk_mpi_cmd.h index 758436a4..164c28c0 100644 --- a/inc/rk_mpi_cmd.h +++ b/inc/rk_mpi_cmd.h @@ -652,7 +652,6 @@ typedef struct MppEncH264RefCfg_t { RK_S32 hw_longterm_mode; RK_S32 i_dpb_size; /* Force a DPB size larger than that implied by B-frames and reference frames. * Useful in combination with interactive error resilience. */ - RK_S32 i_frame_packing; } MppEncH264RefCfg; typedef struct MppEncH264SeiCfg_t { diff --git a/mpp/hal/common/h264/hal_h264e_api.c b/mpp/hal/common/h264/hal_h264e_api.c index 5291cda9..5bf744cc 100644 --- a/mpp/hal/common/h264/hal_h264e_api.c +++ b/mpp/hal/common/h264/hal_h264e_api.c @@ -122,8 +122,6 @@ MPP_RET hal_h264e_init(void *hal, MppHalCfg *cfg) ref->i_long_term_en = H264E_LONGTERM_REF_EN; ref->hw_longterm_mode = 0; ref->i_long_term_internal = 0; - ref->i_frame_packing = -1; - ctx->cfg = cfg->cfg; ctx->set = cfg->set; diff --git a/mpp/hal/common/h264/hal_h264e_com.c b/mpp/hal/common/h264/hal_h264e_com.c index 5c577422..2fb391bd 100644 --- a/mpp/hal/common/h264/hal_h264e_com.c +++ b/mpp/hal/common/h264/hal_h264e_com.c @@ -450,7 +450,6 @@ static void h264e_set_ref(H264eRefParam *ref) ref->i_long_term_en = H264E_LONGTERM_REF_EN; ref->hw_longterm_mode = 0; ref->i_long_term_internal = 0; - ref->i_frame_packing = -1; } void h264e_set_param(H264eHalParam *p, RK_S32 hw_type) diff --git a/mpp/hal/common/h264/hal_h264e_com.h b/mpp/hal/common/h264/hal_h264e_com.h index cfa5fdd1..2da23b0e 100644 --- a/mpp/hal/common/h264/hal_h264e_com.h +++ b/mpp/hal/common/h264/hal_h264e_com.h @@ -360,7 +360,6 @@ typedef struct H264eRefParam_t { RK_S32 hw_longterm_mode; RK_S32 i_dpb_size; /* Force a DPB size larger than that implied by B-frames and reference frames. * Useful in combination with interactive error resilience. */ - RK_S32 i_frame_packing; } H264eRefParam; typedef struct H264eHalParam_t { diff --git a/mpp/hal/rkenc/h264e/hal_h264e_rkv_dpb.c b/mpp/hal/rkenc/h264e/hal_h264e_rkv_dpb.c index da1df5a3..c770fc0e 100644 --- a/mpp/hal/rkenc/h264e/hal_h264e_rkv_dpb.c +++ b/mpp/hal/rkenc/h264e/hal_h264e_rkv_dpb.c @@ -175,14 +175,9 @@ static void h264e_rkv_reference_reset(H264eRkvDpbCtx *dpb_ctx) } static RK_S32 -h264e_rkv_reference_distance(H264eRefParam *ref_cfg, - H264eRkvDpbCtx *dpb_ctx, H264eRkvFrame *frame ) +h264e_rkv_reference_distance(H264eRkvDpbCtx *dpb_ctx, H264eRkvFrame *frame ) { - if ( ref_cfg->i_frame_packing == 5 ) - return abs((dpb_ctx->fdec->i_frame_cnt & ~1) - (frame->i_frame_cnt & ~1)) + - ((dpb_ctx->fdec->i_frame_cnt & 1) != (frame->i_frame_cnt & 1)); - else - return abs(dpb_ctx->fdec->i_frame_cnt - frame->i_frame_cnt); + return abs(dpb_ctx->fdec->i_frame_cnt - frame->i_frame_cnt); } static void h264e_rkv_reference_build_list(H264eHalContext *ctx) @@ -254,8 +249,8 @@ static void h264e_rkv_reference_build_list(H264eHalContext *ctx) if ( list ? dpb_ctx->fref[list][i + 1]->i_poc < dpb_ctx->fref_nearest[list]->i_poc : dpb_ctx->fref[list][i + 1]->i_poc > dpb_ctx->fref_nearest[list]->i_poc ) dpb_ctx->fref_nearest[list] = dpb_ctx->fref[list][i + 1]; - if ( h264e_rkv_reference_distance( ref_cfg, dpb_ctx, dpb_ctx->fref[list][i] ) > - h264e_rkv_reference_distance( ref_cfg, dpb_ctx, dpb_ctx->fref[list][i + 1] ) ) { + if ( h264e_rkv_reference_distance(dpb_ctx, dpb_ctx->fref[list][i] ) > + h264e_rkv_reference_distance(dpb_ctx, dpb_ctx->fref[list][i + 1] ) ) { MPP_SWAP( H264eRkvFrame *, dpb_ctx->fref[list][i], dpb_ctx->fref[list][i + 1] ); b_ok = 0; break;