Repository navigation
decoder: Clear sequence display extension flag on reset - #37
Merged
Merged
Conversation
impeg2d_api_reset() did not clear u1_seq_disp_extn_present. If the stream decoded before the reset had a sequence display extension and the stream after it has none, IMPEG2D_CMD_CTL_GET_SEQ_INFO kept returning the colour description and display size of the previous stream instead of the unspecified values a new decoder returns.
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.
This was referenced Nov 20, 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.
impeg2d_api_reset()does not clearu1_seq_disp_extn_present. After a stream that has a sequence display extension, a stream without one that is decoded afterIVD_CMD_CTL_RESETstill gets the previous stream's video format, colour description and display size fromIMPEG2D_CMD_CTL_GET_SEQ_INFO. A new decoder returns the "unspecified" values for this case (video format 5, colour primaries / transfer / matrix 2, display size = coded size).For example, decode a stream whose sequence display extension signals BT.709, reset, then decode a stream without the extension: GET_SEQ_INFO reports
matrix_coefficients1 instead of 2.This change clears the flag in the reset.
Tested on
main(275c536) with clang 21 and AddressSanitizer: a program that decodes the first stream (fully, or only 3 calls), resets, decodes one access unit of the second stream and calls GET_SEQ_INFO now reports the same values as a new decoder (matrix_coefficientswas 1 before, 2 now). The program and the streams are in this gist: https://gist.github.com/GeekQAQ/5f782dfcad89232e550455a07202efcf The default CMake build (Release, gcc and clang) has no new warnings, andmpeg2decgives byte-identical output before and after the change on 16 short test streams with 1 core, and with 4 cores except for a stream that starts with a B picture, whose 4-core output already varies from run to run onmain(a separate issue, sent as its own PR).