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}
This commit is contained in:
kwiberg 2015-09-16 09:42:18 -07:00 committed by Commit bot
parent 384194369b
commit 844a91081e
13 changed files with 2 additions and 73 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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};

View File

@ -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";

View File

@ -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) {

View File

@ -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) {

View File

@ -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_);

View File

@ -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));

View File

@ -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");

View File

@ -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_;

View File

@ -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;

View File

@ -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 {

View File

@ -132,7 +132,6 @@
'WEBRTC_CODEC_ILBC',
'WEBRTC_CODEC_ISACFX',
'WEBRTC_CODEC_ISAC',
'WEBRTC_CODEC_PCM16',
'<@(neteq_defines)',
],
'sources': [