Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse pic_struct_present_flag #163

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arabian9ts
Copy link

Thank you for the great repository!
I'm considering using pic_struct_present_flag for SEI analysis.

The comment in the code states that if BitstreamRestrictionFlag == 1, parsing may fail due to missing bits. However, it is unclear in which specific samples this issue occurs.

At least according to ITU-T H.264 (04/2017), the standard specifically defines both pic_struct_present_flag and bitstream_restriction_flag as 1-bit fields. I think it would be very useful to parse these fields.

https://www.itu.int/itu-t/recommendations/rec.aspx?rec=13189

sps.Frame_crop_left_offset = bs.ReadUE() // frame_crop_left_offset
sps.Frame_crop_right_offset = bs.ReadUE() // frame_crop_right_offset
sps.Frame_crop_top_offset = bs.ReadUE() // frame_crop_top_offset
sps.Frame_crop_bottom_offset = bs.ReadUE() // frame_crop_bottom_offset
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The editor will automatically insert spaces. sorry.

@@ -117,6 +117,7 @@ func (sps *SPS) Decode(bs *BitStream) {
sps.Offset_for_non_ref_pic = bs.ReadSE() // offset_for_non_ref_pic
sps.Offset_for_top_to_bottom_field = bs.ReadSE() // offset_for_top_to_bottom_field
num_ref_frames_in_pic_order_cnt_cycle := bs.ReadUE()
sps.Offset_for_ref_frame = make([]int64, num_ref_frames_in_pic_order_cnt_cycle)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here index out of range was occurring so fixed to initialize the slice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant