| 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 |
| 11 #include "webrtc/modules/audio_coding/codecs/g711/include/audio_encoder_pcm.h" | 11 #include "webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.h" |
| 12 | 12 |
| 13 #include <limits> | 13 #include <limits> |
| 14 | 14 |
| 15 #include "webrtc/base/checks.h" | 15 #include "webrtc/base/checks.h" |
| 16 #include "webrtc/common_types.h" | 16 #include "webrtc/common_types.h" |
| 17 #include "webrtc/modules/audio_coding/codecs/g711/include/g711_interface.h" | 17 #include "webrtc/modules/audio_coding/codecs/g711/g711_interface.h" |
| 18 | 18 |
| 19 namespace webrtc { | 19 namespace webrtc { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 int16_t NumSamplesPerFrame(int num_channels, | 23 int16_t NumSamplesPerFrame(int num_channels, |
| 24 int frame_size_ms, | 24 int frame_size_ms, |
| 25 int sample_rate_hz) { | 25 int sample_rate_hz) { |
| 26 int samples_per_frame = num_channels * frame_size_ms * sample_rate_hz / 1000; | 26 int samples_per_frame = num_channels * frame_size_ms * sample_rate_hz / 1000; |
| 27 RTC_CHECK_LE(samples_per_frame, std::numeric_limits<int16_t>::max()) | 27 RTC_CHECK_LE(samples_per_frame, std::numeric_limits<int16_t>::max()) |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 size_t input_len, | 133 size_t input_len, |
| 134 uint8_t* encoded) { | 134 uint8_t* encoded) { |
| 135 return WebRtcG711_EncodeU(audio, input_len, encoded); | 135 return WebRtcG711_EncodeU(audio, input_len, encoded); |
| 136 } | 136 } |
| 137 | 137 |
| 138 int AudioEncoderPcmU::BytesPerSample() const { | 138 int AudioEncoderPcmU::BytesPerSample() const { |
| 139 return 1; | 139 return 1; |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace webrtc | 142 } // namespace webrtc |
| OLD | NEW |