Keep bitrate constraints.
Don't relax layer bitrate constraints if spatial layering was requested. Bug: webrtc:10063 Change-Id: Ie572fb6c5fbc677a7dd240dc75b3d75a6e784001 Reviewed-on: https://webrtc-review.googlesource.com/c/112139 Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25828}
This commit is contained in:

committed by
Commit Bot

parent
ff088a1702
commit
3312092b42
@ -181,7 +181,10 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
|
||||
video_codec.VP9()->numberOfTemporalLayers,
|
||||
video_codec.mode == VideoCodecMode::kScreensharing);
|
||||
|
||||
const bool no_spatial_layering = (spatial_layers.size() == 1);
|
||||
// If there was no request for spatial layering, don't limit bitrate
|
||||
// of single spatial layer.
|
||||
const bool no_spatial_layering =
|
||||
video_codec.VP9()->numberOfSpatialLayers <= 1;
|
||||
if (no_spatial_layering) {
|
||||
// Use codec's bitrate limits.
|
||||
spatial_layers.back().minBitrate = video_codec.minBitrate;
|
||||
|
@ -286,4 +286,21 @@ TEST_F(VideoCodecInitializerTest,
|
||||
kDefaultMaxBitrateBps / 1000);
|
||||
}
|
||||
|
||||
TEST_F(VideoCodecInitializerTest,
|
||||
Vp9KeepBitrateLimitsIfNumberOfSpatialLayersIsReducedToOne) {
|
||||
// Request 3 spatial layers for 320x180 input. Actual number of layers will be
|
||||
// reduced to 1 due to low input resolution but SVC bitrate limits should be
|
||||
// applied.
|
||||
SetUpFor(VideoCodecType::kVideoCodecVP9, 3, 3, false);
|
||||
VideoStream stream = DefaultStream();
|
||||
stream.width = 320;
|
||||
stream.height = 180;
|
||||
stream.num_temporal_layers = 3;
|
||||
streams_.push_back(stream);
|
||||
|
||||
EXPECT_TRUE(InitializeCodec());
|
||||
EXPECT_LT(codec_out_.spatialLayers[0].maxBitrate,
|
||||
kDefaultMaxBitrateBps / 1000);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
Reference in New Issue
Block a user