From a723ecc39990f500434d7069178ae1d6cfbbd8ac Mon Sep 17 00:00:00 2001 From: Michael Horowitz Date: Fri, 13 Jul 2018 19:58:22 +0000 Subject: [PATCH] I have been informed that the fix to libvpx for which the unit test in this CL was created has been rolled into chrome. Consequently, I will again revert to (hopefully) land this CL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reland "Reland "Unit test for case where the number of active and configured spatial"" This reverts commit 426d5b75bb8c50f44189c17760330181b21dbf0f. Reason for revert: Original change's description: > Revert "Reland "Unit test for case where the number of active and configured spatial"" > > This reverts commit e144f7fb83956b59297bffccc821e465699d8ae2. > > Reason for revert: downstream project failures > > Original change's description: > > Reland "Unit test for case where the number of active and configured spatial" > > > > This reverts commit 425193b4a92f0df1f3fbea3626b9abf6a38f67ec. > > > > Reason for revert: > > > > Original change's description: > > > Revert "Unit test for case where the number of active and configured spatial" > > > > > > This reverts commit 5eb6045ce5754ce815929c54dd27ab0bf3ae62ba. > > > > > > Reason for revert: Test breaks downstream. > > > > > > Original change's description: > > > > Unit test for case where the number of active and configured spatial > > > > layers differ. > > > > > > > > Bug: webrtc:9472 > > > > Change-Id: I5cf292a12d73777ca0fd5771eb1a4756626f640c > > > > Reviewed-on: https://webrtc-review.googlesource.com/85644 > > > > Reviewed-by: Sergey Silkin > > > > Reviewed-by: Rasmus Brandt > > > > Commit-Queue: Michael Horowitz > > > > Cr-Commit-Position: refs/heads/master@{#23782} > > > > > > TBR=brandtr@webrtc.org,ssilkin@webrtc.org,mhoro@webrtc.org > > > > > > Change-Id: Ib97cdb127e79ee969f7cb3f931cb7bd533f13af0 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: webrtc:9472 > > > Reviewed-on: https://webrtc-review.googlesource.com/86320 > > > Reviewed-by: Björn Terelius > > > Commit-Queue: Björn Terelius > > > Cr-Commit-Position: refs/heads/master@{#23785} > > > > TBR=brandtr@webrtc.org,terelius@webrtc.org,ssilkin@webrtc.org,mhoro@webrtc.org > > > > # Not skipping CQ checks because original CL landed > 1 day ago. > > > > Bug: webrtc:9472 > > Change-Id: I796909c553702a0fa19e5e16e4586f915569b134 > > Reviewed-on: https://webrtc-review.googlesource.com/87220 > > Reviewed-by: Michael Horowitz > > Commit-Queue: Michael Horowitz > > Cr-Commit-Position: refs/heads/master@{#23847} > > TBR=brandtr@webrtc.org,terelius@webrtc.org,ssilkin@webrtc.org,mhoro@webrtc.org > > Change-Id: Iedd3a25d8a40fa6a406fd8e5394031beee4206ed > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9472 > Reviewed-on: https://webrtc-review.googlesource.com/87340 > Reviewed-by: Alessio Bazzica > Commit-Queue: Alessio Bazzica > Cr-Commit-Position: refs/heads/master@{#23859} TBR=brandtr@webrtc.org,alessiob@webrtc.org,terelius@webrtc.org,ssilkin@webrtc.org,mhoro@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:9472 Change-Id: I6f33c7e18a66de5f8c6ca4a2823d28d02de3c756 Reviewed-on: https://webrtc-review.googlesource.com/88581 Reviewed-by: Michael Horowitz Commit-Queue: Michael Horowitz Cr-Commit-Position: refs/heads/master@{#23975} --- .../codecs/vp9/test/vp9_impl_unittest.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc b/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc index 64c1e52ac8..1d899aea9c 100644 --- a/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc +++ b/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc @@ -219,14 +219,17 @@ TEST_F(TestVp9Impl, EncoderExplicitLayering) { } TEST_F(TestVp9Impl, EnableDisableSpatialLayers) { - // Configure encoder to produce N spatial layers. Encode few frames of layer 0 - // then enable layer 1 and encode few more frames and so on until layer N-1. + // Configure encoder to produce N spatial layers. Encode frames of layer 0 + // then enable layer 1 and encode more frames and so on until layer N-1. // Then disable layers one by one in the same way. + // Note: bit rate allocation is high to avoid frame dropping due to rate + // control, the encoder should always produce a frame. A dropped + // frame indicates a problem and the test will fail. const size_t num_spatial_layers = 3; - const size_t num_frames_to_encode = 2; + const size_t num_frames_to_encode = 5; ConfigureSvc(num_spatial_layers); - codec_settings_.VP9()->frameDroppingOn = false; + codec_settings_.VP9()->frameDroppingOn = true; EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, encoder_->InitEncode(&codec_settings_, 1 /* number of cores */, @@ -234,8 +237,10 @@ TEST_F(TestVp9Impl, EnableDisableSpatialLayers) { VideoBitrateAllocation bitrate_allocation; for (size_t sl_idx = 0; sl_idx < num_spatial_layers; ++sl_idx) { + // Allocate high bit rate to avoid frame dropping due to rate control. bitrate_allocation.SetBitrate( - sl_idx, 0, codec_settings_.spatialLayers[sl_idx].targetBitrate * 1000); + sl_idx, 0, + codec_settings_.spatialLayers[sl_idx].targetBitrate * 1000 * 2); EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, encoder_->SetRateAllocation(bitrate_allocation, codec_settings_.maxFramerate));