Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
6ed81fa5
Commit
6ed81fa5
authored
May 12, 2011
by
Yunqing Wang
Committed by
Code Review
May 12, 2011
Browse files
Merge "Modification and issue fix in full-pixel refining search"
parents
ba6f60db
b4da1f83
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp8/encoder/mcomp.c
View file @
6ed81fa5
...
...
@@ -1624,7 +1624,6 @@ int vp8_full_search_sadx8(MACROBLOCK *x, BLOCK *b, BLOCKD *d, MV *ref_mv, int er
int
vp8_refining_search_sad
(
MACROBLOCK
*
x
,
BLOCK
*
b
,
BLOCKD
*
d
,
MV
*
ref_mv
,
int
error_per_bit
,
int
search_range
,
vp8_variance_fn_ptr_t
*
fn_ptr
,
int
*
mvcost
[
2
],
MV
*
center_mv
)
{
MV
neighbors
[
4
]
=
{{
-
1
,
0
},
{
0
,
-
1
},
{
0
,
1
},
{
1
,
0
}};
MV
tempmv
;
int
i
,
j
;
short
this_row_offset
,
this_col_offset
;
...
...
@@ -1647,8 +1646,7 @@ int vp8_refining_search_sad(MACROBLOCK *x, BLOCK *b, BLOCKD *d, MV *ref_mv, int
for
(
i
=
0
;
i
<
search_range
;
i
++
)
{
tempmv
.
row
=
ref_mv
->
row
;
tempmv
.
col
=
ref_mv
->
col
;
int
best_site
=
-
1
;
for
(
j
=
0
;
j
<
4
;
j
++
)
{
...
...
@@ -1670,16 +1668,20 @@ int vp8_refining_search_sad(MACROBLOCK *x, BLOCK *b, BLOCKD *d, MV *ref_mv, int
if
(
thissad
<
bestsad
)
{
bestsad
=
thissad
;
ref_mv
->
row
=
this_row_offset
;
ref_mv
->
col
=
this_col_offset
;
best_address
=
check_here
;
best_site
=
j
;
}
}
}
}
if
(
tempmv
.
row
==
ref_mv
->
row
&&
tempmv
.
col
==
ref_mv
->
col
)
if
(
best_site
==
-
1
)
break
;
else
{
ref_mv
->
row
+=
neighbors
[
best_site
].
row
;
ref_mv
->
col
+=
neighbors
[
best_site
].
col
;
best_address
+=
(
neighbors
[
best_site
].
row
)
*
in_what_stride
+
neighbors
[
best_site
].
col
;
}
}
this_mv
.
row
=
ref_mv
->
row
<<
3
;
...
...
@@ -1695,7 +1697,6 @@ int vp8_refining_search_sad(MACROBLOCK *x, BLOCK *b, BLOCKD *d, MV *ref_mv, int
int
vp8_refining_search_sadx4
(
MACROBLOCK
*
x
,
BLOCK
*
b
,
BLOCKD
*
d
,
MV
*
ref_mv
,
int
error_per_bit
,
int
search_range
,
vp8_variance_fn_ptr_t
*
fn_ptr
,
int
*
mvcost
[
2
],
MV
*
center_mv
)
{
MV
neighbors
[
4
]
=
{{
-
1
,
0
},
{
0
,
-
1
},
{
0
,
1
},
{
1
,
0
}};
MV
tempmv
;
int
i
,
j
;
short
this_row_offset
,
this_col_offset
;
...
...
@@ -1718,11 +1719,9 @@ int vp8_refining_search_sadx4(MACROBLOCK *x, BLOCK *b, BLOCKD *d, MV *ref_mv, in
for
(
i
=
0
;
i
<
search_range
;
i
++
)
{
int
best_site
=
-
1
;
int
all_in
=
1
;
tempmv
.
row
=
ref_mv
->
row
;
tempmv
.
col
=
ref_mv
->
col
;
all_in
&=
((
ref_mv
->
row
-
1
)
>
x
->
mv_row_min
);
all_in
&=
((
ref_mv
->
row
+
1
)
<
x
->
mv_row_max
);
all_in
&=
((
ref_mv
->
col
-
1
)
>
x
->
mv_col_min
);
...
...
@@ -1750,9 +1749,7 @@ int vp8_refining_search_sadx4(MACROBLOCK *x, BLOCK *b, BLOCKD *d, MV *ref_mv, in
if
(
sad_array
[
j
]
<
bestsad
)
{
bestsad
=
sad_array
[
j
];
ref_mv
->
row
=
this_mv
.
row
;
ref_mv
->
col
=
this_mv
.
col
;
best_address
=
block_offset
[
j
];
best_site
=
j
;
}
}
}
...
...
@@ -1779,17 +1776,21 @@ int vp8_refining_search_sadx4(MACROBLOCK *x, BLOCK *b, BLOCKD *d, MV *ref_mv, in
if
(
thissad
<
bestsad
)
{
bestsad
=
thissad
;
ref_mv
->
row
=
this_row_offset
;
ref_mv
->
col
=
this_col_offset
;
best_address
=
check_here
;
best_site
=
j
;
}
}
}
}
}
if
(
tempmv
.
row
==
ref_mv
->
row
&&
tempmv
.
col
==
ref_mv
->
col
)
break
;
if
(
best_site
==
-
1
)
break
;
else
{
ref_mv
->
row
+=
neighbors
[
best_site
].
row
;
ref_mv
->
col
+=
neighbors
[
best_site
].
col
;
best_address
+=
(
neighbors
[
best_site
].
row
)
*
in_what_stride
+
neighbors
[
best_site
].
col
;
}
}
this_mv
.
row
=
ref_mv
->
row
<<
3
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment