| OLD | NEW |
| 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 |
| 11 #include "webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest
.h" | 11 #include "webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest
.h" |
| 12 | 12 |
| 13 #include "webrtc/test/testsupport/fileutils.h" | 13 #include "webrtc/test/testsupport/fileutils.h" |
| 14 | 14 |
| 15 namespace webrtc { | 15 namespace webrtc { |
| 16 namespace test { | 16 namespace test { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 // Loop variables. | 20 // Loop variables. |
| 21 const int kBitrates[] = {30, 50, 100, 200, 300, 500, 1000}; | 21 const int kBitrates[] = {500}; |
| 22 const VideoCodecType kVideoCodecType[] = {kVideoCodecVP8}; | 22 const VideoCodecType kVideoCodecType[] = {kVideoCodecVP8}; |
| 23 const bool kHwCodec[] = {false}; | 23 const bool kHwCodec[] = {false}; |
| 24 | 24 |
| 25 // Codec settings. | 25 // Codec settings. |
| 26 const bool kResilienceOn = false; | 26 const bool kResilienceOn = false; |
| 27 const int kNumTemporalLayers = 1; | 27 const int kNumTemporalLayers = 1; |
| 28 const bool kDenoisingOn = false; | 28 const bool kDenoisingOn = false; |
| 29 const bool kErrorConcealmentOn = false; | 29 const bool kErrorConcealmentOn = false; |
| 30 const bool kSpatialResizeOn = false; | 30 const bool kSpatialResizeOn = false; |
| 31 const bool kFrameDropperOn = false; | 31 const bool kFrameDropperOn = false; |
| 32 | 32 |
| 33 // Test settings. | 33 // Test settings. |
| 34 const bool kUseSingleCore = false; | 34 const bool kUseSingleCore = false; |
| 35 const VisualizationParams kVisualizationParams = { | 35 const VisualizationParams kVisualizationParams = { |
| 36 false, // save_encoded_ivf | 36 false, // save_encoded_ivf |
| 37 false, // save_decoded_y4m | 37 false, // save_decoded_y4m |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 const int kNumFrames = 300; | 40 const int kNumFrames = 30; |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 // Tests for plotting statistics from logs. | 44 // Tests for plotting statistics from logs. |
| 45 class PlotVideoProcessorIntegrationTest | 45 class VideoProcessorIntegrationTestParameterized |
| 46 : public VideoProcessorIntegrationTest, | 46 : public VideoProcessorIntegrationTest, |
| 47 public ::testing::WithParamInterface< | 47 public ::testing::WithParamInterface< |
| 48 ::testing::tuple<int, VideoCodecType, bool>> { | 48 ::testing::tuple<int, VideoCodecType, bool>> { |
| 49 protected: | 49 protected: |
| 50 PlotVideoProcessorIntegrationTest() | 50 VideoProcessorIntegrationTestParameterized() |
| 51 : bitrate_(::testing::get<0>(GetParam())), | 51 : bitrate_(::testing::get<0>(GetParam())), |
| 52 codec_type_(::testing::get<1>(GetParam())), | 52 codec_type_(::testing::get<1>(GetParam())), |
| 53 hw_codec_(::testing::get<2>(GetParam())) {} | 53 hw_codec_(::testing::get<2>(GetParam())) {} |
| 54 ~PlotVideoProcessorIntegrationTest() override = default; | 54 ~VideoProcessorIntegrationTestParameterized() override = default; |
| 55 | 55 |
| 56 void RunTest(int width, | 56 void RunTest(int width, |
| 57 int height, | 57 int height, |
| 58 int framerate, | 58 int framerate, |
| 59 const std::string& filename) { | 59 const std::string& filename) { |
| 60 config_.filename = filename; | 60 config_.filename = filename; |
| 61 config_.input_filename = ResourcePath(filename, "yuv"); | 61 config_.input_filename = ResourcePath(filename, "yuv"); |
| 62 config_.output_filename = | 62 config_.output_filename = |
| 63 TempFilename(OutputPath(), "plot_videoprocessor_integrationtest"); | 63 TempFilename(OutputPath(), "plot_videoprocessor_integrationtest"); |
| 64 config_.use_single_core = kUseSingleCore; | 64 config_.use_single_core = kUseSingleCore; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 79 | 79 |
| 80 ProcessFramesAndMaybeVerify(rate_profile, nullptr, nullptr, | 80 ProcessFramesAndMaybeVerify(rate_profile, nullptr, nullptr, |
| 81 &kVisualizationParams); | 81 &kVisualizationParams); |
| 82 } | 82 } |
| 83 | 83 |
| 84 const int bitrate_; | 84 const int bitrate_; |
| 85 const VideoCodecType codec_type_; | 85 const VideoCodecType codec_type_; |
| 86 const bool hw_codec_; | 86 const bool hw_codec_; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 INSTANTIATE_TEST_CASE_P( | 89 INSTANTIATE_TEST_CASE_P(CodecSettings, |
| 90 CodecSettings, | 90 VideoProcessorIntegrationTestParameterized, |
| 91 PlotVideoProcessorIntegrationTest, | 91 ::testing::Combine(::testing::ValuesIn(kBitrates), |
| 92 ::testing::Combine(::testing::ValuesIn(kBitrates), | 92 ::testing::ValuesIn(kVideoCodecType), |
| 93 ::testing::ValuesIn(kVideoCodecType), | 93 ::testing::ValuesIn(kHwCodec))); |
| 94 ::testing::ValuesIn(kHwCodec))); | |
| 95 | 94 |
| 96 TEST_P(PlotVideoProcessorIntegrationTest, Process_128x96_30fps) { | 95 TEST_P(VideoProcessorIntegrationTestParameterized, Process_128x96_30fps) { |
| 97 RunTest(128, 96, 30, "foreman_128x96"); | 96 RunTest(128, 96, 30, "foreman_128x96"); |
| 98 } | 97 } |
| 99 | 98 |
| 100 TEST_P(PlotVideoProcessorIntegrationTest, Process_160x120_30fps) { | 99 TEST_P(VideoProcessorIntegrationTestParameterized, Process_160x120_30fps) { |
| 101 RunTest(160, 120, 30, "foreman_160x120"); | 100 RunTest(160, 120, 30, "foreman_160x120"); |
| 102 } | 101 } |
| 103 | 102 |
| 104 TEST_P(PlotVideoProcessorIntegrationTest, Process_176x144_30fps) { | 103 TEST_P(VideoProcessorIntegrationTestParameterized, Process_176x144_30fps) { |
| 105 RunTest(176, 144, 30, "foreman_176x144"); | 104 RunTest(176, 144, 30, "foreman_176x144"); |
| 106 } | 105 } |
| 107 | 106 |
| 108 TEST_P(PlotVideoProcessorIntegrationTest, Process_320x240_30fps) { | 107 TEST_P(VideoProcessorIntegrationTestParameterized, Process_320x240_30fps) { |
| 109 RunTest(320, 240, 30, "foreman_320x240"); | 108 RunTest(320, 240, 30, "foreman_320x240"); |
| 110 } | 109 } |
| 111 | 110 |
| 112 TEST_P(PlotVideoProcessorIntegrationTest, Process_352x288_30fps) { | 111 TEST_P(VideoProcessorIntegrationTestParameterized, Process_352x288_30fps) { |
| 113 RunTest(352, 288, 30, "foreman_cif"); | 112 RunTest(352, 288, 30, "foreman_cif"); |
| 114 } | 113 } |
| 115 | 114 |
| 116 } // namespace test | 115 } // namespace test |
| 117 } // namespace webrtc | 116 } // namespace webrtc |
| OLD | NEW |