Fix dynamic slice adjustment for frames with extreme aspect ratios#3960
Open
sprangerik wants to merge 3 commits into
Open
Fix dynamic slice adjustment for frames with extreme aspect ratios#3960sprangerik wants to merge 3 commits into
sprangerik wants to merge 3 commits into
Conversation
dd49137 to
c11d3bd
Compare
When rate control is disabled (RC_OFF_MODE), dynamic slice adjustment in DynamicAdjustSlicing() defaults the minimum macroblock requirement per slice (iMinimalMbNum) to the frame's macroblock width (1 row per slice). For frames with extreme aspect ratios (such as very wide resolutions), requiring 1 macroblock row per slice across multiple slices can exceed the total number of macroblocks in the frame. This change ensures robust macroblock distribution and load balancing by: - Falling back iMinimalMbNum to 1 macroblock per slice when row-based heuristics exceed frame capacity in RC_OFF_MODE. - Skipping adjustment and logging a warning when the requested number of slices equals or exceeds the total macroblocks in the frame. - Adding a capacity guard in GomValidCheckSliceMbNum() for rate-controlled encoding modes. - Adding a unit test (DynamicAdjustSlicingExtremeAspectRatio) to verify dynamic slice adjustment and load balancing on wide aspect ratio frames.
c11d3bd to
4e9ac95
Compare
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.
When rate control is disabled (RC_OFF_MODE), dynamic slice adjustment
in DynamicAdjustSlicing() defaults the minimum macroblock requirement per
slice (iMinimalMbNum) to the frame's macroblock width (1 row per slice).
For frames with extreme aspect ratios (such as very wide resolutions),
requiring 1 macroblock row per slice across multiple slices can exceed the
total number of macroblocks in the frame.
This change ensures robust macroblock distribution and load balancing by:
heuristics exceed frame capacity in RC_OFF_MODE.
slices equals or exceeds the total macroblocks in the frame.
encoding modes.
dynamic slice adjustment and load balancing on wide aspect ratio frames.