Repository navigation
fix(vvc): rebuild constraint bytes in the order stored in vvcC - #590
Merged
rbouqueau merged 2 commits intoNov 23, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: a39eb9b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
|
Indeed, thanks! |
Open
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.
Description
The
Cpart ofvvc1/vvi1codec strings is the base32 ofptl_frame_only_constraint_flag,ptl_multilayer_enabled_flagandgeneral_constraint_infoas stored in the PTL record.vvcCparsing keeps those bits shifted by 2: eachgeneral_constraint_info[i]holds 8 bits starting after the two flags, and the last entry holds the remaining 6 bits.getCodec()did not undo that shift correctly:(gci[i] >> 2) & 0x03and went to the low end, instead of(gci[i] & 0x03) << 6So any record with
general_constraint_infobeyond the first byte got a wrong string. For constraint bytesa5 c3 80it gavevvc1.1.L83.CUUBQGinstead ofCUXBYA.Now the bytes are rebuilt as they appear in the record and then encoded as before. Records with a single zero byte still give
CA.tests/codec.test.tsparses threevvcCboxes and checks the codec string. 2 of the 3 tests fail before the change.vitest run(Node 22): 525 passed.eslint,prettier --check,npm run typesandnpm run buildpass.Note: MP4Box
rfc_6381_get_codec_vvcwrites the last 6-bit entry as 8 bits, so the two match when those last 6 bits are zero (the alignment bits whengci_num_additional_bitsis 0) and differ otherwise.Reference: ISO/IEC 14496-15, VvcPTLRecord, and Annex E for the codecs parameter.