fix(avc): encode avcC trailing info for all profiles outside 66/77/88 - #536
Merged
Merged
Conversation
EncodeSW only wrote the 4 trailing bytes for profiles 100, 110, 122, and 144, while Size() and DecodeAVCDecConfRec treat all profiles outside 66/77/88 that way. For other profiles like 244, the encoded record was 4 bytes shorter than Size().
nchitkara-xai
force-pushed
the
avcc-encode-trailing-info
branch
from
July 25, 2026 01:46
587c1e4 to
616360e
Compare
tobbee
approved these changes
Jul 25, 2026
tobbee
left a comment
Collaborator
There was a problem hiding this comment.
@nchitkara-xai Thanks for this PR. LGTM!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DecodeAVCDecConfRec and Size() treat every AVC profile outside 66/77/88 as having the 4 trailing bytes (chroma format, bit depths, numSPSExt), but EncodeSW only writes them for 100, 110, 122 and 144. For other profiles like 244 the encoded record comes out 4 bytes shorter than Size(), so box sizes go wrong when the record is encoded inside an stsd.
This makes that case the default branch in EncodeSW, matching Size() and the decoder. Added a test that round-trips a profile 244 record.