mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-07 01:52:46 +08:00
[h265e_api]: Clear change flag after proc & support tsvc
Change-Id: I1c9860588b6aa7f043f19f00c9ee212820d6f77a Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
This commit is contained in:
@@ -71,6 +71,7 @@ static MPP_RET h265e_init(void *ctx, EncImplCfg *ctrlCfg)
|
|||||||
h265->min_qp = 10;
|
h265->min_qp = 10;
|
||||||
h265->max_i_qp = 51;
|
h265->max_i_qp = 51;
|
||||||
h265->min_i_qp = 10;
|
h265->min_i_qp = 10;
|
||||||
|
h265->qpmap_mode = 1;
|
||||||
h265->ip_qp_delta = 3;
|
h265->ip_qp_delta = 3;
|
||||||
h265->raw_dealt_qp = 2;
|
h265->raw_dealt_qp = 2;
|
||||||
h265->max_delta_qp = 10;
|
h265->max_delta_qp = 10;
|
||||||
@@ -270,6 +271,7 @@ static MPP_RET h265e_start(void *ctx, HalEncTask *task)
|
|||||||
|
|
||||||
p->rc_ready = 1;
|
p->rc_ready = 1;
|
||||||
rc->change = 0;
|
rc->change = 0;
|
||||||
|
ref->change = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (codec->change) {
|
if (codec->change) {
|
||||||
@@ -303,6 +305,7 @@ static MPP_RET h265e_start(void *ctx, HalEncTask *task)
|
|||||||
* input and output frame rate.
|
* input and output frame rate.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (p->rc_ctx)
|
||||||
task->valid = !rc_frm_check_drop(p->rc_ctx);
|
task->valid = !rc_frm_check_drop(p->rc_ctx);
|
||||||
if (!task->valid)
|
if (!task->valid)
|
||||||
mpp_log_f("drop one frame\n");
|
mpp_log_f("drop one frame\n");
|
||||||
@@ -501,20 +504,17 @@ static MPP_RET h265e_proc_cfg(void *ctx, MpiCmd cmd, void *param)
|
|||||||
h265e_get_extra_info(p, pkt_out);
|
h265e_get_extra_info(p, pkt_out);
|
||||||
} break;
|
} break;
|
||||||
case MPP_ENC_SET_PREP_CFG : {
|
case MPP_ENC_SET_PREP_CFG : {
|
||||||
MppEncPrepCfg *src = &p->set->prep;
|
MppEncPrepCfg *src = (MppEncPrepCfg *)param;
|
||||||
MppEncPrepCfg *dst = &p->cfg->prep;
|
MppEncPrepCfg *dst = &p->cfg->prep;
|
||||||
|
|
||||||
memcpy(src, param, sizeof(MppEncPrepCfg));
|
|
||||||
memcpy(dst, src, sizeof(MppEncPrepCfg));
|
memcpy(dst, src, sizeof(MppEncPrepCfg));
|
||||||
} break;
|
} break;
|
||||||
case MPP_ENC_SET_CODEC_CFG: {
|
case MPP_ENC_SET_CODEC_CFG: {
|
||||||
MppEncCodecCfg *cfg = (MppEncCodecCfg *)param;
|
MppEncCodecCfg *cfg = (MppEncCodecCfg *)param;
|
||||||
MppEncH265Cfg *src = &p->set->codec.h265;
|
MppEncH265Cfg *src = &cfg->h265;
|
||||||
MppEncH265Cfg *dst = &p->cfg->codec.h265;
|
MppEncH265Cfg *dst = &p->cfg->codec.h265;
|
||||||
RK_U32 change = cfg->h265.change;
|
RK_U32 change = cfg->h265.change;
|
||||||
|
|
||||||
memcpy(src, &cfg->h265, sizeof(MppEncH265Cfg));
|
|
||||||
|
|
||||||
// TODO: do codec check first
|
// TODO: do codec check first
|
||||||
if (change & MPP_ENC_H265_CFG_PROFILE_LEVEL_TILER_CHANGE) {
|
if (change & MPP_ENC_H265_CFG_PROFILE_LEVEL_TILER_CHANGE) {
|
||||||
dst->profile = src->profile;
|
dst->profile = src->profile;
|
||||||
@@ -558,7 +558,6 @@ static MPP_RET h265e_proc_cfg(void *ctx, MpiCmd cmd, void *param)
|
|||||||
* When next encoding is trigger the change flag will be clear
|
* When next encoding is trigger the change flag will be clear
|
||||||
*/
|
*/
|
||||||
dst->change |= change;
|
dst->change |= change;
|
||||||
src->change = 0;
|
|
||||||
} break;
|
} break;
|
||||||
case MPP_ENC_SET_RC_CFG : {
|
case MPP_ENC_SET_RC_CFG : {
|
||||||
MppEncRcCfg *src = (MppEncRcCfg *)param;
|
MppEncRcCfg *src = (MppEncRcCfg *)param;
|
||||||
@@ -637,6 +636,12 @@ static MPP_RET h265e_proc_cfg(void *ctx, MpiCmd cmd, void *param)
|
|||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case MPP_ENC_SET_GOPREF: {
|
||||||
|
MppEncGopRef *ref = (MppEncGopRef *)param;
|
||||||
|
MppEncCfgSet *cfg = p->cfg;
|
||||||
|
memcpy(&cfg->gop_ref, ref , sizeof(*ref));
|
||||||
|
} break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
mpp_err("No correspond %08x found, and can not config!\n", cmd);
|
mpp_err("No correspond %08x found, and can not config!\n", cmd);
|
||||||
ret = MPP_NOK;
|
ret = MPP_NOK;
|
||||||
|
@@ -221,6 +221,8 @@ MPP_RET h265e_dpb_set_cfg(H265eDpbCfg *dpb_cfg, MppEncCfgSet* cfg)
|
|||||||
|
|
||||||
RK_S32 i = 0;
|
RK_S32 i = 0;
|
||||||
RK_S32 st_gop_len = ref->ref_gop_len;
|
RK_S32 st_gop_len = ref->ref_gop_len;
|
||||||
|
dpb_cfg->nLongTerm = 1;
|
||||||
|
dpb_cfg->vgop_size = st_gop_len;
|
||||||
for (i = 0; i < st_gop_len + 1; i++) {
|
for (i = 0; i < st_gop_len + 1; i++) {
|
||||||
MppGopRefInfo *info = &ref->gop_info[i];
|
MppGopRefInfo *info = &ref->gop_info[i];
|
||||||
RK_S32 is_non_ref = info->is_non_ref;
|
RK_S32 is_non_ref = info->is_non_ref;
|
||||||
|
@@ -194,9 +194,13 @@ MPP_RET h265e_set_sps(H265eCtx *ctx, H265eSps *sps, H265eVps *vps)
|
|||||||
sps->m_useStrongIntraSmoothing = codec->cu_cfg.strong_intra_smoothing_enabled_flag;
|
sps->m_useStrongIntraSmoothing = codec->cu_cfg.strong_intra_smoothing_enabled_flag;
|
||||||
if (codec->ref_cfg.num_lt_ref_pic > 0 || ctx->dpbcfg.nLongTerm) {
|
if (codec->ref_cfg.num_lt_ref_pic > 0 || ctx->dpbcfg.nLongTerm) {
|
||||||
h265e_dbg_ps("ctx->dpbcfg.nLongTerm = %d", ctx->dpbcfg.nLongTerm);
|
h265e_dbg_ps("ctx->dpbcfg.nLongTerm = %d", ctx->dpbcfg.nLongTerm);
|
||||||
|
if (codec->ref_cfg.num_lt_ref_pic == 0) {
|
||||||
|
codec->ref_cfg.num_lt_ref_pic = 1;
|
||||||
|
}
|
||||||
sps->m_numLongTermRefPicSPS = codec->ref_cfg.num_lt_ref_pic;
|
sps->m_numLongTermRefPicSPS = codec->ref_cfg.num_lt_ref_pic;
|
||||||
sps->m_bLongTermRefsPresent = 1;
|
sps->m_bLongTermRefsPresent = 1;
|
||||||
sps->m_TMVPFlagsPresent = 0;
|
sps->m_TMVPFlagsPresent = 0;
|
||||||
|
codec->tmvp_enable = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sps->m_ptl = &vps->m_ptl;
|
sps->m_ptl = &vps->m_ptl;
|
||||||
|
Reference in New Issue
Block a user