-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fn loop_restoration_filter
: Take safe lpf
arg for Rust fallbacks
#1202
Conversation
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.
Some little things but generally it LGTM.
@@ -170,10 +174,22 @@ impl loop_restoration_filter::Fn { | |||
let dst_ptr = dst.as_mut_ptr::<BD>().cast(); | |||
let dst_stride = dst.stride(); | |||
let left = left[..h as usize].as_ptr().cast(); | |||
let lpf = lpf.cast(); | |||
// NOTE: The calculated pointer may point to before the beginning of |
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.
// NOTE: The calculated pointer may point to before the beginning of | |
// SAFETY: The calculated pointer may point to before the beginning of |
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 isn't a safety comment though. None of the operations it's documenting are unsafe, it's just explaining why we need to use wrapping_offset
instead of offset
.
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.
Yeah, but it's very safety adjacent, and explains why we aren't doing something unsafe
. I think it's better to use SAFETY
for searchability, too.
loop_restoration_filter
: Take safe lpf
arg for Rust fallbacksfn loop_restoration_filter
: Take safe lpf
arg for Rust fallbacks
Pass the full
DisjointMut
buffer and anisize
offset into theloop_restoration_filter
function, then reconstruct the offset in the Rust fallback functions. This makes the Rust fallbacks fully safe.looprestoration.rs
: Unsafe cleanup #852