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
9f9e30d7
Commit
9f9e30d7
authored
Nov 04, 2014
by
Minghai Shang
Committed by
Gerrit Code Review
Nov 04, 2014
Browse files
Merge "[spatial svc] Make spatial svc working for one pass rate control"
parents
825e270d
86c36a50
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/vp9_spatial_svc_encoder.c
View file @
9f9e30d7
...
...
@@ -60,6 +60,11 @@ static const arg_def_t min_bitrate_arg =
ARG_DEF
(
NULL
,
"min-bitrate"
,
1
,
"Minimum bitrate"
);
static
const
arg_def_t
max_bitrate_arg
=
ARG_DEF
(
NULL
,
"max-bitrate"
,
1
,
"Maximum bitrate"
);
static
const
arg_def_t
lag_in_frame_arg
=
ARG_DEF
(
NULL
,
"lag-in-frames"
,
1
,
"Number of frame to input before "
"generating any outputs"
);
static
const
arg_def_t
rc_end_usage_arg
=
ARG_DEF
(
NULL
,
"rc-end-usage"
,
1
,
"0 - 3: VBR, CBR, CQ, Q"
);
#if CONFIG_VP9_HIGHBITDEPTH
static
const
struct
arg_enum_list
bitdepth_enum
[]
=
{
...
...
@@ -80,11 +85,11 @@ static const arg_def_t *svc_args[] = {
&
timebase_arg
,
&
bitrate_arg
,
&
skip_frames_arg
,
&
spatial_layers_arg
,
&
kf_dist_arg
,
&
scale_factors_arg
,
&
passes_arg
,
&
pass_arg
,
&
fpf_name_arg
,
&
min_q_arg
,
&
max_q_arg
,
&
min_bitrate_arg
,
&
max_bitrate_arg
,
&
temporal_layers_arg
,
&
max_bitrate_arg
,
&
temporal_layers_arg
,
&
lag_in_frame_arg
,
#if CONFIG_VP9_HIGHBITDEPTH
&
bitdepth_arg
,
#endif
NULL
&
rc_end_usage_arg
,
NULL
};
static
const
uint32_t
default_frames_to_skip
=
0
;
...
...
@@ -207,6 +212,10 @@ static void parse_command_line(int argc, const char **argv_,
min_bitrate
=
arg_parse_uint
(
&
arg
);
}
else
if
(
arg_match
(
&
arg
,
&
max_bitrate_arg
,
argi
))
{
max_bitrate
=
arg_parse_uint
(
&
arg
);
}
else
if
(
arg_match
(
&
arg
,
&
lag_in_frame_arg
,
argi
))
{
enc_cfg
->
g_lag_in_frames
=
arg_parse_uint
(
&
arg
);
}
else
if
(
arg_match
(
&
arg
,
&
rc_end_usage_arg
,
argi
))
{
enc_cfg
->
rc_end_usage
=
arg_parse_uint
(
&
arg
);
#if CONFIG_VP9_HIGHBITDEPTH
}
else
if
(
arg_match
(
&
arg
,
&
bitdepth_arg
,
argi
))
{
enc_cfg
->
g_bit_depth
=
arg_parse_enum_or_int
(
&
arg
);
...
...
vp9/encoder/vp9_encoder.c
View file @
9f9e30d7
...
...
@@ -584,7 +584,7 @@ static void init_config(struct VP9_COMP *cpi, VP9EncoderConfig *oxcf) {
if
((
cpi
->
svc
.
number_temporal_layers
>
1
&&
cpi
->
oxcf
.
rc_mode
==
VPX_CBR
)
||
((
cpi
->
svc
.
number_temporal_layers
>
1
||
cpi
->
svc
.
number_spatial_layers
>
1
)
&&
cpi
->
oxcf
.
pass
=
=
2
))
{
cpi
->
oxcf
.
pass
!
=
1
))
{
vp9_init_layer_context
(
cpi
);
}
...
...
@@ -1285,7 +1285,7 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
cpi
->
oxcf
.
rc_mode
==
VPX_CBR
)
||
((
cpi
->
svc
.
number_temporal_layers
>
1
||
cpi
->
svc
.
number_spatial_layers
>
1
)
&&
cpi
->
oxcf
.
pass
=
=
2
))
{
cpi
->
oxcf
.
pass
!
=
1
))
{
vp9_update_layer_context_change_config
(
cpi
,
(
int
)
cpi
->
oxcf
.
target_bandwidth
);
}
...
...
vp9/encoder/vp9_encoder.h
View file @
9f9e30d7
...
...
@@ -531,9 +531,8 @@ void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags);
static
INLINE
int
is_two_pass_svc
(
const
struct
VP9_COMP
*
const
cpi
)
{
return
cpi
->
use_svc
&&
(
cpi
->
svc
.
number_temporal_layers
>
1
||
cpi
->
svc
.
number_spatial_layers
>
1
)
&&
(
cpi
->
oxcf
.
pass
==
1
||
cpi
->
oxcf
.
pass
==
2
);
((
cpi
->
svc
.
number_spatial_layers
>
1
)
||
(
cpi
->
svc
.
number_temporal_layers
>
1
&&
cpi
->
oxcf
.
pass
!=
0
));
}
static
INLINE
int
is_altref_enabled
(
const
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