Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 15 matching lines...) Expand all Loading... | |
| 26 #include "gflags/gflags.h" | 26 #include "gflags/gflags.h" |
| 27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 28 #include "webrtc/base/scoped_ptr.h" | 28 #include "webrtc/base/scoped_ptr.h" |
| 29 #include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h" | 29 #include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h" |
| 30 #include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h" | 30 #include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h" |
| 31 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" | 31 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" |
| 32 #include "webrtc/test/testsupport/fileutils.h" | 32 #include "webrtc/test/testsupport/fileutils.h" |
| 33 #include "webrtc/test/testsupport/gtest_disable.h" | 33 #include "webrtc/test/testsupport/gtest_disable.h" |
| 34 #include "webrtc/typedefs.h" | 34 #include "webrtc/typedefs.h" |
| 35 | 35 |
| 36 #ifdef WEBRTC_NETEQ_UNITTEST_BITEXACT | |
| 37 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | |
| 38 #include "external/webrtc/webrtc/modules/audio_coding/neteq/neteq_unittest.pb.h" | |
| 39 #else | |
| 40 #include "webrtc/audio_coding/neteq/neteq_unittest.pb.h" | |
| 41 #endif | |
| 42 #endif | |
| 43 | |
| 36 DEFINE_bool(gen_ref, false, "Generate reference files."); | 44 DEFINE_bool(gen_ref, false, "Generate reference files."); |
| 37 | 45 |
| 38 namespace webrtc { | 46 namespace { |
| 39 | 47 |
| 40 static bool IsAllZero(const int16_t* buf, size_t buf_length) { | 48 bool IsAllZero(const int16_t* buf, size_t buf_length) { |
| 41 bool all_zero = true; | 49 bool all_zero = true; |
| 42 for (size_t n = 0; n < buf_length && all_zero; ++n) | 50 for (size_t n = 0; n < buf_length && all_zero; ++n) |
| 43 all_zero = buf[n] == 0; | 51 all_zero = buf[n] == 0; |
| 44 return all_zero; | 52 return all_zero; |
| 45 } | 53 } |
| 46 | 54 |
| 47 static bool IsAllNonZero(const int16_t* buf, size_t buf_length) { | 55 bool IsAllNonZero(const int16_t* buf, size_t buf_length) { |
| 48 bool all_non_zero = true; | 56 bool all_non_zero = true; |
| 49 for (size_t n = 0; n < buf_length && all_non_zero; ++n) | 57 for (size_t n = 0; n < buf_length && all_non_zero; ++n) |
| 50 all_non_zero = buf[n] != 0; | 58 all_non_zero = buf[n] != 0; |
| 51 return all_non_zero; | 59 return all_non_zero; |
| 52 } | 60 } |
| 53 | 61 |
| 62 #ifdef WEBRTC_NETEQ_UNITTEST_BITEXACT | |
| 63 void Convert(const webrtc::NetEqNetworkStatistics& stats_raw, | |
| 64 webrtc::neteq_unittest::NetEqNetworkStatistics* stats) { | |
| 65 stats->set_current_buffer_size_ms(stats_raw.current_buffer_size_ms); | |
| 66 stats->set_preferred_buffer_size_ms(stats_raw.preferred_buffer_size_ms); | |
| 67 stats->set_jitter_peaks_found(stats_raw.jitter_peaks_found); | |
| 68 stats->set_packet_loss_rate(stats_raw.packet_loss_rate); | |
| 69 stats->set_packet_discard_rate(stats_raw.packet_discard_rate); | |
| 70 stats->set_expand_rate(stats_raw.expand_rate); | |
| 71 stats->set_speech_expand_rate(stats_raw.speech_expand_rate); | |
| 72 stats->set_preemptive_rate(stats_raw.preemptive_rate); | |
| 73 stats->set_accelerate_rate(stats_raw.accelerate_rate); | |
| 74 stats->set_secondary_decoded_rate(stats_raw.secondary_decoded_rate); | |
| 75 stats->set_clockdrift_ppm(stats_raw.clockdrift_ppm); | |
| 76 stats->set_added_zero_samples(stats_raw.added_zero_samples); | |
| 77 stats->set_mean_waiting_time_ms(stats_raw.mean_waiting_time_ms); | |
| 78 stats->set_median_waiting_time_ms(stats_raw.median_waiting_time_ms); | |
| 79 stats->set_min_waiting_time_ms(stats_raw.min_waiting_time_ms); | |
| 80 stats->set_max_waiting_time_ms(stats_raw.max_waiting_time_ms); | |
| 81 } | |
| 82 | |
| 83 void Convert(const webrtc::RtcpStatistics& stats_raw, | |
| 84 webrtc::neteq_unittest::RtcpStatistics* stats) { | |
| 85 stats->set_fraction_lost(stats_raw.fraction_lost); | |
| 86 stats->set_cumulative_lost(stats_raw.cumulative_lost); | |
| 87 stats->set_extended_max_sequence_number( | |
| 88 stats_raw.extended_max_sequence_number); | |
| 89 stats->set_jitter(stats_raw.jitter); | |
| 90 } | |
| 91 | |
| 92 void WriteMessage(FILE* file, const std::string& message) { | |
| 93 int32_t size = message.length(); | |
| 94 ASSERT_EQ(1u, fwrite(&size, sizeof(size), 1, file)); | |
| 95 if (size <= 0) | |
| 96 return; | |
| 97 ASSERT_EQ(static_cast<size_t>(size), | |
| 98 fwrite(message.data(), sizeof(char), size, file)); | |
| 99 } | |
| 100 | |
| 101 void ReadMessage(FILE* file, std::string* message) { | |
| 102 int32_t size; | |
| 103 ASSERT_EQ(1u, fread(&size, sizeof(size), 1, file)); | |
| 104 if (size <= 0) | |
| 105 return; | |
| 106 rtc::scoped_ptr<char[]> buffer(new char[size]); | |
| 107 ASSERT_EQ(static_cast<size_t>(size), | |
| 108 fread(buffer.get(), sizeof(char), size, file)); | |
| 109 message->assign(buffer.get(), size); | |
| 110 } | |
| 111 #endif // WEBRTC_NETEQ_UNITTEST_BITEXACT | |
| 112 | |
| 113 } // namespace | |
| 114 | |
| 115 namespace webrtc { | |
| 116 | |
| 54 class RefFiles { | 117 class RefFiles { |
| 55 public: | 118 public: |
| 56 RefFiles(const std::string& input_file, const std::string& output_file); | 119 RefFiles(const std::string& input_file, const std::string& output_file); |
| 57 ~RefFiles(); | 120 ~RefFiles(); |
| 58 template<class T> void ProcessReference(const T& test_results); | 121 template<class T> void ProcessReference(const T& test_results); |
| 59 template<typename T, size_t n> void ProcessReference( | 122 template<typename T, size_t n> void ProcessReference( |
| 60 const T (&test_results)[n], | 123 const T (&test_results)[n], |
| 61 size_t length); | 124 size_t length); |
| 62 template<typename T, size_t n> void WriteToFile( | 125 template<typename T, size_t n> void WriteToFile( |
| 63 const T (&test_results)[n], | 126 const T (&test_results)[n], |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 if (input_fp_) { | 184 if (input_fp_) { |
| 122 // Read from ref file. | 185 // Read from ref file. |
| 123 T* ref = new T[length]; | 186 T* ref = new T[length]; |
| 124 ASSERT_EQ(length, fread(ref, sizeof(T), length, input_fp_)); | 187 ASSERT_EQ(length, fread(ref, sizeof(T), length, input_fp_)); |
| 125 // Compare | 188 // Compare |
| 126 ASSERT_EQ(0, memcmp(&test_results, ref, sizeof(T) * length)); | 189 ASSERT_EQ(0, memcmp(&test_results, ref, sizeof(T) * length)); |
| 127 delete [] ref; | 190 delete [] ref; |
| 128 } | 191 } |
| 129 } | 192 } |
| 130 | 193 |
| 131 void RefFiles::WriteToFile(const NetEqNetworkStatistics& stats) { | 194 void RefFiles::WriteToFile(const NetEqNetworkStatistics& stats_raw) { |
| 132 if (output_fp_) { | 195 #ifdef WEBRTC_NETEQ_UNITTEST_BITEXACT |
| 133 ASSERT_EQ(1u, fwrite(&stats, sizeof(NetEqNetworkStatistics), 1, | 196 if (!output_fp_) |
| 134 output_fp_)); | 197 return; |
| 135 } | 198 neteq_unittest::NetEqNetworkStatistics stats; |
| 199 Convert(stats_raw, &stats); | |
| 200 | |
| 201 std::string stats_string; | |
| 202 ASSERT_TRUE(stats.SerializeToString(&stats_string)); | |
| 203 WriteMessage(output_fp_, stats_string); | |
| 204 #else | |
| 205 FAIL() << "Write reference file needs Proto Buffer."; | |
|
hlundin-webrtc
2015/12/16 14:10:50
"Writing to reference file requires Proto Buffer."
minyue-webrtc
2015/12/16 14:37:35
yes of course
| |
| 206 #endif // WEBRTC_NETEQ_UNITTEST_BITEXACT | |
| 136 } | 207 } |
| 137 | 208 |
| 138 void RefFiles::ReadFromFileAndCompare( | 209 void RefFiles::ReadFromFileAndCompare( |
| 139 const NetEqNetworkStatistics& stats) { | 210 const NetEqNetworkStatistics& stats) { |
| 140 // TODO(minyue): Update resource/audio_coding/neteq_network_stats.dat and | 211 #ifdef WEBRTC_NETEQ_UNITTEST_BITEXACT |
| 141 // resource/audio_coding/neteq_network_stats_win32.dat. | 212 if (!input_fp_) |
| 142 struct NetEqNetworkStatisticsOld { | 213 return; |
| 143 uint16_t current_buffer_size_ms; // Current jitter buffer size in ms. | 214 |
| 144 uint16_t preferred_buffer_size_ms; // Target buffer size in ms. | 215 std::string stats_string; |
| 145 uint16_t jitter_peaks_found; // 1 if adding extra delay due to peaky | 216 ReadMessage(input_fp_, &stats_string); |
| 146 // jitter; 0 otherwise. | 217 neteq_unittest::NetEqNetworkStatistics ref_stats; |
| 147 uint16_t packet_loss_rate; // Loss rate (network + late) in Q14. | 218 ASSERT_TRUE(ref_stats.ParseFromString(stats_string)); |
| 148 uint16_t packet_discard_rate; // Late loss rate in Q14. | 219 |
| 149 uint16_t expand_rate; // Fraction (of original stream) of synthesized | 220 // Compare |
| 150 // audio inserted through expansion (in Q14). | 221 ASSERT_EQ(stats.current_buffer_size_ms, ref_stats.current_buffer_size_ms()); |
| 151 uint16_t preemptive_rate; // Fraction of data inserted through pre-emptive | 222 ASSERT_EQ(stats.preferred_buffer_size_ms, |
| 152 // expansion (in Q14). | 223 ref_stats.preferred_buffer_size_ms()); |
| 153 uint16_t accelerate_rate; // Fraction of data removed through acceleration | 224 ASSERT_EQ(stats.jitter_peaks_found, ref_stats.jitter_peaks_found()); |
| 154 // (in Q14). | 225 ASSERT_EQ(stats.packet_loss_rate, ref_stats.packet_loss_rate()); |
| 155 int32_t clockdrift_ppm; // Average clock-drift in parts-per-million | 226 ASSERT_EQ(stats.packet_discard_rate, ref_stats.packet_discard_rate()); |
| 156 // (positive or negative). | 227 ASSERT_EQ(stats.expand_rate, ref_stats.expand_rate()); |
| 157 int added_zero_samples; // Number of zero samples added in "off" mode. | 228 ASSERT_EQ(stats.preemptive_rate, ref_stats.preemptive_rate()); |
| 158 }; | 229 ASSERT_EQ(stats.accelerate_rate, ref_stats.accelerate_rate()); |
| 159 if (input_fp_) { | 230 ASSERT_EQ(stats.clockdrift_ppm, ref_stats.clockdrift_ppm()); |
| 160 // Read from ref file. | 231 ASSERT_EQ(stats.added_zero_samples, ref_stats.added_zero_samples()); |
| 161 size_t stat_size = sizeof(NetEqNetworkStatisticsOld); | 232 ASSERT_EQ(stats.secondary_decoded_rate, 0); |
| 162 NetEqNetworkStatisticsOld ref_stats; | 233 ASSERT_LE(stats.speech_expand_rate, ref_stats.expand_rate()); |
| 163 ASSERT_EQ(1u, fread(&ref_stats, stat_size, 1, input_fp_)); | 234 #else |
| 164 // Compare | 235 FAIL() << "Read reference file needs Proto Buffer."; |
|
hlundin-webrtc
2015/12/16 14:10:50
"Reading from reference file requires Proto Buffer
minyue-webrtc
2015/12/16 14:37:35
Done.
| |
| 165 ASSERT_EQ(stats.current_buffer_size_ms, ref_stats.current_buffer_size_ms); | 236 #endif // WEBRTC_NETEQ_UNITTEST_BITEXACT |
| 166 ASSERT_EQ(stats.preferred_buffer_size_ms, | |
| 167 ref_stats.preferred_buffer_size_ms); | |
| 168 ASSERT_EQ(stats.jitter_peaks_found, ref_stats.jitter_peaks_found); | |
| 169 ASSERT_EQ(stats.packet_loss_rate, ref_stats.packet_loss_rate); | |
| 170 ASSERT_EQ(stats.packet_discard_rate, ref_stats.packet_discard_rate); | |
| 171 ASSERT_EQ(stats.expand_rate, ref_stats.expand_rate); | |
| 172 ASSERT_EQ(stats.preemptive_rate, ref_stats.preemptive_rate); | |
| 173 ASSERT_EQ(stats.accelerate_rate, ref_stats.accelerate_rate); | |
| 174 ASSERT_EQ(stats.clockdrift_ppm, ref_stats.clockdrift_ppm); | |
| 175 ASSERT_EQ(stats.added_zero_samples, | |
| 176 static_cast<size_t>(ref_stats.added_zero_samples)); | |
| 177 ASSERT_EQ(stats.secondary_decoded_rate, 0); | |
| 178 ASSERT_LE(stats.speech_expand_rate, ref_stats.expand_rate); | |
| 179 } | |
| 180 } | 237 } |
| 181 | 238 |
| 182 void RefFiles::WriteToFile(const RtcpStatistics& stats) { | 239 void RefFiles::WriteToFile(const RtcpStatistics& stats_raw) { |
| 183 if (output_fp_) { | 240 #ifdef WEBRTC_NETEQ_UNITTEST_BITEXACT |
| 184 ASSERT_EQ(1u, fwrite(&(stats.fraction_lost), sizeof(stats.fraction_lost), 1, | 241 if (!output_fp_) |
| 185 output_fp_)); | 242 return; |
| 186 ASSERT_EQ(1u, fwrite(&(stats.cumulative_lost), | 243 neteq_unittest::RtcpStatistics stats; |
| 187 sizeof(stats.cumulative_lost), 1, output_fp_)); | 244 Convert(stats_raw, &stats); |
| 188 ASSERT_EQ(1u, fwrite(&(stats.extended_max_sequence_number), | 245 |
| 189 sizeof(stats.extended_max_sequence_number), 1, | 246 std::string stats_string; |
| 190 output_fp_)); | 247 ASSERT_TRUE(stats.SerializeToString(&stats_string)); |
| 191 ASSERT_EQ(1u, fwrite(&(stats.jitter), sizeof(stats.jitter), 1, | 248 WriteMessage(output_fp_, stats_string); |
| 192 output_fp_)); | 249 #else |
| 193 } | 250 FAIL() << "Write reference file needs Proto Buffer."; |
|
hlundin-webrtc
2015/12/16 14:10:50
"Writing to reference file requires Proto Buffer."
minyue-webrtc
2015/12/16 14:37:35
Done.
| |
| 251 #endif // WEBRTC_NETEQ_UNITTEST_BITEXACT | |
| 194 } | 252 } |
| 195 | 253 |
| 196 void RefFiles::ReadFromFileAndCompare( | 254 void RefFiles::ReadFromFileAndCompare(const RtcpStatistics& stats) { |
| 197 const RtcpStatistics& stats) { | 255 #ifdef WEBRTC_NETEQ_UNITTEST_BITEXACT |
| 198 if (input_fp_) { | 256 if (!input_fp_) |
| 199 // Read from ref file. | 257 return; |
| 200 RtcpStatistics ref_stats; | 258 std::string stats_string; |
| 201 ASSERT_EQ(1u, fread(&(ref_stats.fraction_lost), | 259 ReadMessage(input_fp_, &stats_string); |
| 202 sizeof(ref_stats.fraction_lost), 1, input_fp_)); | 260 neteq_unittest::RtcpStatistics ref_stats; |
| 203 ASSERT_EQ(1u, fread(&(ref_stats.cumulative_lost), | 261 ASSERT_TRUE(ref_stats.ParseFromString(stats_string)); |
| 204 sizeof(ref_stats.cumulative_lost), 1, input_fp_)); | 262 |
| 205 ASSERT_EQ(1u, fread(&(ref_stats.extended_max_sequence_number), | 263 // Compare |
| 206 sizeof(ref_stats.extended_max_sequence_number), 1, | 264 ASSERT_EQ(stats.fraction_lost, ref_stats.fraction_lost()); |
| 207 input_fp_)); | 265 ASSERT_EQ(stats.cumulative_lost, ref_stats.cumulative_lost()); |
| 208 ASSERT_EQ(1u, fread(&(ref_stats.jitter), sizeof(ref_stats.jitter), 1, | 266 ASSERT_EQ(stats.extended_max_sequence_number, |
| 209 input_fp_)); | 267 ref_stats.extended_max_sequence_number()); |
| 210 // Compare | 268 ASSERT_EQ(stats.jitter, ref_stats.jitter()); |
| 211 ASSERT_EQ(ref_stats.fraction_lost, stats.fraction_lost); | 269 #else |
| 212 ASSERT_EQ(ref_stats.cumulative_lost, stats.cumulative_lost); | 270 FAIL() << "Read reference file needs Proto Buffer."; |
|
hlundin-webrtc
2015/12/16 14:10:50
"Reading from reference file requires Proto Buffer
minyue-webrtc
2015/12/16 14:37:35
Done.
| |
| 213 ASSERT_EQ(ref_stats.extended_max_sequence_number, | 271 #endif // WEBRTC_NETEQ_UNITTEST_BITEXACT |
| 214 stats.extended_max_sequence_number); | |
| 215 ASSERT_EQ(ref_stats.jitter, stats.jitter); | |
| 216 } | |
| 217 } | 272 } |
| 218 | 273 |
| 219 class NetEqDecodingTest : public ::testing::Test { | 274 class NetEqDecodingTest : public ::testing::Test { |
| 220 protected: | 275 protected: |
| 221 // NetEQ must be polled for data once every 10 ms. Thus, neither of the | 276 // NetEQ must be polled for data once every 10 ms. Thus, neither of the |
| 222 // constants below can be changed. | 277 // constants below can be changed. |
| 223 static const int kTimeStepMs = 10; | 278 static const int kTimeStepMs = 10; |
| 224 static const size_t kBlockSize8kHz = kTimeStepMs * 8; | 279 static const size_t kBlockSize8kHz = kTimeStepMs * 8; |
| 225 static const size_t kBlockSize16kHz = kTimeStepMs * 16; | 280 static const size_t kBlockSize16kHz = kTimeStepMs * 16; |
| 226 static const size_t kBlockSize32kHz = kTimeStepMs * 32; | 281 static const size_t kBlockSize32kHz = kTimeStepMs * 32; |
| 227 static const size_t kMaxBlockSize = kBlockSize32kHz; | 282 static const size_t kMaxBlockSize = kBlockSize32kHz; |
| 228 static const int kInitSampleRateHz = 8000; | 283 static const int kInitSampleRateHz = 8000; |
| 229 | 284 |
| 230 NetEqDecodingTest(); | 285 NetEqDecodingTest(); |
| 231 virtual void SetUp(); | 286 virtual void SetUp(); |
| 232 virtual void TearDown(); | 287 virtual void TearDown(); |
| 233 void SelectDecoders(NetEqDecoder* used_codec); | 288 void SelectDecoders(NetEqDecoder* used_codec); |
| 234 void LoadDecoders(); | 289 void LoadDecoders(); |
| 235 void OpenInputFile(const std::string &rtp_file); | 290 void OpenInputFile(const std::string &rtp_file); |
| 236 void Process(size_t* out_len); | 291 void Process(size_t* out_len); |
| 292 | |
| 237 void DecodeAndCompare(const std::string& rtp_file, | 293 void DecodeAndCompare(const std::string& rtp_file, |
| 238 const std::string& ref_file, | 294 const std::string& ref_file, |
| 239 const std::string& stat_ref_file, | 295 const std::string& stat_ref_file, |
| 240 const std::string& rtcp_ref_file); | 296 const std::string& rtcp_ref_file); |
| 297 | |
| 241 static void PopulateRtpInfo(int frame_index, | 298 static void PopulateRtpInfo(int frame_index, |
| 242 int timestamp, | 299 int timestamp, |
| 243 WebRtcRTPHeader* rtp_info); | 300 WebRtcRTPHeader* rtp_info); |
| 244 static void PopulateCng(int frame_index, | 301 static void PopulateCng(int frame_index, |
| 245 int timestamp, | 302 int timestamp, |
| 246 WebRtcRTPHeader* rtp_info, | 303 WebRtcRTPHeader* rtp_info, |
| 247 uint8_t* payload, | 304 uint8_t* payload, |
| 248 size_t* payload_len); | 305 size_t* payload_len); |
| 249 | 306 |
| 250 void WrapTest(uint16_t start_seq_no, uint32_t start_timestamp, | 307 void WrapTest(uint16_t start_seq_no, uint32_t start_timestamp, |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 446 size_t* payload_len) { | 503 size_t* payload_len) { |
| 447 rtp_info->header.sequenceNumber = frame_index; | 504 rtp_info->header.sequenceNumber = frame_index; |
| 448 rtp_info->header.timestamp = timestamp; | 505 rtp_info->header.timestamp = timestamp; |
| 449 rtp_info->header.ssrc = 0x1234; // Just an arbitrary SSRC. | 506 rtp_info->header.ssrc = 0x1234; // Just an arbitrary SSRC. |
| 450 rtp_info->header.payloadType = 98; // WB CNG. | 507 rtp_info->header.payloadType = 98; // WB CNG. |
| 451 rtp_info->header.markerBit = 0; | 508 rtp_info->header.markerBit = 0; |
| 452 payload[0] = 64; // Noise level -64 dBov, quite arbitrarily chosen. | 509 payload[0] = 64; // Noise level -64 dBov, quite arbitrarily chosen. |
| 453 *payload_len = 1; // Only noise level, no spectral parameters. | 510 *payload_len = 1; // Only noise level, no spectral parameters. |
| 454 } | 511 } |
| 455 | 512 |
| 456 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \ | 513 #if (!defined(WEBRTC_IOS) && !defined(WEBRTC_ANDROID) && \ |
| 514 WEBRTC_NETEQ_UNITTEST_BITEXACT) && \ | |
|
hlundin-webrtc
2015/12/16 14:10:50
For completeness, I think you should also write de
minyue-webrtc
2015/12/16 14:37:35
Done.
| |
| 515 (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \ | |
| 457 defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722) | 516 defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722) |
| 458 #define IF_ALL_CODECS(x) x | 517 #define MAYBE_TestBitExactness TestBitExactness |
| 459 #else | 518 #else |
| 460 #define IF_ALL_CODECS(x) DISABLED_##x | 519 #define MAYBE_TestBitExactness DISABLED_TestBitExactness |
| 461 #endif | 520 #endif |
| 462 | 521 TEST_F(NetEqDecodingTest, MAYBE_TestBitExactness) { |
| 463 TEST_F(NetEqDecodingTest, | |
| 464 DISABLED_ON_IOS(DISABLED_ON_ANDROID(IF_ALL_CODECS(TestBitExactness)))) { | |
| 465 const std::string input_rtp_file = webrtc::test::ProjectRootPath() + | 522 const std::string input_rtp_file = webrtc::test::ProjectRootPath() + |
| 466 "resources/audio_coding/neteq_universal_new.rtp"; | 523 "resources/audio_coding/neteq_universal_new.rtp"; |
| 467 // Note that neteq4_universal_ref.pcm and neteq4_universal_ref_win_32.pcm | 524 // Note that neteq4_universal_ref.pcm and neteq4_universal_ref_win_32.pcm |
| 468 // are identical. The latter could have been removed, but if clients still | 525 // are identical. The latter could have been removed, but if clients still |
| 469 // have a copy of the file, the test will fail. | 526 // have a copy of the file, the test will fail. |
| 470 const std::string input_ref_file = | 527 const std::string input_ref_file = |
| 471 webrtc::test::ResourcePath("audio_coding/neteq4_universal_ref", "pcm"); | 528 webrtc::test::ResourcePath("audio_coding/neteq4_universal_ref", "pcm"); |
| 472 #if defined(_MSC_VER) && (_MSC_VER >= 1700) | 529 #if defined(_MSC_VER) && (_MSC_VER >= 1700) |
| 473 // For Visual Studio 2012 and later, we will have to use the generic reference | 530 // For Visual Studio 2012 and later, we will have to use the generic reference |
| 474 // file, rather than the windows-specific one. | 531 // file, rather than the windows-specific one. |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1546 // Pull audio once. | 1603 // Pull audio once. |
| 1547 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, | 1604 ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, &out_len, |
| 1548 &num_channels, &type)); | 1605 &num_channels, &type)); |
| 1549 ASSERT_EQ(kBlockSize16kHz, out_len); | 1606 ASSERT_EQ(kBlockSize16kHz, out_len); |
| 1550 } | 1607 } |
| 1551 // Verify speech output. | 1608 // Verify speech output. |
| 1552 EXPECT_EQ(kOutputNormal, type); | 1609 EXPECT_EQ(kOutputNormal, type); |
| 1553 } | 1610 } |
| 1554 | 1611 |
| 1555 } // namespace webrtc | 1612 } // namespace webrtc |
| OLD | NEW |