Commit c8b81aef authored by Monty's avatar Monty Committed by Monty Montgomery
Browse files

Fixes for Clippy errors in LRF patches

parent d6007286
......@@ -327,14 +327,13 @@ pub fn cdef_sb_padded_frame_copy<T: Pixel>(
pub fn cdef_empty_frame<T: Pixel>(f: &Frame<T>) -> Frame<T> {
let out = Frame {
Frame {
planes: [
Plane::new(0, 0, f.planes[0].cfg.xdec, f.planes[0].cfg.ydec, 0, 0),
Plane::new(0, 0, f.planes[0].cfg.xdec, f.planes[0].cfg.ydec, 0, 0),
Plane::new(0, 0, f.planes[0].cfg.xdec, f.planes[0].cfg.ydec, 0, 0),
]
};
out
}
}
// We assume in is padded, and the area we'll write out is at least as
......
......@@ -3029,7 +3029,7 @@ impl ContextWriter {
RestorationFilter::None => {
w.symbol_bits(0, &self.fc.lrf_switchable_cdf[..nsym])
}
RestorationFilter::Wiener{coeffs: _} => {
RestorationFilter::Wiener{ .. } => {
unreachable!() // for now, not permanently
}
RestorationFilter::Sgrproj{set, xqd} => {
......
......@@ -134,20 +134,16 @@ fn sgrproj_box_sum_slow<T: Pixel>(a: &mut i32, b: &mut i32,
let mut sum:i32 = 0;
for yi in y-r as isize..=y+r as isize {
let src_plane;
let src_w;
let src_h;
// decide if we're vertically inside or outside the stripe
if yi >= stripe_y && yi < stripe_y + stripe_h as isize {
src_plane = cdeffed;
src_w = (cdeffed_w as isize - x + r as isize) as usize;
src_h = cdeffed_h as isize;
let (src_plane, src_w, src_h) = if yi >= stripe_y && yi < stripe_y + stripe_h as isize {
(cdeffed,
(cdeffed_w as isize - x + r as isize) as usize,
cdeffed_h as isize)
} else {
src_plane = backing;
src_w = (backing_w as isize - x + r as isize) as usize;
src_h = backing_h as isize;
}
(backing,
(backing_w as isize - x + r as isize) as usize,
backing_h as isize)
};
// clamp vertically to storage at top and passed-in height at bottom
let cropped_y = clamp(yi, -src_plane.y, src_h - 1);
// clamp vertically to stripe limits
......@@ -172,7 +168,7 @@ fn sgrproj_box_sum_slow<T: Pixel>(a: &mut i32, b: &mut i32,
sum += c;
}
// run accumulation to right of frame (if any)
for _xi in right..2*r+1 {
for _xi in right..=2*r {
let c = i32::cast_from(p[src_w - 1]);
ssq += c*c;
sum += c;
......@@ -229,17 +225,14 @@ fn sgrproj_box_sum_fastx_r1<T: Pixel>(a: &mut i32, b: &mut i32,
let mut ssq:i32 = 0;
let mut sum:i32 = 0;
for yi in y-1..=y+1 {
let src_plane;
let src_h;
// decide if we're vertically inside or outside the stripe
if yi >= stripe_y && yi < stripe_y + stripe_h as isize {
src_plane = cdeffed;
src_h = cdeffed_h as isize;
let (src_plane, src_h) = if yi >= stripe_y && yi < stripe_y + stripe_h as isize {
(cdeffed,
cdeffed_h as isize)
} else {
src_plane = backing;
src_h = backing_h as isize;
}
(backing,
backing_h as isize)
};
// clamp vertically to storage addressing limit
let cropped_y = clamp(yi, -src_plane.y, src_h - 1);
// clamp vertically to stripe limits
......@@ -264,17 +257,14 @@ fn sgrproj_box_sum_fastx_r2<T: Pixel>(a: &mut i32, b: &mut i32,
let mut ssq:i32 = 0;
let mut sum:i32 = 0;
for yi in y - 2..=y + 2 {
let src_plane;
let src_h;
// decide if we're vertically inside or outside the stripe
if yi >= stripe_y && yi < stripe_y + stripe_h as isize {
src_plane = cdeffed;
src_h = cdeffed_h as isize;
let (src_plane, src_h) = if yi >= stripe_y && yi < stripe_y + stripe_h as isize {
(cdeffed,
cdeffed_h as isize)
} else {
src_plane = backing;
src_h = backing_h as isize;
}
(backing,
backing_h as isize)
};
// clamp vertically to storage addressing limit
let cropped_y = clamp(yi, -src_plane.y, src_h as isize - 1);
// clamp vertically to stripe limits
......
......@@ -1287,7 +1287,7 @@ pub fn rdo_loop_decision<T: Pixel>(sbo: &SuperBlockOffset, fi: &FrameInvariants<
&cdef_plane.slice(&PlaneOffset{x: 0, y: 0}),
cmp::min(cdef_plane.cfg.width, fi.width - ipo.x as usize),
cmp::min(cdef_plane.cfg.height, fi.height - ipo.y as usize));
let current_lrf = RestorationFilter::Sgrproj{set: set, xqd: [xqd0, xqd1]};
let current_lrf = RestorationFilter::Sgrproj{set, xqd: [xqd0, xqd1]};
if let RestorationFilter::Sgrproj{set, xqd} = current_lrf {
// At present, this is a gross simplification
sgrproj_stripe_filter(set, xqd, fi,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment