| 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 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 bool Lost() override; | 44 bool Lost() override; |
| 45 void set_loss_rate(double loss_rate) { loss_rate_ = loss_rate; } | 45 void set_loss_rate(double loss_rate) { loss_rate_ = loss_rate; } |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 double loss_rate_; | 48 double loss_rate_; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class GilbertElliotLoss : public LossModel { | 51 class GilbertElliotLoss : public LossModel { |
| 52 public: | 52 public: |
| 53 GilbertElliotLoss(double prob_trans_11, double prob_trans_01); | 53 GilbertElliotLoss(double prob_trans_11, double prob_trans_01); |
| 54 ~GilbertElliotLoss() override; |
| 54 bool Lost() override; | 55 bool Lost() override; |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 // Prob. of losing current packet, when previous packet is lost. | 58 // Prob. of losing current packet, when previous packet is lost. |
| 58 double prob_trans_11_; | 59 double prob_trans_11_; |
| 59 // Prob. of losing current packet, when previous packet is not lost. | 60 // Prob. of losing current packet, when previous packet is not lost. |
| 60 double prob_trans_01_; | 61 double prob_trans_01_; |
| 61 bool lost_last_; | 62 bool lost_last_; |
| 62 std::unique_ptr<UniformLoss> uniform_loss_model_; | 63 std::unique_ptr<UniformLoss> uniform_loss_model_; |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 class NetEqQualityTest : public ::testing::Test { | 66 class NetEqQualityTest : public ::testing::Test { |
| 66 protected: | 67 protected: |
| 67 NetEqQualityTest(int block_duration_ms, | 68 NetEqQualityTest(int block_duration_ms, |
| 68 int in_sampling_khz, | 69 int in_sampling_khz, |
| 69 int out_sampling_khz, | 70 int out_sampling_khz, |
| 70 NetEqDecoder decoder_type); | 71 NetEqDecoder decoder_type); |
| 71 virtual ~NetEqQualityTest(); | 72 ~NetEqQualityTest() override; |
| 72 | 73 |
| 73 void SetUp() override; | 74 void SetUp() override; |
| 74 | 75 |
| 75 // EncodeBlock(...) does the following: | 76 // EncodeBlock(...) does the following: |
| 76 // 1. encodes a block of audio, saved in |in_data| and has a length of | 77 // 1. encodes a block of audio, saved in |in_data| and has a length of |
| 77 // |block_size_samples| (samples per channel), | 78 // |block_size_samples| (samples per channel), |
| 78 // 2. save the bit stream to |payload| of |max_bytes| bytes in size, | 79 // 2. save the bit stream to |payload| of |max_bytes| bytes in size, |
| 79 // 3. returns the length of the payload (in bytes), | 80 // 3. returns the length of the payload (in bytes), |
| 80 virtual int EncodeBlock(int16_t* in_data, size_t block_size_samples, | 81 virtual int EncodeBlock(int16_t* in_data, size_t block_size_samples, |
| 81 rtc::Buffer* payload, size_t max_bytes) = 0; | 82 rtc::Buffer* payload, size_t max_bytes) = 0; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 AudioFrame out_frame_; | 131 AudioFrame out_frame_; |
| 131 WebRtcRTPHeader rtp_header_; | 132 WebRtcRTPHeader rtp_header_; |
| 132 | 133 |
| 133 size_t total_payload_size_bytes_; | 134 size_t total_payload_size_bytes_; |
| 134 }; | 135 }; |
| 135 | 136 |
| 136 } // namespace test | 137 } // namespace test |
| 137 } // namespace webrtc | 138 } // namespace webrtc |
| 138 | 139 |
| 139 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ | 140 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ |
| OLD | NEW |