• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:max +full:- +full:width

4  *  Use of this source code is governed by a BSD-style license
37 "WebRTC-LegacySimulcastLayerLimit";
48 // Min/max bitrate for the higher one of the two simulcast stream used for
60 int width; member
98 // As the resolution goes down, interpolate the target and max bitrates down
100 // and the max will be capped from below accordingly.
108 return a * (1.0 - rate) + b * rate; in Interpolate()
114 trials.Lookup("WebRTC-LowresSimulcastBitrateInterpolation"), "Enabled"); in EnableLowresBitrateInterpolation()
124 SimulcastFormat& format0x0 = formats[formats.size() - 1]; in GetSimulcastFormats()
125 const SimulcastFormat& format_prev = formats[formats.size() - 2]; in GetSimulcastFormats()
136 trials.Lookup("WebRTC-VP8ConferenceTemporalLayers"); in DefaultNumberOfTemporalLayers()
154 int FindSimulcastFormatIndex(int width, in FindSimulcastFormatIndex() argument
157 RTC_DCHECK_GE(width, 0); in FindSimulcastFormatIndex()
161 if (width * height >= formats[i].width * formats[i].height) { in FindSimulcastFormatIndex()
166 return -1; in FindSimulcastFormatIndex()
171 // Round size to nearest simulcast-friendly size.
172 // Simulcast stream width and height must both be dividable by
173 // |2 ^ (simulcast_layers - 1)|.
175 int base2_exponent = static_cast<int>(simulcast_layers) - 1; in NormalizeSimulcastSize()
186 int width, in InterpolateSimulcastFormat() argument
192 width, height, enable_lowres_bitrate_interpolation); in InterpolateSimulcastFormat()
196 formats[index - 1].width * formats[index - 1].height; in InterpolateSimulcastFormat()
197 const int total_pixels_down = formats[index].width * formats[index].height; in InterpolateSimulcastFormat()
198 const int total_pixels = width * height; in InterpolateSimulcastFormat()
199 const float rate = (total_pixels_up - total_pixels) / in InterpolateSimulcastFormat()
200 static_cast<float>(total_pixels_up - total_pixels_down); in InterpolateSimulcastFormat()
204 ? formats[index - 1].max_layers in InterpolateSimulcastFormat()
206 webrtc::DataRate max_bitrate = Interpolate(formats[index - 1].max_bitrate, in InterpolateSimulcastFormat()
209 formats[index - 1].target_bitrate, formats[index].target_bitrate, rate); in InterpolateSimulcastFormat()
210 webrtc::DataRate min_bitrate = Interpolate(formats[index - 1].min_bitrate, in InterpolateSimulcastFormat()
213 return {width, height, max_layers, max_bitrate, target_bitrate, min_bitrate}; in InterpolateSimulcastFormat()
217 int width, in InterpolateSimulcastFormat() argument
220 return InterpolateSimulcastFormat(width, height, absl::nullopt, in InterpolateSimulcastFormat()
225 int width, in FindSimulcastMaxBitrate() argument
228 return InterpolateSimulcastFormat(width, height, in FindSimulcastMaxBitrate()
234 int width, in FindSimulcastTargetBitrate() argument
237 return InterpolateSimulcastFormat(width, height, in FindSimulcastTargetBitrate()
243 int width, in FindSimulcastMinBitrate() argument
246 return InterpolateSimulcastFormat(width, height, in FindSimulcastMinBitrate()
253 if (layers->empty()) in BoostMaxSimulcastLayer()
260 // Spend additional bits to boost the max layer. in BoostMaxSimulcastLayer()
261 const webrtc::DataRate bitrate_left = max_bitrate - total_bitrate; in BoostMaxSimulcastLayer()
262 layers->back().max_bitrate_bps += bitrate_left.bps(); in BoostMaxSimulcastLayer()
272 for (size_t s = 0; s < layers.size() - 1; ++s) { in GetTotalMaxBitrate()
279 size_t LimitSimulcastLayerCount(int width, in LimitSimulcastLayerCount() argument
286 // Max layers from one higher resolution in kSimulcastFormats will be used in LimitSimulcastLayerCount()
287 // if the ratio (pixels_up - pixels) / (pixels_up - pixels_down) is less in LimitSimulcastLayerCount()
292 trials.Lookup("WebRTC-SimulcastLayerLimitRoundUp")); in LimitSimulcastLayerCount()
296 size_t adaptive_layer_count = std::max( in LimitSimulcastLayerCount()
298 InterpolateSimulcastFormat(width, height, max_ratio.GetOptional(), in LimitSimulcastLayerCount()
313 int width, in GetSimulcastConfig() argument
327 return GetScreenshareLayers(max_layers, width, height, bitrate_priority, in GetSimulcastConfig()
333 // the WebRTC-LegacySimulcastLayerLimit field trial until they update. in GetSimulcastConfig()
335 LimitSimulcastLayerCount(width, height, min_layers, max_layers, trials); in GetSimulcastConfig()
337 return GetNormalSimulcastLayers(max_layers, width, height, bitrate_priority, in GetSimulcastConfig()
345 int width, in GetNormalSimulcastLayers() argument
357 // Format width and height has to be divisible by |2 ^ num_simulcast_layers - in GetNormalSimulcastLayers()
359 width = NormalizeSimulcastSize(width, layer_count); in GetNormalSimulcastLayers()
362 // -1) to lowest resolution at `s` = 0. in GetNormalSimulcastLayers()
363 for (size_t s = layer_count - 1;; --s) { in GetNormalSimulcastLayers()
364 layers[s].width = width; in GetNormalSimulcastLayers()
366 // TODO(pbos): Fill actual temporal-layer bitrate thresholds. in GetNormalSimulcastLayers()
371 FindSimulcastMaxBitrate(width, height, in GetNormalSimulcastLayers()
375 FindSimulcastTargetBitrate(width, height, in GetNormalSimulcastLayers()
405 FindSimulcastMinBitrate(width, height, in GetNormalSimulcastLayers()
411 std::max(layers[s].min_bitrate_bps, layers[s].max_bitrate_bps); in GetNormalSimulcastLayers()
413 std::max(layers[s].min_bitrate_bps, layers[s].target_bitrate_bps); in GetNormalSimulcastLayers()
417 width /= 2; in GetNormalSimulcastLayers()
435 int width, in GetScreenshareLayers() argument
447 // piggybacked on the VideoCodec struct as target and max bitrates, in GetScreenshareLayers()
449 layers[0].width = width; in GetScreenshareLayers()
466 // Set the max bitrate to where the base layer would have been if temporal in GetScreenshareLayers()
473 // Experimental temporal layer mode used, use increased max bitrate. in GetScreenshareLayers()
478 layers[1].width = width; in GetScreenshareLayers()
491 // The bitrate priority currently implemented on a per-sender level, so we in GetScreenshareLayers()