Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libavcenc: do not reset status before all threads are made aware #57

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

harishdm
Copy link
Member

At the end of encoding of a frame, the entropy thread communicates the encoded bit stream size to rc module for update. After this update, if rc decides to skip the frame due to vbv overflow, the bitstream context is reset and frame is marked for skip.

Due to an oversight, if entropy encoding sees an error, then this update is happening at the end of each row. Now rc has decided to skip the frame and the context is reset. As the bitstream context is reset, other threads are unaware of this problem and continue encoding.

This is causing issues.

Restrict the rc update to the thread that entropy code the last row.

Bug: oss-fuzz:59543
Bug: 285891354
Test: avc_enc_fuzzer

Change-Id: If45a5f34abb59ece812733af8f54f72ae5474d03

At the end of encoding of a frame, the entropy thread communicates
the encoded bit stream size to rc module for update. After this
update, if rc decides to skip the frame due to vbv overflow, the
bitstream context is reset and frame is marked for skip.

Due to an oversight, if entropy encoding sees an error, then this
update is happening at the end of each row. Now rc has decided to
skip the frame and the context is reset. As the bitstream context is
reset, other threads are unaware of this problem and continue encoding.

This is causing issues.

Restrict the rc update to the thread that entropy code the last row.

Bug: oss-fuzz:59543
Bug: 285891354
Test: avc_enc_fuzzer

Change-Id: If45a5f34abb59ece812733af8f54f72ae5474d03
@harishdm harishdm merged commit 30858f4 into main Sep 14, 2023
3 checks passed
@harishdm harishdm deleted the enc-bitstream-fix branch September 14, 2023 03:38
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.

2 participants