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 |
11 #include "webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.h" | 11 #include "webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.h" |
12 | 12 |
13 #include <string.h> | 13 #include <string.h> |
14 | 14 |
15 #include "webrtc/base/checks.h" | 15 #include "webrtc/modules/audio_coding/codecs/g722/g722_interface.h" |
16 #include "webrtc/modules/audio_coding/codecs/legacy_encoded_audio_frame.h" | 16 #include "webrtc/modules/audio_coding/codecs/legacy_encoded_audio_frame.h" |
17 #include "webrtc/modules/audio_coding/codecs/g722/g722_interface.h" | 17 #include "webrtc/rtc_base/checks.h" |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
21 AudioDecoderG722Impl::AudioDecoderG722Impl() { | 21 AudioDecoderG722Impl::AudioDecoderG722Impl() { |
22 WebRtcG722_CreateDecoder(&dec_state_); | 22 WebRtcG722_CreateDecoder(&dec_state_); |
23 WebRtcG722_DecoderInit(dec_state_); | 23 WebRtcG722_DecoderInit(dec_state_); |
24 } | 24 } |
25 | 25 |
26 AudioDecoderG722Impl::~AudioDecoderG722Impl() { | 26 AudioDecoderG722Impl::~AudioDecoderG722Impl() { |
27 WebRtcG722_FreeDecoder(dec_state_); | 27 WebRtcG722_FreeDecoder(dec_state_); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // where N is the total number of samples. | 153 // where N is the total number of samples. |
154 for (size_t i = 0; i < encoded_len / 2; i++) { | 154 for (size_t i = 0; i < encoded_len / 2; i++) { |
155 uint8_t right_byte = encoded_deinterleaved[i + 1]; | 155 uint8_t right_byte = encoded_deinterleaved[i + 1]; |
156 memmove(&encoded_deinterleaved[i + 1], &encoded_deinterleaved[i + 2], | 156 memmove(&encoded_deinterleaved[i + 1], &encoded_deinterleaved[i + 2], |
157 encoded_len - i - 2); | 157 encoded_len - i - 2); |
158 encoded_deinterleaved[encoded_len - 1] = right_byte; | 158 encoded_deinterleaved[encoded_len - 1] = right_byte; |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 } // namespace webrtc | 162 } // namespace webrtc |
OLD | NEW |