-
Notifications
You must be signed in to change notification settings - Fork 22
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
struct Dav1dFrameHeader
: backport memory size reduction from dav1d 1.3.0
#1007
Conversation
Signed-off-by: James Almer <[email protected]>
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.
Mostly good, I just have some small comments about casts. And I think sharpness
is supposed to be a u8
like in C.
.frame_offset, | ||
frame_offset, | ||
.frame_offset as c_int, | ||
frame_offset as c_int, |
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.
We could make fn get_poc_diff
and all of the poc
fields/vars u8
s. I can add that if you want (I checked to see if it it's possible).
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.
Yes, but that's really beyond the scope of this PR. I'll let you create a new one.
@@ -358,7 +359,7 @@ unsafe fn read_tx_tree( | |||
}; | |||
} | |||
|
|||
fn neg_deinterleave(diff: c_int, r#ref: c_int, max: c_int) -> c_int { | |||
fn neg_deinterleave(diff: u8, r#ref: u8, max: u8) -> u8 { |
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.
We can't change these to unsigned, max - 1
may be negative.
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.
Does #1056 solve it?
`max` can be 0 and subtracting 1 causes underflow
`max` can be 0 and subtracting 1 causes underflow
`max` can be 0 and subtracting 1 causes underflow
Dav1dFrameHeader
of Backport: Reduce the size of some public structs #505.Shrinks
Rav1dFrameHeader
from 1664 to 1120 bytes.