-
Notifications
You must be signed in to change notification settings - Fork 253
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
frame: plane: Fix Downsampling of odd sized frames #2095
Conversation
Did AWCY and noticed there is a very small encoding time improving by less than a second or second which is neglible, Good news is nothing is broken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Could you make a downsampling test that shows this? See the existing downsample test - make an odd sized ones. |
Currently, the hres and qres are talking half(1/2) and one-fourth(1/4) of the width and height which is rounded down, when we have an odd sized frame this becomes a problem so to solve that we are rounding one up for both width and height. Earlier: src.cfg.width / 2 Now : (src.cfg.width + 1) / 2, Fixes xiph#2055
06cf778
to
3fb58a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case describes the expectation that padding pixels be used when down-sampling planes of odd dimensions. This requires that padding pixels are available, which is true of width if both stride and alignment are even. Odd heights are less constrained, so some care may be required. In practice, we substantially pad the frames to simplify motion estimation.
3fb58a5
to
6c572ac
Compare
Here we have modified the test case since we are considering odd heights, the exceptional case is where the right or bottom padding are zero causing additional pixels to be read from the next row or past the end of the data Co-authored-by: David Michael Barr <b@rr-dav.id.au>
6c572ac
to
a18627f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sufficiently describes the expectations and limitations of downsampling planes with odd dimensions. We ought to pad the input frames before downsampling - I have not yet traced through all the frame creation code to determine whether we already do that.
* frame: plane: Fix Downsampling of odd sized frames Currently, the hres and qres are talking half(1/2) and one-fourth(1/4) of the width and height which is rounded down, when we have an odd sized frame this becomes a problem so to solve that we are rounding one up for both width and height. Earlier: src.cfg.width / 2 Now : (src.cfg.width + 1) / 2, Fixes xiph#2055 * frame: plane: Introduce new test case for down_sampling Here we have modified the test case since we are considering odd heights, the exceptional case is where the right or bottom padding are zero causing additional pixels to be read from the next row or past the end of the data Co-authored-by: David Michael Barr <b@rr-dav.id.au> * benches: plane: Introduce new bench with odd frames Co-authored-by: David Michael Barr <b@rr-dav.id.au>
* frame: plane: Fix Downsampling of odd sized frames Currently, the hres and qres are talking half(1/2) and one-fourth(1/4) of the width and height which is rounded down, when we have an odd sized frame this becomes a problem so to solve that we are rounding one up for both width and height. Earlier: src.cfg.width / 2 Now : (src.cfg.width + 1) / 2, Fixes xiph#2055 * frame: plane: Introduce new test case for down_sampling Here we have modified the test case since we are considering odd heights, the exceptional case is where the right or bottom padding are zero causing additional pixels to be read from the next row or past the end of the data Co-authored-by: David Michael Barr <b@rr-dav.id.au> * benches: plane: Introduce new bench with odd frames Co-authored-by: David Michael Barr <b@rr-dav.id.au>
Hi,
Currently, the hres and qres are talking half(1/2) and one-fourth(1/4) of the
width and height which is rounded down, when we have an odd-sized frame this becomes
a problem so to solve that we are rounding one up for both width and height.
Earlier: src.cfg.width / 2
Now : (src.cfg.width + 1) / 2,
Fixes #2055
I am not 100% if doing this causes any other harm, but it would be great, to hear the comments with this