Commit 520226b6 authored by Zhong Li's avatar Zhong Li

lavc/hevc_ps_enc: fix vps nal issues

1. write vps_num_hrd_parameters element
2. flush left bits
Signed-off-by: 's avatarZhong Li <zhong.li@intel.com>
parent 8865ae95
...@@ -67,7 +67,7 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id, ...@@ -67,7 +67,7 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
uint8_t *buf, int buf_size) uint8_t *buf, int buf_size)
{ {
PutBitContext pb; PutBitContext pb;
int i; int i, data_size;
init_put_bits(&pb, buf, buf_size); init_put_bits(&pb, buf, buf_size);
put_bits(&pb, 4, id); put_bits(&pb, 4, id);
...@@ -103,6 +103,7 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id, ...@@ -103,6 +103,7 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
if (vps->vps_poc_proportional_to_timing_flag) if (vps->vps_poc_proportional_to_timing_flag)
set_ue_golomb(&pb, vps->vps_num_ticks_poc_diff_one - 1); set_ue_golomb(&pb, vps->vps_num_ticks_poc_diff_one - 1);
set_ue_golomb(&pb, vps->vps_num_hrd_parameters);
if (vps->vps_num_hrd_parameters) { if (vps->vps_num_hrd_parameters) {
avpriv_report_missing_feature(NULL, "Writing HRD parameters"); avpriv_report_missing_feature(NULL, "Writing HRD parameters");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
...@@ -114,5 +115,8 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id, ...@@ -114,5 +115,8 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
put_bits(&pb, 1, 1); // stop bit put_bits(&pb, 1, 1); // stop bit
avpriv_align_put_bits(&pb); avpriv_align_put_bits(&pb);
return put_bits_count(&pb) / 8; data_size = put_bits_count(&pb) / 8;
flush_put_bits(&pb);
return data_size;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment