Reland "Add dav1d decoder to WebRTC."

This reverts commit 8498b7e7f6b90fa036de2a6887d34256f0565b4f.

Reason for revert: Updating CL to include conditional build flag.

Original change's description:
> Revert "Add dav1d decoder to WebRTC."
>
> This reverts commit 147858577d4db6d257d3cc248fe571a1bbf887e3.
>
> Reason for revert: High binary size increase
>
> Original change's description:
> > Add dav1d decoder to WebRTC.
> >
> > Bug: none
> > Change-Id: I7642f42e592dcf510679f881f118bc4dab93b31c
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237504
> > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
> > Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35394}
>
> TBR=danilchap@webrtc.org,mbonadei@webrtc.org,ilnik@webrtc.org,philipel@webrtc.org,mflodman@webrtc.org,ssilkin@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I00a8acd6ea94ce523c2d5ba705333c9174678180
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: none
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238560
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
> Owners-Override: Artem Titov <titovartem@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35395}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: none
Change-Id: Iff51848731646159e87e075c38af7cb6355f5b5b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238661
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35409}
This commit is contained in:
philipel
2021-11-23 11:00:24 +01:00
committed by WebRTC LUCI CQ
parent 707e5a0cd7
commit b09d87232b
11 changed files with 317 additions and 10 deletions

View File

@ -18,6 +18,8 @@
#include "media/engine/internal_decoder_factory.h"
#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"
@ -38,7 +40,15 @@ VideoCodecTestFixture::Config CreateConfig(std::string filename) {
return config;
}
TEST(VideoCodecTestLibaom, HighBitrateAV1) {
class VideoCodecTestAv1 : public ::testing::TestWithParam<std::string> {
public:
VideoCodecTestAv1() : scoped_field_trial_(GetParam()) {}
private:
ScopedFieldTrials scoped_field_trial_;
};
TEST_P(VideoCodecTestAv1, HighBitrate) {
auto config = CreateConfig("foreman_cif");
config.SetCodecSettings(cricket::kAv1CodecName, 1, 1, 1, false, true, true,
kCifWidth, kCifHeight);
@ -56,7 +66,7 @@ TEST(VideoCodecTestLibaom, HighBitrateAV1) {
fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
}
TEST(VideoCodecTestLibaom, VeryLowBitrateAV1) {
TEST_P(VideoCodecTestAv1, VeryLowBitrate) {
auto config = CreateConfig("foreman_cif");
config.SetCodecSettings(cricket::kAv1CodecName, 1, 1, 1, false, true, true,
kCifWidth, kCifHeight);
@ -76,7 +86,7 @@ TEST(VideoCodecTestLibaom, VeryLowBitrateAV1) {
#if !defined(WEBRTC_ANDROID)
constexpr int kHdWidth = 1280;
constexpr int kHdHeight = 720;
TEST(VideoCodecTestLibaom, HdAV1) {
TEST_P(VideoCodecTestAv1, Hd) {
auto config = CreateConfig("ConferenceMotion_1280_720_50");
config.SetCodecSettings(cricket::kAv1CodecName, 1, 1, 1, false, true, true,
kHdWidth, kHdHeight);
@ -95,6 +105,23 @@ TEST(VideoCodecTestLibaom, HdAV1) {
}
#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