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
d009c236
Commit
d009c236
authored
May 30, 2014
by
Paul Wilkins
Committed by
Gerrit Code Review
May 30, 2014
Browse files
Merge "Re-factor some duplicate code."
parents
cf83983b
39c91d84
Changes
4
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_firstpass.c
View file @
d009c236
...
...
@@ -1576,7 +1576,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
// Break out conditions.
if
(
// Break at
cpi->
max_gf_interval unless almost totally static.
// Break at
active_
max_gf_interval unless almost totally static.
(
i
>=
active_max_gf_interval
&&
(
zero_motion_accumulator
<
0
.
995
))
||
(
// Don't break out with a very short interval.
...
...
vp9/encoder/vp9_ratectrl.c
View file @
d009c236
...
...
@@ -1388,6 +1388,24 @@ int vp9_compute_qdelta_by_rate(const RATE_CONTROL *rc, FRAME_TYPE frame_type,
return
target_index
-
qindex
;
}
void
vp9_rc_set_gf_max_interval
(
const
VP9EncoderConfig
*
const
oxcf
,
RATE_CONTROL
*
const
rc
)
{
// Set Maximum gf/arf interval
rc
->
max_gf_interval
=
16
;
// 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
(
rc
->
static_scene_max_gf_interval
>
oxcf
->
lag_in_frames
-
1
)
rc
->
static_scene_max_gf_interval
=
oxcf
->
lag_in_frames
-
1
;
}
if
(
rc
->
max_gf_interval
>
rc
->
static_scene_max_gf_interval
)
rc
->
max_gf_interval
=
rc
->
static_scene_max_gf_interval
;
}
void
vp9_rc_update_framerate
(
VP9_COMP
*
cpi
)
{
const
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
const
VP9EncoderConfig
*
const
oxcf
=
&
cpi
->
oxcf
;
...
...
@@ -1412,21 +1430,5 @@ void vp9_rc_update_framerate(VP9_COMP *cpi) {
rc
->
max_frame_bandwidth
=
MAX
(
MAX
((
cm
->
MBs
*
MAX_MB_RATE
),
MAXRATE_1080P
),
vbr_max_bits
);
// Set Maximum gf/arf interval
rc
->
max_gf_interval
=
16
;
// Extended interval for genuinely static scenes
rc
->
static_scene_max_gf_interval
=
cpi
->
oxcf
.
key_freq
>>
1
;
// Special conditions when alt ref frame enabled in lagged compress mode
if
(
oxcf
->
play_alternate
&&
oxcf
->
lag_in_frames
)
{
if
(
rc
->
max_gf_interval
>
oxcf
->
lag_in_frames
-
1
)
rc
->
max_gf_interval
=
oxcf
->
lag_in_frames
-
1
;
if
(
rc
->
static_scene_max_gf_interval
>
oxcf
->
lag_in_frames
-
1
)
rc
->
static_scene_max_gf_interval
=
oxcf
->
lag_in_frames
-
1
;
}
if
(
rc
->
max_gf_interval
>
rc
->
static_scene_max_gf_interval
)
rc
->
max_gf_interval
=
rc
->
static_scene_max_gf_interval
;
vp9_rc_set_gf_max_interval
(
oxcf
,
rc
);
}
vp9/encoder/vp9_ratectrl.h
View file @
d009c236
...
...
@@ -178,6 +178,9 @@ int vp9_compute_qdelta_by_rate(const RATE_CONTROL *rc, FRAME_TYPE frame_type,
void
vp9_rc_update_framerate
(
struct
VP9_COMP
*
cpi
);
void
vp9_rc_set_gf_max_interval
(
const
struct
VP9EncoderConfig
*
const
oxcf
,
RATE_CONTROL
*
const
rc
);
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
vp9/encoder/vp9_svc_layercontext.c
View file @
d009c236
...
...
@@ -149,20 +149,7 @@ void vp9_update_spatial_layer_framerate(VP9_COMP *const cpi, double framerate) {
oxcf
->
two_pass_vbrmin_section
/
100
);
lrc
->
max_frame_bandwidth
=
(
int
)(((
int64_t
)
lrc
->
avg_frame_bandwidth
*
oxcf
->
two_pass_vbrmax_section
)
/
100
);
lrc
->
max_gf_interval
=
16
;
lrc
->
static_scene_max_gf_interval
=
cpi
->
oxcf
.
key_freq
>>
1
;
if
(
oxcf
->
play_alternate
&&
oxcf
->
lag_in_frames
)
{
if
(
lrc
->
max_gf_interval
>
oxcf
->
lag_in_frames
-
1
)
lrc
->
max_gf_interval
=
oxcf
->
lag_in_frames
-
1
;
if
(
lrc
->
static_scene_max_gf_interval
>
oxcf
->
lag_in_frames
-
1
)
lrc
->
static_scene_max_gf_interval
=
oxcf
->
lag_in_frames
-
1
;
}
if
(
lrc
->
max_gf_interval
>
lrc
->
static_scene_max_gf_interval
)
lrc
->
max_gf_interval
=
lrc
->
static_scene_max_gf_interval
;
vp9_rc_set_gf_max_interval
(
oxcf
,
lrc
);
}
void
vp9_restore_layer_context
(
VP9_COMP
*
const
cpi
)
{
...
...
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