-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes #848. * Fixes #855. * Fixes #841. This does add back some bounds checks since the only and final slicing is done in `fn loopfilter_sb::Fn::call`, which is inside inner loops. @fbossen, how does this look for perf? Only 2 `unsafe` ops left (after #1239 is merged, too)! Though still 122 `unsafe` ops in `neon` `fn`s. ## Addendum So it turns out the `- b4strideb` in `fn loop_filter_sb128_rust` makes the index negative, so the initial slice needs to be larger. This is difficult to safely do, though, because all of the other uses of `f.lf.level` do not go through `DisjointMut`'s safe APIs since there were overlapping `&mut`s since indices 0 and 1 are written simultaneously to 2 and 3, and thus were done `unsafe`ly. This loses the disjointedness checking, though, which is a problem for making other changes. Thus, this PR leaves the `- b4strideb` as an `unsafe` `lvl.as_ptr().sub(b4strideb)` for now. In a follow-up PR, I'm going to change the `[u8; 4]` `lvl` elements to just `u8`s. This will allow the disjoint writes to `[0..2]` and `[2..4]` to be done safely with `DisjointMut`s APIs and will remove the need for `fn unaligned_lvl_slice`. Fixed in #1273 now.
- Loading branch information
Showing
5 changed files
with
85 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.