mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-28 11:21:45 +08:00
[mpp_enc_cfg]: Add frame drop paramters
Add frame drop parameters for frame drop behavior on bitrate overflow. Change-Id: Id90fbd0c63b1a0909e426a2c9f09c8b371bec0b7 Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -160,6 +160,7 @@ typedef enum MppEncRcCfgChange_e {
|
||||
MPP_ENC_RC_CFG_CHANGE_GOP = (1 << 7),
|
||||
MPP_ENC_RC_CFG_CHANGE_SKIP_CNT = (1 << 8),
|
||||
MPP_ENC_RC_CFG_CHANGE_MAX_REENC = (1 << 9),
|
||||
MPP_ENC_RC_CFG_CHANGE_DROP_FRM = (1 << 10),
|
||||
MPP_ENC_RC_CFG_CHANGE_ALL = (0xFFFFFFFF),
|
||||
} MppEncRcCfgChange;
|
||||
|
||||
@@ -181,6 +182,13 @@ typedef enum MppEncRcQuality_e {
|
||||
MPP_ENC_RC_QUALITY_BUTT
|
||||
} MppEncRcQuality;
|
||||
|
||||
typedef enum MppEncRcDropFrmMode_e {
|
||||
MPP_ENC_RC_DROP_FRM_DISABLED,
|
||||
MPP_ENC_RC_DROP_FRM_NORMAL,
|
||||
MPP_ENC_RC_DROP_FRM_PSKIP,
|
||||
MPP_ENC_RC_DROP_FRM_BUTT
|
||||
} MppEncRcDropFrmMode;
|
||||
|
||||
typedef struct MppEncRcCfg_t {
|
||||
RK_U32 change;
|
||||
|
||||
@@ -287,6 +295,30 @@ typedef struct MppEncRcCfg_t {
|
||||
* stat_times - the time of bitrate statistics
|
||||
*/
|
||||
RK_S32 stat_times;
|
||||
|
||||
/*
|
||||
* drop frame parameters
|
||||
* used on bitrate is far over the max bitrate
|
||||
*
|
||||
* drop_mode
|
||||
*
|
||||
* MPP_ENC_RC_DROP_FRM_DISABLED
|
||||
* - do not drop frame when bitrate overflow.
|
||||
* MPP_ENC_RC_DROP_FRM_NORMAL
|
||||
* - do not encode the dropped frame when bitrate overflow.
|
||||
* MPP_ENC_RC_DROP_FRM_PSKIP
|
||||
* - encode a all skip frame when bitrate overflow.
|
||||
*
|
||||
* drop_threshold
|
||||
*
|
||||
* The percentage threshold over max_bitrate for trigger frame drop.
|
||||
*
|
||||
* drop_gap
|
||||
* The max continuous frame drop number
|
||||
*/
|
||||
MppEncRcDropFrmMode drop_mode;
|
||||
RK_U32 drop_threshold;
|
||||
RK_U32 drop_gap;
|
||||
} MppEncRcCfg;
|
||||
|
||||
/*
|
||||
|
||||
@@ -162,6 +162,9 @@ static const char *cfg_func_names[] = {
|
||||
ENTRY(rc, fps_out_denorm, S32, RK_S32, MPP_ENC_RC_CFG_CHANGE_FPS_OUT, rc, fps_out_denorm) \
|
||||
ENTRY(rc, gop, S32, RK_S32, MPP_ENC_RC_CFG_CHANGE_GOP, rc, gop) \
|
||||
ENTRY(rc, max_reenc_times,U32, RK_U32, MPP_ENC_RC_CFG_CHANGE_MAX_REENC, rc, max_reenc_times) \
|
||||
ENTRY(rc, drop_mode, U32, MppEncRcDropFrmMode, MPP_ENC_RC_CFG_CHANGE_DROP_FRM, rc, drop_mode) \
|
||||
ENTRY(rc, drop_thd, U32, RK_U32, MPP_ENC_RC_CFG_CHANGE_DROP_FRM, rc, drop_threshold) \
|
||||
ENTRY(rc, drop_gap, U32, RK_U32, MPP_ENC_RC_CFG_CHANGE_DROP_FRM, rc, drop_gap) \
|
||||
/* prep config */ \
|
||||
ENTRY(prep, width, S32, RK_S32, MPP_ENC_PREP_CFG_CHANGE_INPUT, prep, width) \
|
||||
ENTRY(prep, height, S32, RK_S32, MPP_ENC_PREP_CFG_CHANGE_INPUT, prep, height) \
|
||||
@@ -245,7 +248,7 @@ RK_S32 const_strlen(const char* str)
|
||||
return *str ? 1 + const_strlen(str + 1) : 0;
|
||||
}
|
||||
|
||||
static RK_S32 node_len = ENTRY_TABLE(EXPAND_AS_STRLEN) - 47;
|
||||
static RK_S32 node_len = ENTRY_TABLE(EXPAND_AS_STRLEN) - 53;
|
||||
|
||||
class MppEncCfgService
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user