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 70 matching lines...) Loading... |
81 size_t AudioEncoderIsacT<T>::MaxEncodedBytes() const { | 81 size_t AudioEncoderIsacT<T>::MaxEncodedBytes() const { |
82 return kSufficientEncodeBufferSizeBytes; | 82 return kSufficientEncodeBufferSizeBytes; |
83 } | 83 } |
84 | 84 |
85 template <typename T> | 85 template <typename T> |
86 int AudioEncoderIsacT<T>::SampleRateHz() const { | 86 int AudioEncoderIsacT<T>::SampleRateHz() const { |
87 return T::EncSampRate(isac_state_); | 87 return T::EncSampRate(isac_state_); |
88 } | 88 } |
89 | 89 |
90 template <typename T> | 90 template <typename T> |
91 int AudioEncoderIsacT<T>::NumChannels() const { | 91 size_t AudioEncoderIsacT<T>::NumChannels() const { |
92 return 1; | 92 return 1; |
93 } | 93 } |
94 | 94 |
95 template <typename T> | 95 template <typename T> |
96 size_t AudioEncoderIsacT<T>::Num10MsFramesInNextPacket() const { | 96 size_t AudioEncoderIsacT<T>::Num10MsFramesInNextPacket() const { |
97 const int samples_in_next_packet = T::GetNewFrameLen(isac_state_); | 97 const int samples_in_next_packet = T::GetNewFrameLen(isac_state_); |
98 return static_cast<size_t>( | 98 return static_cast<size_t>( |
99 rtc::CheckedDivExact(samples_in_next_packet, | 99 rtc::CheckedDivExact(samples_in_next_packet, |
100 rtc::CheckedDivExact(SampleRateHz(), 100))); | 100 rtc::CheckedDivExact(SampleRateHz(), 100))); |
101 } | 101 } |
(...skipping 79 matching lines...) Loading... |
181 // we get an encoding that isn't bit-for-bit identical with what a combined | 181 // we get an encoding that isn't bit-for-bit identical with what a combined |
182 // encoder+decoder object produces. | 182 // encoder+decoder object produces. |
183 RTC_CHECK_EQ(0, T::SetDecSampRate(isac_state_, config.sample_rate_hz)); | 183 RTC_CHECK_EQ(0, T::SetDecSampRate(isac_state_, config.sample_rate_hz)); |
184 | 184 |
185 config_ = config; | 185 config_ = config; |
186 } | 186 } |
187 | 187 |
188 } // namespace webrtc | 188 } // namespace webrtc |
189 | 189 |
190 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_ | 190 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_IMPL_H_ |
OLD | NEW |