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
dadde1df
Commit
dadde1df
authored
6 years ago
by
Luca Barbato
Committed by
Luca Barbato
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a benchmark for get_sad
parent
8f2e4a6f
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/bench.rs
+3
-1
3 additions, 1 deletion
benches/bench.rs
benches/me.rs
+82
-0
82 additions, 0 deletions
benches/me.rs
with
85 additions
and
1 deletion
benches/bench.rs
+
3
−
1
View file @
dadde1df
...
...
@@ -13,6 +13,7 @@ extern crate rand;
extern
crate
rav1e
;
mod
predict
;
mod
me
;
use
criterion
::
*
;
use
rav1e
::
cdef
::
cdef_filter_frame
;
...
...
@@ -138,9 +139,10 @@ criterion_group!(intra_prediction, predict::pred_bench,);
criterion_group!
(
cfl
,
cfl_rdo
);
criterion_group!
(
cdef
,
cdef_frame
);
criterion_group!
(
write_block
,
write_b
);
criterion_group!
(
me
,
me
::
get_sad
);
#[cfg(feature
=
"comparative_bench"
)]
criterion_main!
(
comparative
::
intra_prediction
);
#[cfg(not(feature
=
"comparative_bench"
))]
criterion_main!
(
write_block
,
intra_prediction
,
cdef
,
cfl
);
criterion_main!
(
write_block
,
intra_prediction
,
cdef
,
cfl
,
me
);
This diff is collapsed.
Click to expand it.
benches/me.rs
0 → 100644
+
82
−
0
View file @
dadde1df
// Copyright (c) 2017-2018, The rav1e contributors. All rights reserved
//
// This source code is subject to the terms of the BSD 2 Clause License and
// the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
// was not distributed with this source code in the LICENSE file, you can
// obtain it at www.aomedia.org/license/software. If the Alliance for Open
// Media Patent License 1.0 was not distributed with this source code in the
// PATENTS file, you can obtain it at www.aomedia.org/license/patent.
use
criterion
::
*
;
use
partition
::
*
;
use
plane
::
*
;
use
rand
::{
ChaChaRng
,
Rng
,
SeedableRng
};
use
rav1e
::
me
;
fn
fill_plane
(
ra
:
&
mut
ChaChaRng
,
plane
:
&
mut
Plane
)
{
let
stride
=
plane
.cfg.stride
;
for
row
in
plane
.data
.chunks_mut
(
stride
)
{
for
mut
pixel
in
row
{
let
v
:
u8
=
ra
.gen
();
*
pixel
=
v
as
u16
;
}
}
}
fn
new_plane
(
ra
:
&
mut
ChaChaRng
,
width
:
usize
,
height
:
usize
)
->
Plane
{
let
mut
p
=
Plane
::
new
(
width
,
height
,
0
,
0
,
128
+
8
,
128
+
8
);
fill_plane
(
ra
,
&
mut
p
);
p
}
fn
bench_get_sad
(
b
:
&
mut
Bencher
,
bs
:
&
BlockSize
)
{
let
mut
ra
=
ChaChaRng
::
from_seed
([
0
;
32
]);
let
bsw
=
bs
.width
();
let
bsh
=
bs
.height
();
let
w
=
640
;
let
h
=
480
;
let
input_plane
=
new_plane
(
&
mut
ra
,
w
,
h
);
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
);
b
.iter
(||
{
let
_
=
me
::
get_sad
(
&
mut
plane_org
,
&
mut
plane_ref
,
bsw
,
bsh
);
plane_org
.y
=
0
;
plane_ref
.y
=
0
;
})
}
pub
fn
get_sad
(
c
:
&
mut
Criterion
)
{
use
partition
::
BlockSize
::
*
;
let
blocks
=
vec!
[
BLOCK_4X4
,
BLOCK_4X8
,
BLOCK_8X4
,
BLOCK_8X8
,
BLOCK_8X16
,
BLOCK_16X8
,
BLOCK_16X16
,
BLOCK_16X32
,
BLOCK_32X16
,
BLOCK_32X32
,
BLOCK_32X64
,
BLOCK_64X32
,
BLOCK_64X64
,
BLOCK_64X128
,
BLOCK_128X64
,
BLOCK_128X128
,
BLOCK_4X16
,
BLOCK_16X4
,
BLOCK_8X32
,
BLOCK_32X8
,
BLOCK_16X64
,
BLOCK_64X16
,
];
c
.bench_function_over_inputs
(
"get_sad"
,
bench_get_sad
,
blocks
);
}
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