Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
50ca3c83
Commit
50ca3c83
authored
11 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Cleaning up vp9_refining_search_8p_c() function."
parents
6f8b3039
55d02302
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vp9/encoder/vp9_mcomp.c
+28
-40
vp9/encoder/vp9_mcomp.c
vp9/encoder/vp9_mcomp.h
+1
-1
vp9/encoder/vp9_mcomp.h
with
29 additions
and
41 deletions
vp9/encoder/vp9_mcomp.c
+
28
−
40
View file @
50ca3c83
...
...
@@ -1903,65 +1903,54 @@ int vp9_refining_search_sadx4(MACROBLOCK *x,
return
INT_MAX
;
}
/* This function is called when we do joint motion search in comp_inter_inter
* mode.
*/
int
vp9_refining_search_8p_c
(
MACROBLOCK
*
x
,
// This function is called when we do joint motion search in comp_inter_inter
// mode.
int
vp9_refining_search_8p_c
(
const
MACROBLOCK
*
x
,
MV
*
ref_mv
,
int
error_per_bit
,
int
search_range
,
vp9_variance_fn_ptr_t
*
fn_ptr
,
int
*
mvjcost
,
int
*
mvcost
[
2
],
const
MV
*
center_mv
,
const
uint8_t
*
second_pred
,
int
w
,
int
h
)
{
const
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
MV
neighbors
[
8
]
=
{{
-
1
,
0
},
{
0
,
-
1
},
{
0
,
1
},
{
1
,
0
},
{
-
1
,
-
1
},
{
1
,
-
1
},
{
-
1
,
1
},
{
1
,
1
}};
const
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
const
MV
neighbors
[
8
]
=
{{
-
1
,
0
},
{
0
,
-
1
},
{
0
,
1
},
{
1
,
0
},
{
-
1
,
-
1
},
{
1
,
-
1
},
{
-
1
,
1
},
{
1
,
1
}};
int
i
,
j
;
int
this_row_offset
,
this_col_offset
;
int
what_stride
=
x
->
plane
[
0
].
src
.
stride
;
int
in_what_stride
=
xd
->
plane
[
0
].
pre
[
0
].
stride
;
uint8_t
*
what
=
x
->
plane
[
0
].
src
.
buf
;
uint8_t
*
best_address
=
xd
->
plane
[
0
].
pre
[
0
].
buf
+
(
ref_mv
->
row
*
xd
->
plane
[
0
].
pre
[
0
].
stride
)
+
ref_mv
->
col
;
uint8_t
*
check_here
;
const
uint8_t
*
what
=
x
->
plane
[
0
].
src
.
buf
;
const
int
what_stride
=
x
->
plane
[
0
].
src
.
stride
;
const
uint8_t
*
in_what
=
xd
->
plane
[
0
].
pre
[
0
].
buf
;
const
int
in_what_stride
=
xd
->
plane
[
0
].
pre
[
0
].
stride
;
const
uint8_t
*
best_address
=
&
in_what
[
ref_mv
->
row
*
in_what_stride
+
ref_mv
->
col
];
unsigned
int
thissad
;
MV
this_mv
;
unsigned
int
bestsad
=
INT_MAX
;
MV
fcenter_mv
;
const
MV
fcenter_mv
=
{
center_mv
->
row
>>
3
,
center_mv
->
col
>>
3
};
int
*
mvjsadcost
=
x
->
nmvjointsadcost
;
const
int
*
mvjsadcost
=
x
->
nmvjointsadcost
;
int
*
mvsadcost
[
2
]
=
{
x
->
nmvsadcost
[
0
],
x
->
nmvsadcost
[
1
]};
fcenter_mv
.
row
=
center_mv
->
row
>>
3
;
fcenter_mv
.
col
=
center_mv
->
col
>>
3
;
/* Get compound pred by averaging two pred blocks. */
bestsad
=
fn_ptr
->
sdaf
(
what
,
what_stride
,
best_address
,
in_what_stride
,
second_pred
,
0x7fffffff
)
+
mvsad_err_cost
(
ref_mv
,
&
fcenter_mv
,
mvjsadcost
,
mvsadcost
,
error_per_bit
);
unsigned
int
bestsad
=
fn_ptr
->
sdaf
(
what
,
what_stride
,
best_address
,
in_what_stride
,
second_pred
,
0x7fffffff
)
+
mvsad_err_cost
(
ref_mv
,
&
fcenter_mv
,
mvjsadcost
,
mvsadcost
,
error_per_bit
);
for
(
i
=
0
;
i
<
search_range
;
i
++
)
{
for
(
i
=
0
;
i
<
search_range
;
++
i
)
{
int
best_site
=
-
1
;
for
(
j
=
0
;
j
<
8
;
j
++
)
{
this_row
_offset
=
ref_mv
->
row
+
neighbors
[
j
].
row
;
this_col
_offset
=
ref_mv
->
col
+
neighbors
[
j
].
col
;
this_
mv
.
row
=
ref_mv
->
row
+
neighbors
[
j
].
row
;
this_
mv
.
col
=
ref_mv
->
col
+
neighbors
[
j
].
col
;
if
((
this_col
_offset
>
x
->
mv_col_min
)
&&
(
this_col
_offset
<
x
->
mv_col_max
)
&&
(
this_row
_offset
>
x
->
mv_row_min
)
&&
(
this_row
_offset
<
x
->
mv_row_max
))
{
c
heck_here
=
(
neighbors
[
j
]
.
row
)
*
in_what_stride
+
neighbors
[
j
].
col
+
best_address
;
if
((
this_
mv
.
col
>
x
->
mv_col_min
)
&&
(
this_
mv
.
col
<
x
->
mv_col_max
)
&&
(
this_
mv
.
row
>
x
->
mv_row_min
)
&&
(
this_
mv
.
row
<
x
->
mv_row_max
))
{
c
onst
uint8_t
*
check_here
=
&
in_what
[
this_mv
.
row
*
in_what_stride
+
this_mv
.
col
]
;
/* Get compound block and use it to calculate SAD. */
thissad
=
fn_ptr
->
sdaf
(
what
,
what_stride
,
check_here
,
in_what_stride
,
second_pred
,
bestsad
);
if
(
thissad
<
bestsad
)
{
this_mv
.
row
=
this_row_offset
;
this_mv
.
col
=
this_col_offset
;
thissad
+=
mvsad_err_cost
(
&
this_mv
,
&
fcenter_mv
,
mvjsadcost
,
mvsadcost
,
error_per_bit
);
if
(
thissad
<
bestsad
)
{
...
...
@@ -1977,8 +1966,7 @@ int vp9_refining_search_8p_c(MACROBLOCK *x,
}
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
;
best_address
=
&
in_what
[
ref_mv
->
row
*
in_what_stride
+
ref_mv
->
col
];
}
}
...
...
This diff is collapsed.
Click to expand it.
vp9/encoder/vp9_mcomp.h
+
1
−
1
View file @
50ca3c83
...
...
@@ -123,7 +123,7 @@ typedef int (*vp9_diamond_search_fn_t)(MACROBLOCK *x,
int
*
mvjcost
,
int
*
mvcost
[
2
],
const
MV
*
center_mv
);
int
vp9_refining_search_8p_c
(
MACROBLOCK
*
x
,
int
vp9_refining_search_8p_c
(
const
MACROBLOCK
*
x
,
MV
*
ref_mv
,
int
error_per_bit
,
int
search_range
,
vp9_variance_fn_ptr_t
*
fn_ptr
,
int
*
mvjcost
,
int
*
mvcost
[
2
],
...
...
This diff is collapsed.
Click to expand it.
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!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets