mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-20 00:57:49 +01:00
Use GetTemporalLayerSum
Bug: b/337757868 Change-Id: Ieff4c22425bab06c12419d64db7a2eef69cc54d6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355962 Auto-Submit: Sergey Silkin <ssilkin@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42630}
This commit is contained in:
parent
c0a32fe01b
commit
e9810a8adb
1 changed files with 2 additions and 6 deletions
|
@ -818,16 +818,12 @@ void LibaomAv1Encoder::SetRates(const RateControlParameters& parameters) {
|
|||
if (SvcEnabled()) {
|
||||
for (int sid = 0; sid < svc_params_->number_spatial_layers; ++sid) {
|
||||
// libaom bitrate for spatial id S and temporal id T means bitrate
|
||||
// of frames with spatial_id=S and temporal_id<=T
|
||||
// while `parameters.bitrate` provdies bitrate of frames with
|
||||
// spatial_id=S and temporal_id=T
|
||||
int accumulated_bitrate_bps = 0;
|
||||
// of frames with spatial_id=S and temporal_id<=T.
|
||||
for (int tid = 0; tid < svc_params_->number_temporal_layers; ++tid) {
|
||||
int layer_index = sid * svc_params_->number_temporal_layers + tid;
|
||||
accumulated_bitrate_bps += parameters.bitrate.GetBitrate(sid, tid);
|
||||
// `svc_params_->layer_target_bitrate` expects bitrate in kbps.
|
||||
svc_params_->layer_target_bitrate[layer_index] =
|
||||
accumulated_bitrate_bps / 1000;
|
||||
parameters.bitrate.GetTemporalLayerSum(sid, tid) / 1000;
|
||||
}
|
||||
}
|
||||
SetEncoderControlParameters(AV1E_SET_SVC_PARAMS, &*svc_params_);
|
||||
|
|
Loading…
Reference in a new issue