Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
rav1e
Commits
77cfa28b
Commit
77cfa28b
authored
Apr 18, 2019
by
Romain Vimont
Committed by
Thomas Daede
Apr 19, 2019
Browse files
Remove unused members from RestorationPlane
They have been implemented in TileRestorationPlane instead.
parent
af1f88d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lrf.rs
View file @
77cfa28b
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment