summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2014-04-23 15:41:24 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2014-09-09 01:20:11 +0800
commit14f13cae75f05b751f1c030568b7c837c53e654f (patch)
treebc6ca46cafa83929f0978f501733824f97129112
parentf47cb0027cdf7bc21a3d7bed595af102dddbb3a9 (diff)
downloadlibva-14f13cae75f05b751f1c030568b7c837c53e654f.tar.gz
test/encode/avcenc: update the SPS parameter for encoding
It will simplify the calculation of POC and frame_num. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> (cherry picked from commit d794d040b8f7311d7b19d62826fbd3725d3bc7b9)
-rw-r--r--test/encode/avcenc.c11
1 files 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