Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
b27edc67
Commit
b27edc67
authored
Apr 18, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Apr 18, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Code cleanup inside findnearmv code." into experimental
parents
f0b065e9
19e97145
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
22 deletions
+8
-22
vp9/common/vp9_findnearmv.c
vp9/common/vp9_findnearmv.c
+2
-5
vp9/common/vp9_findnearmv.h
vp9/common/vp9_findnearmv.h
+6
-17
No files found.
vp9/common/vp9_findnearmv.c
View file @
b27edc67
...
...
@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <limits.h>
#include "vp9/common/vp9_findnearmv.h"
...
...
@@ -22,8 +21,7 @@ const uint8_t vp9_mbsplit_offset[4][16] = {
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
}
};
static
void
lower_mv_precision
(
int_mv
*
mv
,
int
usehp
)
{
static
void
lower_mv_precision
(
int_mv
*
mv
,
int
usehp
)
{
if
(
!
usehp
||
!
vp9_use_nmv_hp
(
&
mv
->
as_mv
))
{
if
(
mv
->
as_mv
.
row
&
1
)
mv
->
as_mv
.
row
+=
(
mv
->
as_mv
.
row
>
0
?
-
1
:
1
);
...
...
@@ -32,8 +30,7 @@ static void lower_mv_precision(int_mv *mv, int usehp)
}
}
vp9_prob
*
vp9_mv_ref_probs
(
VP9_COMMON
*
pc
,
vp9_prob
p
[
4
],
const
int
context
)
{
vp9_prob
*
vp9_mv_ref_probs
(
VP9_COMMON
*
pc
,
vp9_prob
p
[
4
],
int
context
)
{
p
[
0
]
=
pc
->
fc
.
vp9_mode_contexts
[
context
][
0
];
p
[
1
]
=
pc
->
fc
.
vp9_mode_contexts
[
context
][
1
];
p
[
2
]
=
pc
->
fc
.
vp9_mode_contexts
[
context
][
2
];
...
...
vp9/common/vp9_findnearmv.h
View file @
b27edc67
...
...
@@ -20,10 +20,9 @@
#define LEFT_TOP_MARGIN ((VP9BORDERINPIXELS - VP9_INTERP_EXTEND) << 3)
#define RIGHT_BOTTOM_MARGIN ((VP9BORDERINPIXELS - VP9_INTERP_EXTEND) << 3)
/* check a list of motion vectors by sad score using a number rows of pixels
* above and a number cols of pixels in the left to select the one with best
* score to use as ref motion vector
*/
// check a list of motion vectors by sad score using a number rows of pixels
// above and a number cols of pixels in the left to select the one with best
// score to use as ref motion vector
void
vp9_find_best_ref_mvs
(
MACROBLOCKD
*
xd
,
uint8_t
*
ref_y_buffer
,
int
ref_y_stride
,
...
...
@@ -49,29 +48,19 @@ static void clamp_mv(int_mv *mv,
int
mb_to_right_edge
,
int
mb_to_top_edge
,
int
mb_to_bottom_edge
)
{
mv
->
as_mv
.
col
=
(
mv
->
as_mv
.
col
<
mb_to_left_edge
)
?
mb_to_left_edge
:
mv
->
as_mv
.
col
;
mv
->
as_mv
.
col
=
(
mv
->
as_mv
.
col
>
mb_to_right_edge
)
?
mb_to_right_edge
:
mv
->
as_mv
.
col
;
mv
->
as_mv
.
row
=
(
mv
->
as_mv
.
row
<
mb_to_top_edge
)
?
mb_to_top_edge
:
mv
->
as_mv
.
row
;
mv
->
as_mv
.
row
=
(
mv
->
as_mv
.
row
>
mb_to_bottom_edge
)
?
mb_to_bottom_edge
:
mv
->
as_mv
.
row
;
mv
->
as_mv
.
col
=
clamp
(
mv
->
as_mv
.
col
,
mb_to_left_edge
,
mb_to_right_edge
);
mv
->
as_mv
.
row
=
clamp
(
mv
->
as_mv
.
row
,
mb_to_top_edge
,
mb_to_bottom_edge
);
}
static
int
clamp_mv2
(
int_mv
*
mv
,
const
MACROBLOCKD
*
xd
)
{
int_mv
tmp_mv
;
int
mv_clampped
=
0
;
tmp_mv
.
as_int
=
mv
->
as_int
;
clamp_mv
(
mv
,
xd
->
mb_to_left_edge
-
LEFT_TOP_MARGIN
,
xd
->
mb_to_right_edge
+
RIGHT_BOTTOM_MARGIN
,
xd
->
mb_to_top_edge
-
LEFT_TOP_MARGIN
,
xd
->
mb_to_bottom_edge
+
RIGHT_BOTTOM_MARGIN
);
if
(
tmp_mv
.
as_int
!=
mv
->
as_int
)
mv_clampped
=
1
;
return
mv_clampped
;
return
tmp_mv
.
as_int
!=
mv
->
as_int
;
}
static
int
check_mv_bounds
(
int_mv
*
mv
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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