Commit 77cfa28b authored by Romain Vimont's avatar Romain Vimont Committed by Thomas Daede
Browse files

Remove unused members from RestorationPlane

They have been implemented in TileRestorationPlane instead.
parent af1f88d9
......@@ -11,7 +11,6 @@
use crate::encoder::Frame;
use crate::encoder::FrameInvariants;
use crate::context::SuperBlockOffset;
use crate::context::PLANES;
use crate::context::MAX_SB_SIZE;
use crate::plane::Plane;
......@@ -839,8 +838,6 @@ pub struct RestorationPlaneConfig {
#[derive(Clone, Debug)]
pub struct RestorationPlane {
pub cfg: RestorationPlaneConfig,
pub wiener_ref: [[i8; 3]; 2],
pub sgrproj_ref: [i8; 2],
pub units: FrameRestorationUnits,
}
......@@ -863,31 +860,10 @@ impl RestorationPlane {
cols,
rows,
},
wiener_ref: [WIENER_TAPS_MID; 2],
sgrproj_ref: SGRPROJ_XQD_MID,
units: FrameRestorationUnits::new(cols, rows),
}
}
fn restoration_unit_index(&self, sbo: SuperBlockOffset) -> Option<(usize, usize)> {
// there is 1 restoration unit for (1 << sb_shift) super-blocks
let mask = (1 << self.cfg.sb_shift) - 1;
let first_sbo = sbo.x & mask == 0 && sbo.y & mask == 0;
if first_sbo {
let x = sbo.x >> self.cfg.sb_shift;
let y = sbo.y >> self.cfg.sb_shift;
if x < self.cfg.cols && y < self.cfg.rows {
Some((x, y))
} else {
// this super-block will share the "stretched" restoration unit from its neighbours
None
}
} else {
// the restoration unit is ignored for others super-blocks
None
}
}
// Stripes are always 64 pixels high in a non-subsampled
// frame, and decimated from 64 pixels in chroma. When
// filtering, they are not co-located on Y with superblocks.
......@@ -898,19 +874,6 @@ impl RestorationPlane {
)
}
pub fn restoration_unit(&self, sbo: SuperBlockOffset) -> Option<&RestorationUnit> {
self.restoration_unit_index(sbo).map(|(x, y)| &self.units[y][x])
}
pub fn restoration_unit_mut(&mut self, sbo: SuperBlockOffset) -> Option<&mut RestorationUnit> {
// cannot use map() due to lifetime constraints
if let Some((x, y)) = self.restoration_unit_index(sbo) {
Some(&mut self.units[y][x])
} else {
None
}
}
pub fn restoration_unit_by_stripe(&self, stripenum: usize, rux: usize) -> &RestorationUnit {
let (x, y) = self.restoration_unit_index_by_stripe(stripenum, rux);
&self.units[y][x]
......@@ -956,14 +919,6 @@ impl RestorationState {
}
}
pub fn has_restoration_unit(&self, sbo: SuperBlockOffset) -> bool {
let is_some = self.planes[0].restoration_unit(sbo).is_some();
debug_assert_eq!(is_some, self.planes[1].restoration_unit(sbo).is_some());
debug_assert_eq!(is_some, self.planes[2].restoration_unit(sbo).is_some());
is_some
}
pub fn lrf_filter_frame<T: Pixel>(&mut self, out: &mut Frame<T>, pre_cdef: &Frame<T>,
fi: &FrameInvariants<T>) {
let cdeffed = out.clone();
......
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