mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-16 15:20:42 +01:00
video_layer_allocation: clean up unused code
remove unused support for more than four spatial layer descriptions of temporal layers BUG=webrtc:12000 Change-Id: I087bcd020897898636bdf9c838abafa8c73c53f3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281320 Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Philipp Hancke <phancke@microsoft.com> Reviewed-by: Per Kjellander <perkj@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38646}
This commit is contained in:
parent
11be12118b
commit
05b58ad77e
1 changed files with 7 additions and 17 deletions
|
@ -184,16 +184,12 @@ bool RtpVideoLayersAllocationExtension::Write(
|
|||
}
|
||||
++write_at;
|
||||
|
||||
{ // Number of temporal layers.
|
||||
{ // Number of temporal layers per spatial layer (at most kMaxSpatialIds).
|
||||
static_assert(VideoLayersAllocation::kMaxSpatialIds == 4);
|
||||
int bit_offset = 8;
|
||||
*write_at = 0;
|
||||
for (const auto& layer : allocation.active_spatial_layers) {
|
||||
if (bit_offset == 0) {
|
||||
bit_offset = 6;
|
||||
*++write_at = 0;
|
||||
} else {
|
||||
bit_offset -= 2;
|
||||
}
|
||||
bit_offset -= 2;
|
||||
*write_at |=
|
||||
((layer.target_bitrate_per_temporal_layer.size() - 1) << bit_offset);
|
||||
}
|
||||
|
@ -269,8 +265,9 @@ bool RtpVideoLayersAllocationExtension::Parse(
|
|||
return false;
|
||||
}
|
||||
|
||||
// Read number of temporal layers,
|
||||
// Create `allocation->active_spatial_layers` while iterating though it.
|
||||
// Read number of temporal layers per spatial layer (at most kMaxSpatialIds),
|
||||
// create `allocation->active_spatial_layers` while iterating though it.
|
||||
static_assert(VideoLayersAllocation::kMaxSpatialIds == 4);
|
||||
int bit_offset = 8;
|
||||
for (int stream_idx = 0; stream_idx < num_rtp_streams; ++stream_idx) {
|
||||
for (int sid = 0; sid < VideoLayersAllocation::kMaxSpatialIds; ++sid) {
|
||||
|
@ -278,14 +275,7 @@ bool RtpVideoLayersAllocationExtension::Parse(
|
|||
continue;
|
||||
}
|
||||
|
||||
if (bit_offset == 0) {
|
||||
bit_offset = 6;
|
||||
if (++read_at == end) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
bit_offset -= 2;
|
||||
}
|
||||
bit_offset -= 2;
|
||||
int num_temporal_layers = 1 + ((*read_at >> bit_offset) & 0b11);
|
||||
allocation->active_spatial_layers.emplace_back();
|
||||
auto& layer = allocation->active_spatial_layers.back();
|
||||
|
|
Loading…
Reference in a new issue