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
Guillaume Martres
aom-rav1e
Commits
c90cd4d5
Commit
c90cd4d5
authored
Jun 12, 2014
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Jun 12, 2014
Browse files
Merge "Moving full_pixel_search() to vp9_mcomp.c."
parents
ab449cd9
442cbf56
Changes
5
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_mcomp.c
View file @
c90cd4d5
...
...
@@ -1593,3 +1593,49 @@ int vp9_refining_search_8p_c(const MACROBLOCK *x,
}
return
best_sad
;
}
int
vp9_full_pixel_search
(
VP9_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
,
MV
*
mvp_full
,
int
step_param
,
int
error_per_bit
,
const
MV
*
ref_mv
,
MV
*
tmp_mv
,
int
var_max
,
int
rd
)
{
const
SPEED_FEATURES
*
const
sf
=
&
cpi
->
sf
;
const
SEARCH_METHODS
method
=
sf
->
search_method
;
vp9_variance_fn_ptr_t
*
fn_ptr
=
&
cpi
->
fn_ptr
[
bsize
];
int
var
=
0
;
switch
(
method
)
{
case
FAST_DIAMOND
:
var
=
vp9_fast_dia_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
0
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
FAST_HEX
:
var
=
vp9_fast_hex_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
0
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
HEX
:
var
=
vp9_hex_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
1
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
SQUARE
:
var
=
vp9_square_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
1
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
BIGDIA
:
var
=
vp9_bigdia_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
1
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
NSTEP
:
var
=
vp9_full_pixel_diamond
(
cpi
,
x
,
mvp_full
,
step_param
,
error_per_bit
,
(
sf
->
max_step_search_steps
-
1
)
-
step_param
,
1
,
fn_ptr
,
ref_mv
,
tmp_mv
);
break
;
default:
assert
(
!
"Invalid search method."
);
}
if
(
method
!=
NSTEP
&&
rd
&&
var
<
var_max
)
var
=
vp9_get_mvpred_var
(
x
,
tmp_mv
,
ref_mv
,
fn_ptr
,
1
);
return
var
;
}
vp9/encoder/vp9_mcomp.h
View file @
c90cd4d5
...
...
@@ -145,6 +145,14 @@ int vp9_refining_search_8p_c(const MACROBLOCK *x,
int
search_range
,
const
vp9_variance_fn_ptr_t
*
fn_ptr
,
const
MV
*
center_mv
,
const
uint8_t
*
second_pred
);
struct
VP9_COMP
;
int
vp9_full_pixel_search
(
struct
VP9_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
,
MV
*
mvp_full
,
int
step_param
,
int
error_per_bit
,
const
MV
*
ref_mv
,
MV
*
tmp_mv
,
int
var_max
,
int
rd
);
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
vp9/encoder/vp9_pickmode.c
View file @
c90cd4d5
...
...
@@ -84,8 +84,8 @@ static void full_pixel_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
mvp_full
.
col
>>=
3
;
mvp_full
.
row
>>=
3
;
full_pixel_search
(
cpi
,
x
,
bsize
,
&
mvp_full
,
step_param
,
sadpb
,
&
ref_mv
,
&
tmp_mv
->
as_mv
,
INT_MAX
,
0
);
vp9_
full_pixel_search
(
cpi
,
x
,
bsize
,
&
mvp_full
,
step_param
,
sadpb
,
&
ref_mv
,
&
tmp_mv
->
as_mv
,
INT_MAX
,
0
);
x
->
mv_col_min
=
tmp_col_min
;
x
->
mv_col_max
=
tmp_col_max
;
...
...
vp9/encoder/vp9_rdopt.c
View file @
c90cd4d5
...
...
@@ -1850,9 +1850,9 @@ static int64_t rd_pick_best_sub8x8_mode(VP9_COMP *cpi, MACROBLOCK *x,
vp9_set_mv_search_range
(
x
,
&
bsi
->
ref_mv
[
0
]
->
as_mv
);
bestsme
=
full_pixel_search
(
cpi
,
x
,
bsize
,
&
mvp_full
,
step_param
,
sadpb
,
&
bsi
->
ref_mv
[
0
]
->
as_mv
,
new_mv
,
INT_MAX
,
1
);
bestsme
=
vp9_
full_pixel_search
(
cpi
,
x
,
bsize
,
&
mvp_full
,
step_param
,
sadpb
,
&
bsi
->
ref_mv
[
0
]
->
as_mv
,
new_mv
,
INT_MAX
,
1
);
// Should we do a full search (best quality only)
if
(
is_best_mode
(
cpi
->
oxcf
.
mode
))
{
...
...
@@ -2385,8 +2385,8 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
mvp_full
.
col
>>=
3
;
mvp_full
.
row
>>=
3
;
bestsme
=
full_pixel_search
(
cpi
,
x
,
bsize
,
&
mvp_full
,
step_param
,
sadpb
,
&
ref_mv
,
&
tmp_mv
->
as_mv
,
INT_MAX
,
1
);
bestsme
=
vp9_
full_pixel_search
(
cpi
,
x
,
bsize
,
&
mvp_full
,
step_param
,
sadpb
,
&
ref_mv
,
&
tmp_mv
->
as_mv
,
INT_MAX
,
1
);
x
->
mv_col_min
=
tmp_col_min
;
x
->
mv_col_max
=
tmp_col_max
;
...
...
vp9/encoder/vp9_rdopt.h
View file @
c90cd4d5
...
...
@@ -94,52 +94,6 @@ static INLINE int rd_less_than_thresh(int64_t best_rd, int thresh,
return
best_rd
<
((
int64_t
)
thresh
*
thresh_fact
>>
5
)
||
thresh
==
INT_MAX
;
}
static
INLINE
int
full_pixel_search
(
VP9_COMP
*
cpi
,
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
,
MV
*
mvp_full
,
int
step_param
,
int
error_per_bit
,
const
MV
*
ref_mv
,
MV
*
tmp_mv
,
int
var_max
,
int
rd
)
{
const
SPEED_FEATURES
*
const
sf
=
&
cpi
->
sf
;
const
SEARCH_METHODS
method
=
sf
->
search_method
;
vp9_variance_fn_ptr_t
*
fn_ptr
=
&
cpi
->
fn_ptr
[
bsize
];
int
var
=
0
;
switch
(
method
)
{
case
FAST_DIAMOND
:
var
=
vp9_fast_dia_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
0
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
FAST_HEX
:
var
=
vp9_fast_hex_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
0
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
HEX
:
var
=
vp9_hex_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
1
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
SQUARE
:
var
=
vp9_square_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
1
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
BIGDIA
:
var
=
vp9_bigdia_search
(
x
,
mvp_full
,
step_param
,
error_per_bit
,
1
,
fn_ptr
,
1
,
ref_mv
,
tmp_mv
);
break
;
case
NSTEP
:
var
=
vp9_full_pixel_diamond
(
cpi
,
x
,
mvp_full
,
step_param
,
error_per_bit
,
(
sf
->
max_step_search_steps
-
1
)
-
step_param
,
1
,
fn_ptr
,
ref_mv
,
tmp_mv
);
break
;
default:
assert
(
!
"Invalid search method."
);
}
if
(
method
!=
NSTEP
&&
rd
&&
var
<
var_max
)
var
=
vp9_get_mvpred_var
(
x
,
tmp_mv
,
ref_mv
,
fn_ptr
,
1
);
return
var
;
}
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
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