Add ability for VideoEncoder to signal frame rate allocation.
This CL add new data to the VideoEncoder::EncoderInfo struct, indicating how the encoder intends to allocate frames across spatial and temporal layers. This metadata will be used in upcoming CLs to control how the encoder's rate controller performs. Bug: webrtc:10155 Change-Id: Id56fae04bae5f230d1a985171097d7ca83a3be8a Reviewed-on: https://webrtc-review.googlesource.com/c/117900 Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26300}
This commit is contained in:
@ -1354,6 +1354,22 @@ VideoEncoder::EncoderInfo VP9EncoderImpl::GetEncoderInfo() const {
|
||||
info.has_trusted_rate_controller = trusted_rate_controller_;
|
||||
info.is_hardware_accelerated = false;
|
||||
info.has_internal_source = false;
|
||||
for (size_t si = 0; si < num_spatial_layers_; ++si) {
|
||||
info.fps_allocation[si].clear();
|
||||
if (!codec_.spatialLayers[si].active) {
|
||||
continue;
|
||||
}
|
||||
// This spatial layer may already use a fraction of the total frame rate.
|
||||
const float sl_fps_fraction =
|
||||
codec_.spatialLayers[si].maxFramerate / codec_.maxFramerate;
|
||||
for (size_t ti = 0; ti < num_temporal_layers_; ++ti) {
|
||||
const uint32_t decimator =
|
||||
num_temporal_layers_ <= 1 ? 1 : config_->ts_rate_decimator[ti];
|
||||
RTC_DCHECK_GT(decimator, 0);
|
||||
info.fps_allocation[si].push_back(rtc::saturated_cast<uint8_t>(
|
||||
EncoderInfo::kMaxFramerateFraction * (sl_fps_fraction / decimator)));
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user