Rename local var active_tls_ to active_tls
The local variable active_tls_ in EncoderBitrateAdjuster::AdjustRateAllocation() is named like a class data member. Rename it active_tls to follow the naming convention for local variables. Bug: None Change-Id: If7a5c7b14227bb03460b071c17f92f72396127f4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293440 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39315}
This commit is contained in:
parent
f4c04286bc
commit
4173483f61
@ -75,15 +75,15 @@ VideoBitrateAllocation EncoderBitrateAdjuster::AdjustRateAllocation(
|
||||
|
||||
// First check that overshoot detectors exist, and store per spatial layer
|
||||
// how many active temporal layers we have.
|
||||
size_t active_tls_[kMaxSpatialLayers] = {};
|
||||
size_t active_tls[kMaxSpatialLayers] = {};
|
||||
for (size_t si = 0; si < kMaxSpatialLayers; ++si) {
|
||||
active_tls_[si] = 0;
|
||||
active_tls[si] = 0;
|
||||
for (size_t ti = 0; ti < kMaxTemporalStreams; ++ti) {
|
||||
// Layer is enabled iff it has both positive bitrate and framerate target.
|
||||
if (rates.bitrate.GetBitrate(si, ti) > 0 &&
|
||||
current_fps_allocation_[si].size() > ti &&
|
||||
current_fps_allocation_[si][ti] > 0) {
|
||||
++active_tls_[si];
|
||||
++active_tls[si];
|
||||
if (!overshoot_detectors_[si][ti]) {
|
||||
overshoot_detectors_[si][ti] =
|
||||
std::make_unique<EncoderOvershootDetector>(kWindowSizeMs);
|
||||
@ -114,14 +114,14 @@ VideoBitrateAllocation EncoderBitrateAdjuster::AdjustRateAllocation(
|
||||
if (frames_since_layout_change_ < kMinFramesSinceLayoutChange) {
|
||||
layer_info.link_utilization_factor = kDefaultUtilizationFactor;
|
||||
layer_info.media_utilization_factor = kDefaultUtilizationFactor;
|
||||
} else if (active_tls_[si] == 0 ||
|
||||
} else if (active_tls[si] == 0 ||
|
||||
layer_info.target_rate == DataRate::Zero()) {
|
||||
// No signaled temporal layers, or no bitrate set. Could either be unused
|
||||
// spatial layer or bitrate dynamic mode; pass bitrate through without any
|
||||
// change.
|
||||
layer_info.link_utilization_factor = 1.0;
|
||||
layer_info.media_utilization_factor = 1.0;
|
||||
} else if (active_tls_[si] == 1) {
|
||||
} else if (active_tls[si] == 1) {
|
||||
// A single active temporal layer, this might mean single layer or that
|
||||
// encoder does not support temporal layers. Merge target bitrates for
|
||||
// this spatial layer.
|
||||
@ -141,7 +141,7 @@ VideoBitrateAllocation EncoderBitrateAdjuster::AdjustRateAllocation(
|
||||
// If any layer is missing a utilization factor, fall back to default.
|
||||
layer_info.link_utilization_factor = 0.0;
|
||||
layer_info.media_utilization_factor = 0.0;
|
||||
for (size_t ti = 0; ti < active_tls_[si]; ++ti) {
|
||||
for (size_t ti = 0; ti < active_tls[si]; ++ti) {
|
||||
RTC_DCHECK(overshoot_detectors_[si][ti]);
|
||||
const absl::optional<double> ti_link_utilization_factor =
|
||||
overshoot_detectors_[si][ti]->GetNetworkRateUtilizationFactor(
|
||||
@ -233,7 +233,7 @@ VideoBitrateAllocation EncoderBitrateAdjuster::AdjustRateAllocation(
|
||||
}
|
||||
|
||||
// Populate the adjusted allocation with determined utilization factor.
|
||||
if (active_tls_[si] == 1 &&
|
||||
if (active_tls[si] == 1 &&
|
||||
layer_info.target_rate >
|
||||
DataRate::BitsPerSec(rates.bitrate.GetBitrate(si, 0))) {
|
||||
// Bitrate allocation indicates temporal layer usage, but encoder
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user