decoder: check profile interop conformance ASAP - #5181
Open
wantehchang wants to merge 1 commit into
Open
Conversation
read_sequence_header_obu() should call av2_check_profile_interop_conformance() as soon as it has read all the members of seq_params checked by that function. This allows the av2_max_level_bitrate() call in read_sequence_header_obu() to assume seq_params->seq_profile_idc is a supported profile. Document the members of seq_params checked by av2_check_profile_interop_conformance().
wantehchang
commented
Jul 30, 2026
| } break; | ||
| default: | ||
| // Profile 5+ - reserved/unsupported | ||
| return 0; |
Member
Author
There was a problem hiding this comment.
Note that av2_check_profile_interop_conformance() returns 0 if the profile is reserved/unsupported.
| if (!av2_check_profile_interop_conformance(seq_params, &cm->error, 1)) { | ||
| avm_internal_error(&cm->error, AVM_CODEC_UNSUP_BITSTREAM, | ||
| "Unsupported profile, bitdepth, chroma format or number " | ||
| "of embedded layers"); |
Member
Author
There was a problem hiding this comment.
I added "profile" to the error message because av2_check_profile_interop_conformance() also returns 0 if the profile is unsupported.
| int64_t seq_bitrate = av2_max_level_bitrate( | ||
| seq_params->seq_profile_idc, seq_params->seq_max_level_idx, | ||
| seq_params->seq_tier, seq_params->subsampling_x, | ||
| seq_params->subsampling_y, seq_params->monochrome); |
Member
Author
There was a problem hiding this comment.
This av2_max_level_bitrate() call can now assume seq_params->seq_profile_idc is a supported profile. It won't need to check for unsupported profiles.
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.
read_sequence_header_obu() should call
av2_check_profile_interop_conformance() as soon as it has read all the members of seq_params checked by that function. This allows the av2_max_level_bitrate() call in read_sequence_header_obu() to assume seq_params->seq_profile_idc is a supported profile.
Document the members of seq_params checked by
av2_check_profile_interop_conformance().