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/include/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/base/checks.h" |
16 #include "webrtc/modules/audio_coding/codecs/g722/include/g722_interface.h" | 16 #include "webrtc/modules/audio_coding/codecs/g722/g722_interface.h" |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 | 19 |
20 AudioDecoderG722::AudioDecoderG722() { | 20 AudioDecoderG722::AudioDecoderG722() { |
21 WebRtcG722_CreateDecoder(&dec_state_); | 21 WebRtcG722_CreateDecoder(&dec_state_); |
22 WebRtcG722_DecoderInit(dec_state_); | 22 WebRtcG722_DecoderInit(dec_state_); |
23 } | 23 } |
24 | 24 |
25 AudioDecoderG722::~AudioDecoderG722() { | 25 AudioDecoderG722::~AudioDecoderG722() { |
26 WebRtcG722_FreeDecoder(dec_state_); | 26 WebRtcG722_FreeDecoder(dec_state_); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // where N is the total number of samples. | 129 // where N is the total number of samples. |
130 for (size_t i = 0; i < encoded_len / 2; i++) { | 130 for (size_t i = 0; i < encoded_len / 2; i++) { |
131 uint8_t right_byte = encoded_deinterleaved[i + 1]; | 131 uint8_t right_byte = encoded_deinterleaved[i + 1]; |
132 memmove(&encoded_deinterleaved[i + 1], &encoded_deinterleaved[i + 2], | 132 memmove(&encoded_deinterleaved[i + 1], &encoded_deinterleaved[i + 2], |
133 encoded_len - i - 2); | 133 encoded_len - i - 2); |
134 encoded_deinterleaved[encoded_len - 1] = right_byte; | 134 encoded_deinterleaved[encoded_len - 1] = right_byte; |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 } // namespace webrtc | 138 } // namespace webrtc |
OLD | NEW |