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
3448ddc3
Unverified
Commit
3448ddc3
authored
6 years ago
by
Frank Bossen
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Avoid searching out of bounds motion vectors in ME (#559)
parent
c7a5ce2c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/me.rs
+20
-4
20 additions, 4 deletions
src/me.rs
with
20 additions
and
4 deletions
src/me.rs
+
20
−
4
View file @
3448ddc3
...
...
@@ -9,6 +9,7 @@
use
context
::
BlockOffset
;
use
context
::
BLOCK_TO_PLANE_SHIFT
;
use
context
::
MI_SIZE
;
use
partition
::
*
;
use
plane
::
*
;
use
FrameInvariants
;
...
...
@@ -51,10 +52,18 @@ pub fn motion_estimation(
let
range
=
32
as
isize
;
let
blk_w
=
bsize
.width
();
let
blk_h
=
bsize
.height
();
let
x_lo
=
po
.x
-
range
;
let
x_hi
=
po
.x
+
range
;
let
y_lo
=
po
.y
-
range
;
let
y_hi
=
po
.y
+
range
;
let
border_w
=
128
+
blk_w
as
isize
*
8
;
let
border_h
=
128
+
blk_h
as
isize
*
8
;
let
cols
=
(
rec
.frame.planes
[
0
]
.cfg.width
+
MI_SIZE
-
1
)
/
MI_SIZE
;
let
rows
=
(
rec
.frame.planes
[
0
]
.cfg.height
+
MI_SIZE
-
1
)
/
MI_SIZE
;
let
x_min
=
-
(
bo
.x
as
isize
)
*
(
8
*
MI_SIZE
)
as
isize
-
border_w
;
let
x_max
=
(
cols
-
bo
.x
-
blk_w
/
MI_SIZE
)
as
isize
*
(
8
*
MI_SIZE
)
as
isize
+
border_w
;
let
y_min
=
-
(
bo
.y
as
isize
)
*
(
8
*
MI_SIZE
)
as
isize
-
border_h
;
let
y_max
=
(
rows
-
bo
.y
-
blk_h
/
MI_SIZE
)
as
isize
*
(
8
*
MI_SIZE
)
as
isize
+
border_h
;
let
x_lo
=
po
.x
-
(
range
.max
(
x_min
/
8
));
let
x_hi
=
po
.x
+
(
range
.min
(
x_max
/
8
));
let
y_lo
=
po
.y
-
(
range
.max
(
y_min
/
8
));
let
y_hi
=
po
.y
+
(
range
.min
(
y_max
/
8
));
let
mut
lowest_sad
=
128
*
128
*
4096
as
u32
;
let
mut
best_mv
=
MotionVector
{
row
:
0
,
col
:
0
};
...
...
@@ -98,6 +107,13 @@ pub fn motion_estimation(
col
:
center_mv_h
.col
+
step
*
(
j
as
i16
-
1
)
};
if
(
cand_mv
.col
as
isize
)
<
x_min
||
(
cand_mv
.col
as
isize
)
>
x_max
{
continue
;
}
if
(
cand_mv
.row
as
isize
)
<
y_min
||
(
cand_mv
.row
as
isize
)
>
y_max
{
continue
;
}
{
let
tmp_slice
=
&
mut
tmp_plane
.mut_slice
(
&
PlaneOffset
{
x
:
0
,
y
:
0
});
...
...
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