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
Xiph.Org
aom-rav1e
Commits
9f900a1c
Commit
9f900a1c
authored
Mar 22, 2012
by
Ronald S. Bultje
Browse files
Only enable compound prediction if multiple reference frames are present.
Change-Id: Ia52ac825400eb83ff663e3a05a3fe0b3526bac9a
parent
2823173e
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp8/encoder/encodeframe.c
View file @
9f900a1c
...
...
@@ -854,6 +854,32 @@ static void encode_frame_internal(VP8_COMP *cpi)
}
static
int
check_dual_ref_flags
(
VP8_COMP
*
cpi
)
{
MACROBLOCKD
*
xd
=
&
cpi
->
mb
.
e_mbd
;
int
ref_flags
=
cpi
->
ref_frame_flags
;
if
(
segfeature_active
(
xd
,
1
,
SEG_LVL_REF_FRAME
))
{
if
((
ref_flags
&
(
VP8_LAST_FLAG
|
VP8_GOLD_FLAG
))
==
(
VP8_LAST_FLAG
|
VP8_GOLD_FLAG
)
&&
check_segref
(
xd
,
1
,
LAST_FRAME
))
return
1
;
if
((
ref_flags
&
(
VP8_GOLD_FLAG
|
VP8_ALT_FLAG
))
==
(
VP8_GOLD_FLAG
|
VP8_ALT_FLAG
)
&&
check_segref
(
xd
,
1
,
GOLDEN_FRAME
))
return
1
;
if
((
ref_flags
&
(
VP8_ALT_FLAG
|
VP8_LAST_FLAG
))
==
(
VP8_ALT_FLAG
|
VP8_LAST_FLAG
)
&&
check_segref
(
xd
,
1
,
ALTREF_FRAME
))
return
1
;
return
0
;
}
else
{
return
(
!!
(
ref_flags
&
VP8_GOLD_FLAG
)
+
!!
(
ref_flags
&
VP8_LAST_FLAG
)
+
!!
(
ref_flags
&
VP8_ALT_FLAG
)
)
>=
2
;
}
}
void
vp8_encode_frame
(
VP8_COMP
*
cpi
)
{
if
(
cpi
->
sf
.
RD
)
...
...
@@ -884,7 +910,8 @@ void vp8_encode_frame(VP8_COMP *cpi)
if
(
cpi
->
rd_prediction_type_threshes
[
frame_type
][
1
]
>
cpi
->
rd_prediction_type_threshes
[
frame_type
][
0
]
&&
cpi
->
rd_prediction_type_threshes
[
frame_type
][
1
]
>
cpi
->
rd_prediction_type_threshes
[
frame_type
][
2
])
cpi
->
rd_prediction_type_threshes
[
frame_type
][
2
]
&&
check_dual_ref_flags
(
cpi
))
pred_type
=
COMP_PREDICTION_ONLY
;
else
if
(
cpi
->
rd_prediction_type_threshes
[
frame_type
][
0
]
>
cpi
->
rd_prediction_type_threshes
[
frame_type
][
1
]
&&
...
...
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