From 844a91081ef1141bd9888e828bef87a7737c24a8 Mon Sep 17 00:00:00 2001 From: kwiberg Date: Wed, 16 Sep 2015 09:42:18 -0700 Subject: [PATCH] Remove the preprocessor symbol WEBRTC_CODEC_PCM16 (it was always defined) BUG=webrtc:4557 Review URL: https://codereview.webrtc.org/1336923002 Cr-Commit-Position: refs/heads/master@{#9955} --- webrtc/engine_configurations.h | 3 --- .../audio_coding/main/acm2/acm_codec_database.cc | 6 ------ .../audio_coding/main/acm2/acm_codec_database.h | 12 ------------ .../main/acm2/audio_coding_module_impl.cc | 2 -- .../audio_coding/main/acm2/codec_manager.cc | 6 +----- .../audio_coding/main/acm2/codec_owner.cc | 6 +----- .../audio_coding/main/test/TestAllCodecs.cc | 5 ----- .../modules/audio_coding/main/test/TestRedFec.cc | 4 ---- .../modules/audio_coding/main/test/TestStereo.cc | 10 ---------- .../modules/audio_coding/main/test/TestStereo.h | 2 -- .../audio_coding/neteq/audio_decoder_impl.cc | 16 ---------------- .../audio_coding/neteq/audio_decoder_impl.h | 2 -- webrtc/modules/audio_coding/neteq/neteq.gypi | 1 - 13 files changed, 2 insertions(+), 73 deletions(-) diff --git a/webrtc/engine_configurations.h b/webrtc/engine_configurations.h index 4f6159cac9..3b06c35a30 100644 --- a/webrtc/engine_configurations.h +++ b/webrtc/engine_configurations.h @@ -35,9 +35,6 @@ // (which are mandatory and don't have any defines). #define WEBRTC_CODEC_AVT -// PCM16 is useful for testing and incurs only a small binary size cost. -#define WEBRTC_CODEC_PCM16 - // iLBC and Redundancy coding are excluded from Chromium and Mozilla // builds to reduce binary size. #if !defined(WEBRTC_CHROMIUM_BUILD) && !defined(WEBRTC_MOZILLA_BUILD) diff --git a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc index 9f97c79a8a..4abd369656 100644 --- a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc +++ b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc @@ -39,7 +39,6 @@ const CodecInst ACMCodecDB::database_[] = { {105, "ISAC", 48000, kIsacPacSize1440, 1, kIsacSwbDefaultRate}, # endif #endif -#ifdef WEBRTC_CODEC_PCM16 // Mono {107, "L16", 8000, 80, 1, 128000}, {108, "L16", 16000, 160, 1, 256000}, @@ -48,7 +47,6 @@ const CodecInst ACMCodecDB::database_[] = { {111, "L16", 8000, 80, 2, 128000}, {112, "L16", 16000, 160, 2, 256000}, {113, "L16", 32000, 320, 2, 512000}, -#endif // G.711, PCM mu-law and A-law. // Mono {0, "PCMU", 8000, 160, 1, 64000}, @@ -99,7 +97,6 @@ const ACMCodecDB::CodecSettings ACMCodecDB::codec_settings_[] = { {1, {kIsacPacSize1440}, 0, 1, true}, # endif #endif -#ifdef WEBRTC_CODEC_PCM16 // Mono {4, {80, 160, 240, 320}, 0, 2, false}, {4, {160, 320, 480, 640}, 0, 2, false}, @@ -108,7 +105,6 @@ const ACMCodecDB::CodecSettings ACMCodecDB::codec_settings_[] = { {4, {80, 160, 240, 320}, 0, 2, false}, {4, {160, 320, 480, 640}, 0, 2, false}, {2, {320, 640}, 0, 2}, -#endif // G.711, PCM mu-law and A-law. // Mono {6, {80, 160, 240, 320, 400, 480}, 0, 2, false}, @@ -157,7 +153,6 @@ const NetEqDecoder ACMCodecDB::neteq_decoders_[] = { kDecoderISACfb, # endif #endif -#ifdef WEBRTC_CODEC_PCM16 // Mono kDecoderPCM16B, kDecoderPCM16Bwb, @@ -166,7 +161,6 @@ const NetEqDecoder ACMCodecDB::neteq_decoders_[] = { kDecoderPCM16B_2ch, kDecoderPCM16Bwb_2ch, kDecoderPCM16Bswb32kHz_2ch, -#endif // G.711, PCM mu-las and A-law. // Mono kDecoderPCMu, diff --git a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h index b1ae5aa0f5..925c25fc42 100644 --- a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h +++ b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h @@ -38,7 +38,6 @@ class ACMCodecDB { , kISACFB # endif #endif -#ifdef WEBRTC_CODEC_PCM16 // Mono , kPCM16B , kPCM16Bwb @@ -47,7 +46,6 @@ class ACMCodecDB { , kPCM16B_2ch , kPCM16Bwb_2ch , kPCM16Bswb32kHz_2ch -#endif // Mono , kPCMU , kPCMA @@ -89,16 +87,6 @@ class ACMCodecDB { # ifndef WEBRTC_CODEC_ISACFX enum {kISAC = -1}; # endif -#endif -#ifndef WEBRTC_CODEC_PCM16 - // Mono - enum {kPCM16B = -1}; - enum {kPCM16Bwb = -1}; - enum {kPCM16Bswb32kHz = -1}; - // Stereo - enum {kPCM16B_2ch = -1}; - enum {kPCM16Bwb_2ch = -1}; - enum {kPCM16Bswb32kHz_2ch = -1}; #endif // 48 kHz not supported, always set to -1. enum {kPCM16Bswb48kHz = -1}; diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc index cb07cd6eb7..be0fbf1d3e 100644 --- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc +++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc @@ -1015,7 +1015,6 @@ bool AudioCodingImpl::MapCodecTypeToParameters(int codec_type, int* sample_rate_hz, int* channels) { switch (codec_type) { -#ifdef WEBRTC_CODEC_PCM16 case acm2::ACMCodecDB::kPCM16B: *codec_name = "L16"; *sample_rate_hz = 8000; @@ -1046,7 +1045,6 @@ bool AudioCodingImpl::MapCodecTypeToParameters(int codec_type, *sample_rate_hz = 32000; *channels = 2; break; -#endif #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) case acm2::ACMCodecDB::kISAC: *codec_name = "ISAC"; diff --git a/webrtc/modules/audio_coding/main/acm2/codec_manager.cc b/webrtc/modules/audio_coding/main/acm2/codec_manager.cc index 863a86eae5..c2e07ebd7b 100644 --- a/webrtc/modules/audio_coding/main/acm2/codec_manager.cc +++ b/webrtc/modules/audio_coding/main/acm2/codec_manager.cc @@ -122,11 +122,7 @@ bool IsPcmA(const CodecInst& codec) { } bool IsPcm16B(const CodecInst& codec) { - return -#ifdef WEBRTC_CODEC_PCM16 - !STR_CASE_CMP(codec.plname, "l16") || -#endif - false; + return !STR_CASE_CMP(codec.plname, "l16"); } bool IsIlbc(const CodecInst& codec) { diff --git a/webrtc/modules/audio_coding/main/acm2/codec_owner.cc b/webrtc/modules/audio_coding/main/acm2/codec_owner.cc index f0c38b84dc..e2c4548c8e 100644 --- a/webrtc/modules/audio_coding/main/acm2/codec_owner.cc +++ b/webrtc/modules/audio_coding/main/acm2/codec_owner.cc @@ -51,11 +51,7 @@ bool IsPcmA(const CodecInst& codec) { } bool IsPcm16B(const CodecInst& codec) { - return -#ifdef WEBRTC_CODEC_PCM16 - !STR_CASE_CMP(codec.plname, "l16") || -#endif - false; + return !STR_CASE_CMP(codec.plname, "l16"); } bool IsIlbc(const CodecInst& codec) { diff --git a/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc b/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc index b1badb6363..21d97f1abf 100644 --- a/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc +++ b/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc @@ -223,7 +223,6 @@ void TestAllCodecs::Perform() { Run(channel_a_to_b_); outfile_b_.Close(); #endif -#ifdef WEBRTC_CODEC_PCM16 if (test_mode_ != 0) { printf("===============================================================\n"); } @@ -263,7 +262,6 @@ void TestAllCodecs::Perform() { RegisterSendCodec('A', codec_l16, 32000, 512000, 640, 0); Run(channel_a_to_b_); outfile_b_.Close(); -#endif if (test_mode_ != 0) { printf("===============================================================\n"); } @@ -339,9 +337,6 @@ void TestAllCodecs::Perform() { #ifndef WEBRTC_CODEC_ISACFX printf(" ISAC fix\n"); #endif -#ifndef WEBRTC_CODEC_PCM16 - printf(" PCM16\n"); -#endif printf("\nTo complete the test, listen to the %d number of output files.\n", test_count_); diff --git a/webrtc/modules/audio_coding/main/test/TestRedFec.cc b/webrtc/modules/audio_coding/main/test/TestRedFec.cc index 6027a4d0e1..a48b2ebdfe 100644 --- a/webrtc/modules/audio_coding/main/test/TestRedFec.cc +++ b/webrtc/modules/audio_coding/main/test/TestRedFec.cc @@ -82,10 +82,6 @@ void TestRedFec::Perform() { _acmA->RegisterTransportCallback(_channelA2B); _channelA2B->RegisterReceiverACM(_acmB.get()); -#ifndef WEBRTC_CODEC_PCM16 - EXPECT_TRUE(false) << "PCM16 needs to be activated to run this test\n"); - return; -#endif EXPECT_EQ(0, RegisterSendCodec('A', kNameL16, 8000)); EXPECT_EQ(0, RegisterSendCodec('A', kNameCN, 8000)); EXPECT_EQ(0, RegisterSendCodec('A', kNameRED)); diff --git a/webrtc/modules/audio_coding/main/test/TestStereo.cc b/webrtc/modules/audio_coding/main/test/TestStereo.cc index 1eb4a675fe..32ecadface 100644 --- a/webrtc/modules/audio_coding/main/test/TestStereo.cc +++ b/webrtc/modules/audio_coding/main/test/TestStereo.cc @@ -118,11 +118,9 @@ TestStereo::TestStereo(int test_mode) #ifdef WEBRTC_CODEC_G722 , g722_pltype_(0) #endif -#ifdef WEBRTC_CODEC_PCM16 , l16_8khz_pltype_(-1) , l16_16khz_pltype_(-1) , l16_32khz_pltype_(-1) -#endif #ifdef PCMA_AND_PCMU , pcma_pltype_(-1) , pcmu_pltype_(-1) @@ -247,7 +245,6 @@ void TestStereo::Perform() { Run(channel_a2b_, audio_channels, codec_channels); out_file_.Close(); #endif -#ifdef WEBRTC_CODEC_PCM16 if (test_mode_ != 0) { printf("===========================================================\n"); printf("Test number: %d\n", test_cntr_ + 1); @@ -306,7 +303,6 @@ void TestStereo::Perform() { l16_32khz_pltype_); Run(channel_a2b_, audio_channels, codec_channels); out_file_.Close(); -#endif #ifdef PCMA_AND_PCMU if (test_mode_ != 0) { printf("===========================================================\n"); @@ -435,7 +431,6 @@ void TestStereo::Perform() { Run(channel_a2b_, audio_channels, codec_channels); out_file_.Close(); #endif -#ifdef WEBRTC_CODEC_PCM16 if (test_mode_ != 0) { printf("===============================================================\n"); printf("Test number: %d\n", test_cntr_ + 1); @@ -470,7 +465,6 @@ void TestStereo::Perform() { l16_32khz_pltype_); Run(channel_a2b_, audio_channels, codec_channels); out_file_.Close(); -#endif #ifdef PCMA_AND_PCMU if (test_mode_ != 0) { printf("===============================================================\n"); @@ -538,7 +532,6 @@ void TestStereo::Perform() { Run(channel_a2b_, audio_channels, codec_channels); out_file_.Close(); #endif -#ifdef WEBRTC_CODEC_PCM16 if (test_mode_ != 0) { printf("===============================================================\n"); printf("Test number: %d\n", test_cntr_ + 1); @@ -572,7 +565,6 @@ void TestStereo::Perform() { l16_32khz_pltype_); Run(channel_a2b_, audio_channels, codec_channels); out_file_.Close(); -#endif #ifdef PCMA_AND_PCMU if (test_mode_ != 0) { printf("===============================================================\n"); @@ -662,9 +654,7 @@ void TestStereo::Perform() { #ifdef WEBRTC_CODEC_G722 printf(" G.722\n"); #endif -#ifdef WEBRTC_CODEC_PCM16 printf(" PCM16\n"); -#endif printf(" G.711\n"); #ifdef WEBRTC_CODEC_OPUS printf(" Opus\n"); diff --git a/webrtc/modules/audio_coding/main/test/TestStereo.h b/webrtc/modules/audio_coding/main/test/TestStereo.h index c6412c7946..b56e995272 100644 --- a/webrtc/modules/audio_coding/main/test/TestStereo.h +++ b/webrtc/modules/audio_coding/main/test/TestStereo.h @@ -100,11 +100,9 @@ class TestStereo : public ACMTest { #ifdef WEBRTC_CODEC_G722 int g722_pltype_; #endif -#ifdef WEBRTC_CODEC_PCM16 int l16_8khz_pltype_; int l16_16khz_pltype_; int l16_32khz_pltype_; -#endif #ifdef PCMA_AND_PCMU int pcma_pltype_; int pcmu_pltype_; diff --git a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc index 2e05fe1c51..1b0a1c17d2 100644 --- a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc +++ b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc @@ -31,9 +31,7 @@ #ifdef WEBRTC_CODEC_OPUS #include "webrtc/modules/audio_coding/codecs/opus/interface/audio_decoder_opus.h" #endif -#ifdef WEBRTC_CODEC_PCM16 #include "webrtc/modules/audio_coding/codecs/pcm16b/include/pcm16b.h" -#endif namespace webrtc { @@ -98,7 +96,6 @@ size_t AudioDecoderPcmAMultiCh::Channels() const { } // PCM16B -#ifdef WEBRTC_CODEC_PCM16 AudioDecoderPcm16B::AudioDecoderPcm16B() {} void AudioDecoderPcm16B::Reset() { @@ -134,7 +131,6 @@ AudioDecoderPcm16BMultiCh::AudioDecoderPcm16BMultiCh(size_t num_channels) size_t AudioDecoderPcm16BMultiCh::Channels() const { return channels_; } -#endif // iLBC #ifdef WEBRTC_CODEC_ILBC @@ -352,7 +348,6 @@ bool CodecSupported(NetEqDecoder codec_type) { case kDecoderISACswb: case kDecoderISACfb: #endif -#ifdef WEBRTC_CODEC_PCM16 case kDecoderPCM16B: case kDecoderPCM16Bwb: case kDecoderPCM16Bswb32kHz: @@ -362,7 +357,6 @@ bool CodecSupported(NetEqDecoder codec_type) { case kDecoderPCM16Bswb32kHz_2ch: case kDecoderPCM16Bswb48kHz_2ch: case kDecoderPCM16B_5ch: -#endif #ifdef WEBRTC_CODEC_G722 case kDecoderG722: case kDecoderG722_2ch: @@ -395,21 +389,17 @@ int CodecSampleRateHz(NetEqDecoder codec_type) { #ifdef WEBRTC_CODEC_ILBC case kDecoderILBC: #endif -#ifdef WEBRTC_CODEC_PCM16 case kDecoderPCM16B: case kDecoderPCM16B_2ch: case kDecoderPCM16B_5ch: -#endif case kDecoderCNGnb: { return 8000; } #if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC) case kDecoderISAC: #endif -#ifdef WEBRTC_CODEC_PCM16 case kDecoderPCM16Bwb: case kDecoderPCM16Bwb_2ch: -#endif #ifdef WEBRTC_CODEC_G722 case kDecoderG722: case kDecoderG722_2ch: @@ -421,19 +411,15 @@ int CodecSampleRateHz(NetEqDecoder codec_type) { case kDecoderISACswb: case kDecoderISACfb: #endif -#ifdef WEBRTC_CODEC_PCM16 case kDecoderPCM16Bswb32kHz: case kDecoderPCM16Bswb32kHz_2ch: -#endif case kDecoderCNGswb32kHz: { return 32000; } -#ifdef WEBRTC_CODEC_PCM16 case kDecoderPCM16Bswb48kHz: case kDecoderPCM16Bswb48kHz_2ch: { return 48000; } -#endif #ifdef WEBRTC_CODEC_OPUS case kDecoderOpus: case kDecoderOpus_2ch: { @@ -476,7 +462,6 @@ AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type) { case kDecoderISACfb: return new AudioDecoderIsac(); #endif -#ifdef WEBRTC_CODEC_PCM16 case kDecoderPCM16B: case kDecoderPCM16Bwb: case kDecoderPCM16Bswb32kHz: @@ -489,7 +474,6 @@ AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type) { return new AudioDecoderPcm16BMultiCh(2); case kDecoderPCM16B_5ch: return new AudioDecoderPcm16BMultiCh(5); -#endif #ifdef WEBRTC_CODEC_G722 case kDecoderG722: return new AudioDecoderG722; diff --git a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.h b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.h index 345f4d5385..2d0d041692 100644 --- a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.h +++ b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.h @@ -93,7 +93,6 @@ class AudioDecoderPcmAMultiCh : public AudioDecoderPcmA { RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderPcmAMultiCh); }; -#ifdef WEBRTC_CODEC_PCM16 // This class handles all four types (i.e., sample rates) of PCM16B codecs. // The type is specified in the constructor parameter |type|. class AudioDecoderPcm16B : public AudioDecoder { @@ -126,7 +125,6 @@ class AudioDecoderPcm16BMultiCh : public AudioDecoderPcm16B { const size_t channels_; RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderPcm16BMultiCh); }; -#endif #ifdef WEBRTC_CODEC_ILBC class AudioDecoderIlbc : public AudioDecoder { diff --git a/webrtc/modules/audio_coding/neteq/neteq.gypi b/webrtc/modules/audio_coding/neteq/neteq.gypi index 2c58c998d6..6d0162286d 100644 --- a/webrtc/modules/audio_coding/neteq/neteq.gypi +++ b/webrtc/modules/audio_coding/neteq/neteq.gypi @@ -132,7 +132,6 @@ 'WEBRTC_CODEC_ILBC', 'WEBRTC_CODEC_ISACFX', 'WEBRTC_CODEC_ISAC', - 'WEBRTC_CODEC_PCM16', '<@(neteq_defines)', ], 'sources': [