mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[h264e]: Add gaps in frame_num config entry
Some of NVR product may do some thing special when decoding the first GOP of bitstream encoded by MPP, and report "gaps in frame_num is not allowed" although frame_num is bitstream is continuous. Setting gaps_in_frame_num_allowed_flag to true will avoid this problem. 1. Set gaps_in_frame_num_allowed_flag true as default 2. call mpp_enc_cfg_set_u32(cfg, "h264:gaps_not_allowed", 1) if you want gaps_in_frame_num_allowed_flag to be false. Change-Id: I8242fb318e051a61772c02a2c8bb59e4b589ff6d Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:

committed by
Herman Chen

parent
6f16b401d7
commit
e6d2ab3c60
@@ -559,6 +559,8 @@ typedef enum MppEncH264CfgChange_e {
|
||||
MPP_ENC_H264_CFG_CHANGE_MAX_POC_LSB = (1 << 11),
|
||||
/* change on log2 max frame number minus 4 */
|
||||
MPP_ENC_H264_CFG_CHANGE_MAX_FRM_NUM = (1 << 12),
|
||||
/* change on gaps_in_frame_num_value_allowed_flag */
|
||||
MPP_ENC_H264_CFG_CHANGE_GAPS_IN_FRM_NUM = (1 << 13),
|
||||
|
||||
/* change on max_qp / min_qp */
|
||||
MPP_ENC_H264_CFG_CHANGE_QP_LIMIT = (1 << 16),
|
||||
@@ -607,6 +609,7 @@ typedef struct MppEncH264Cfg_t {
|
||||
RK_U8 poc_type;
|
||||
RK_U8 log2_max_poc_lsb;
|
||||
RK_U8 log2_max_frame_num;
|
||||
RK_U32 gaps_not_allowed;
|
||||
|
||||
/*
|
||||
* H.264 profile_idc parameter
|
||||
|
@@ -169,6 +169,7 @@ RK_U32 mpp_enc_cfg_debug = 0;
|
||||
ENTRY(h264, poc_type, U32, RK_U32, MPP_ENC_H264_CFG_CHANGE_POC_TYPE, codec.h264, poc_type) \
|
||||
ENTRY(h264, log2_max_poc_lsb, U32, RK_U32, MPP_ENC_H264_CFG_CHANGE_MAX_POC_LSB, codec.h264, log2_max_poc_lsb) \
|
||||
ENTRY(h264, log2_max_frm_num, U32, RK_U32, MPP_ENC_H264_CFG_CHANGE_MAX_FRM_NUM, codec.h264, log2_max_frame_num) \
|
||||
ENTRY(h264, gaps_not_allowed, U32, RK_U32, MPP_ENC_H264_CFG_CHANGE_GAPS_IN_FRM_NUM, codec.h264, gaps_not_allowed) \
|
||||
ENTRY(h264, cabac_en, S32, RK_S32, MPP_ENC_H264_CFG_CHANGE_ENTROPY, codec.h264, entropy_coding_mode) \
|
||||
ENTRY(h264, cabac_idc, S32, RK_S32, MPP_ENC_H264_CFG_CHANGE_ENTROPY, codec.h264, cabac_init_idc) \
|
||||
ENTRY(h264, trans8x8, S32, RK_S32, MPP_ENC_H264_CFG_CHANGE_TRANS_8x8, codec.h264, transform8x8_mode) \
|
||||
|
@@ -349,6 +349,11 @@ static MPP_RET h264e_proc_h264_cfg(MppEncH264Cfg *dst, MppEncH264Cfg *src)
|
||||
dst->log2_max_frame_num = src->log2_max_frame_num;
|
||||
dst->change |= MPP_ENC_H264_CFG_CHANGE_MAX_FRM_NUM;
|
||||
}
|
||||
if ((change & MPP_ENC_H264_CFG_CHANGE_GAPS_IN_FRM_NUM) &&
|
||||
(dst->gaps_not_allowed != src->gaps_not_allowed)) {
|
||||
dst->gaps_not_allowed = src->gaps_not_allowed;
|
||||
dst->change |= MPP_ENC_H264_CFG_CHANGE_GAPS_IN_FRM_NUM;
|
||||
}
|
||||
if ((change & MPP_ENC_H264_CFG_CHANGE_ENTROPY) &&
|
||||
((dst->entropy_coding_mode != src->entropy_coding_mode) ||
|
||||
(dst->cabac_init_idc != src->cabac_init_idc))) {
|
||||
|
@@ -141,7 +141,7 @@ MPP_RET h264e_sps_update(H264eSps *sps, MppEncCfgSet *cfg)
|
||||
// max one reference frame
|
||||
sps->num_ref_frames = info->dpb_size;
|
||||
|
||||
sps->gaps_in_frame_num_value_allowed = 0;
|
||||
sps->gaps_in_frame_num_value_allowed = !h264->gaps_not_allowed;
|
||||
|
||||
// default 720p without cropping
|
||||
sps->pic_width_in_mbs = aligned_w >> 4;
|
||||
|
Reference in New Issue
Block a user