Skip to content

decoder: Clear sequence display extension flag on reset - #37

Merged
harishdm merged 1 commit into
ittiam-systems:mainfrom
GeekQAQ:reset-seq-disp-ext
Nov 20, 2026
Merged

harishdm merged 1 commit into
ittiam-systems:mainfrom
GeekQAQ:reset-seq-disp-ext

Conversation

@GeekQAQ

@GeekQAQ GeekQAQ commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

impeg2d_api_reset() does not clear u1_seq_disp_extn_present. After a stream that has a sequence display extension, a stream without one that is decoded after IVD_CMD_CTL_RESET still gets the previous stream's video format, colour description and display size from IMPEG2D_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_coefficients 1 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_coefficients was 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, and mpeg2dec gives 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 on main (a separate issue, sent as its own PR).

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.
Copilot AI balanced review requested due to automatic review settings November 19, 2026 23:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@harishdm
harishdm merged commit e41129b into ittiam-systems:main Nov 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants