mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[h265e_ps]: Add auto tile split cfg
Auto tile cfg will let encoder auto split picture into tiles according to platform encoder core number. When enabled on RK3588 all picture will be splited into two tiles. Encoder cfg string: h265:auto_tile Change-Id: I3bd91a7781fc2c7e0b43bf2e3be775a5b8098d78 Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
This commit is contained in:
@@ -930,6 +930,7 @@ typedef enum MppEncH265CfgChange_e {
|
||||
MPP_ENC_H265_CFG_RC_I_QP_CHANGE = (1 << 19),
|
||||
MPP_ENC_H265_CFG_RC_MAX_QP_STEP_CHANGE = (1 << 21),
|
||||
MPP_ENC_H265_CFG_RC_IP_DELTA_QP_CHANGE = (1 << 20),
|
||||
MPP_ENC_H265_CFG_TITLE_CHANGE = (1 << 22),
|
||||
MPP_ENC_H265_CFG_CHANGE_ALL = (0xFFFFFFFF),
|
||||
} MppEncH265CfgChange;
|
||||
|
||||
@@ -1050,6 +1051,7 @@ typedef struct MppEncH265Cfg_t {
|
||||
MppEncH265DblkCfg_t dblk_cfg;
|
||||
MppEncH265RefCfg ref_cfg;
|
||||
MppEncH265MergesCfg merge_cfg;
|
||||
RK_S32 auto_tile;
|
||||
|
||||
/* extra info */
|
||||
MppEncH265VuiCfg vui;
|
||||
|
@@ -225,6 +225,7 @@ public:
|
||||
ENTRY(h265, qp_delta_ip, S32, RK_S32, MPP_ENC_RC_CFG_CHANGE_QP_IP, rc, qp_delta_ip) \
|
||||
ENTRY(h265, sao_luma_disable, S32, RK_S32, MPP_ENC_H265_CFG_SAO_CHANGE, codec.h265, sao_cfg.slice_sao_luma_disable) \
|
||||
ENTRY(h265, sao_chroma_disable, S32, RK_S32, MPP_ENC_H265_CFG_SAO_CHANGE, codec.h265, sao_cfg.slice_sao_chroma_disable) \
|
||||
ENTRY(h265, auto_tile, S32, RK_S32, MPP_ENC_H265_CFG_TITLE_CHANGE, codec.h265, auto_tile) \
|
||||
/* vp8 config */ \
|
||||
ENTRY(vp8, qp_init, S32, RK_S32, MPP_ENC_RC_CFG_CHANGE_QP_INIT, rc, qp_init) \
|
||||
ENTRY(vp8, qp_min, S32, RK_S32, MPP_ENC_RC_CFG_CHANGE_QP_RANGE, rc, qp_min) \
|
||||
@@ -358,7 +359,7 @@ MppEncCfgService::MppEncCfgService() :
|
||||
MPP_RET ret;
|
||||
RK_S32 i;
|
||||
|
||||
ret = mpp_trie_init(&trie, 1622, cfg_cnt);
|
||||
ret = mpp_trie_init(&trie, 1639, cfg_cnt);
|
||||
if (ret) {
|
||||
mpp_err_f("failed to init enc cfg set trie\n");
|
||||
return ;
|
||||
|
@@ -447,6 +447,9 @@ static MPP_RET h265e_proc_h265_cfg(MppEncH265Cfg *dst, MppEncH265Cfg *src)
|
||||
memcpy(&dst->sao_cfg, &src->sao_cfg, sizeof(src->sao_cfg));
|
||||
}
|
||||
|
||||
if (change & MPP_ENC_H265_CFG_TITLE_CHANGE)
|
||||
dst->auto_tile = src->auto_tile;
|
||||
|
||||
/*
|
||||
* NOTE: use OR here for avoiding overwrite on multiple config
|
||||
* When next encoding is trigger the change flag will be clear
|
||||
|
@@ -439,6 +439,9 @@ MPP_RET h265e_set_pps(H265eCtx *ctx, H265ePps *pps, H265eSps *sps)
|
||||
if (strstr(soc_name, "rk3566") || strstr(soc_name, "rk3568")) {
|
||||
pps->m_nNumTileColumnsMinus1 = (sps->m_picWidthInLumaSamples - 1) / 1920 ;
|
||||
} else if (strstr(soc_name, "rk3588")) {
|
||||
if (codec->auto_tile)
|
||||
pps->m_nNumTileColumnsMinus1 = 1;
|
||||
else
|
||||
pps->m_nNumTileColumnsMinus1 = (sps->m_picWidthInLumaSamples - 1) / 4096 ;
|
||||
}
|
||||
if (pps->m_nNumTileColumnsMinus1) {
|
||||
|
Reference in New Issue
Block a user