mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Make dav1d the default AV1 decoder.
Bug: chromium:1330308, b/234414450 Change-Id: Idc35c9e3612843001f8d7d9361f3769b45350e63 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268183 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37483}
This commit is contained in:
parent
7b19036b80
commit
26910ffe22
2 changed files with 5 additions and 31 deletions
|
@ -51,7 +51,7 @@ std::vector<SdpVideoFormat> InternalDecoderFactory::GetSupportedFormats()
|
|||
formats.push_back(h264_format);
|
||||
|
||||
if (kIsLibaomAv1DecoderSupported ||
|
||||
(kDav1dIsIncluded && field_trial::IsEnabled(kDav1dFieldTrial))) {
|
||||
(kDav1dIsIncluded && !field_trial::IsDisabled(kDav1dFieldTrial))) {
|
||||
formats.push_back(SdpVideoFormat(cricket::kAv1CodecName));
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ std::unique_ptr<VideoDecoder> InternalDecoderFactory::CreateVideoDecoder(
|
|||
return H264Decoder::Create();
|
||||
|
||||
if (absl::EqualsIgnoreCase(format.name, cricket::kAv1CodecName) &&
|
||||
kDav1dIsIncluded && field_trial::IsEnabled(kDav1dFieldTrial)) {
|
||||
kDav1dIsIncluded && !field_trial::IsDisabled(kDav1dFieldTrial)) {
|
||||
return CreateDav1dDecoder();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "media/engine/internal_encoder_factory.h"
|
||||
#include "media/engine/simulcast_encoder_adapter.h"
|
||||
#include "modules/video_coding/codecs/av1/libaom_av1_decoder.h"
|
||||
#include "test/field_trial.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/file_utils.h"
|
||||
|
||||
|
@ -40,15 +39,7 @@ VideoCodecTestFixture::Config CreateConfig(std::string filename) {
|
|||
return config;
|
||||
}
|
||||
|
||||
class VideoCodecTestAv1 : public ::testing::TestWithParam<std::string> {
|
||||
public:
|
||||
VideoCodecTestAv1() : scoped_field_trial_(GetParam()) {}
|
||||
|
||||
private:
|
||||
ScopedFieldTrials scoped_field_trial_;
|
||||
};
|
||||
|
||||
TEST_P(VideoCodecTestAv1, HighBitrate) {
|
||||
TEST(VideoCodecTestAv1, HighBitrate) {
|
||||
auto config = CreateConfig("foreman_cif");
|
||||
config.SetCodecSettings(cricket::kAv1CodecName, 1, 1, 1, false, true, true,
|
||||
kCifWidth, kCifHeight);
|
||||
|
@ -66,7 +57,7 @@ TEST_P(VideoCodecTestAv1, HighBitrate) {
|
|||
fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
|
||||
}
|
||||
|
||||
TEST_P(VideoCodecTestAv1, VeryLowBitrate) {
|
||||
TEST(VideoCodecTestAv1, VeryLowBitrate) {
|
||||
auto config = CreateConfig("foreman_cif");
|
||||
config.SetCodecSettings(cricket::kAv1CodecName, 1, 1, 1, false, true, true,
|
||||
kCifWidth, kCifHeight);
|
||||
|
@ -86,7 +77,7 @@ TEST_P(VideoCodecTestAv1, VeryLowBitrate) {
|
|||
#if !defined(WEBRTC_ANDROID)
|
||||
constexpr int kHdWidth = 1280;
|
||||
constexpr int kHdHeight = 720;
|
||||
TEST_P(VideoCodecTestAv1, Hd) {
|
||||
TEST(VideoCodecTestAv1, Hd) {
|
||||
auto config = CreateConfig("ConferenceMotion_1280_720_50");
|
||||
config.SetCodecSettings(cricket::kAv1CodecName, 1, 1, 1, false, true, true,
|
||||
kHdWidth, kHdHeight);
|
||||
|
@ -106,23 +97,6 @@ TEST_P(VideoCodecTestAv1, Hd) {
|
|||
}
|
||||
#endif
|
||||
|
||||
std::vector<std::string> GetTestValues() {
|
||||
std::vector<std::string> field_trial_values;
|
||||
#if defined(RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY)
|
||||
field_trial_values.push_back("WebRTC-Dav1dDecoder/Enabled/");
|
||||
#endif
|
||||
if (kIsLibaomAv1DecoderSupported) {
|
||||
// As long as the field trial doesn't enable dav1d the libaom decoder will
|
||||
// be used instead.
|
||||
field_trial_values.push_back("");
|
||||
}
|
||||
return field_trial_values;
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(Decoder,
|
||||
VideoCodecTestAv1,
|
||||
testing::ValuesIn(GetTestValues()));
|
||||
|
||||
} // namespace
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
|
Loading…
Reference in a new issue