hardware/intel/libva
Revision | e0b5e873ef78829b7b84237125c7b7273fa790e8 (tree) |
---|---|
Time | 2013-06-25 14:53:58 |
Author | Austin Yuan <shengquan.yuan@inte...> |
Commiter | Xiang, Haihao |
h264encode: correct negative POC after a new IDR
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
@@ -119,6 +119,7 @@ static int ip_period = 1; | ||
119 | 119 | static int rc_mode = VA_RC_VBR; |
120 | 120 | static unsigned long long current_frame_encoding = 0; |
121 | 121 | static unsigned long long current_frame_display = 0; |
122 | +static unsigned long long current_IDR_display = 0; | |
122 | 123 | static int current_frame_num = 0; |
123 | 124 | static int current_frame_type; |
124 | 125 | #define current_slot (current_frame_display % SURFACE_NUM) |
@@ -297,7 +298,7 @@ static void sps_rbsp(bitstream *bs) | ||
297 | 298 | bitstream_put_ui(bs, !!(constraint_set_flag & 8), 1); /* constraint_set3_flag */ |
298 | 299 | bitstream_put_ui(bs, 0, 4); /* reserved_zero_4bits */ |
299 | 300 | 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 */ | |
301 | 302 | |
302 | 303 | if ( profile_idc == PROFILE_IDC_HIGH) { |
303 | 304 | bitstream_put_ue(bs, 1); /* chroma_format_idc = 1, 4:2:0 */ |
@@ -381,8 +382,8 @@ static void sps_rbsp(bitstream *bs) | ||
381 | 382 | |
382 | 383 | static void pps_rbsp(bitstream *bs) |
383 | 384 | { |
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 */ | |
386 | 387 | |
387 | 388 | bitstream_put_ui(bs, pic_param.pic_fields.bits.entropy_coding_mode_flag, 1); /* entropy_coding_mode_flag */ |
388 | 389 |
@@ -1283,7 +1284,7 @@ static int render_picture(void) | ||
1283 | 1284 | pic_param.CurrPic.picture_id = ref_surface[current_slot]; |
1284 | 1285 | pic_param.CurrPic.frame_idx = current_frame_num; |
1285 | 1286 | 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); | |
1287 | 1288 | pic_param.CurrPic.BottomFieldOrderCnt = pic_param.CurrPic.TopFieldOrderCnt; |
1288 | 1289 | CurrentCurrPic = pic_param.CurrPic; |
1289 | 1290 |
@@ -1852,6 +1853,7 @@ static int encode_frames(void) | ||
1852 | 1853 | if (current_frame_type == FRAME_IDR) { |
1853 | 1854 | numShortTerm = 0; |
1854 | 1855 | current_frame_num = 0; |
1856 | + current_IDR_display = current_frame_display; | |
1855 | 1857 | } |
1856 | 1858 | /* check if the source frame is ready */ |
1857 | 1859 | while (srcsurface_status[current_slot] != SRC_SURFACE_IN_ENCODING); |