From 14f13cae75f05b751f1c030568b7c837c53e654f Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Wed, 23 Apr 2014 15:41:24 +0800 Subject: [PATCH] test/encode/avcenc: update the SPS parameter for encoding It will simplify the calculation of POC and frame_num. Signed-off-by: Zhao Yakui (cherry picked from commit d794d040b8f7311d7b19d62826fbd3725d3bc7b9) --- test/encode/avcenc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/encode/avcenc.c b/test/encode/avcenc.c index b867a4c..23782e6 100644 --- a/test/encode/avcenc.c +++ b/test/encode/avcenc.c @@ -93,6 +93,12 @@ static int ip_period = 1; #define MAX_SLICES 32 + +static unsigned int MaxFrameNum = (1<<12); +static unsigned int MaxPicOrderCntLsb = (1<<8); +static unsigned int Log2MaxFrameNum = 12; +static unsigned int Log2MaxPicOrderCntLsb = 8; + static int build_packed_pic_buffer(unsigned char **header_buffer); @@ -1398,6 +1404,7 @@ static void avcenc_context_seq_param_init(VAEncSequenceParameterBufferH264 *seq_ seq_param->seq_parameter_set_id = 0; seq_param->level_idc = 41; seq_param->intra_period = intra_period; + seq_param->intra_idr_period = seq_param->intra_period; seq_param->ip_period = ip_period; seq_param->max_num_ref_frames = 4; seq_param->picture_width_in_mbs = width_in_mbs; @@ -1429,8 +1436,8 @@ static void avcenc_context_seq_param_init(VAEncSequenceParameterBufferH264 *seq_ seq_param->seq_fields.bits.pic_order_cnt_type = 0; seq_param->seq_fields.bits.direct_8x8_inference_flag = 0; - seq_param->seq_fields.bits.log2_max_frame_num_minus4 = 0; - seq_param->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 = 2; + seq_param->seq_fields.bits.log2_max_frame_num_minus4 = Log2MaxFrameNum - 4; + seq_param->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 = Log2MaxPicOrderCntLsb - 4; if (frame_bit_rate > 0) seq_param->vui_parameters_present_flag = 1; //HRD info located in vui -- 2.7.4