| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 enum NetEqDecoder decoder_type); | 69 enum NetEqDecoder decoder_type); |
| 70 virtual ~NetEqQualityTest(); | 70 virtual ~NetEqQualityTest(); |
| 71 | 71 |
| 72 void SetUp() override; | 72 void SetUp() override; |
| 73 | 73 |
| 74 // EncodeBlock(...) does the following: | 74 // EncodeBlock(...) does the following: |
| 75 // 1. encodes a block of audio, saved in |in_data| and has a length of | 75 // 1. encodes a block of audio, saved in |in_data| and has a length of |
| 76 // |block_size_samples| (samples per channel), | 76 // |block_size_samples| (samples per channel), |
| 77 // 2. save the bit stream to |payload| of |max_bytes| bytes in size, | 77 // 2. save the bit stream to |payload| of |max_bytes| bytes in size, |
| 78 // 3. returns the length of the payload (in bytes), | 78 // 3. returns the length of the payload (in bytes), |
| 79 virtual int EncodeBlock(int16_t* in_data, int block_size_samples, | 79 virtual int EncodeBlock(int16_t* in_data, size_t block_size_samples, |
| 80 uint8_t* payload, int max_bytes) = 0; | 80 uint8_t* payload, size_t max_bytes) = 0; |
| 81 | 81 |
| 82 // PacketLost(...) determines weather a packet sent at an indicated time gets | 82 // PacketLost(...) determines weather a packet sent at an indicated time gets |
| 83 // lost or not. | 83 // lost or not. |
| 84 bool PacketLost(); | 84 bool PacketLost(); |
| 85 | 85 |
| 86 // DecodeBlock() decodes a block of audio using the payload stored in | 86 // DecodeBlock() decodes a block of audio using the payload stored in |
| 87 // |payload_| with the length of |payload_size_bytes_| (bytes). The decoded | 87 // |payload_| with the length of |payload_size_bytes_| (bytes). The decoded |
| 88 // audio is to be stored in |out_data_|. | 88 // audio is to be stored in |out_data_|. |
| 89 int DecodeBlock(); | 89 int DecodeBlock(); |
| 90 | 90 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 104 private: | 104 private: |
| 105 int decoded_time_ms_; | 105 int decoded_time_ms_; |
| 106 int decodable_time_ms_; | 106 int decodable_time_ms_; |
| 107 double drift_factor_; | 107 double drift_factor_; |
| 108 int packet_loss_rate_; | 108 int packet_loss_rate_; |
| 109 const int block_duration_ms_; | 109 const int block_duration_ms_; |
| 110 const int in_sampling_khz_; | 110 const int in_sampling_khz_; |
| 111 const int out_sampling_khz_; | 111 const int out_sampling_khz_; |
| 112 | 112 |
| 113 // Number of samples per channel in a frame. | 113 // Number of samples per channel in a frame. |
| 114 const int 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 int 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 int max_payload_bytes_; | 120 size_t max_payload_bytes_; |
| 121 | 121 |
| 122 rtc::scoped_ptr<InputAudioFile> in_file_; | 122 rtc::scoped_ptr<InputAudioFile> in_file_; |
| 123 rtc::scoped_ptr<AudioSink> output_; | 123 rtc::scoped_ptr<AudioSink> output_; |
| 124 std::ofstream log_file_; | 124 std::ofstream log_file_; |
| 125 | 125 |
| 126 rtc::scoped_ptr<RtpGenerator> rtp_generator_; | 126 rtc::scoped_ptr<RtpGenerator> rtp_generator_; |
| 127 rtc::scoped_ptr<NetEq> neteq_; | 127 rtc::scoped_ptr<NetEq> neteq_; |
| 128 rtc::scoped_ptr<LossModel> loss_model_; | 128 rtc::scoped_ptr<LossModel> loss_model_; |
| 129 | 129 |
| 130 rtc::scoped_ptr<int16_t[]> in_data_; | 130 rtc::scoped_ptr<int16_t[]> in_data_; |
| 131 rtc::scoped_ptr<uint8_t[]> payload_; | 131 rtc::scoped_ptr<uint8_t[]> payload_; |
| 132 rtc::scoped_ptr<int16_t[]> out_data_; | 132 rtc::scoped_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 |