From db750eff51e916969d2d1cb49e0bc4ec1362f1d0 Mon Sep 17 00:00:00 2001 From: Herman Chen Date: Wed, 16 Sep 2020 15:49:54 +0800 Subject: [PATCH] [mpi_enc_test]: Add encoder frame skip config When the bitrate overflow the encoder can drop or encode skip frame. drop_mode: MPP_ENC_RC_DROP_FRM_DISABLED - Do not drop frame when bitrate is too large. MPP_ENC_RC_DROP_FRM_NORMAL - Drop frame when bitrate is too large. MPP_ENC_RC_DROP_FRM_PSKIP - Encode force pskip frame to keep frame rate when bitrate overflow. drop_thd: The instantaneous bitrate overflow threshold to trigger drop frame. drop_gap: The minimum gap between two continuous drop frames. 0 - enable continnous drop frame. Signed-off-by: Herman Chen Change-Id: If17ee5f46ee03ae4ad958c8fad30a4a82f422118 --- test/mpi_enc_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/mpi_enc_test.c b/test/mpi_enc_test.c index a98577e4..00f68183 100644 --- a/test/mpi_enc_test.c +++ b/test/mpi_enc_test.c @@ -557,6 +557,11 @@ MPP_RET test_mpp_enc_cfg_setup(MpiEncTestData *p) mpp_enc_cfg_set_s32(cfg, "rc:fps_out_denorm", p->fps_out_den); mpp_enc_cfg_set_s32(cfg, "rc:gop", p->gop_len ? p->gop_len : p->fps_out_num * 2); + /* drop frame or not when bitrate overflow */ + mpp_enc_cfg_set_u32(cfg, "rc:drop_mode", MPP_ENC_RC_DROP_FRM_DISABLED); + mpp_enc_cfg_set_u32(cfg, "rc:drop_thd", 20); /* 20% of max bps */ + mpp_enc_cfg_set_u32(cfg, "rc:drop_gap", 1); /* Do not continuous drop frame */ + /* setup codec */ mpp_enc_cfg_set_s32(cfg, "codec:type", p->type); switch (p->type) {