[mpp_enc_cfg]: Add super frame config

Change-Id: I0df2db8fd7c5e10412584ded557da3962b77f882
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2020-11-23 19:43:06 +08:00
parent c124e1c247
commit 7ae2f73bca
3 changed files with 29 additions and 4 deletions

View File

@@ -165,6 +165,8 @@ typedef enum MppEncRcCfgChange_e {
MPP_ENC_RC_CFG_CHANGE_MAX_I_PROP = (1 << 11),
MPP_ENC_RC_CFG_CHANGE_MIN_I_PROP = (1 << 12),
MPP_ENC_RC_CFG_CHANGE_INIT_IP_RATIO = (1 << 13),
MPP_ENC_RC_CFG_CHANGE_PRIORITY = (1 << 14),
MPP_ENC_RC_CFG_CHANGE_SUPER_FRM = (1 << 15),
MPP_ENC_RC_CFG_CHANGE_ALL = (0xFFFFFFFF),
} MppEncRcCfgChange;
@@ -306,9 +308,15 @@ typedef struct MppEncRcCfg_t {
* drop_gap
* The max continuous frame drop number
*/
MppEncRcDropFrmMode drop_mode;
RK_U32 drop_threshold;
RK_U32 drop_gap;
MppEncRcDropFrmMode drop_mode;
RK_U32 drop_threshold;
RK_U32 drop_gap;
MppEncRcSuperFrameMode super_mode;
RK_U32 super_i_thd;
RK_U32 super_p_thd;
MppEncRcPriority rc_priority;
RK_S32 max_i_prop;
RK_S32 min_i_prop;

View File

@@ -28,6 +28,12 @@ typedef enum MppEncRcMode_e {
MPP_ENC_RC_MODE_BUTT
} MppEncRcMode;
typedef enum MppEncRcPriority_e {
MPP_ENC_RC_BY_BITRATE_FIRST,
MPP_ENC_RC_BY_FRM_SIZE_FIRST,
MPP_ENC_RC_PRIORITY_BUTT
} MppEncRcPriority;
typedef enum MppEncRcDropFrmMode_e {
MPP_ENC_RC_DROP_FRM_DISABLED,
MPP_ENC_RC_DROP_FRM_NORMAL,
@@ -35,4 +41,11 @@ typedef enum MppEncRcDropFrmMode_e {
MPP_ENC_RC_DROP_FRM_BUTT
} MppEncRcDropFrmMode;
typedef enum MppEncRcSuperFrameMode_t {
MPP_ENC_RC_SUPER_FRM_NONE,
MPP_ENC_RC_SUPER_FRM_DROP,
MPP_ENC_RC_SUPER_FRM_REENC,
MPP_ENC_RC_SUPER_FRM_BUTT
} MppEncRcSuperFrameMode;
#endif /*__RK_VENC_RC_H__*/

View File

@@ -162,12 +162,16 @@ 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, priority, U32, MppEncRcPriority, MPP_ENC_RC_CFG_CHANGE_PRIORITY, rc, rc_priority) \
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) \
ENTRY(rc, max_i_prop, S32, RK_S32, MPP_ENC_RC_CFG_CHANGE_MAX_I_PROP, rc, max_i_prop) \
ENTRY(rc, min_i_prop, S32, RK_S32, MPP_ENC_RC_CFG_CHANGE_MIN_I_PROP, rc, min_i_prop) \
ENTRY(rc, init_ip_ratio, S32, RK_S32, MPP_ENC_RC_CFG_CHANGE_INIT_IP_RATIO, rc, init_ip_ratio) \
ENTRY(rc, super_mode, U32, MppEncRcSuperFrameMode, MPP_ENC_RC_CFG_CHANGE_SUPER_FRM, rc, super_mode) \
ENTRY(rc, super_i_thd, U32, RK_U32, MPP_ENC_RC_CFG_CHANGE_SUPER_FRM, rc, super_i_thd) \
ENTRY(rc, super_p_thd, U32, RK_U32, MPP_ENC_RC_CFG_CHANGE_SUPER_FRM, rc, super_p_thd) \
/* 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) \
@@ -259,7 +263,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) - 55;
static RK_S32 node_len = ENTRY_TABLE(EXPAND_AS_STRLEN) - 50;
class MppEncCfgService
{