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

Add support for AVC separate fields #94

Merged
merged 7 commits into from
Sep 5, 2024
Merged

Conversation

philipnbbc
Copy link
Collaborator

This PR adds support for separate field coded AVC that are stored as a pair of fields in MXF.

The AVCEssenceParser is renamed to AVCCodedPictureEssenceParser, supporting parsing pictures. A new frame / separate field parser (AVCEssenceParser) has been added. The new AVCEssenceParser will identify frame or fields and combine field pairs. The EssenceParser and child classes now have ParseFrameSize2 and ParseFrameInfo2 methods that return / use a ParsedFrameSize object that handles the info related to a frame or pair of fields.

The AVCWriteHelper has been updated to process fields from AVCEssenceParser to calculate the AVC Sub-descriptor properties.

The bmxparser has a --avc-picture option to dump picture (frame or single field) info rather than frame or field pair info.

The file and essence provided by #86 is now supported.

Added ParseFrameSize2() and ParseFrameInfo2() essence parser methods
that are given / return a ParsedFrameSize object that holds frame parse
state and supports separate fields. These methods are called rather than
the old (version 1) methods and if a parser does not implement them
(which is all but the AVC parser) then the new method calls the old
method.

The previous AVCEssenceParser was renamed to
AVCCodedPictureEssenceParser and it is limited to parsing a coded
picture (frame coded or field coded).

The AVCEssenceParser was changed to support frames or separate field pairs.

The AVCWriteHelper was updated to handle the fields (access units /
codec pictures) when calculating the index and AVC sub-descriptor properties.
Handle case where a B-frame is before a IDR frame in presentation order
but after it in coded order. The B-frame can only have backward prediction
and the key frame offset is to the IDR frame.
rather than at the end of the provided data which would result in both
fields of separate fields being parsed.
The frame size may be determined outside the parser (e.g. if the
remaining bytes are assumed to be part of the frame) and this method
allows the state to be reset.
Signal access to parameter sets in every access unit over the other
availability flags.

Signal access to a parameter set in every GOP over only present in the
first access unit if there is only 1 GOP.
@philipnbbc philipnbbc force-pushed the philipn-avc-separate-fields branch from dd24bd6 to 3ce05f2 Compare September 4, 2024 11:23
@philipnbbc philipnbbc merged commit 78c3744 into main Sep 5, 2024
10 checks passed
@philipnbbc philipnbbc deleted the philipn-avc-separate-fields branch September 10, 2024 07:12
@FranceBB
Copy link

FranceBB commented Sep 12, 2024

People don't say it enough, but 'thank you' Phil for everything you're doing and you've been doing over the years for the open source community. This was the last piece of the puzzle to have a proper AVC Long GOP support. It's been a while since September 2022, but the puzzle is now complete and I'm sure a lot of people are gonna be happy about this. :)

@philipnbbc
Copy link
Collaborator Author

Thanks! It's important for us to promote standards and ensure everyone can benefit and participate.

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.

2 participants