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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // 38 bytes per frame of 20 ms => 15200 bits/s. | 82 // 38 bytes per frame of 20 ms => 15200 bits/s. |
83 return 15200; | 83 return 15200; |
84 case 3: case 6: | 84 case 3: case 6: |
85 // 50 bytes per frame of 30 ms => (approx) 13333 bits/s. | 85 // 50 bytes per frame of 30 ms => (approx) 13333 bits/s. |
86 return 13333; | 86 return 13333; |
87 default: | 87 default: |
88 FATAL(); | 88 FATAL(); |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 AudioEncoder::EncodedInfo AudioEncoderIlbc::EncodeInternal( | 92 AudioEncoder::EncodedInfo AudioEncoderIlbc::EncodeImpl( |
93 uint32_t rtp_timestamp, | 93 uint32_t rtp_timestamp, |
94 rtc::ArrayView<const int16_t> audio, | 94 rtc::ArrayView<const int16_t> audio, |
95 rtc::Buffer* encoded) { | 95 rtc::Buffer* encoded) { |
96 | 96 |
97 // Save timestamp if starting a new packet. | 97 // Save timestamp if starting a new packet. |
98 if (num_10ms_frames_buffered_ == 0) | 98 if (num_10ms_frames_buffered_ == 0) |
99 first_timestamp_in_buffer_ = rtp_timestamp; | 99 first_timestamp_in_buffer_ = rtp_timestamp; |
100 | 100 |
101 // Buffer input. | 101 // Buffer input. |
102 std::copy(audio.cbegin(), audio.cend(), | 102 std::copy(audio.cbegin(), audio.cend(), |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 switch (num_10ms_frames_per_packet_) { | 150 switch (num_10ms_frames_per_packet_) { |
151 case 2: return 38; | 151 case 2: return 38; |
152 case 3: return 50; | 152 case 3: return 50; |
153 case 4: return 2 * 38; | 153 case 4: return 2 * 38; |
154 case 6: return 2 * 50; | 154 case 6: return 2 * 50; |
155 default: FATAL(); | 155 default: FATAL(); |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 } // namespace webrtc | 159 } // namespace webrtc |
OLD | NEW |