• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

Revisione0b5e873ef78829b7b84237125c7b7273fa790e8 (tree)
Time2013-06-25 14:53:58
AuthorAustin Yuan <shengquan.yuan@inte...>
CommiterXiang, Haihao

Log Message

h264encode: correct negative POC after a new IDR

Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>

Change Summary

Incremental Difference

--- a/test/encode/h264encode.c
+++ b/test/encode/h264encode.c
@@ -119,6 +119,7 @@ static int ip_period = 1;
119119 static int rc_mode = VA_RC_VBR;
120120 static unsigned long long current_frame_encoding = 0;
121121 static unsigned long long current_frame_display = 0;
122+static unsigned long long current_IDR_display = 0;
122123 static int current_frame_num = 0;
123124 static int current_frame_type;
124125 #define current_slot (current_frame_display % SURFACE_NUM)
@@ -297,7 +298,7 @@ static void sps_rbsp(bitstream *bs)
297298 bitstream_put_ui(bs, !!(constraint_set_flag & 8), 1); /* constraint_set3_flag */
298299 bitstream_put_ui(bs, 0, 4); /* reserved_zero_4bits */
299300 bitstream_put_ui(bs, seq_param.level_idc, 8); /* level_idc */
300- bitstream_put_ue(bs, seq_param.seq_parameter_set_id++); /* seq_parameter_set_id */
301+ bitstream_put_ue(bs, seq_param.seq_parameter_set_id); /* seq_parameter_set_id */
301302
302303 if ( profile_idc == PROFILE_IDC_HIGH) {
303304 bitstream_put_ue(bs, 1); /* chroma_format_idc = 1, 4:2:0 */
@@ -381,8 +382,8 @@ static void sps_rbsp(bitstream *bs)
381382
382383 static void pps_rbsp(bitstream *bs)
383384 {
384- bitstream_put_ue(bs, pic_param.pic_parameter_set_id++); /* pic_parameter_set_id */
385- bitstream_put_ue(bs, pic_param.seq_parameter_set_id++); /* seq_parameter_set_id */
385+ bitstream_put_ue(bs, pic_param.pic_parameter_set_id); /* pic_parameter_set_id */
386+ bitstream_put_ue(bs, pic_param.seq_parameter_set_id); /* seq_parameter_set_id */
386387
387388 bitstream_put_ui(bs, pic_param.pic_fields.bits.entropy_coding_mode_flag, 1); /* entropy_coding_mode_flag */
388389
@@ -1283,7 +1284,7 @@ static int render_picture(void)
12831284 pic_param.CurrPic.picture_id = ref_surface[current_slot];
12841285 pic_param.CurrPic.frame_idx = current_frame_num;
12851286 pic_param.CurrPic.flags = 0;
1286- pic_param.CurrPic.TopFieldOrderCnt = calc_poc(current_frame_display % MaxPicOrderCntLsb);
1287+ pic_param.CurrPic.TopFieldOrderCnt = calc_poc((current_frame_display - current_IDR_display) % MaxPicOrderCntLsb);
12871288 pic_param.CurrPic.BottomFieldOrderCnt = pic_param.CurrPic.TopFieldOrderCnt;
12881289 CurrentCurrPic = pic_param.CurrPic;
12891290
@@ -1852,6 +1853,7 @@ static int encode_frames(void)
18521853 if (current_frame_type == FRAME_IDR) {
18531854 numShortTerm = 0;
18541855 current_frame_num = 0;
1856+ current_IDR_display = current_frame_display;
18551857 }
18561858 /* check if the source frame is ready */
18571859 while (srcsurface_status[current_slot] != SRC_SURFACE_IN_ENCODING);