Repository navigation
decoder: Clear sequence display extension flag on each sequence header - #43
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
u1_seq_disp_extn_present is set when a sequence display extension is parsed and was cleared only at init and on reset. If a stream has a second sequence header that is not followed by a sequence display extension, IMPEG2D_CMD_CTL_GET_SEQ_INFO kept returning the video format, colour description and display size of the earlier sequence instead of the unspecified values. Clear the flag when a sequence header is parsed, so it only reflects an extension that follows the current sequence header.
GeekQAQ
force-pushed
the
seq-hdr-disp-ext
branch
from
November 22, 2026 09:10
a76cf1d to
3ff5fa0
Compare
harishdm
approved these changes
Nov 23, 2026
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.
Decode one stream in which the first sequence has a sequence display extension and a later sequence (same picture size, so no
IVD_RES_CHANGEDand no reset) has none, then callIMPEG2D_CMD_CTL_GET_SEQ_INFO. It should report the unspecified values for the later sequence, as a new decoder does for that sequence alone (video format 5, colour primaries / transfer / matrix 2, display size = coded size). It still reports the earlier sequence's values:matrix_coefficients1 (BT.709) instead of 2.This is a follow-up to #37. That change clears
u1_seq_disp_extn_presentinimpeg2d_api_reset(), which covers a new stream after a reset, but the flag is still kept across sequence headers within a stream. This change clears it at the start ofimpeg2d_dec_seq_hdr(); the extension that follows each sequence header sets it again, so streams that repeat the extension with every sequence header report the same values as before. The clear in the reset is kept as it is.Tested on
main(7c88238) with clang and AddressSanitizer: with the reproducer in this gist (https://gist.github.com/GeekQAQ/ab723979677865d84838fff898e2a7f0),GET_SEQ_INFOafter the first sequence still reportsmatrix_coefficients1, and after the second sequence it now reports 2, the same as a new decoder (it was 1 before). The reset case from #37 still reports the same values as a new decoder. The default CMake build (Release, gcc and clang) has no new warnings, andmpeg2decgives byte-identical output before and after the change on 11 short test streams (including the two-sequence one; one of them is rejected as too small both before and after) with 1 core, and on 10 of them with 4 cores. The remaining stream starts with a B picture, and its 4-core output already varies from run to run onmain, so it is not compared.