Fix PSkip fast algorithm from screen-sharing #3638
Merged
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.
We observed blurry screen-sharing issue when user share screen from messenger on Chrome. The issue is because of a fast algorithm for screen sharing. We proposed to introduce a control on this fast algorithm and turn the option off by default.
Details:
There is a fast mode decision algorithm in Openh264: if the encoder finds that the source pixels of the current block are exactly the same as those of the reference block, it would directly encode it with the PSKIP mode. This usually happens when the shared screen is stable.
However, this algorithm introduces a problem. When the bandwidth is limited, the key frame is usually encoded by large QP, which is associated with poor quality. Ideally, we should refine the quality in the frames that follow. Unfortunately, the fast algorithm identifies all subsequent frames as stable and encodes all the blocks with the PSKIP mode. This is problematic because some reference blocks may have poor quality and should be encoded with the inter mode. As a result, we will never have good screen-sharing quality unless we scroll up/down the screen.
This pull request introduces a control on this fast algorithm and turn the option off by default.