mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 01:02:39 +08:00
fix[tune]: Replace qpmap_en with deblur_en
Deblur_en is more generic for upper application. Change-Id: Ibe4e0f81851fdbbe8fb8b7d840a4a9380e0403b1 Signed-off-by: Tingjin Huang <timkingh.huang@rock-chips.com>
This commit is contained in:
@@ -1439,7 +1439,6 @@ typedef enum MppEncFineTuneCfgChange_e {
|
||||
MPP_ENC_TUNE_CFG_CHANGE_ATL_STR = (1 << 9),
|
||||
MPP_ENC_TUNE_CFG_CHANGE_SAO_STR_I = (1 << 10),
|
||||
MPP_ENC_TUNE_CFG_CHANGE_SAO_STR_P = (1 << 11),
|
||||
MPP_ENC_TUNE_CFG_CHANGE_QPMAP_EN = (1 << 12),
|
||||
MPP_ENC_TUNE_CFG_CHANGE_RC_CONTAINER = (1 << 13),
|
||||
MPP_ENC_TUNE_CFG_CHANGE_VMAF_OPT = (1 << 14)
|
||||
} MppEncFineTuneCfgChange;
|
||||
@@ -1458,7 +1457,6 @@ typedef struct MppEncFineTuneCfg_t {
|
||||
RK_S32 atl_str; /* anti_stripe */
|
||||
RK_S32 sao_str_i; /* anti blur */
|
||||
RK_S32 sao_str_p; /* anti blur */
|
||||
RK_S32 qpmap_en;
|
||||
RK_S32 rc_container;
|
||||
RK_S32 vmaf_opt;
|
||||
} MppEncFineTuneCfg;
|
||||
|
@@ -266,7 +266,6 @@ public:
|
||||
ENTRY(tune, atl_str, S32, MPP_ENC_TUNE_CFG_CHANGE_ATL_STR, tune, atl_str) \
|
||||
ENTRY(tune, sao_str_i, S32, MPP_ENC_TUNE_CFG_CHANGE_SAO_STR_I, tune, sao_str_i) \
|
||||
ENTRY(tune, sao_str_p, S32, MPP_ENC_TUNE_CFG_CHANGE_SAO_STR_P, tune, sao_str_p) \
|
||||
ENTRY(tune, qpmap_en, S32, MPP_ENC_TUNE_CFG_CHANGE_QPMAP_EN, tune, qpmap_en) \
|
||||
ENTRY(tune, rc_container, S32, MPP_ENC_TUNE_CFG_CHANGE_RC_CONTAINER, tune, rc_container) \
|
||||
ENTRY(tune, vmaf_opt, S32, MPP_ENC_TUNE_CFG_CHANGE_VMAF_OPT, tune, vmaf_opt)
|
||||
|
||||
|
@@ -102,7 +102,7 @@ static void init_h264e_cfg_set(MppEncCfgSet *cfg, MppClientType type)
|
||||
h264->profile = H264_PROFILE_BASELINE;
|
||||
h264->level = H264_LEVEL_3_1;
|
||||
cfg->tune.scene_mode = MPP_ENC_SCENE_MODE_DEFAULT;
|
||||
cfg->tune.qpmap_en = 0;
|
||||
cfg->tune.deblur_en = 0;
|
||||
cfg->tune.vmaf_opt = 0;
|
||||
|
||||
switch (type) {
|
||||
|
@@ -119,7 +119,7 @@ static MPP_RET h265e_init(void *ctx, EncImplCfg *ctrlCfg)
|
||||
p->cfg->tune.sao_str_i = 0;
|
||||
p->cfg->tune.sao_str_p = 1;
|
||||
p->cfg->tune.deblur_str = 3;
|
||||
p->cfg->tune.qpmap_en = 0;
|
||||
p->cfg->tune.deblur_en = 0;
|
||||
p->cfg->tune.rc_container = 0;
|
||||
p->cfg->tune.vmaf_opt = 0;
|
||||
|
||||
|
@@ -942,14 +942,6 @@ MPP_RET mpp_enc_proc_tune_cfg(MppEncFineTuneCfg *dst, MppEncFineTuneCfg *src)
|
||||
ret = MPP_ERR_VALUE;
|
||||
}
|
||||
|
||||
if (change & MPP_ENC_TUNE_CFG_CHANGE_QPMAP_EN)
|
||||
dst->qpmap_en = src->qpmap_en;
|
||||
|
||||
if (dst->qpmap_en < 0 || dst->qpmap_en > 1) {
|
||||
mpp_err("invalid qpmap_en %d not in range [0, 1]\n", dst->qpmap_en);
|
||||
ret = MPP_ERR_VALUE;
|
||||
}
|
||||
|
||||
if (change & MPP_ENC_TUNE_CFG_CHANGE_RC_CONTAINER)
|
||||
dst->rc_container = src->rc_container;
|
||||
|
||||
|
@@ -2162,7 +2162,7 @@ static MPP_RET hal_h264e_vepu580_gen_regs(void *hal, HalEncTask *task)
|
||||
if (frm_status->is_i_refresh)
|
||||
setup_vepu580_intra_refresh(regs, ctx, frm_status->seq_idx % cfg->rc.gop);
|
||||
|
||||
if (cfg->tune.qpmap_en && (!rc_task->info.complex_scene) &&
|
||||
if (cfg->tune.deblur_en && (!rc_task->info.complex_scene) &&
|
||||
cfg->rc.rc_mode == MPP_ENC_RC_MODE_SMTRC &&
|
||||
cfg->tune.scene_mode == MPP_ENC_SCENE_MODE_IPC) {
|
||||
if (MPP_OK != setup_vepu580_qpmap_buf(ctx))
|
||||
|
@@ -348,8 +348,8 @@ static MPP_RET setup_vepu580_qpmap_buf(HalH264eVepu580Ctx *ctx)
|
||||
RK_S32 md_flag_size = ctx->md_flag_size
|
||||
= mb_w * mb_h;
|
||||
|
||||
if (!ctx->cfg->tune.qpmap_en) {
|
||||
mpp_log("qpmap_en is closed!\n");
|
||||
if (!ctx->cfg->tune.deblur_en) {
|
||||
mpp_log("deblurring is closed!\n");
|
||||
goto __RET;
|
||||
}
|
||||
|
||||
|
@@ -2764,7 +2764,7 @@ MPP_RET hal_h265e_v580_gen_regs(void *hal, HalEncTask *task)
|
||||
if (frm->is_i_refresh)
|
||||
setup_intra_refresh(ctx, frm->seq_idx % ctx->cfg->rc.gop);
|
||||
|
||||
if (cfg->tune.qpmap_en && (!rc_task->info.complex_scene) &&
|
||||
if (cfg->tune.deblur_en && (!rc_task->info.complex_scene) &&
|
||||
cfg->rc.rc_mode == MPP_ENC_RC_MODE_SMTRC &&
|
||||
cfg->tune.scene_mode == MPP_ENC_SCENE_MODE_IPC) {
|
||||
if (MPP_OK != vepu580_setup_qpmap_buf(ctx))
|
||||
|
@@ -633,8 +633,8 @@ static MPP_RET vepu580_setup_qpmap_buf(H265eV580HalContext *ctx)
|
||||
RK_S32 md_flag_size = ctx->md_flag_size
|
||||
= ctu_w * ctu_h * 16;
|
||||
|
||||
if (!ctx->cfg->tune.qpmap_en) {
|
||||
mpp_log("qpmap_en is closed!\n");
|
||||
if (!ctx->cfg->tune.deblur_en) {
|
||||
mpp_log("deblurring is closed!\n");
|
||||
goto __RET;
|
||||
}
|
||||
|
||||
|
@@ -390,7 +390,6 @@ MPP_RET test_mpp_enc_cfg_setup(MpiEncMultiCtxInfo *info)
|
||||
mpp_enc_cfg_set_s32(cfg, "tune:scene_mode", p->scene_mode);
|
||||
mpp_enc_cfg_set_s32(cfg, "tune:deblur_en", cmd->deblur_en);
|
||||
mpp_enc_cfg_set_s32(cfg, "tune:deblur_str", cmd->deblur_str);
|
||||
mpp_enc_cfg_set_s32(cfg, "tune:qpmap_en", 1);
|
||||
mpp_enc_cfg_set_s32(cfg, "tune:rc_container", cmd->rc_container);
|
||||
mpp_enc_cfg_set_s32(cfg, "tune:vmaf_opt", 0);
|
||||
mpp_enc_cfg_set_s32(cfg, "hw:qbias_en", 1);
|
||||
|
Reference in New Issue
Block a user