Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rav1e
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timothy B. Terriberry
rav1e
Commits
aab9c3ed
Commit
aab9c3ed
authored
6 years ago
by
Luca Barbato
Committed by
Luca Barbato
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
get_sad does not need mutable PlaneSlices anymore
parent
eb18ea7a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benches/me.rs
+3
-3
3 additions, 3 deletions
benches/me.rs
src/me.rs
+7
-7
7 additions, 7 deletions
src/me.rs
with
10 additions
and
10 deletions
benches/me.rs
+
3
−
3
View file @
aab9c3ed
...
...
@@ -41,11 +41,11 @@ fn bench_get_sad(b: &mut Bencher, bs: &BlockSize) {
let
rec_plane
=
new_plane
(
&
mut
ra
,
w
,
h
);
let
po
=
PlaneOffset
{
x
:
0
,
y
:
0
};
let
mut
plane_org
=
input_plane
.slice
(
&
po
);
let
mut
plane_ref
=
rec_plane
.slice
(
&
po
);
let
plane_org
=
input_plane
.slice
(
&
po
);
let
plane_ref
=
rec_plane
.slice
(
&
po
);
b
.iter
(||
{
let
_
=
me
::
get_sad
(
&
mut
plane_org
,
&
mut
plane_ref
,
bsw
,
bsh
);
let
_
=
me
::
get_sad
(
&
plane_org
,
&
plane_ref
,
bsw
,
bsh
);
})
}
...
...
This diff is collapsed.
Click to expand it.
src/me.rs
+
7
−
7
View file @
aab9c3ed
...
...
@@ -17,7 +17,7 @@ use FrameState;
#[inline(always)]
pub
fn
get_sad
(
plane_org
:
&
mut
PlaneSlice
,
plane_ref
:
&
mut
PlaneSlice
,
blk_h
:
usize
,
plane_org
:
&
PlaneSlice
,
plane_ref
:
&
PlaneSlice
,
blk_h
:
usize
,
blk_w
:
usize
)
->
u32
{
let
mut
sum
=
0
as
u32
;
...
...
@@ -64,10 +64,10 @@ pub fn motion_estimation(
for
y
in
(
y_lo
..
y_hi
)
.step_by
(
2
)
{
for
x
in
(
x_lo
..
x_hi
)
.step_by
(
2
)
{
let
mut
plane_org
=
fs
.input.planes
[
0
]
.slice
(
&
po
);
let
mut
plane_ref
=
rec
.frame.planes
[
0
]
.slice
(
&
PlaneOffset
{
x
,
y
});
let
plane_org
=
fs
.input.planes
[
0
]
.slice
(
&
po
);
let
plane_ref
=
rec
.frame.planes
[
0
]
.slice
(
&
PlaneOffset
{
x
,
y
});
let
sad
=
get_sad
(
&
mut
plane_org
,
&
mut
plane_ref
,
blk_h
,
blk_w
);
let
sad
=
get_sad
(
&
plane_org
,
&
plane_ref
,
blk_h
,
blk_w
);
if
sad
<
lowest_sad
{
lowest_sad
=
sad
;
...
...
@@ -117,10 +117,10 @@ pub fn motion_estimation(
);
}
let
mut
plane_org
=
fs
.input.planes
[
0
]
.slice
(
&
po
);
let
mut
plane_ref
=
tmp_plane
.slice
(
&
PlaneOffset
{
x
:
0
,
y
:
0
});
let
plane_org
=
fs
.input.planes
[
0
]
.slice
(
&
po
);
let
plane_ref
=
tmp_plane
.slice
(
&
PlaneOffset
{
x
:
0
,
y
:
0
});
let
sad
=
get_sad
(
&
mut
plane_org
,
&
mut
plane_ref
,
blk_h
,
blk_w
);
let
sad
=
get_sad
(
&
plane_org
,
&
plane_ref
,
blk_h
,
blk_w
);
if
sad
<
lowest_sad
{
lowest_sad
=
sad
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment