diff --git a/api/video_codecs/video_codec.h b/api/video_codecs/video_codec.h index c07fae9b8b..330bbbce19 100644 --- a/api/video_codecs/video_codec.h +++ b/api/video_codecs/video_codec.h @@ -19,7 +19,7 @@ #include "absl/types/optional.h" #include "api/video/video_bitrate_allocation.h" #include "api/video/video_codec_type.h" -#include "common_types.h" // NOLINT(build/include_directory) +#include "common_types.h" // NOLINT(build/include) #include "rtc_base/system/rtc_export.h" namespace webrtc { diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index fde66bb1bb..9b8f00ca90 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -6,7 +6,6 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -import("//third_party/libaom/options.gni") import("../../webrtc.gni") rtc_library("encoded_frame") { @@ -786,9 +785,6 @@ if (rtc_include_tests) { "codecs/vp8/test/vp8_impl_unittest.cc", "codecs/vp9/test/vp9_impl_unittest.cc", ] - if (enable_libaom) { - sources += [ "codecs/test/videocodec_test_libaom.cc" ] - } if (rtc_use_h264) { sources += [ "codecs/test/videocodec_test_openh264.cc" ] } diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc index 8ac9a21a14..2e9a48af09 100644 --- a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +++ b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc @@ -38,6 +38,7 @@ namespace webrtc { namespace { // Encoder configuration parameters +constexpr int kQpMax = 56; constexpr int kQpMin = 10; constexpr int kUsageProfile = 1; // 0 = good quality; 1 = real-time. constexpr int kMinQindex = 58; // Min qindex threshold for QP scaling. @@ -183,7 +184,7 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, cfg_.g_input_bit_depth = kBitDepth; cfg_.kf_mode = AOM_KF_DISABLED; cfg_.rc_min_quantizer = kQpMin; - cfg_.rc_max_quantizer = encoder_settings_.qpMax; + cfg_.rc_max_quantizer = kQpMax; cfg_.g_usage = kUsageProfile; if (svc_controller_->StreamConfig().num_spatial_layers > 1 || svc_controller_->StreamConfig().num_temporal_layers > 1) { @@ -283,7 +284,7 @@ bool LibaomAv1Encoder::SetSvcParams( svc_config.num_spatial_layers * svc_config.num_temporal_layers; for (int i = 0; i < num_layers; ++i) { svc_params.min_quantizers[i] = kQpMin; - svc_params.max_quantizers[i] = encoder_settings_.qpMax; + svc_params.max_quantizers[i] = kQpMax; } // Assume each temporal layer doubles framerate. diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc index 492e8f006a..6d1d0bbb24 100644 --- a/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc +++ b/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc @@ -32,7 +32,6 @@ TEST(LibaomAv1EncoderTest, InitAndRelease) { codec_settings.width = 1280; codec_settings.height = 720; codec_settings.maxFramerate = 30; - codec_settings.qpMax = 63; VideoEncoder::Capabilities capabilities(/*loss_notification=*/false); VideoEncoder::Settings encoder_settings(capabilities, /*number_of_cores=*/1, /*max_payload_size=*/1200); diff --git a/modules/video_coding/codecs/av1/libaom_av1_unittest.cc b/modules/video_coding/codecs/av1/libaom_av1_unittest.cc index eab043c59a..a2752e6377 100644 --- a/modules/video_coding/codecs/av1/libaom_av1_unittest.cc +++ b/modules/video_coding/codecs/av1/libaom_av1_unittest.cc @@ -100,7 +100,6 @@ class TestAv1Encoder { codec_settings.height = kHeight; codec_settings.maxFramerate = kFramerate; codec_settings.maxBitrate = 1000; - codec_settings.qpMax = 63; VideoEncoder::Settings encoder_settings( VideoEncoder::Capabilities(/*loss_notification=*/false), /*number_of_cores=*/1, /*max_payload_size=*/1200); diff --git a/modules/video_coding/codecs/test/videocodec_test_fixture_impl.cc b/modules/video_coding/codecs/test/videocodec_test_fixture_impl.cc index 990db54321..7e92b360bd 100644 --- a/modules/video_coding/codecs/test/videocodec_test_fixture_impl.cc +++ b/modules/video_coding/codecs/test/videocodec_test_fixture_impl.cc @@ -205,9 +205,6 @@ void VideoCodecTestFixtureImpl::Config::SetCodecSettings( codec_settings.VP9()->numberOfSpatialLayers = static_cast(num_spatial_layers); break; - case kVideoCodecAV1: - codec_settings.qpMax = 63; - break; case kVideoCodecH264: codec_settings.H264()->frameDroppingOn = frame_dropper_on; codec_settings.H264()->keyFrameInterval = kBaseKeyFrameInterval; diff --git a/modules/video_coding/codecs/test/videocodec_test_libaom.cc b/modules/video_coding/codecs/test/videocodec_test_libaom.cc deleted file mode 100644 index 45730aa09e..0000000000 --- a/modules/video_coding/codecs/test/videocodec_test_libaom.cc +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "api/test/create_videocodec_test_fixture.h" -#include "api/test/video/function_video_encoder_factory.h" -#include "api/video_codecs/sdp_video_format.h" -#include "media/base/media_constants.h" -#include "media/engine/internal_decoder_factory.h" -#include "media/engine/internal_encoder_factory.h" -#include "media/engine/simulcast_encoder_adapter.h" -#include "test/gtest.h" -#include "test/testsupport/file_utils.h" - -namespace webrtc { -namespace test { -namespace { -// Test clips settings. -constexpr int kCifWidth = 352; -constexpr int kCifHeight = 288; -constexpr int kNumFramesLong = 300; - -VideoCodecTestFixture::Config CreateConfig(std::string filename) { - VideoCodecTestFixture::Config config; - config.filename = filename; - config.filepath = ResourcePath(config.filename, "yuv"); - config.num_frames = kNumFramesLong; - config.use_single_core = true; - return config; -} - -TEST(VideoCodecTestLibaom, HighBitrateAV1) { - auto config = CreateConfig("foreman_cif"); - config.SetCodecSettings(cricket::kAv1CodecName, 1, 1, 1, false, true, true, - kCifWidth, kCifHeight); - config.num_frames = kNumFramesLong; - auto fixture = CreateVideoCodecTestFixture(config); - - std::vector rate_profiles = {{500, 30, 0}}; - - std::vector rc_thresholds = { - {12, 1, 0, 1, 0.3, 0.1, 0, 1}}; - - std::vector quality_thresholds = {{37, 34, 0.94, 0.92}}; - - fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr); -} - -TEST(VideoCodecTestLibaom, VeryLowBitrateAV1) { - auto config = CreateConfig("foreman_cif"); - config.SetCodecSettings(cricket::kAv1CodecName, 1, 1, 1, false, true, true, - kCifWidth, kCifHeight); - auto fixture = CreateVideoCodecTestFixture(config); - - std::vector rate_profiles = {{50, 30, 0}}; - - std::vector rc_thresholds = { - {15, 8, 75, 2, 2, 2, 2, 1}}; - - std::vector quality_thresholds = {{28, 25, 0.70, 0.62}}; - - fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr); -} - -#if !defined(WEBRTC_ANDROID) -constexpr int kHdWidth = 1280; -constexpr int kHdHeight = 720; -TEST(VideoCodecTestLibaom, HdAV1) { - auto config = CreateConfig("ConferenceMotion_1280_720_50"); - config.SetCodecSettings(cricket::kAv1CodecName, 1, 1, 1, false, true, true, - kHdWidth, kHdHeight); - config.num_frames = kNumFramesLong; - auto fixture = CreateVideoCodecTestFixture(config); - - std::vector rate_profiles = {{1000, 50, 0}}; - - std::vector rc_thresholds = { - {13, 3, 0, 1, 0.3, 0.1, 0, 1}}; - - std::vector quality_thresholds = {{36, 32, 0.93, 0.87}}; - - fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr); -} -#endif - -} // namespace -} // namespace test -} // namespace webrtc