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
86583b2b
Commit
86583b2b
authored
Jun 12, 2014
by
Dmitry Kovalev
Browse files
Adding is_altref_enabled() function.
Change-Id: I54cdb4ce11590511e6f86bc2fd55771f1c18a20a
parent
d5ae4331
Changes
4
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_encoder.c
View file @
86583b2b
...
...
@@ -588,8 +588,6 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
cpi
->
oxcf
=
*
oxcf
;
cpi
->
pass
=
get_pass
(
cpi
->
oxcf
.
mode
);
if
(
cpi
->
oxcf
.
mode
==
REALTIME
)
cpi
->
oxcf
.
play_alternate
=
0
;
rc
->
baseline_gf_interval
=
DEFAULT_GF_INTERVAL
;
cpi
->
ref_frame_flags
=
VP9_ALT_FLAG
|
VP9_GOLD_FLAG
|
VP9_LAST_FLAG
;
...
...
@@ -2416,7 +2414,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
cpi
->
refresh_alt_ref_frame
=
0
;
// Should we code an alternate reference frame.
if
(
cpi
->
oxcf
.
play_alternate
&&
rc
->
source_alt_ref_pending
)
{
if
(
is_altref_enabled
(
&
cpi
->
oxcf
)
&&
rc
->
source_alt_ref_pending
)
{
int
frames_to_arf
;
#if CONFIG_MULTIPLE_ARF
...
...
vp9/encoder/vp9_encoder.h
View file @
86583b2b
...
...
@@ -284,6 +284,10 @@ typedef struct VP9EncoderConfig {
vp8e_tuning
tuning
;
}
VP9EncoderConfig
;
static
INLINE
int
is_altref_enabled
(
const
VP9EncoderConfig
*
cfg
)
{
return
cfg
->
mode
!=
REALTIME
&&
cfg
->
play_alternate
&&
cfg
->
lag_in_frames
>
0
;
}
static
INLINE
int
is_lossless_requested
(
const
VP9EncoderConfig
*
cfg
)
{
return
cfg
->
best_allowed_q
==
0
&&
cfg
->
worst_allowed_q
==
0
;
}
...
...
vp9/encoder/vp9_firstpass.c
View file @
86583b2b
...
...
@@ -1526,7 +1526,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
double
mv_in_out_accumulator
=
0
.
0
;
double
abs_mv_in_out_accumulator
=
0
.
0
;
double
mv_ratio_accumulator_thresh
;
unsigned
int
allow_alt_ref
=
oxcf
->
play_alternate
&&
oxcf
->
lag_in_frames
;
unsigned
int
allow_alt_ref
=
is_altref_enabled
(
oxcf
)
;
int
f_boost
=
0
;
int
b_boost
=
0
;
...
...
vp9/encoder/vp9_ratectrl.c
View file @
86583b2b
...
...
@@ -1129,7 +1129,7 @@ void vp9_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) {
rc
->
total_target_vs_actual
=
rc
->
total_actual_bits
-
rc
->
total_target_bits
;
if
(
oxcf
->
play_alternate
&&
cpi
->
refresh_alt_ref_frame
&&
if
(
is_altref_enabled
(
oxcf
)
&&
cpi
->
refresh_alt_ref_frame
&&
(
cm
->
frame_type
!=
KEY_FRAME
))
// Update the alternate reference frame stats as appropriate.
update_alt_ref_frame_stats
(
cpi
);
...
...
@@ -1389,8 +1389,7 @@ void vp9_rc_set_gf_max_interval(const VP9EncoderConfig *const oxcf,
// Extended interval for genuinely static scenes
rc
->
static_scene_max_gf_interval
=
oxcf
->
key_freq
>>
1
;
// Special conditions when alt ref frame enabled
if
(
oxcf
->
play_alternate
&&
oxcf
->
lag_in_frames
)
{
if
(
is_altref_enabled
(
oxcf
))
{
if
(
rc
->
static_scene_max_gf_interval
>
oxcf
->
lag_in_frames
-
1
)
rc
->
static_scene_max_gf_interval
=
oxcf
->
lag_in_frames
-
1
;
}
...
...
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