diff --git a/experiments/field_trials.py b/experiments/field_trials.py index 768b42f4d0..5321c3fa7a 100755 --- a/experiments/field_trials.py +++ b/experiments/field_trials.py @@ -886,9 +886,6 @@ POLICY_EXEMPT_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([ FieldTrial('WebRTC-VideoRateControl', 42220259, INDEFINITE), - FieldTrial('WebRTC-Vp9ExternalRefCtrl', - 42234783, - date(2024, 4, 1)), FieldTrial('WebRTC-Vp9InterLayerPred', NO_BUG, # chromium:949536 INDEFINITE), @@ -902,7 +899,7 @@ POLICY_EXEMPT_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([ ]) # yapf: disable POLICY_EXEMPT_FIELD_TRIALS_DIGEST: str = \ - '32ec47da125c13ceb01a908627c7c10aada3d4dd' + '936929707bc1d3db75b6702394ca3b69ef328410' REGISTERED_FIELD_TRIALS: FrozenSet[FieldTrial] = ACTIVE_FIELD_TRIALS.union( POLICY_EXEMPT_FIELD_TRIALS) diff --git a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc index c558f9262d..e8b2bb68a0 100644 --- a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc +++ b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc @@ -274,7 +274,6 @@ LibvpxVp9Encoder::LibvpxVp9Encoder(const Environment& env, "WebRTC-Vp9IssueKeyFrameOnLayerDeactivation")), is_svc_(false), inter_layer_pred_(InterLayerPredMode::kOn), - external_ref_control_(false), // Set in InitEncode because of tests. trusted_rate_controller_(RateControlSettings(env.field_trials()) .LibvpxVp9TrustedRateController()), first_frame_in_picture_(true), @@ -285,8 +284,6 @@ LibvpxVp9Encoder::LibvpxVp9Encoder(const Environment& env, is_flexible_mode_(false), variable_framerate_controller_(variable_framerate_screenshare::kMinFps), quality_scaler_experiment_(ParseQualityScalerConfig(env.field_trials())), - external_ref_ctrl_( - !env.field_trials().IsDisabled("WebRTC-Vp9ExternalRefCtrl")), performance_flags_(ParsePerformanceFlagsFromTrials(env.field_trials())), num_steady_state_frames_(0), config_changed_(true), @@ -687,13 +684,6 @@ int LibvpxVp9Encoder::InitEncode(const VideoCodec* inst, return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; } - // External reference control is required for different frame rate on spatial - // layers because libvpx generates rtp incompatible references in this case. - external_ref_control_ = external_ref_ctrl_ || - (num_spatial_layers_ > 1 && - codec_.mode == VideoCodecMode::kScreensharing) || - inter_layer_pred_ == InterLayerPredMode::kOn; - if (num_temporal_layers_ == 1) { gof_.SetGofInfoVP9(kTemporalStructureMode1); config_->temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING; @@ -726,14 +716,12 @@ int LibvpxVp9Encoder::InitEncode(const VideoCodec* inst, return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; } - if (external_ref_control_) { - config_->temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_BYPASS; - if (num_temporal_layers_ > 1 && num_spatial_layers_ > 1 && - codec_.mode == VideoCodecMode::kScreensharing) { - // External reference control for several temporal layers with different - // frame rates on spatial layers is not implemented yet. - return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; - } + config_->temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_BYPASS; + if (num_temporal_layers_ > 1 && num_spatial_layers_ > 1 && + codec_.mode == VideoCodecMode::kScreensharing) { + // External reference control for several temporal layers with different + // frame rates on spatial layers is not implemented yet. + return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; } ref_buf_ = {}; @@ -1207,7 +1195,7 @@ int LibvpxVp9Encoder::Encode(const VideoFrame& input_image, vpx_svc_ref_frame_config_t ref_config = Vp9References(layer_frames_); libvpx_->codec_control(encoder_, VP9E_SET_SVC_REF_FRAME_CONFIG, &ref_config); - } else if (external_ref_control_) { + } else { vpx_svc_ref_frame_config_t ref_config = SetReferences(force_key_frame_, layer_id.spatial_layer_id); diff --git a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.h b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.h index 0073380520..752caa0d0d 100644 --- a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.h +++ b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.h @@ -158,7 +158,6 @@ class LibvpxVp9Encoder : public VideoEncoder { bool layer_deactivation_requires_key_frame_; bool is_svc_; InterLayerPredMode inter_layer_pred_; - bool external_ref_control_; const bool trusted_rate_controller_; vpx_svc_frame_drop_t svc_drop_frame_; bool first_frame_in_picture_; @@ -197,7 +196,6 @@ class LibvpxVp9Encoder : public VideoEncoder { } quality_scaler_experiment_; static QualityScalerExperiment ParseQualityScalerConfig( const FieldTrialsView& trials); - const bool external_ref_ctrl_; // Flags that can affect speed vs quality tradeoff, and are configureable per // resolution ranges. 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 4cd9dd4b56..08d786773c 100644 --- a/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc +++ b/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc @@ -735,8 +735,6 @@ TEST(Vp9ImplTest, SpatialUpswitchNotAtGOFBoundary) { TEST_F(TestVp9Impl, DisableEnableBaseLayerTriggersKeyFrame) { // Configure encoder to produce N spatial layers. Encode frames for all // layers. Then disable all but the last layer. Then reenable all back again. - test::ScopedFieldTrials override_field_trials( - "WebRTC-Vp9ExternalRefCtrl/Enabled/"); const size_t num_spatial_layers = 3; const size_t num_temporal_layers = 3; // Must not be multiple of temporal period to exercise all code paths. @@ -1954,18 +1952,14 @@ TEST_F(TestVp9Impl, EncoderInfoFpsAllocationFlexibleMode) { } class Vp9ImplWithLayeringTest - : public ::testing::TestWithParam> { + : public ::testing::TestWithParam> { protected: Vp9ImplWithLayeringTest() : num_spatial_layers_(std::get<0>(GetParam())), - num_temporal_layers_(std::get<1>(GetParam())), - override_field_trials_(std::get<2>(GetParam()) - ? "WebRTC-Vp9ExternalRefCtrl/Enabled/" - : "") {} + num_temporal_layers_(std::get<1>(GetParam())) {} const uint8_t num_spatial_layers_; const uint8_t num_temporal_layers_; - const test::ScopedFieldTrials override_field_trials_; }; TEST_P(Vp9ImplWithLayeringTest, FlexibleMode) { @@ -2032,8 +2026,7 @@ TEST_P(Vp9ImplWithLayeringTest, FlexibleMode) { INSTANTIATE_TEST_SUITE_P(All, Vp9ImplWithLayeringTest, ::testing::Combine(::testing::Values(1, 2, 3), - ::testing::Values(1, 2, 3), - ::testing::Bool())); + ::testing::Values(1, 2, 3))); class TestVp9ImplFrameDropping : public TestVp9Impl { protected: diff --git a/test/fuzzers/vp9_encoder_references_fuzzer.cc b/test/fuzzers/vp9_encoder_references_fuzzer.cc index 88c0d43bed..e41847d29e 100644 --- a/test/fuzzers/vp9_encoder_references_fuzzer.cc +++ b/test/fuzzers/vp9_encoder_references_fuzzer.cc @@ -192,7 +192,6 @@ class FieldTrials : public FieldTrialsView { ~FieldTrials() override = default; std::string Lookup(absl::string_view key) const override { static constexpr absl::string_view kBinaryFieldTrials[] = { - "WebRTC-Vp9ExternalRefCtrl", "WebRTC-Vp9IssueKeyFrameOnLayerDeactivation", }; for (size_t i = 0; i < ABSL_ARRAYSIZE(kBinaryFieldTrials); ++i) { diff --git a/video/full_stack_tests.cc b/video/full_stack_tests.cc index 7e462605e1..123ca10f0e 100644 --- a/video/full_stack_tests.cc +++ b/video/full_stack_tests.cc @@ -1008,8 +1008,7 @@ TEST(FullStackTest, Vp9ksvc_3sl_Low) { TEST(FullStackTest, Vp9ksvc_3sl_Low_Bw_Limited) { webrtc::test::ScopedFieldTrials override_trials( - AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/" - "WebRTC-Vp9ExternalRefCtrl/Enabled/")); + AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/")); auto fixture = CreateVideoQualityTestFixture(); ParamsWithLogging simulcast; simulcast.config->link_capacity = DataRate::KilobitsPerSec(500);