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
1349e863
Commit
1349e863
authored
10 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
10 years ago
Browse files
Options
Download
Plain Diff
Merge "Converting target_bandwidth to Bit/s at very beginning."
parents
2d6bd24b
3fff4bd2
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
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
vp9/encoder/vp9_encoder.c
+0
-3
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_svc_layercontext.c
+5
-6
vp9/encoder/vp9_svc_layercontext.c
vp9/vp9_cx_iface.c
+10
-4
vp9/vp9_cx_iface.c
with
15 additions
and
13 deletions
vp9/encoder/vp9_encoder.c
+
0
−
3
View file @
1349e863
...
@@ -632,9 +632,6 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
...
@@ -632,9 +632,6 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
cpi
->
oxcf
.
maximum_buffer_size
=
240000
;
cpi
->
oxcf
.
maximum_buffer_size
=
240000
;
}
}
// Convert target bandwidth from Kbit/s to Bit/s
cpi
->
oxcf
.
target_bandwidth
*=
1000
;
cpi
->
oxcf
.
starting_buffer_level
=
cpi
->
oxcf
.
starting_buffer_level
=
vp9_rescale
(
cpi
->
oxcf
.
starting_buffer_level
,
vp9_rescale
(
cpi
->
oxcf
.
starting_buffer_level
,
cpi
->
oxcf
.
target_bandwidth
,
1000
);
cpi
->
oxcf
.
target_bandwidth
,
1000
);
...
...
This diff is collapsed.
Click to expand it.
vp9/encoder/vp9_svc_layercontext.c
+
5
−
6
View file @
1349e863
...
@@ -46,10 +46,10 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
...
@@ -46,10 +46,10 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
lrc
->
key_frame_rate_correction_factor
=
1
.
0
;
lrc
->
key_frame_rate_correction_factor
=
1
.
0
;
if
(
svc
->
number_temporal_layers
>
1
)
{
if
(
svc
->
number_temporal_layers
>
1
)
{
lc
->
target_bandwidth
=
oxcf
->
ts_target_bitrate
[
layer
]
*
1000
;
lc
->
target_bandwidth
=
oxcf
->
ts_target_bitrate
[
layer
];
lrc
->
last_q
[
INTER_FRAME
]
=
oxcf
->
worst_allowed_q
;
lrc
->
last_q
[
INTER_FRAME
]
=
oxcf
->
worst_allowed_q
;
}
else
{
}
else
{
lc
->
target_bandwidth
=
oxcf
->
ss_target_bitrate
[
layer
]
*
1000
;
lc
->
target_bandwidth
=
oxcf
->
ss_target_bitrate
[
layer
];
lrc
->
last_q
[
0
]
=
oxcf
->
best_allowed_q
;
lrc
->
last_q
[
0
]
=
oxcf
->
best_allowed_q
;
lrc
->
last_q
[
1
]
=
oxcf
->
best_allowed_q
;
lrc
->
last_q
[
1
]
=
oxcf
->
best_allowed_q
;
lrc
->
last_q
[
2
]
=
oxcf
->
best_allowed_q
;
lrc
->
last_q
[
2
]
=
oxcf
->
best_allowed_q
;
...
@@ -82,9 +82,9 @@ void vp9_update_layer_context_change_config(VP9_COMP *const cpi,
...
@@ -82,9 +82,9 @@ void vp9_update_layer_context_change_config(VP9_COMP *const cpi,
RATE_CONTROL
*
const
lrc
=
&
lc
->
rc
;
RATE_CONTROL
*
const
lrc
=
&
lc
->
rc
;
if
(
svc
->
number_temporal_layers
>
1
)
{
if
(
svc
->
number_temporal_layers
>
1
)
{
lc
->
target_bandwidth
=
oxcf
->
ts_target_bitrate
[
layer
]
*
1000
;
lc
->
target_bandwidth
=
oxcf
->
ts_target_bitrate
[
layer
];
}
else
{
}
else
{
lc
->
target_bandwidth
=
oxcf
->
ss_target_bitrate
[
layer
]
*
1000
;
lc
->
target_bandwidth
=
oxcf
->
ss_target_bitrate
[
layer
];
}
}
bitrate_alloc
=
(
float
)
lc
->
target_bandwidth
/
target_bandwidth
;
bitrate_alloc
=
(
float
)
lc
->
target_bandwidth
/
target_bandwidth
;
// Update buffer-related quantities.
// Update buffer-related quantities.
...
@@ -132,8 +132,7 @@ void vp9_update_temporal_layer_framerate(VP9_COMP *const cpi) {
...
@@ -132,8 +132,7 @@ void vp9_update_temporal_layer_framerate(VP9_COMP *const cpi) {
}
else
{
}
else
{
const
double
prev_layer_framerate
=
const
double
prev_layer_framerate
=
oxcf
->
framerate
/
oxcf
->
ts_rate_decimator
[
layer
-
1
];
oxcf
->
framerate
/
oxcf
->
ts_rate_decimator
[
layer
-
1
];
const
int
prev_layer_target_bandwidth
=
const
int
prev_layer_target_bandwidth
=
oxcf
->
ts_target_bitrate
[
layer
-
1
];
oxcf
->
ts_target_bitrate
[
layer
-
1
]
*
1000
;
lc
->
avg_frame_size
=
lc
->
avg_frame_size
=
(
int
)((
lc
->
target_bandwidth
-
prev_layer_target_bandwidth
)
/
(
int
)((
lc
->
target_bandwidth
-
prev_layer_target_bandwidth
)
/
(
lc
->
framerate
-
prev_layer_framerate
));
(
lc
->
framerate
-
prev_layer_framerate
));
...
...
This diff is collapsed.
Click to expand it.
vp9/vp9_cx_iface.c
+
10
−
4
View file @
1349e863
...
@@ -327,7 +327,8 @@ static vpx_codec_err_t set_encoder_config(
...
@@ -327,7 +327,8 @@ static vpx_codec_err_t set_encoder_config(
else
if
(
cfg
->
rc_end_usage
==
VPX_CBR
)
else
if
(
cfg
->
rc_end_usage
==
VPX_CBR
)
oxcf
->
rc_mode
=
RC_MODE_CBR
;
oxcf
->
rc_mode
=
RC_MODE_CBR
;
oxcf
->
target_bandwidth
=
cfg
->
rc_target_bitrate
;
// Convert target bandwidth from Kbit/s to Bit/s
oxcf
->
target_bandwidth
=
1000
*
cfg
->
rc_target_bitrate
;
oxcf
->
rc_max_intra_bitrate_pct
=
extra_cfg
->
rc_max_intra_bitrate_pct
;
oxcf
->
rc_max_intra_bitrate_pct
=
extra_cfg
->
rc_max_intra_bitrate_pct
;
oxcf
->
best_allowed_q
=
vp9_quantizer_to_qindex
(
cfg
->
rc_min_quantizer
);
oxcf
->
best_allowed_q
=
vp9_quantizer_to_qindex
(
cfg
->
rc_min_quantizer
);
...
@@ -387,7 +388,9 @@ static vpx_codec_err_t set_encoder_config(
...
@@ -387,7 +388,9 @@ static vpx_codec_err_t set_encoder_config(
oxcf
->
ss_number_layers
=
cfg
->
ss_number_layers
;
oxcf
->
ss_number_layers
=
cfg
->
ss_number_layers
;
if
(
oxcf
->
ss_number_layers
>
1
)
{
if
(
oxcf
->
ss_number_layers
>
1
)
{
vp9_copy
(
oxcf
->
ss_target_bitrate
,
cfg
->
ss_target_bitrate
);
int
i
;
for
(
i
=
0
;
i
<
VPX_SS_MAX_LAYERS
;
++
i
)
oxcf
->
ss_target_bitrate
[
i
]
=
1000
*
cfg
->
ss_target_bitrate
[
i
];
}
else
if
(
oxcf
->
ss_number_layers
==
1
)
{
}
else
if
(
oxcf
->
ss_number_layers
==
1
)
{
oxcf
->
ss_target_bitrate
[
0
]
=
(
int
)
oxcf
->
target_bandwidth
;
oxcf
->
ss_target_bitrate
[
0
]
=
(
int
)
oxcf
->
target_bandwidth
;
}
}
...
@@ -395,8 +398,11 @@ static vpx_codec_err_t set_encoder_config(
...
@@ -395,8 +398,11 @@ static vpx_codec_err_t set_encoder_config(
oxcf
->
ts_number_layers
=
cfg
->
ts_number_layers
;
oxcf
->
ts_number_layers
=
cfg
->
ts_number_layers
;
if
(
oxcf
->
ts_number_layers
>
1
)
{
if
(
oxcf
->
ts_number_layers
>
1
)
{
vp9_copy
(
oxcf
->
ts_target_bitrate
,
cfg
->
ts_target_bitrate
);
int
i
;
vp9_copy
(
oxcf
->
ts_rate_decimator
,
cfg
->
ts_rate_decimator
);
for
(
i
=
0
;
i
<
VPX_TS_MAX_LAYERS
;
++
i
)
{
oxcf
->
ts_target_bitrate
[
i
]
=
1000
*
cfg
->
ts_target_bitrate
[
i
];
oxcf
->
ts_rate_decimator
[
i
]
=
cfg
->
ts_rate_decimator
[
i
];
}
}
else
if
(
oxcf
->
ts_number_layers
==
1
)
{
}
else
if
(
oxcf
->
ts_number_layers
==
1
)
{
oxcf
->
ts_target_bitrate
[
0
]
=
(
int
)
oxcf
->
target_bandwidth
;
oxcf
->
ts_target_bitrate
[
0
]
=
(
int
)
oxcf
->
target_bandwidth
;
oxcf
->
ts_rate_decimator
[
0
]
=
1
;
oxcf
->
ts_rate_decimator
[
0
]
=
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