Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
4df4b526
Commit
4df4b526
authored
10 years ago
by
Marco Paniconi
Committed by
Gerrit Code Review
10 years ago
Browse files
Options
Download
Plain Diff
Merge "vpx_temporal_pattern_encoder: add speed setting to command line."
parents
7efe8876
ccdbbe0a
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
nextgen
nextgenv2
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/vpx_temporal_scalable_patterns.c
+22
-15
examples/vpx_temporal_scalable_patterns.c
with
22 additions
and
15 deletions
examples/vpx_temporal_scalable_patterns.c
+
22
−
15
View file @
4df4b526
...
...
@@ -437,6 +437,7 @@ int main(int argc, char **argv) {
vpx_codec_err_t
res
;
unsigned
int
width
;
unsigned
int
height
;
int
speed
;
int
frame_avail
;
int
got_data
;
int
flags
=
0
;
...
...
@@ -457,7 +458,7 @@ int main(int argc, char **argv) {
// Check usage and arguments.
if
(
argc
<
11
)
{
die
(
"Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
"<rate_num> <rate_den> <frame_drop_threshold> <mode> "
"<rate_num> <rate_den>
<speed>
<frame_drop_threshold> <mode> "
"<Rate_0> ... <Rate_nlayers-1>
\n
"
,
argv
[
0
]);
}
...
...
@@ -473,12 +474,12 @@ int main(int argc, char **argv) {
die
(
"Invalid resolution: %d x %d"
,
width
,
height
);
}
layering_mode
=
strtol
(
argv
[
9
],
NULL
,
0
);
layering_mode
=
strtol
(
argv
[
10
],
NULL
,
0
);
if
(
layering_mode
<
0
||
layering_mode
>
12
)
{
die
(
"Invalid mode (0..12) %s"
,
argv
[
9
]);
die
(
"Invalid
layering
mode (0..12) %s"
,
argv
[
10
]);
}
if
(
argc
!=
1
0
+
mode_to_num_layers
[
layering_mode
])
{
if
(
argc
!=
1
1
+
mode_to_num_layers
[
layering_mode
])
{
die
(
"Invalid number of arguments"
);
}
...
...
@@ -501,12 +502,17 @@ int main(int argc, char **argv) {
cfg
.
g_timebase
.
num
=
strtol
(
argv
[
6
],
NULL
,
0
);
cfg
.
g_timebase
.
den
=
strtol
(
argv
[
7
],
NULL
,
0
);
for
(
i
=
10
;
(
int
)
i
<
10
+
mode_to_num_layers
[
layering_mode
];
++
i
)
{
cfg
.
ts_target_bitrate
[
i
-
10
]
=
strtol
(
argv
[
i
],
NULL
,
0
);
speed
=
strtol
(
argv
[
8
],
NULL
,
0
);
if
(
speed
<
0
)
{
die
(
"Invalid speed setting: must be positive"
);
}
for
(
i
=
11
;
(
int
)
i
<
11
+
mode_to_num_layers
[
layering_mode
];
++
i
)
{
cfg
.
ts_target_bitrate
[
i
-
11
]
=
strtol
(
argv
[
i
],
NULL
,
0
);
}
// Real time parameters.
cfg
.
rc_dropframe_thresh
=
strtol
(
argv
[
8
],
NULL
,
0
);
cfg
.
rc_dropframe_thresh
=
strtol
(
argv
[
9
],
NULL
,
0
);
cfg
.
rc_end_usage
=
VPX_CBR
;
cfg
.
rc_resize_allowed
=
0
;
cfg
.
rc_min_quantizer
=
2
;
...
...
@@ -563,14 +569,15 @@ int main(int argc, char **argv) {
if
(
vpx_codec_enc_init
(
&
codec
,
encoder
->
interface
(),
&
cfg
,
0
))
die_codec
(
&
codec
,
"Failed to initialize encoder"
);
vpx_codec_control
(
&
codec
,
VP8E_SET_CPUUSED
,
-
6
);
vpx_codec_control
(
&
codec
,
VP8E_SET_NOISE_SENSITIVITY
,
1
);
if
(
strncmp
(
encoder
->
name
,
"vp9"
,
3
)
==
0
)
{
vpx_codec_control
(
&
codec
,
VP8E_SET_CPUUSED
,
5
);
vpx_codec_control
(
&
codec
,
VP9E_SET_AQ_MODE
,
3
);
vpx_codec_control
(
&
codec
,
VP8E_SET_NOISE_SENSITIVITY
,
0
);
if
(
vpx_codec_control
(
&
codec
,
VP9E_SET_SVC
,
1
))
{
die_codec
(
&
codec
,
"Failed to set SVC"
);
if
(
strncmp
(
encoder
->
name
,
"vp8"
,
3
)
==
0
)
{
vpx_codec_control
(
&
codec
,
VP8E_SET_CPUUSED
,
-
speed
);
vpx_codec_control
(
&
codec
,
VP8E_SET_NOISE_SENSITIVITY
,
1
);
}
else
if
(
strncmp
(
encoder
->
name
,
"vp9"
,
3
)
==
0
)
{
vpx_codec_control
(
&
codec
,
VP8E_SET_CPUUSED
,
speed
);
vpx_codec_control
(
&
codec
,
VP9E_SET_AQ_MODE
,
3
);
vpx_codec_control
(
&
codec
,
VP8E_SET_NOISE_SENSITIVITY
,
0
);
if
(
vpx_codec_control
(
&
codec
,
VP9E_SET_SVC
,
1
))
{
die_codec
(
&
codec
,
"Failed to set SVC"
);
}
}
vpx_codec_control
(
&
codec
,
VP8E_SET_STATIC_THRESHOLD
,
1
);
...
...
This diff is collapsed.
Click to expand it.
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!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets