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
Container Registry
Model registry
Operate
Environments
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
Xiph.Org
rav1e
Commits
4273e67d
Commit
4273e67d
authored
6 years ago
by
David Michael Barr
Browse files
Options
Downloads
Patches
Plain Diff
Remove MAX_ITER from prediction benchmarks
parent
b44e5640
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benches/comparative/predict.rs
+20
-28
20 additions, 28 deletions
benches/comparative/predict.rs
benches/predict.rs
+43
-75
43 additions, 75 deletions
benches/predict.rs
with
63 additions
and
103 deletions
benches/comparative/predict.rs
+
20
−
28
View file @
4273e67d
...
...
@@ -70,20 +70,16 @@ fn predict_intra_4x4_aom(
let
mut
rng
=
ChaChaRng
::
from_seed
([
0
;
32
]);
let
(
mut
block
,
above_context
,
left_context
)
=
generate_block
(
&
mut
rng
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
unsafe
{
predictor
(
block
.as_mut_ptr
(),
BLOCK_SIZE
.width
()
as
libc
::
ptrdiff_t
,
4
,
4
,
above_context
.as_ptr
(),
left_context
.as_ptr
(),
8
);
}
}
b
.iter
(||
unsafe
{
predictor
(
block
.as_mut_ptr
(),
BLOCK_SIZE
.width
()
as
libc
::
ptrdiff_t
,
4
,
4
,
above_context
.as_ptr
(),
left_context
.as_ptr
(),
8
);
})
}
...
...
@@ -190,19 +186,15 @@ pub fn intra_cfl_4x4_aom(b: &mut Bencher) {
let
ac
:
Vec
<
i16
>
=
(
0
..
(
32
*
32
))
.map
(|
_
|
rng
.gen
())
.collect
();
let
alpha
=
-
1
as
i16
;
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
unsafe
{
cfl_predict_hbd_c
(
ac
.as_ptr
(),
block
.as_mut_ptr
(),
BLOCK_SIZE
.width
()
as
libc
::
ptrdiff_t
,
alpha
as
libc
::
c_int
,
8
,
4
,
4
);
}
}
b
.iter
(||
unsafe
{
cfl_predict_hbd_c
(
ac
.as_ptr
(),
block
.as_mut_ptr
(),
BLOCK_SIZE
.width
()
as
libc
::
ptrdiff_t
,
alpha
as
libc
::
c_int
,
8
,
4
,
4
);
})
}
This diff is collapsed.
Click to expand it.
benches/predict.rs
+
43
−
75
View file @
4273e67d
...
...
@@ -12,7 +12,6 @@ use rand::{ChaChaRng, Rng, SeedableRng};
use
rav1e
::
partition
::
BlockSize
;
use
rav1e
::
predict
::{
Block4x4
,
Intra
};
pub
const
MAX_ITER
:
usize
=
50000
;
pub
const
BLOCK_SIZE
:
BlockSize
=
BlockSize
::
BLOCK_32X32
;
pub
fn
generate_block
(
rng
:
&
mut
ChaChaRng
)
->
(
Vec
<
u16
>
,
Vec
<
u16
>
,
Vec
<
u16
>
)
{
...
...
@@ -54,29 +53,16 @@ pub fn intra_dc_4x4(b: &mut Bencher) {
let
(
mut
block
,
above
,
left
)
=
generate_block
(
&
mut
ra
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_dc
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
}
Block4x4
::
pred_dc
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]);
})
}
pub
fn
intra_dc_128_4x4_u8
(
b
:
&
mut
Bencher
)
{
let
mut
ra
=
ChaChaRng
::
from_seed
([
0
;
32
]);
let
(
mut
block
,
above
,
left
)
=
generate_block_u8
(
&
mut
ra
);
let
(
mut
block
,
_
above
,
_
left
)
=
generate_block_u8
(
&
mut
ra
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_dc_128
(
&
mut
block
,
BLOCK_SIZE
.width
(),
8
);
}
Block4x4
::
pred_dc_128
(
&
mut
block
,
BLOCK_SIZE
.width
(),
8
);
})
}
...
...
@@ -85,14 +71,12 @@ pub fn intra_dc_left_4x4(b: &mut Bencher) {
let
(
mut
block
,
above
,
left
)
=
generate_block
(
&
mut
ra
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_dc_left
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
}
Block4x4
::
pred_dc_left
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
})
}
...
...
@@ -101,14 +85,12 @@ pub fn intra_dc_top_4x4(b: &mut Bencher) {
let
(
mut
block
,
above
,
left
)
=
generate_block
(
&
mut
ra
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_dc_top
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
}
Block4x4
::
pred_dc_top
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
})
}
...
...
@@ -117,9 +99,7 @@ pub fn intra_h_4x4(b: &mut Bencher) {
let
(
mut
block
,
_above
,
left
)
=
generate_block
(
&
mut
rng
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_h
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
left
[
..
4
]);
}
Block4x4
::
pred_h
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
left
[
..
4
]);
})
}
...
...
@@ -128,9 +108,7 @@ pub fn intra_v_4x4(b: &mut Bencher) {
let
(
mut
block
,
above
,
_left
)
=
generate_block
(
&
mut
rng
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_v
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
]);
}
Block4x4
::
pred_v
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
]);
})
}
...
...
@@ -140,15 +118,13 @@ pub fn intra_paeth_4x4(b: &mut Bencher) {
let
above_left
=
unsafe
{
*
above
.as_ptr
()
.offset
(
-
1
)
};
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_paeth
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
],
above_left
);
}
Block4x4
::
pred_paeth
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
],
above_left
);
})
}
...
...
@@ -157,14 +133,12 @@ pub fn intra_smooth_4x4(b: &mut Bencher) {
let
(
mut
block
,
above
,
left
)
=
generate_block
(
&
mut
rng
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_smooth
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
}
Block4x4
::
pred_smooth
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
})
}
...
...
@@ -173,14 +147,12 @@ pub fn intra_smooth_h_4x4(b: &mut Bencher) {
let
(
mut
block
,
above
,
left
)
=
generate_block
(
&
mut
rng
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_smooth_h
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
}
Block4x4
::
pred_smooth_h
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
})
}
...
...
@@ -189,14 +161,12 @@ pub fn intra_smooth_v_4x4(b: &mut Bencher) {
let
(
mut
block
,
above
,
left
)
=
generate_block
(
&
mut
rng
);
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_smooth_v
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
}
Block4x4
::
pred_smooth_v
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
above
[
..
4
],
&
left
[
..
4
]
);
})
}
...
...
@@ -207,8 +177,6 @@ pub fn intra_cfl_4x4(b: &mut Bencher) {
let
alpha
=
-
1
as
i16
;
b
.iter
(||
{
for
_
in
0
..
MAX_ITER
{
Block4x4
::
pred_cfl
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
ac
,
alpha
,
8
);
}
Block4x4
::
pred_cfl
(
&
mut
block
,
BLOCK_SIZE
.width
(),
&
ac
,
alpha
,
8
);
})
}
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