Skip to content

Commit

Permalink
Code review cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
randomPoison committed Apr 24, 2024
1 parent 67f3186 commit d38b9bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/ipred_prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ pub fn rav1d_prepare_intra_edges<BD: BitDepth>(
edge_flags: EdgeFlags,
dst: &[BD::Pixel], // contains 4*h first rows of picture, last row in slice contains 4*w samples
stride: ptrdiff_t,
// Buffer and offset pair. `isize` value is the base offset that should be used
// when indexing into the buffer.
prefilter_toplevel_sb_edge: Option<(&DisjointMut<AlignedVec64<u8>>, isize)>,
mut mode: IntraPredMode,
angle: &mut c_int,
Expand Down
15 changes: 4 additions & 11 deletions src/recon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4498,12 +4498,12 @@ pub(crate) unsafe fn rav1d_backup_ipred_edge<BD: BitDepth>(
.offset((x_off * 4) as isize)
.offset((((t.b.y + f.sb_step) * 4 - 1) as isize * BD::pxstride(f.cur.stride[0])) as isize);
let ipred_edge_off = (f.ipred_edge_off * 0) + (sby_off + x_off * 4) as usize;
let n = (4 * (ts.tiling.col_end - x_off)).try_into().unwrap();
let n = 4 * (ts.tiling.col_end - x_off) as usize;
BD::pixel_copy(
&mut f
.ipred_edge
.mut_slice_as(ipred_edge_off..ipred_edge_off + n),
slice::from_raw_parts(y, (4 * (ts.tiling.col_end - x_off)).try_into().unwrap()),
slice::from_raw_parts(y, n),
n,
);
if f.cur.p.layout as c_uint != Rav1dPixelLayout::I400 as c_int as c_uint {
Expand All @@ -4517,19 +4517,12 @@ pub(crate) unsafe fn rav1d_backup_ipred_edge<BD: BitDepth>(
while pl <= 2 {
let ipred_edge_off =
(f.ipred_edge_off * pl) + (sby_off + (x_off * 4 >> ss_hor)) as usize;
let n = (4 * (ts.tiling.col_end - x_off) >> ss_hor)
.try_into()
.unwrap();
let n = 4 * (ts.tiling.col_end - x_off) as usize >> ss_hor;
BD::pixel_copy(
&mut f
.ipred_edge
.mut_slice_as(ipred_edge_off..ipred_edge_off + n),
&slice::from_raw_parts(
f.cur.data.data[pl].cast(),
(uv_off + (4 * (ts.tiling.col_end - x_off) >> ss_hor) as isize)
.try_into()
.unwrap(),
)[uv_off.try_into().unwrap()..],
&slice::from_raw_parts(f.cur.data.data[pl].cast::<BD::Pixel>().offset(uv_off), n),
n,
);
pl += 1;
Expand Down

0 comments on commit d38b9bb

Please sign in to comment.