| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ |
| 13 | 13 |
| 14 #include <fstream> | 14 #include <fstream> |
| 15 #include <memory> |
| 15 #include <gflags/gflags.h> | 16 #include <gflags/gflags.h> |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "webrtc/base/scoped_ptr.h" | |
| 18 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" | 18 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" |
| 19 #include "webrtc/modules/audio_coding/neteq/tools/audio_sink.h" | 19 #include "webrtc/modules/audio_coding/neteq/tools/audio_sink.h" |
| 20 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" | 20 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" |
| 21 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" | 21 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" |
| 22 #include "webrtc/typedefs.h" | 22 #include "webrtc/typedefs.h" |
| 23 | 23 |
| 24 using google::RegisterFlagValidator; | 24 using google::RegisterFlagValidator; |
| 25 | 25 |
| 26 namespace webrtc { | 26 namespace webrtc { |
| 27 namespace test { | 27 namespace test { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 51 public: | 51 public: |
| 52 GilbertElliotLoss(double prob_trans_11, double prob_trans_01); | 52 GilbertElliotLoss(double prob_trans_11, double prob_trans_01); |
| 53 bool Lost() override; | 53 bool Lost() override; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 // Prob. of losing current packet, when previous packet is lost. | 56 // Prob. of losing current packet, when previous packet is lost. |
| 57 double prob_trans_11_; | 57 double prob_trans_11_; |
| 58 // Prob. of losing current packet, when previous packet is not lost. | 58 // Prob. of losing current packet, when previous packet is not lost. |
| 59 double prob_trans_01_; | 59 double prob_trans_01_; |
| 60 bool lost_last_; | 60 bool lost_last_; |
| 61 rtc::scoped_ptr<UniformLoss> uniform_loss_model_; | 61 std::unique_ptr<UniformLoss> uniform_loss_model_; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 class NetEqQualityTest : public ::testing::Test { | 64 class NetEqQualityTest : public ::testing::Test { |
| 65 protected: | 65 protected: |
| 66 NetEqQualityTest(int block_duration_ms, | 66 NetEqQualityTest(int block_duration_ms, |
| 67 int in_sampling_khz, | 67 int in_sampling_khz, |
| 68 int out_sampling_khz, | 68 int out_sampling_khz, |
| 69 NetEqDecoder decoder_type); | 69 NetEqDecoder decoder_type); |
| 70 virtual ~NetEqQualityTest(); | 70 virtual ~NetEqQualityTest(); |
| 71 | 71 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 // Number of samples per channel in a frame. | 113 // Number of samples per channel in a frame. |
| 114 const size_t in_size_samples_; | 114 const size_t in_size_samples_; |
| 115 | 115 |
| 116 // Expected output number of samples per channel in a frame. | 116 // Expected output number of samples per channel in a frame. |
| 117 const size_t out_size_samples_; | 117 const size_t out_size_samples_; |
| 118 | 118 |
| 119 size_t payload_size_bytes_; | 119 size_t payload_size_bytes_; |
| 120 size_t max_payload_bytes_; | 120 size_t max_payload_bytes_; |
| 121 | 121 |
| 122 rtc::scoped_ptr<InputAudioFile> in_file_; | 122 std::unique_ptr<InputAudioFile> in_file_; |
| 123 rtc::scoped_ptr<AudioSink> output_; | 123 std::unique_ptr<AudioSink> output_; |
| 124 std::ofstream log_file_; | 124 std::ofstream log_file_; |
| 125 | 125 |
| 126 rtc::scoped_ptr<RtpGenerator> rtp_generator_; | 126 std::unique_ptr<RtpGenerator> rtp_generator_; |
| 127 rtc::scoped_ptr<NetEq> neteq_; | 127 std::unique_ptr<NetEq> neteq_; |
| 128 rtc::scoped_ptr<LossModel> loss_model_; | 128 std::unique_ptr<LossModel> loss_model_; |
| 129 | 129 |
| 130 rtc::scoped_ptr<int16_t[]> in_data_; | 130 std::unique_ptr<int16_t[]> in_data_; |
| 131 rtc::scoped_ptr<uint8_t[]> payload_; | 131 std::unique_ptr<uint8_t[]> payload_; |
| 132 rtc::scoped_ptr<int16_t[]> out_data_; | 132 std::unique_ptr<int16_t[]> out_data_; |
| 133 WebRtcRTPHeader rtp_header_; | 133 WebRtcRTPHeader rtp_header_; |
| 134 | 134 |
| 135 size_t total_payload_size_bytes_; | 135 size_t total_payload_size_bytes_; |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace test | 138 } // namespace test |
| 139 } // namespace webrtc | 139 } // namespace webrtc |
| 140 | 140 |
| 141 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ | 141 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ |
| OLD | NEW |