| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // In this test, we let the target packet loss rate match the actual rate. | 189 // In this test, we let the target packet loss rate match the actual rate. |
| 190 actual_packet_loss_rate = mode_set[i].target_packet_loss_rate; | 190 actual_packet_loss_rate = mode_set[i].target_packet_loss_rate; |
| 191 // Run every mode a certain time. | 191 // Run every mode a certain time. |
| 192 time_now_ms = 0; | 192 time_now_ms = 0; |
| 193 fec_frames = 0; | 193 fec_frames = 0; |
| 194 while (time_now_ms < kDurationMs) { | 194 while (time_now_ms < kDurationMs) { |
| 195 // Encode & decode. | 195 // Encode & decode. |
| 196 EncodeABlock(); | 196 EncodeABlock(); |
| 197 | 197 |
| 198 // Check if payload has FEC. | 198 // Check if payload has FEC. |
| 199 int16_t fec = WebRtcOpus_PacketHasFec(&bit_stream_[0], encoded_bytes_); | 199 int fec = WebRtcOpus_PacketHasFec(&bit_stream_[0], encoded_bytes_); |
| 200 | 200 |
| 201 // If FEC is disabled or the target packet loss rate is set to 0, there | 201 // If FEC is disabled or the target packet loss rate is set to 0, there |
| 202 // should be no FEC in the bit stream. | 202 // should be no FEC in the bit stream. |
| 203 if (!mode_set[i].fec || mode_set[i].target_packet_loss_rate == 0) { | 203 if (!mode_set[i].fec || mode_set[i].target_packet_loss_rate == 0) { |
| 204 EXPECT_EQ(fec, 0); | 204 EXPECT_EQ(fec, 0); |
| 205 } else if (fec == 1) { | 205 } else if (fec == 1) { |
| 206 fec_frames++; | 206 fec_frames++; |
| 207 } | 207 } |
| 208 | 208 |
| 209 lost_previous = lost_current; | 209 lost_previous = lost_current; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 230 ::std::tr1::make_tuple(1, 32000, string("audio_coding/testfile32kHz"), | 230 ::std::tr1::make_tuple(1, 32000, string("audio_coding/testfile32kHz"), |
| 231 string("pcm")), | 231 string("pcm")), |
| 232 ::std::tr1::make_tuple(2, 64000, string("audio_coding/teststereo32kHz"), | 232 ::std::tr1::make_tuple(2, 64000, string("audio_coding/teststereo32kHz"), |
| 233 string("pcm"))}; | 233 string("pcm"))}; |
| 234 | 234 |
| 235 // 64 kbps, stereo | 235 // 64 kbps, stereo |
| 236 INSTANTIATE_TEST_CASE_P(AllTest, OpusFecTest, | 236 INSTANTIATE_TEST_CASE_P(AllTest, OpusFecTest, |
| 237 ::testing::ValuesIn(param_set)); | 237 ::testing::ValuesIn(param_set)); |
| 238 | 238 |
| 239 } // namespace webrtc | 239 } // namespace webrtc |
| OLD | NEW |