1 /*
2  *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #include <memory>
12 #include <vector>
13 
14 #include "api/test/create_videocodec_test_fixture.h"
15 #include "api/test/video/function_video_encoder_factory.h"
16 #include "api/video_codecs/sdp_video_format.h"
17 #include "media/base/media_constants.h"
18 #include "media/engine/internal_decoder_factory.h"
19 #include "media/engine/internal_encoder_factory.h"
20 #include "media/engine/simulcast_encoder_adapter.h"
21 #include "modules/video_coding/utility/vp8_header_parser.h"
22 #include "modules/video_coding/utility/vp9_uncompressed_header_parser.h"
23 #include "test/gtest.h"
24 #include "test/testsupport/file_utils.h"
25 
26 namespace webrtc {
27 namespace test {
28 
29 using VideoStatistics = VideoCodecTestStats::VideoStatistics;
30 
31 namespace {
32 // Codec settings.
33 const int kCifWidth = 352;
34 const int kCifHeight = 288;
35 const int kNumFramesShort = 100;
36 const int kNumFramesLong = 300;
37 const size_t kBitrateRdPerfKbps[] = {100,  200,  300,  400,  500,  600,
38                                      700,  800,  1000, 1250, 1400, 1600,
39                                      1800, 2000, 2200, 2500};
40 const size_t kNumFirstFramesToSkipAtRdPerfAnalysis = 60;
41 
42 class QpFrameChecker : public VideoCodecTestFixture::EncodedFrameChecker {
43  public:
CheckEncodedFrame(webrtc::VideoCodecType codec,const EncodedImage & encoded_frame) const44   void CheckEncodedFrame(webrtc::VideoCodecType codec,
45                          const EncodedImage& encoded_frame) const override {
46     int qp;
47     if (codec == kVideoCodecVP8) {
48       EXPECT_TRUE(vp8::GetQp(encoded_frame.data(), encoded_frame.size(), &qp));
49     } else if (codec == kVideoCodecVP9) {
50       EXPECT_TRUE(vp9::GetQp(encoded_frame.data(), encoded_frame.size(), &qp));
51     } else {
52       RTC_NOTREACHED();
53     }
54     EXPECT_EQ(encoded_frame.qp_, qp) << "Encoder QP != parsed bitstream QP.";
55   }
56 };
57 
CreateConfig()58 VideoCodecTestFixture::Config CreateConfig() {
59   VideoCodecTestFixture::Config config;
60   config.filename = "foreman_cif";
61   config.filepath = ResourcePath(config.filename, "yuv");
62   config.num_frames = kNumFramesLong;
63   config.use_single_core = true;
64   return config;
65 }
66 
PrintRdPerf(std::map<size_t,std::vector<VideoStatistics>> rd_stats)67 void PrintRdPerf(std::map<size_t, std::vector<VideoStatistics>> rd_stats) {
68   printf("--> Summary\n");
69   printf("%11s %5s %6s %11s %12s %11s %13s %13s %5s %7s %7s %7s %13s %13s\n",
70          "uplink_kbps", "width", "height", "spatial_idx", "temporal_idx",
71          "target_kbps", "downlink_kbps", "framerate_fps", "psnr", "psnr_y",
72          "psnr_u", "psnr_v", "enc_speed_fps", "dec_speed_fps");
73   for (const auto& rd_stat : rd_stats) {
74     const size_t bitrate_kbps = rd_stat.first;
75     for (const auto& layer_stat : rd_stat.second) {
76       printf(
77           "%11zu %5zu %6zu %11zu %12zu %11zu %13zu %13.2f %5.2f %7.2f %7.2f "
78           "%7.2f"
79           "%13.2f %13.2f\n",
80           bitrate_kbps, layer_stat.width, layer_stat.height,
81           layer_stat.spatial_idx, layer_stat.temporal_idx,
82           layer_stat.target_bitrate_kbps, layer_stat.bitrate_kbps,
83           layer_stat.framerate_fps, layer_stat.avg_psnr, layer_stat.avg_psnr_y,
84           layer_stat.avg_psnr_u, layer_stat.avg_psnr_v,
85           layer_stat.enc_speed_fps, layer_stat.dec_speed_fps);
86     }
87   }
88 }
89 }  // namespace
90 
91 #if defined(RTC_ENABLE_VP9)
TEST(VideoCodecTestLibvpx,HighBitrateVP9)92 TEST(VideoCodecTestLibvpx, HighBitrateVP9) {
93   auto config = CreateConfig();
94   config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
95                           kCifWidth, kCifHeight);
96   config.num_frames = kNumFramesShort;
97   const auto frame_checker = std::make_unique<QpFrameChecker>();
98   config.encoded_frame_checker = frame_checker.get();
99   auto fixture = CreateVideoCodecTestFixture(config);
100 
101   std::vector<RateProfile> rate_profiles = {{500, 30, 0}};
102 
103   std::vector<RateControlThresholds> rc_thresholds = {
104       {5, 1, 0, 1, 0.3, 0.1, 0, 1}};
105 
106   std::vector<QualityThresholds> quality_thresholds = {{37, 36, 0.94, 0.92}};
107 
108   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
109 }
110 
TEST(VideoCodecTestLibvpx,ChangeBitrateVP9)111 TEST(VideoCodecTestLibvpx, ChangeBitrateVP9) {
112   auto config = CreateConfig();
113   config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
114                           kCifWidth, kCifHeight);
115   const auto frame_checker = std::make_unique<QpFrameChecker>();
116   config.encoded_frame_checker = frame_checker.get();
117   auto fixture = CreateVideoCodecTestFixture(config);
118 
119   std::vector<RateProfile> rate_profiles = {
120       {200, 30, 0},  // target_kbps, input_fps, frame_num
121       {700, 30, 100},
122       {500, 30, 200}};
123 
124   std::vector<RateControlThresholds> rc_thresholds = {
125       {5, 2, 0, 1, 0.5, 0.1, 0, 1},
126       {15, 3, 0, 1, 0.5, 0.1, 0, 0},
127       {11, 2, 0, 1, 0.5, 0.1, 0, 0}};
128 
129   std::vector<QualityThresholds> quality_thresholds = {
130       {34, 33, 0.90, 0.88}, {38, 35, 0.95, 0.91}, {35, 34, 0.93, 0.90}};
131 
132   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
133 }
134 
TEST(VideoCodecTestLibvpx,ChangeFramerateVP9)135 TEST(VideoCodecTestLibvpx, ChangeFramerateVP9) {
136   auto config = CreateConfig();
137   config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
138                           kCifWidth, kCifHeight);
139   const auto frame_checker = std::make_unique<QpFrameChecker>();
140   config.encoded_frame_checker = frame_checker.get();
141   auto fixture = CreateVideoCodecTestFixture(config);
142 
143   std::vector<RateProfile> rate_profiles = {
144       {100, 24, 0},  // target_kbps, input_fps, frame_num
145       {100, 15, 100},
146       {100, 10, 200}};
147 
148   // Framerate mismatch should be lower for lower framerate.
149   std::vector<RateControlThresholds> rc_thresholds = {
150       {10, 2, 40, 1, 0.5, 0.2, 0, 1},
151       {8, 2, 5, 1, 0.5, 0.2, 0, 0},
152       {5, 2, 0, 1, 0.5, 0.3, 0, 0}};
153 
154   // Quality should be higher for lower framerates for the same content.
155   std::vector<QualityThresholds> quality_thresholds = {
156       {33, 32, 0.88, 0.86}, {33.5, 32, 0.90, 0.86}, {33.5, 31.5, 0.90, 0.85}};
157 
158   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
159 }
160 
TEST(VideoCodecTestLibvpx,DenoiserOnVP9)161 TEST(VideoCodecTestLibvpx, DenoiserOnVP9) {
162   auto config = CreateConfig();
163   config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, true, true, false,
164                           kCifWidth, kCifHeight);
165   config.num_frames = kNumFramesShort;
166   const auto frame_checker = std::make_unique<QpFrameChecker>();
167   config.encoded_frame_checker = frame_checker.get();
168   auto fixture = CreateVideoCodecTestFixture(config);
169 
170   std::vector<RateProfile> rate_profiles = {{500, 30, 0}};
171 
172   std::vector<RateControlThresholds> rc_thresholds = {
173       {5, 1, 0, 1, 0.3, 0.1, 0, 1}};
174 
175   std::vector<QualityThresholds> quality_thresholds = {{37.5, 36, 0.94, 0.93}};
176 
177   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
178 }
179 
TEST(VideoCodecTestLibvpx,VeryLowBitrateVP9)180 TEST(VideoCodecTestLibvpx, VeryLowBitrateVP9) {
181   auto config = CreateConfig();
182   config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, true,
183                           kCifWidth, kCifHeight);
184   const auto frame_checker = std::make_unique<QpFrameChecker>();
185   config.encoded_frame_checker = frame_checker.get();
186   auto fixture = CreateVideoCodecTestFixture(config);
187 
188   std::vector<RateProfile> rate_profiles = {{50, 30, 0}};
189 
190   std::vector<RateControlThresholds> rc_thresholds = {
191       {15, 3, 75, 1, 0.5, 0.4, 2, 1}};
192 
193   std::vector<QualityThresholds> quality_thresholds = {{28, 25, 0.80, 0.65}};
194 
195   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
196 }
197 
198 // TODO(marpan): Add temporal layer test for VP9, once changes are in
199 // vp9 wrapper for this.
200 
201 #endif  // defined(RTC_ENABLE_VP9)
202 
TEST(VideoCodecTestLibvpx,HighBitrateVP8)203 TEST(VideoCodecTestLibvpx, HighBitrateVP8) {
204   auto config = CreateConfig();
205   config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, true, true, false,
206                           kCifWidth, kCifHeight);
207   config.num_frames = kNumFramesShort;
208   const auto frame_checker = std::make_unique<QpFrameChecker>();
209   config.encoded_frame_checker = frame_checker.get();
210   auto fixture = CreateVideoCodecTestFixture(config);
211 
212   std::vector<RateProfile> rate_profiles = {{500, 30, 0}};
213 
214   std::vector<RateControlThresholds> rc_thresholds = {
215       {5, 1, 0, 1, 0.2, 0.1, 0, 1}};
216 
217 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
218   std::vector<QualityThresholds> quality_thresholds = {{35, 33, 0.91, 0.89}};
219 #else
220   std::vector<QualityThresholds> quality_thresholds = {{37, 35, 0.93, 0.91}};
221 #endif
222   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
223 }
224 
225 // The tests below are currently disabled for Android. For ARM, the encoder
226 // uses |cpu_speed| = 12, as opposed to default |cpu_speed| <= 6 for x86,
227 // which leads to significantly different quality. The quality and rate control
228 // settings in the tests below are defined for encoder speed setting
229 // |cpu_speed| <= ~6. A number of settings would need to be significantly
230 // modified for the |cpu_speed| = 12 case. For now, keep the tests below
231 // disabled on Android. Some quality parameter in the above test has been
232 // adjusted to also pass for |cpu_speed| <= 12.
233 
234 // TODO(webrtc:9267): Fails on iOS
235 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
236 #define MAYBE_ChangeBitrateVP8 DISABLED_ChangeBitrateVP8
237 #else
238 #define MAYBE_ChangeBitrateVP8 ChangeBitrateVP8
239 #endif
TEST(VideoCodecTestLibvpx,MAYBE_ChangeBitrateVP8)240 TEST(VideoCodecTestLibvpx, MAYBE_ChangeBitrateVP8) {
241   auto config = CreateConfig();
242   config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, true, true, false,
243                           kCifWidth, kCifHeight);
244   const auto frame_checker = std::make_unique<QpFrameChecker>();
245   config.encoded_frame_checker = frame_checker.get();
246   auto fixture = CreateVideoCodecTestFixture(config);
247 
248   std::vector<RateProfile> rate_profiles = {
249       {200, 30, 0},  // target_kbps, input_fps, frame_num
250       {800, 30, 100},
251       {500, 30, 200}};
252 
253   std::vector<RateControlThresholds> rc_thresholds = {
254       {5, 1, 0, 1, 0.2, 0.1, 0, 1},
255       {15.5, 1, 0, 1, 0.2, 0.1, 0, 0},
256       {15, 1, 0, 1, 0.2, 0.1, 0, 0}};
257 
258 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
259   std::vector<QualityThresholds> quality_thresholds = {
260       {31.8, 31, 0.86, 0.85}, {36, 34.8, 0.92, 0.90}, {33.5, 32, 0.90, 0.88}};
261 #else
262   std::vector<QualityThresholds> quality_thresholds = {
263       {33, 32, 0.89, 0.88}, {38, 36, 0.94, 0.93}, {35, 34, 0.92, 0.91}};
264 #endif
265   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
266 }
267 
268 // TODO(webrtc:9267): Fails on iOS
269 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
270 #define MAYBE_ChangeFramerateVP8 DISABLED_ChangeFramerateVP8
271 #else
272 #define MAYBE_ChangeFramerateVP8 ChangeFramerateVP8
273 #endif
TEST(VideoCodecTestLibvpx,MAYBE_ChangeFramerateVP8)274 TEST(VideoCodecTestLibvpx, MAYBE_ChangeFramerateVP8) {
275   auto config = CreateConfig();
276   config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, true, true, false,
277                           kCifWidth, kCifHeight);
278   const auto frame_checker = std::make_unique<QpFrameChecker>();
279   config.encoded_frame_checker = frame_checker.get();
280   auto fixture = CreateVideoCodecTestFixture(config);
281 
282   std::vector<RateProfile> rate_profiles = {
283       {80, 24, 0},  // target_kbps, input_fps, frame_index_rate_update
284       {80, 15, 100},
285       {80, 10, 200}};
286 
287 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
288   std::vector<RateControlThresholds> rc_thresholds = {
289       {10, 2, 60, 1, 0.3, 0.3, 0, 1},
290       {10, 2, 30, 1, 0.3, 0.3, 0, 0},
291       {10, 2, 10, 1, 0.3, 0.2, 0, 0}};
292 #else
293   std::vector<RateControlThresholds> rc_thresholds = {
294       {10, 2, 20, 1, 0.3, 0.15, 0, 1},
295       {5, 2, 5, 1, 0.3, 0.15, 0, 0},
296       {4, 2, 1, 1, 0.3, 0.2, 0, 0}};
297 #endif
298 
299 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
300   std::vector<QualityThresholds> quality_thresholds = {
301       {31, 30, 0.85, 0.84}, {31.5, 30.5, 0.86, 0.84}, {30.5, 29, 0.83, 0.78}};
302 #else
303   std::vector<QualityThresholds> quality_thresholds = {
304       {31, 30, 0.87, 0.86}, {32, 31, 0.89, 0.86}, {32, 30, 0.87, 0.82}};
305 #endif
306   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
307 }
308 
309 #if defined(WEBRTC_ANDROID)
310 #define MAYBE_TemporalLayersVP8 DISABLED_TemporalLayersVP8
311 #else
312 #define MAYBE_TemporalLayersVP8 TemporalLayersVP8
313 #endif
TEST(VideoCodecTestLibvpx,MAYBE_TemporalLayersVP8)314 TEST(VideoCodecTestLibvpx, MAYBE_TemporalLayersVP8) {
315   auto config = CreateConfig();
316   config.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 3, true, true, false,
317                           kCifWidth, kCifHeight);
318   const auto frame_checker = std::make_unique<QpFrameChecker>();
319   config.encoded_frame_checker = frame_checker.get();
320   auto fixture = CreateVideoCodecTestFixture(config);
321 
322   std::vector<RateProfile> rate_profiles = {{200, 30, 0}, {400, 30, 150}};
323 
324 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
325   std::vector<RateControlThresholds> rc_thresholds = {
326       {10, 1, 2.1, 1, 0.2, 0.1, 0, 1}, {12, 2, 3, 1, 0.2, 0.1, 0, 1}};
327 #else
328   std::vector<RateControlThresholds> rc_thresholds = {
329       {5, 1, 0, 1, 0.2, 0.1, 0, 1}, {10, 2, 0, 1, 0.2, 0.1, 0, 1}};
330 #endif
331 // Min SSIM drops because of high motion scene with complex backgound (trees).
332 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
333   std::vector<QualityThresholds> quality_thresholds = {{31, 30, 0.85, 0.83},
334                                                        {31, 28, 0.85, 0.75}};
335 #else
336   std::vector<QualityThresholds> quality_thresholds = {{32, 30, 0.88, 0.85},
337                                                        {33, 30, 0.89, 0.83}};
338 #endif
339   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
340 }
341 
342 #if defined(WEBRTC_ANDROID)
343 #define MAYBE_MultiresVP8 DISABLED_MultiresVP8
344 #else
345 #define MAYBE_MultiresVP8 MultiresVP8
346 #endif
TEST(VideoCodecTestLibvpx,MAYBE_MultiresVP8)347 TEST(VideoCodecTestLibvpx, MAYBE_MultiresVP8) {
348   auto config = CreateConfig();
349   config.filename = "ConferenceMotion_1280_720_50";
350   config.filepath = ResourcePath(config.filename, "yuv");
351   config.num_frames = 100;
352   config.SetCodecSettings(cricket::kVp8CodecName, 3, 1, 3, true, true, false,
353                           1280, 720);
354   const auto frame_checker = std::make_unique<QpFrameChecker>();
355   config.encoded_frame_checker = frame_checker.get();
356   auto fixture = CreateVideoCodecTestFixture(config);
357 
358   std::vector<RateProfile> rate_profiles = {{1500, 30, 0}};
359 #if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64)
360   std::vector<RateControlThresholds> rc_thresholds = {
361       {4.1, 1.04, 7, 0.18, 0.14, 0.08, 0, 1}};
362 #else
363   std::vector<RateControlThresholds> rc_thresholds = {
364       {5, 1, 5, 1, 0.3, 0.1, 0, 1}};
365 #endif
366   std::vector<QualityThresholds> quality_thresholds = {{34, 32, 0.90, 0.88}};
367 
368   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
369 }
370 
371 #if defined(WEBRTC_ANDROID)
372 #define MAYBE_SimulcastVP8 DISABLED_SimulcastVP8
373 #else
374 #define MAYBE_SimulcastVP8 SimulcastVP8
375 #endif
TEST(VideoCodecTestLibvpx,MAYBE_SimulcastVP8)376 TEST(VideoCodecTestLibvpx, MAYBE_SimulcastVP8) {
377   auto config = CreateConfig();
378   config.filename = "ConferenceMotion_1280_720_50";
379   config.filepath = ResourcePath(config.filename, "yuv");
380   config.num_frames = 100;
381   config.SetCodecSettings(cricket::kVp8CodecName, 3, 1, 3, true, true, false,
382                           1280, 720);
383   const auto frame_checker = std::make_unique<QpFrameChecker>();
384   config.encoded_frame_checker = frame_checker.get();
385 
386   InternalEncoderFactory internal_encoder_factory;
387   std::unique_ptr<VideoEncoderFactory> adapted_encoder_factory =
388       std::make_unique<FunctionVideoEncoderFactory>([&]() {
389         return std::make_unique<SimulcastEncoderAdapter>(
390             &internal_encoder_factory, SdpVideoFormat(cricket::kVp8CodecName));
391       });
392   std::unique_ptr<InternalDecoderFactory> internal_decoder_factory(
393       new InternalDecoderFactory());
394 
395   auto fixture =
396       CreateVideoCodecTestFixture(config, std::move(internal_decoder_factory),
397                                   std::move(adapted_encoder_factory));
398 
399   std::vector<RateProfile> rate_profiles = {{1500, 30, 0}};
400 
401   std::vector<RateControlThresholds> rc_thresholds = {
402       {20, 5, 90, 1, 0.5, 0.3, 0, 1}};
403   std::vector<QualityThresholds> quality_thresholds = {{34, 32, 0.90, 0.88}};
404 
405   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
406 }
407 
408 #if defined(WEBRTC_ANDROID)
409 #define MAYBE_SvcVP9 DISABLED_SvcVP9
410 #else
411 #define MAYBE_SvcVP9 SvcVP9
412 #endif
TEST(VideoCodecTestLibvpx,MAYBE_SvcVP9)413 TEST(VideoCodecTestLibvpx, MAYBE_SvcVP9) {
414   auto config = CreateConfig();
415   config.filename = "ConferenceMotion_1280_720_50";
416   config.filepath = ResourcePath(config.filename, "yuv");
417   config.num_frames = 100;
418   config.SetCodecSettings(cricket::kVp9CodecName, 1, 3, 3, true, true, false,
419                           1280, 720);
420   const auto frame_checker = std::make_unique<QpFrameChecker>();
421   config.encoded_frame_checker = frame_checker.get();
422   auto fixture = CreateVideoCodecTestFixture(config);
423 
424   std::vector<RateProfile> rate_profiles = {{1500, 30, 0}};
425 
426   std::vector<RateControlThresholds> rc_thresholds = {
427       {5, 1, 5, 1, 0.3, 0.1, 0, 1}};
428   std::vector<QualityThresholds> quality_thresholds = {{36, 34, 0.93, 0.90}};
429 
430   fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr);
431 }
432 
TEST(VideoCodecTestLibvpx,DISABLED_MultiresVP8RdPerf)433 TEST(VideoCodecTestLibvpx, DISABLED_MultiresVP8RdPerf) {
434   auto config = CreateConfig();
435   config.filename = "FourPeople_1280x720_30";
436   config.filepath = ResourcePath(config.filename, "yuv");
437   config.num_frames = 300;
438   config.print_frame_level_stats = true;
439   config.SetCodecSettings(cricket::kVp8CodecName, 3, 1, 3, true, true, false,
440                           1280, 720);
441   const auto frame_checker = std::make_unique<QpFrameChecker>();
442   config.encoded_frame_checker = frame_checker.get();
443   auto fixture = CreateVideoCodecTestFixture(config);
444 
445   std::map<size_t, std::vector<VideoStatistics>> rd_stats;
446   for (size_t bitrate_kbps : kBitrateRdPerfKbps) {
447     std::vector<RateProfile> rate_profiles = {{bitrate_kbps, 30, 0}};
448 
449     fixture->RunTest(rate_profiles, nullptr, nullptr, nullptr);
450 
451     rd_stats[bitrate_kbps] =
452         fixture->GetStats().SliceAndCalcLayerVideoStatistic(
453             kNumFirstFramesToSkipAtRdPerfAnalysis, config.num_frames - 1);
454   }
455 
456   PrintRdPerf(rd_stats);
457 }
458 
TEST(VideoCodecTestLibvpx,DISABLED_SvcVP9RdPerf)459 TEST(VideoCodecTestLibvpx, DISABLED_SvcVP9RdPerf) {
460   auto config = CreateConfig();
461   config.filename = "FourPeople_1280x720_30";
462   config.filepath = ResourcePath(config.filename, "yuv");
463   config.num_frames = 300;
464   config.print_frame_level_stats = true;
465   config.SetCodecSettings(cricket::kVp9CodecName, 1, 3, 3, true, true, false,
466                           1280, 720);
467   const auto frame_checker = std::make_unique<QpFrameChecker>();
468   config.encoded_frame_checker = frame_checker.get();
469   auto fixture = CreateVideoCodecTestFixture(config);
470 
471   std::map<size_t, std::vector<VideoStatistics>> rd_stats;
472   for (size_t bitrate_kbps : kBitrateRdPerfKbps) {
473     std::vector<RateProfile> rate_profiles = {{bitrate_kbps, 30, 0}};
474 
475     fixture->RunTest(rate_profiles, nullptr, nullptr, nullptr);
476 
477     rd_stats[bitrate_kbps] =
478         fixture->GetStats().SliceAndCalcLayerVideoStatistic(
479             kNumFirstFramesToSkipAtRdPerfAnalysis, config.num_frames - 1);
480   }
481 
482   PrintRdPerf(rd_stats);
483 }
484 
485 }  // namespace test
486 }  // namespace webrtc
487