Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.cc

Issue 1335923002: Add RTC_ prefix to (D)CHECKs and related macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 10 matching lines...) Expand all
21 21
22 size_t AudioDecoderPcm16B::Channels() const { 22 size_t AudioDecoderPcm16B::Channels() const {
23 return 1; 23 return 1;
24 } 24 }
25 25
26 int AudioDecoderPcm16B::DecodeInternal(const uint8_t* encoded, 26 int AudioDecoderPcm16B::DecodeInternal(const uint8_t* encoded,
27 size_t encoded_len, 27 size_t encoded_len,
28 int sample_rate_hz, 28 int sample_rate_hz,
29 int16_t* decoded, 29 int16_t* decoded,
30 SpeechType* speech_type) { 30 SpeechType* speech_type) {
31 DCHECK(sample_rate_hz == 8000 || sample_rate_hz == 16000 || 31 RTC_DCHECK(sample_rate_hz == 8000 || sample_rate_hz == 16000 ||
32 sample_rate_hz == 32000 || sample_rate_hz == 48000) 32 sample_rate_hz == 32000 || sample_rate_hz == 48000)
33 << "Unsupported sample rate " << sample_rate_hz; 33 << "Unsupported sample rate " << sample_rate_hz;
34 size_t ret = WebRtcPcm16b_Decode(encoded, encoded_len, decoded); 34 size_t ret = WebRtcPcm16b_Decode(encoded, encoded_len, decoded);
35 *speech_type = ConvertSpeechType(1); 35 *speech_type = ConvertSpeechType(1);
36 return static_cast<int>(ret); 36 return static_cast<int>(ret);
37 } 37 }
38 38
39 int AudioDecoderPcm16B::PacketDuration(const uint8_t* encoded, 39 int AudioDecoderPcm16B::PacketDuration(const uint8_t* encoded,
40 size_t encoded_len) const { 40 size_t encoded_len) const {
41 // Two encoded byte per sample per channel. 41 // Two encoded byte per sample per channel.
42 return static_cast<int>(encoded_len / (2 * Channels())); 42 return static_cast<int>(encoded_len / (2 * Channels()));
43 } 43 }
44 44
45 AudioDecoderPcm16BMultiCh::AudioDecoderPcm16BMultiCh(size_t num_channels) 45 AudioDecoderPcm16BMultiCh::AudioDecoderPcm16BMultiCh(size_t num_channels)
46 : channels_(num_channels) { 46 : channels_(num_channels) {
47 DCHECK(num_channels > 0); 47 RTC_DCHECK(num_channels > 0);
48 } 48 }
49 49
50 size_t AudioDecoderPcm16BMultiCh::Channels() const { 50 size_t AudioDecoderPcm16BMultiCh::Channels() const {
51 return channels_; 51 return channels_;
52 } 52 }
53 53
54 } // namespace webrtc 54 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698