Skip to content

libavc: reset i4_error_code to prevent early worker thread abort - #145

Merged
harishdm merged 1 commit into
ittiam-systems:mainfrom
harishdm:avc-error
Sep 29, 2026
Merged

harishdm merged 1 commit into
ittiam-systems:mainfrom
harishdm:avc-error

Conversation

@harishdm

Copy link
Copy Markdown
Member

The recon and deblocking worker threads abort when ps_dec->i4_error_code is non-zero, a check added to fix a worker thread hang. The following cases could cause them to abort early:

  • ps_dec->i4_error_code was not cleared at the start of ih264d_video_decode(), so an error set during a previous decode call persisted across subsequent frames.
  • ih264d_process_intra_mb() sets ERROR_INTRAPRED when an intra prediction mode needs unavailable neighbors, although the mode is already replaced with mode 0 (vertical). Before that check, this error code was not read during decoding.

Reset ps_dec->i4_error_code to 0 at the start of ih264d_video_decode() alongside ps_dec_op->u4_error_code, and stop setting ERROR_INTRAPRED.

Bug: 548241521
Bug: 565823098
Flag: EXEMPT BUGFIX
Test: atest CtsMediaV2TestCases:android.mediav2.cts.EncodeDecodeAccuracyTest#testEncodeDecodeAccuracyRGB
atest MctsMediaV2TestCases
atest MctsMediaDecoderTestCases
atest MctsMediaCodecTestCases
atest VtsHalMediaC2V1_0TargetVideoDecTest

Change-Id: I191ea7a6f6bd027fd3719db6581703c790eb40f2 (cherry picked from commit cfc33cb8eb9394274d1ca7a1c3193800d9356faa)

The recon and deblocking worker threads abort when ps_dec->i4_error_code
is non-zero, a check added to fix a worker thread hang. The following
cases could cause them to abort early:

- ps_dec->i4_error_code was not cleared at the start of
  ih264d_video_decode(), so an error set during a previous decode call
  persisted across subsequent frames.
- ih264d_process_intra_mb() sets ERROR_INTRAPRED when an intra
  prediction mode needs unavailable neighbors, although the mode is
  already replaced with mode 0 (vertical). Before that check, this error
  code was not read during decoding.

Reset ps_dec->i4_error_code to 0 at the start of ih264d_video_decode()
alongside ps_dec_op->u4_error_code, and stop setting ERROR_INTRAPRED.

Bug: 548241521
Bug: 565823098
Flag: EXEMPT BUGFIX
Test: atest CtsMediaV2TestCases:android.mediav2.cts.EncodeDecodeAccuracyTest#testEncodeDecodeAccuracyRGB
      atest MctsMediaV2TestCases
      atest MctsMediaDecoderTestCases
      atest MctsMediaCodecTestCases
      atest VtsHalMediaC2V1_0TargetVideoDecTest

Change-Id: I191ea7a6f6bd027fd3719db6581703c790eb40f2
(cherry picked from commit cfc33cb8eb9394274d1ca7a1c3193800d9356faa)
@harishdm
harishdm merged commit 6d58534 into ittiam-systems:main Sep 29, 2026
10 checks passed
@harishdm
harishdm deleted the avc-error branch September 29, 2026 02:47
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.

1 participant