Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: webrtc/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc

Issue 3008543002: Make rate control and quality thresholds optional in VideoProcessorIntegrationTest. (Closed)
Patch Set: asapersson comments 1. Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 PlotVideoProcessorIntegrationTest() 51 PlotVideoProcessorIntegrationTest()
52 : bitrate_(::testing::get<0>(GetParam())), 52 : bitrate_(::testing::get<0>(GetParam())),
53 codec_type_(::testing::get<1>(GetParam())), 53 codec_type_(::testing::get<1>(GetParam())),
54 hw_codec_(::testing::get<2>(GetParam())) {} 54 hw_codec_(::testing::get<2>(GetParam())) {}
55 ~PlotVideoProcessorIntegrationTest() override = default; 55 ~PlotVideoProcessorIntegrationTest() override = default;
56 56
57 void RunTest(int width, 57 void RunTest(int width,
58 int height, 58 int height,
59 int framerate, 59 int framerate,
60 const std::string& filename) { 60 const std::string& filename) {
61 // Bitrate and frame rate profile. 61 SetTestConfig(&config_, hw_codec_, kUseSingleCore, kPacketLoss, filename,
62 kVerboseLogging, kBatchMode);
63 SetCodecSettings(&config_, codec_type_, kNumTemporalLayers,
64 kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn,
65 kSpatialResizeOn, kResilienceOn, width, height);
66
62 RateProfile rate_profile; 67 RateProfile rate_profile;
63 SetRateProfile(&rate_profile, 68 SetRateProfile(&rate_profile,
64 0, // update_index 69 0, // update_index
65 bitrate_, framerate, 70 bitrate_, framerate,
66 0); // frame_index_rate_update 71 0); // frame_index_rate_update
67 rate_profile.frame_index_rate_update[1] = kNumFrames + 1; 72 rate_profile.frame_index_rate_update[1] = kNumFrames + 1;
68 rate_profile.num_frames = kNumFrames; 73 rate_profile.num_frames = kNumFrames;
69 74
70 // Codec/network settings. 75 ProcessFramesAndMaybeVerify(rate_profile, nullptr, nullptr,
71 SetTestConfig(&config_, hw_codec_, kUseSingleCore, kPacketLoss, filename, 76 &kVisualizationParams);
72 kVerboseLogging, kBatchMode);
73 SetCodecSettings(&config_, codec_type_, kNumTemporalLayers,
74 kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn,
75 kSpatialResizeOn, kResilienceOn, width, height);
76
77 // Use default thresholds for quality (PSNR and SSIM).
78 QualityThresholds quality_thresholds;
79
80 // Use very loose thresholds for rate control, so even poor HW codecs will
81 // pass the requirements.
82 RateControlThresholds rc_thresholds[1];
83 // clang-format off
84 SetRateControlThresholds(
85 rc_thresholds,
86 0, // update_index
87 kNumFrames + 1, // max_num_dropped_frames
88 10000, // max_key_frame_size_mismatch
89 10000, // max_delta_frame_size_mismatch
90 10000, // max_encoding_rate_mismatch
91 kNumFrames + 1, // max_time_hit_target
92 0, // num_spatial_resizes
93 1); // num_key_frames
94 // clang-format on
95
96 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
97 &kVisualizationParams);
98 } 77 }
99 78
100 const int bitrate_; 79 const int bitrate_;
101 const VideoCodecType codec_type_; 80 const VideoCodecType codec_type_;
102 const bool hw_codec_; 81 const bool hw_codec_;
103 }; 82 };
104 83
105 INSTANTIATE_TEST_CASE_P( 84 INSTANTIATE_TEST_CASE_P(
106 CodecSettings, 85 CodecSettings,
107 PlotVideoProcessorIntegrationTest, 86 PlotVideoProcessorIntegrationTest,
(...skipping 16 matching lines...) Expand all
124 TEST_P(PlotVideoProcessorIntegrationTest, Process_320x240_30fps) { 103 TEST_P(PlotVideoProcessorIntegrationTest, Process_320x240_30fps) {
125 RunTest(320, 240, 30, "foreman_320x240"); 104 RunTest(320, 240, 30, "foreman_320x240");
126 } 105 }
127 106
128 TEST_P(PlotVideoProcessorIntegrationTest, Process_352x288_30fps) { 107 TEST_P(PlotVideoProcessorIntegrationTest, Process_352x288_30fps) {
129 RunTest(352, 288, 30, "foreman_cif"); 108 RunTest(352, 288, 30, "foreman_cif");
130 } 109 }
131 110
132 } // namespace test 111 } // namespace test
133 } // namespace webrtc 112 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698