Skip to content
GitLab
Menu
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
4ce6928d
Commit
4ce6928d
authored
Jun 02, 2011
by
Yaowu Xu
Committed by
Code Review
Jun 02, 2011
Browse files
Merge "further clean up of errorperbit and sadperbit"
parents
4101b5c5
5b2fb329
Changes
5
Hide whitespace changes
Inline
Side-by-side
vp8/encoder/firstpass.c
View file @
4ce6928d
...
...
@@ -449,7 +449,9 @@ static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x,
// Initial step/diamond search centred on best mv
tmp_mv
.
as_int
=
0
;
tmp_err
=
cpi
->
diamond_search_sad
(
x
,
b
,
d
,
ref_mv
,
&
tmp_mv
,
step_param
,
x
->
errorperbit
,
&
num00
,
&
v_fn_ptr
,
x
->
mvcost
,
ref_mv
);
tmp_err
=
cpi
->
diamond_search_sad
(
x
,
b
,
d
,
ref_mv
,
&
tmp_mv
,
step_param
,
x
->
sadperbit16
,
&
num00
,
&
v_fn_ptr
,
x
->
mvcost
,
ref_mv
);
if
(
tmp_err
<
INT_MAX
-
new_mv_mode_penalty
)
tmp_err
+=
new_mv_mode_penalty
;
...
...
@@ -472,7 +474,10 @@ static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x,
num00
--
;
else
{
tmp_err
=
cpi
->
diamond_search_sad
(
x
,
b
,
d
,
ref_mv
,
&
tmp_mv
,
step_param
+
n
,
x
->
errorperbit
,
&
num00
,
&
v_fn_ptr
,
x
->
mvcost
,
ref_mv
);
tmp_err
=
cpi
->
diamond_search_sad
(
x
,
b
,
d
,
ref_mv
,
&
tmp_mv
,
step_param
+
n
,
x
->
sadperbit16
,
&
num00
,
&
v_fn_ptr
,
x
->
mvcost
,
ref_mv
);
if
(
tmp_err
<
INT_MAX
-
new_mv_mode_penalty
)
tmp_err
+=
new_mv_mode_penalty
;
...
...
vp8/encoder/mcomp.c
View file @
4ce6928d
...
...
@@ -1000,7 +1000,8 @@ cal_neighbors:
this_mv
.
as_mv
.
col
=
bc
<<
3
;
this_offset
=
(
unsigned
char
*
)(
*
(
d
->
base_pre
)
+
d
->
pre
+
(
br
*
(
in_what_stride
))
+
bc
);
return
vfp
->
vf
(
what
,
what_stride
,
this_offset
,
in_what_stride
,
&
bestsad
)
+
mv_err_cost
(
&
this_mv
,
center_mv
,
mvcost
,
x
->
errorperbit
)
;
return
vfp
->
vf
(
what
,
what_stride
,
this_offset
,
in_what_stride
,
&
bestsad
)
+
mv_err_cost
(
&
this_mv
,
center_mv
,
mvcost
,
x
->
errorperbit
)
;
}
#undef CHECK_BOUNDS
#undef CHECK_POINT
...
...
vp8/encoder/pickinter.c
View file @
4ce6928d
...
...
@@ -713,7 +713,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
int
step_param
;
int
further_steps
;
int
n
=
0
;
int
sadpb
=
x
->
sadperbit16
/
2
;
int
sadpb
=
x
->
sadperbit16
;
int
col_min
;
int
col_max
;
...
...
@@ -817,7 +817,11 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
}
if
(
bestsme
<
INT_MAX
)
cpi
->
find_fractional_mv_step
(
x
,
b
,
d
,
&
d
->
bmi
.
mv
,
&
best_ref_mv
,
x
->
errorperbit
,
&
cpi
->
fn_ptr
[
BLOCK_16X16
],
cpi
->
mb
.
mvcost
,
&
distortion2
,
&
sse
);
cpi
->
find_fractional_mv_step
(
x
,
b
,
d
,
&
d
->
bmi
.
mv
,
&
best_ref_mv
,
x
->
errorperbit
,
&
cpi
->
fn_ptr
[
BLOCK_16X16
],
cpi
->
mb
.
mvcost
,
&
distortion2
,
&
sse
);
mode_mv
[
NEWMV
].
as_int
=
d
->
bmi
.
mv
.
as_int
;
...
...
vp8/encoder/rdopt.c
View file @
4ce6928d
...
...
@@ -198,8 +198,8 @@ static int sad_per_bit4lut[QINDEX_RANGE] =
void
vp8cx_initialize_me_consts
(
VP8_COMP
*
cpi
,
int
QIndex
)
{
cpi
->
mb
.
sadperbit16
=
sad_per_bit16lut
[
QIndex
];
cpi
->
mb
.
sadperbit4
=
sad_per_bit4lut
[
QIndex
];
cpi
->
mb
.
sadperbit16
=
sad_per_bit16lut
[
QIndex
]
/
2
;
cpi
->
mb
.
sadperbit4
=
sad_per_bit4lut
[
QIndex
]
/
2
;
}
void
vp8_initialize_rd_consts
(
VP8_COMP
*
cpi
,
int
Qvalue
)
...
...
@@ -1131,7 +1131,7 @@ static void rd_check_segment(VP8_COMP *cpi, MACROBLOCK *x,
further_steps
=
(
MAX_MVSEARCH_STEPS
-
1
)
-
step_param
;
{
int
sadpb
=
x
->
sadperbit4
/
2
;
int
sadpb
=
x
->
sadperbit4
;
// find first label
n
=
vp8_mbsplit_offset
[
segmentation
][
i
];
...
...
@@ -1202,13 +1202,10 @@ static void rd_check_segment(VP8_COMP *cpi, MACROBLOCK *x,
{
int
distortion
;
unsigned
int
sse
;
cpi
->
find_fractional_mv_step
(
x
,
c
,
e
,
&
mode_mv
[
NEW4X4
],
bsi
->
ref_mv
,
x
->
errorperbit
,
v_fn_ptr
,
x
->
mvcost
,
&
distortion
,
&
sse
);
if
(
!
cpi
->
common
.
full_pixel
)
cpi
->
find_fractional_mv_step
(
x
,
c
,
e
,
&
mode_mv
[
NEW4X4
],
bsi
->
ref_mv
,
x
->
errorperbit
/
2
,
v_fn_ptr
,
x
->
mvcost
,
&
distortion
,
&
sse
);
else
vp8_skip_fractional_mv_step
(
x
,
c
,
e
,
&
mode_mv
[
NEW4X4
],
bsi
->
ref_mv
,
x
->
errorperbit
,
v_fn_ptr
,
x
->
mvcost
,
&
distortion
,
&
sse
);
}
}
/* NEW4X4 */
...
...
@@ -2038,7 +2035,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
int
do_refine
=
1
;
/* If last step (1-away) of n-step search doesn't pick the center point as the best match,
we will do a final 1-away diamond refining search */
int
sadpb
=
x
->
sadperbit16
/
2
;
int
sadpb
=
x
->
sadperbit16
;
int
col_min
=
(
best_ref_mv
.
as_mv
.
col
-
MAX_FULL_PEL_VAL
)
>>
3
;
int
col_max
=
(
best_ref_mv
.
as_mv
.
col
+
MAX_FULL_PEL_VAL
)
>>
3
;
...
...
@@ -2147,7 +2144,10 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
{
int
dis
;
/* TODO: use dis in distortion calculation later. */
unsigned
int
sse
;
cpi
->
find_fractional_mv_step
(
x
,
b
,
d
,
&
d
->
bmi
.
mv
,
&
best_ref_mv
,
x
->
errorperbit
/
4
,
&
cpi
->
fn_ptr
[
BLOCK_16X16
],
x
->
mvcost
,
&
dis
,
&
sse
);
cpi
->
find_fractional_mv_step
(
x
,
b
,
d
,
&
d
->
bmi
.
mv
,
&
best_ref_mv
,
x
->
errorperbit
,
&
cpi
->
fn_ptr
[
BLOCK_16X16
],
x
->
mvcost
,
&
dis
,
&
sse
);
}
mode_mv
[
NEWMV
].
as_int
=
d
->
bmi
.
mv
.
as_int
;
...
...
vp8/encoder/temporal_filter.c
View file @
4ce6928d
...
...
@@ -200,7 +200,7 @@ static int vp8_temporal_filter_find_matching_mb_c
bestsme
=
vp8_hex_search
(
x
,
b
,
d
,
&
best_ref_mv1
,
&
d
->
bmi
.
mv
,
step_param
,
sadpb
/*x->errorperbit*/
,
sadpb
,
&
num00
,
&
cpi
->
fn_ptr
[
BLOCK_16X16
],
mvsadcost
,
mvcost
,
&
best_ref_mv1
);
...
...
Write
Preview
Supports
Markdown
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