OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 41 matching lines...) Loading... |
52 | 52 |
53 void SetUp() override { | 53 void SetUp() override { |
54 ASSERT_EQ(1, channels_) << "iLBC supports only mono audio."; | 54 ASSERT_EQ(1, channels_) << "iLBC supports only mono audio."; |
55 AudioEncoderIlbc::Config config; | 55 AudioEncoderIlbc::Config config; |
56 config.frame_size_ms = FLAGS_frame_size_ms; | 56 config.frame_size_ms = FLAGS_frame_size_ms; |
57 encoder_.reset(new AudioEncoderIlbc(config)); | 57 encoder_.reset(new AudioEncoderIlbc(config)); |
58 NetEqQualityTest::SetUp(); | 58 NetEqQualityTest::SetUp(); |
59 } | 59 } |
60 | 60 |
61 int EncodeBlock(int16_t* in_data, | 61 int EncodeBlock(int16_t* in_data, |
62 int block_size_samples, | 62 size_t block_size_samples, |
63 uint8_t* payload, | 63 uint8_t* payload, |
64 int max_bytes) override { | 64 size_t max_bytes) override { |
65 const int kFrameSizeSamples = 80; // Samples per 10 ms. | 65 const size_t kFrameSizeSamples = 80; // Samples per 10 ms. |
66 int encoded_samples = 0; | 66 size_t encoded_samples = 0; |
67 uint32_t dummy_timestamp = 0; | 67 uint32_t dummy_timestamp = 0; |
68 AudioEncoder::EncodedInfo info; | 68 AudioEncoder::EncodedInfo info; |
69 do { | 69 do { |
70 info = encoder_->Encode(dummy_timestamp, &in_data[encoded_samples], | 70 info = encoder_->Encode(dummy_timestamp, &in_data[encoded_samples], |
71 kFrameSizeSamples, max_bytes, payload); | 71 kFrameSizeSamples, max_bytes, payload); |
72 encoded_samples += kFrameSizeSamples; | 72 encoded_samples += kFrameSizeSamples; |
73 } while (info.encoded_bytes == 0); | 73 } while (info.encoded_bytes == 0); |
74 return rtc::checked_cast<int>(info.encoded_bytes); | 74 return rtc::checked_cast<int>(info.encoded_bytes); |
75 } | 75 } |
76 | 76 |
77 private: | 77 private: |
78 rtc::scoped_ptr<AudioEncoderIlbc> encoder_; | 78 rtc::scoped_ptr<AudioEncoderIlbc> encoder_; |
79 }; | 79 }; |
80 | 80 |
81 TEST_F(NetEqIlbcQualityTest, Test) { | 81 TEST_F(NetEqIlbcQualityTest, Test) { |
82 Simulate(); | 82 Simulate(); |
83 } | 83 } |
84 | 84 |
85 } // namespace test | 85 } // namespace test |
86 } // namespace webrtc | 86 } // namespace webrtc |
OLD | NEW |