Make an enum class out of NetEqDecoder, and hide the neteq_decoders_ table

This operation was relatively simple, since no one was doing anything
fishy with this enum. A large number of lines had to be changed
because the enum values now live in their own namespace, but this is
arguably worth it since it is now much clearer what sort of constant
they are.

BUG=webrtc:5028

Review URL: https://codereview.webrtc.org/1424083002

Cr-Commit-Position: refs/heads/master@{#10449}
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 14a0df3..f7842ce 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.cc
@@ -173,49 +173,44 @@
 // Create a database of all NetEQ decoders at compile time.
 const NetEqDecoder ACMCodecDB::neteq_decoders_[] = {
 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
-    kDecoderISAC,
+    NetEqDecoder::kDecoderISAC,
 # if (defined(WEBRTC_CODEC_ISAC))
-    kDecoderISACswb,
+    NetEqDecoder::kDecoderISACswb,
 # endif
 #endif
     // Mono
-    kDecoderPCM16B,
-    kDecoderPCM16Bwb,
-    kDecoderPCM16Bswb32kHz,
+    NetEqDecoder::kDecoderPCM16B, NetEqDecoder::kDecoderPCM16Bwb,
+    NetEqDecoder::kDecoderPCM16Bswb32kHz,
     // Stereo
-    kDecoderPCM16B_2ch,
-    kDecoderPCM16Bwb_2ch,
-    kDecoderPCM16Bswb32kHz_2ch,
+    NetEqDecoder::kDecoderPCM16B_2ch, NetEqDecoder::kDecoderPCM16Bwb_2ch,
+    NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch,
     // G.711, PCM mu-las and A-law.
     // Mono
-    kDecoderPCMu,
-    kDecoderPCMa,
+    NetEqDecoder::kDecoderPCMu, NetEqDecoder::kDecoderPCMa,
     // Stereo
-    kDecoderPCMu_2ch,
-    kDecoderPCMa_2ch,
+    NetEqDecoder::kDecoderPCMu_2ch, NetEqDecoder::kDecoderPCMa_2ch,
 #ifdef WEBRTC_CODEC_ILBC
-    kDecoderILBC,
+    NetEqDecoder::kDecoderILBC,
 #endif
 #ifdef WEBRTC_CODEC_G722
     // Mono
-    kDecoderG722,
+    NetEqDecoder::kDecoderG722,
     // Stereo
-    kDecoderG722_2ch,
+    NetEqDecoder::kDecoderG722_2ch,
 #endif
 #ifdef WEBRTC_CODEC_OPUS
     // Mono and stereo.
-    kDecoderOpus,
+    NetEqDecoder::kDecoderOpus,
 #endif
     // Comfort noise for three different sampling frequencies.
-    kDecoderCNGnb,
-    kDecoderCNGwb,
-    kDecoderCNGswb32kHz
+    NetEqDecoder::kDecoderCNGnb, NetEqDecoder::kDecoderCNGwb,
+    NetEqDecoder::kDecoderCNGswb32kHz,
 #ifdef ENABLE_48000_HZ
-    , kDecoderCNGswb48kHz
+    NetEqDecoder::kDecoderCNGswb48kHz,
 #endif
-    , kDecoderAVT
+    NetEqDecoder::kDecoderAVT,
 #ifdef WEBRTC_CODEC_RED
-    , kDecoderRED
+    NetEqDecoder::kDecoderRED,
 #endif
 };
 
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 a5d4300..84c8846 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_codec_database.h
@@ -101,7 +101,11 @@
   // neteq_decoders_ - list of supported decoders in NetEQ.
   static const CodecInst database_[kMaxNumCodecs];
   static const CodecSettings codec_settings_[kMaxNumCodecs];
+
+ private:
   static const NetEqDecoder neteq_decoders_[kMaxNumCodecs];
+
+  friend class RentACodec;
 };
 
 }  // namespace acm2
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
index 80b7071..cf486ce 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
@@ -409,15 +409,17 @@
                               int channels,
                               int sample_rate_hz,
                               AudioDecoder* audio_decoder) {
-  assert(acm_codec_id >= -1);  // -1 means external decoder
-  NetEqDecoder neteq_decoder = (acm_codec_id == -1)
-                                   ? kDecoderArbitrary
-                                   : ACMCodecDB::neteq_decoders_[acm_codec_id];
-
-  // Make sure the right decoder is registered for Opus.
-  if (neteq_decoder == kDecoderOpus && channels == 2) {
-    neteq_decoder = kDecoderOpus_2ch;
-  }
+  const auto neteq_decoder = [acm_codec_id, channels]() -> NetEqDecoder {
+    if (acm_codec_id == -1)
+      return NetEqDecoder::kDecoderArbitrary;  // External decoder.
+    const rtc::Maybe<RentACodec::CodecId> cid =
+        RentACodec::CodecIdFromIndex(acm_codec_id);
+    RTC_DCHECK(cid) << "Invalid codec index: " << acm_codec_id;
+    const rtc::Maybe<NetEqDecoder> ned =
+        RentACodec::NetEqDecoderFromCodecId(*cid, channels);
+    RTC_DCHECK(ned) << "Invalid codec ID: " << static_cast<int>(*cid);
+    return *ned;
+  }();
 
   CriticalSectionScoped lock(crit_sect_.get());
 
diff --git a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
index 4554209..42f0a4c 100644
--- a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
+++ b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
@@ -55,5 +55,16 @@
                                          NumberOfCodecs());
 }
 
+rtc::Maybe<NetEqDecoder> RentACodec::NetEqDecoderFromCodecId(CodecId codec_id,
+                                                             int num_channels) {
+  rtc::Maybe<int> i = CodecIndexFromId(codec_id);
+  if (!i)
+    return rtc::Maybe<NetEqDecoder>();
+  const NetEqDecoder ned = ACMCodecDB::neteq_decoders_[*i];
+  return (ned == NetEqDecoder::kDecoderOpus && num_channels == 2)
+             ? NetEqDecoder::kDecoderOpus_2ch
+             : ned;
+}
+
 }  // namespace acm2
 }  // namespace webrtc
diff --git a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
index 8482d8f..55a5d03 100644
--- a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
+++ b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
@@ -97,6 +97,36 @@
     kNone = -1
   };
 
+  enum class NetEqDecoder {
+    kDecoderPCMu,
+    kDecoderPCMa,
+    kDecoderPCMu_2ch,
+    kDecoderPCMa_2ch,
+    kDecoderILBC,
+    kDecoderISAC,
+    kDecoderISACswb,
+    kDecoderPCM16B,
+    kDecoderPCM16Bwb,
+    kDecoderPCM16Bswb32kHz,
+    kDecoderPCM16Bswb48kHz,
+    kDecoderPCM16B_2ch,
+    kDecoderPCM16Bwb_2ch,
+    kDecoderPCM16Bswb32kHz_2ch,
+    kDecoderPCM16Bswb48kHz_2ch,
+    kDecoderPCM16B_5ch,
+    kDecoderG722,
+    kDecoderG722_2ch,
+    kDecoderRED,
+    kDecoderAVT,
+    kDecoderCNGnb,
+    kDecoderCNGwb,
+    kDecoderCNGswb32kHz,
+    kDecoderCNGswb48kHz,
+    kDecoderArbitrary,
+    kDecoderOpus,
+    kDecoderOpus_2ch,
+  };
+
   static inline size_t NumberOfCodecs() {
     return static_cast<size_t>(CodecId::kNumCodecs);
   }
@@ -121,6 +151,9 @@
                                                  int channels);
   static bool IsCodecValid(const CodecInst& codec_inst);
   static rtc::ArrayView<const CodecInst> Database();
+
+  static rtc::Maybe<NetEqDecoder> NetEqDecoderFromCodecId(CodecId codec_id,
+                                                          int num_channels);
 };
 
 }  // namespace acm2
diff --git a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc
index d982cec..a9ea44d 100644
--- a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc
@@ -75,43 +75,43 @@
 
 bool CodecSupported(NetEqDecoder codec_type) {
   switch (codec_type) {
-    case kDecoderPCMu:
-    case kDecoderPCMa:
-    case kDecoderPCMu_2ch:
-    case kDecoderPCMa_2ch:
+    case NetEqDecoder::kDecoderPCMu:
+    case NetEqDecoder::kDecoderPCMa:
+    case NetEqDecoder::kDecoderPCMu_2ch:
+    case NetEqDecoder::kDecoderPCMa_2ch:
 #ifdef WEBRTC_CODEC_ILBC
-    case kDecoderILBC:
+    case NetEqDecoder::kDecoderILBC:
 #endif
 #if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC)
-    case kDecoderISAC:
+    case NetEqDecoder::kDecoderISAC:
 #endif
 #ifdef WEBRTC_CODEC_ISAC
-    case kDecoderISACswb:
+    case NetEqDecoder::kDecoderISACswb:
 #endif
-    case kDecoderPCM16B:
-    case kDecoderPCM16Bwb:
-    case kDecoderPCM16Bswb32kHz:
-    case kDecoderPCM16Bswb48kHz:
-    case kDecoderPCM16B_2ch:
-    case kDecoderPCM16Bwb_2ch:
-    case kDecoderPCM16Bswb32kHz_2ch:
-    case kDecoderPCM16Bswb48kHz_2ch:
-    case kDecoderPCM16B_5ch:
+    case NetEqDecoder::kDecoderPCM16B:
+    case NetEqDecoder::kDecoderPCM16Bwb:
+    case NetEqDecoder::kDecoderPCM16Bswb32kHz:
+    case NetEqDecoder::kDecoderPCM16Bswb48kHz:
+    case NetEqDecoder::kDecoderPCM16B_2ch:
+    case NetEqDecoder::kDecoderPCM16Bwb_2ch:
+    case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch:
+    case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch:
+    case NetEqDecoder::kDecoderPCM16B_5ch:
 #ifdef WEBRTC_CODEC_G722
-    case kDecoderG722:
-    case kDecoderG722_2ch:
+    case NetEqDecoder::kDecoderG722:
+    case NetEqDecoder::kDecoderG722_2ch:
 #endif
 #ifdef WEBRTC_CODEC_OPUS
-    case kDecoderOpus:
-    case kDecoderOpus_2ch:
+    case NetEqDecoder::kDecoderOpus:
+    case NetEqDecoder::kDecoderOpus_2ch:
 #endif
-    case kDecoderRED:
-    case kDecoderAVT:
-    case kDecoderCNGnb:
-    case kDecoderCNGwb:
-    case kDecoderCNGswb32kHz:
-    case kDecoderCNGswb48kHz:
-    case kDecoderArbitrary: {
+    case NetEqDecoder::kDecoderRED:
+    case NetEqDecoder::kDecoderAVT:
+    case NetEqDecoder::kDecoderCNGnb:
+    case NetEqDecoder::kDecoderCNGwb:
+    case NetEqDecoder::kDecoderCNGswb32kHz:
+    case NetEqDecoder::kDecoderCNGswb48kHz:
+    case NetEqDecoder::kDecoderArbitrary: {
       return true;
     }
     default: {
@@ -122,50 +122,50 @@
 
 int CodecSampleRateHz(NetEqDecoder codec_type) {
   switch (codec_type) {
-    case kDecoderPCMu:
-    case kDecoderPCMa:
-    case kDecoderPCMu_2ch:
-    case kDecoderPCMa_2ch:
+    case NetEqDecoder::kDecoderPCMu:
+    case NetEqDecoder::kDecoderPCMa:
+    case NetEqDecoder::kDecoderPCMu_2ch:
+    case NetEqDecoder::kDecoderPCMa_2ch:
 #ifdef WEBRTC_CODEC_ILBC
-    case kDecoderILBC:
+    case NetEqDecoder::kDecoderILBC:
 #endif
-    case kDecoderPCM16B:
-    case kDecoderPCM16B_2ch:
-    case kDecoderPCM16B_5ch:
-    case kDecoderCNGnb: {
+    case NetEqDecoder::kDecoderPCM16B:
+    case NetEqDecoder::kDecoderPCM16B_2ch:
+    case NetEqDecoder::kDecoderPCM16B_5ch:
+    case NetEqDecoder::kDecoderCNGnb: {
       return 8000;
     }
 #if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC)
-    case kDecoderISAC:
+    case NetEqDecoder::kDecoderISAC:
 #endif
-    case kDecoderPCM16Bwb:
-    case kDecoderPCM16Bwb_2ch:
+    case NetEqDecoder::kDecoderPCM16Bwb:
+    case NetEqDecoder::kDecoderPCM16Bwb_2ch:
 #ifdef WEBRTC_CODEC_G722
-    case kDecoderG722:
-    case kDecoderG722_2ch:
+    case NetEqDecoder::kDecoderG722:
+    case NetEqDecoder::kDecoderG722_2ch:
 #endif
-    case kDecoderCNGwb: {
+    case NetEqDecoder::kDecoderCNGwb: {
       return 16000;
     }
 #ifdef WEBRTC_CODEC_ISAC
-    case kDecoderISACswb:
+    case NetEqDecoder::kDecoderISACswb:
 #endif
-    case kDecoderPCM16Bswb32kHz:
-    case kDecoderPCM16Bswb32kHz_2ch:
-    case kDecoderCNGswb32kHz: {
+    case NetEqDecoder::kDecoderPCM16Bswb32kHz:
+    case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch:
+    case NetEqDecoder::kDecoderCNGswb32kHz: {
       return 32000;
     }
-    case kDecoderPCM16Bswb48kHz:
-    case kDecoderPCM16Bswb48kHz_2ch: {
+    case NetEqDecoder::kDecoderPCM16Bswb48kHz:
+    case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch: {
       return 48000;
     }
 #ifdef WEBRTC_CODEC_OPUS
-    case kDecoderOpus:
-    case kDecoderOpus_2ch: {
+    case NetEqDecoder::kDecoderOpus:
+    case NetEqDecoder::kDecoderOpus_2ch: {
       return 48000;
     }
 #endif
-    case kDecoderCNGswb48kHz: {
+    case NetEqDecoder::kDecoderCNGswb48kHz: {
       // TODO(tlegrand): Remove limitation once ACM has full 48 kHz support.
       return 32000;
     }
@@ -180,58 +180,58 @@
     return NULL;
   }
   switch (codec_type) {
-    case kDecoderPCMu:
+    case NetEqDecoder::kDecoderPCMu:
       return new AudioDecoderPcmU(1);
-    case kDecoderPCMa:
+    case NetEqDecoder::kDecoderPCMa:
       return new AudioDecoderPcmA(1);
-    case kDecoderPCMu_2ch:
+    case NetEqDecoder::kDecoderPCMu_2ch:
       return new AudioDecoderPcmU(2);
-    case kDecoderPCMa_2ch:
+    case NetEqDecoder::kDecoderPCMa_2ch:
       return new AudioDecoderPcmA(2);
 #ifdef WEBRTC_CODEC_ILBC
-    case kDecoderILBC:
+    case NetEqDecoder::kDecoderILBC:
       return new AudioDecoderIlbc;
 #endif
 #if defined(WEBRTC_CODEC_ISACFX)
-    case kDecoderISAC:
+    case NetEqDecoder::kDecoderISAC:
       return new AudioDecoderIsacFix();
 #elif defined(WEBRTC_CODEC_ISAC)
-    case kDecoderISAC:
-    case kDecoderISACswb:
+    case NetEqDecoder::kDecoderISAC:
+    case NetEqDecoder::kDecoderISACswb:
       return new AudioDecoderIsac();
 #endif
-    case kDecoderPCM16B:
-    case kDecoderPCM16Bwb:
-    case kDecoderPCM16Bswb32kHz:
-    case kDecoderPCM16Bswb48kHz:
+    case NetEqDecoder::kDecoderPCM16B:
+    case NetEqDecoder::kDecoderPCM16Bwb:
+    case NetEqDecoder::kDecoderPCM16Bswb32kHz:
+    case NetEqDecoder::kDecoderPCM16Bswb48kHz:
       return new AudioDecoderPcm16B(1);
-    case kDecoderPCM16B_2ch:
-    case kDecoderPCM16Bwb_2ch:
-    case kDecoderPCM16Bswb32kHz_2ch:
-    case kDecoderPCM16Bswb48kHz_2ch:
+    case NetEqDecoder::kDecoderPCM16B_2ch:
+    case NetEqDecoder::kDecoderPCM16Bwb_2ch:
+    case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch:
+    case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch:
       return new AudioDecoderPcm16B(2);
-    case kDecoderPCM16B_5ch:
+    case NetEqDecoder::kDecoderPCM16B_5ch:
       return new AudioDecoderPcm16B(5);
 #ifdef WEBRTC_CODEC_G722
-    case kDecoderG722:
+    case NetEqDecoder::kDecoderG722:
       return new AudioDecoderG722;
-    case kDecoderG722_2ch:
+    case NetEqDecoder::kDecoderG722_2ch:
       return new AudioDecoderG722Stereo;
 #endif
 #ifdef WEBRTC_CODEC_OPUS
-    case kDecoderOpus:
+    case NetEqDecoder::kDecoderOpus:
       return new AudioDecoderOpus(1);
-    case kDecoderOpus_2ch:
+    case NetEqDecoder::kDecoderOpus_2ch:
       return new AudioDecoderOpus(2);
 #endif
-    case kDecoderCNGnb:
-    case kDecoderCNGwb:
-    case kDecoderCNGswb32kHz:
-    case kDecoderCNGswb48kHz:
+    case NetEqDecoder::kDecoderCNGnb:
+    case NetEqDecoder::kDecoderCNGwb:
+    case NetEqDecoder::kDecoderCNGswb32kHz:
+    case NetEqDecoder::kDecoderCNGswb48kHz:
       return new AudioDecoderCng;
-    case kDecoderRED:
-    case kDecoderAVT:
-    case kDecoderArbitrary:
+    case NetEqDecoder::kDecoderRED:
+    case NetEqDecoder::kDecoderAVT:
+    case NetEqDecoder::kDecoderArbitrary:
     default: {
       return NULL;
     }
diff --git a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.h b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.h
index 6214787..3229033 100644
--- a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.h
+++ b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.h
@@ -20,6 +20,7 @@
 #ifdef WEBRTC_CODEC_G722
 #include "webrtc/modules/audio_coding/codecs/g722/include/g722_interface.h"
 #endif
+#include "webrtc/modules/audio_coding/main/acm2/rent_a_codec.h"
 #include "webrtc/typedefs.h"
 
 namespace webrtc {
@@ -56,35 +57,7 @@
   RTC_DISALLOW_COPY_AND_ASSIGN(AudioDecoderCng);
 };
 
-enum NetEqDecoder {
-  kDecoderPCMu,
-  kDecoderPCMa,
-  kDecoderPCMu_2ch,
-  kDecoderPCMa_2ch,
-  kDecoderILBC,
-  kDecoderISAC,
-  kDecoderISACswb,
-  kDecoderPCM16B,
-  kDecoderPCM16Bwb,
-  kDecoderPCM16Bswb32kHz,
-  kDecoderPCM16Bswb48kHz,
-  kDecoderPCM16B_2ch,
-  kDecoderPCM16Bwb_2ch,
-  kDecoderPCM16Bswb32kHz_2ch,
-  kDecoderPCM16Bswb48kHz_2ch,
-  kDecoderPCM16B_5ch,
-  kDecoderG722,
-  kDecoderG722_2ch,
-  kDecoderRED,
-  kDecoderAVT,
-  kDecoderCNGnb,
-  kDecoderCNGwb,
-  kDecoderCNGswb32kHz,
-  kDecoderCNGswb48kHz,
-  kDecoderArbitrary,
-  kDecoderOpus,
-  kDecoderOpus_2ch,
-};
+using NetEqDecoder = acm2::RentACodec::NetEqDecoder;
 
 // Returns true if |codec_type| is supported.
 bool CodecSupported(NetEqDecoder codec_type);
diff --git a/webrtc/modules/audio_coding/neteq/audio_decoder_unittest.cc b/webrtc/modules/audio_coding/neteq/audio_decoder_unittest.cc
index 364accb..8f82fb1 100644
--- a/webrtc/modules/audio_coding/neteq/audio_decoder_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/audio_decoder_unittest.cc
@@ -680,64 +680,73 @@
 }  // namespace
 
 TEST(AudioDecoder, CodecSampleRateHz) {
-  EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMu));
-  EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMa));
-  EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMu_2ch));
-  EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMa_2ch));
-  EXPECT_EQ(has_ilbc ? 8000 : -1, CodecSampleRateHz(kDecoderILBC));
-  EXPECT_EQ(has_isac ? 16000 : -1, CodecSampleRateHz(kDecoderISAC));
-  EXPECT_EQ(has_isac_swb ? 32000 : -1, CodecSampleRateHz(kDecoderISACswb));
-  EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCM16B));
-  EXPECT_EQ(16000, CodecSampleRateHz(kDecoderPCM16Bwb));
-  EXPECT_EQ(32000, CodecSampleRateHz(kDecoderPCM16Bswb32kHz));
-  EXPECT_EQ(48000, CodecSampleRateHz(kDecoderPCM16Bswb48kHz));
-  EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCM16B_2ch));
-  EXPECT_EQ(16000, CodecSampleRateHz(kDecoderPCM16Bwb_2ch));
-  EXPECT_EQ(32000, CodecSampleRateHz(kDecoderPCM16Bswb32kHz_2ch));
-  EXPECT_EQ(48000, CodecSampleRateHz(kDecoderPCM16Bswb48kHz_2ch));
-  EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCM16B_5ch));
-  EXPECT_EQ(has_g722 ? 16000 : -1, CodecSampleRateHz(kDecoderG722));
-  EXPECT_EQ(has_g722 ? 16000 : -1, CodecSampleRateHz(kDecoderG722_2ch));
-  EXPECT_EQ(-1, CodecSampleRateHz(kDecoderRED));
-  EXPECT_EQ(-1, CodecSampleRateHz(kDecoderAVT));
-  EXPECT_EQ(8000, CodecSampleRateHz(kDecoderCNGnb));
-  EXPECT_EQ(16000, CodecSampleRateHz(kDecoderCNGwb));
-  EXPECT_EQ(32000, CodecSampleRateHz(kDecoderCNGswb32kHz));
-  EXPECT_EQ(has_opus ? 48000 : -1, CodecSampleRateHz(kDecoderOpus));
-  EXPECT_EQ(has_opus ? 48000 : -1, CodecSampleRateHz(kDecoderOpus_2ch));
+  EXPECT_EQ(8000, CodecSampleRateHz(NetEqDecoder::kDecoderPCMu));
+  EXPECT_EQ(8000, CodecSampleRateHz(NetEqDecoder::kDecoderPCMa));
+  EXPECT_EQ(8000, CodecSampleRateHz(NetEqDecoder::kDecoderPCMu_2ch));
+  EXPECT_EQ(8000, CodecSampleRateHz(NetEqDecoder::kDecoderPCMa_2ch));
+  EXPECT_EQ(has_ilbc ? 8000 : -1,
+            CodecSampleRateHz(NetEqDecoder::kDecoderILBC));
+  EXPECT_EQ(has_isac ? 16000 : -1,
+            CodecSampleRateHz(NetEqDecoder::kDecoderISAC));
+  EXPECT_EQ(has_isac_swb ? 32000 : -1,
+            CodecSampleRateHz(NetEqDecoder::kDecoderISACswb));
+  EXPECT_EQ(8000, CodecSampleRateHz(NetEqDecoder::kDecoderPCM16B));
+  EXPECT_EQ(16000, CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bwb));
+  EXPECT_EQ(32000, CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb32kHz));
+  EXPECT_EQ(48000, CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb48kHz));
+  EXPECT_EQ(8000, CodecSampleRateHz(NetEqDecoder::kDecoderPCM16B_2ch));
+  EXPECT_EQ(16000, CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bwb_2ch));
+  EXPECT_EQ(32000, CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch));
+  EXPECT_EQ(48000, CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch));
+  EXPECT_EQ(8000, CodecSampleRateHz(NetEqDecoder::kDecoderPCM16B_5ch));
+  EXPECT_EQ(has_g722 ? 16000 : -1,
+            CodecSampleRateHz(NetEqDecoder::kDecoderG722));
+  EXPECT_EQ(has_g722 ? 16000 : -1,
+            CodecSampleRateHz(NetEqDecoder::kDecoderG722_2ch));
+  EXPECT_EQ(-1, CodecSampleRateHz(NetEqDecoder::kDecoderRED));
+  EXPECT_EQ(-1, CodecSampleRateHz(NetEqDecoder::kDecoderAVT));
+  EXPECT_EQ(8000, CodecSampleRateHz(NetEqDecoder::kDecoderCNGnb));
+  EXPECT_EQ(16000, CodecSampleRateHz(NetEqDecoder::kDecoderCNGwb));
+  EXPECT_EQ(32000, CodecSampleRateHz(NetEqDecoder::kDecoderCNGswb32kHz));
+  EXPECT_EQ(has_opus ? 48000 : -1,
+            CodecSampleRateHz(NetEqDecoder::kDecoderOpus));
+  EXPECT_EQ(has_opus ? 48000 : -1,
+            CodecSampleRateHz(NetEqDecoder::kDecoderOpus_2ch));
+  EXPECT_EQ(48000, CodecSampleRateHz(NetEqDecoder::kDecoderOpus));
+  EXPECT_EQ(48000, CodecSampleRateHz(NetEqDecoder::kDecoderOpus_2ch));
   // TODO(tlegrand): Change 32000 to 48000 below once ACM has 48 kHz support.
-  EXPECT_EQ(32000, CodecSampleRateHz(kDecoderCNGswb48kHz));
-  EXPECT_EQ(-1, CodecSampleRateHz(kDecoderArbitrary));
+  EXPECT_EQ(32000, CodecSampleRateHz(NetEqDecoder::kDecoderCNGswb48kHz));
+  EXPECT_EQ(-1, CodecSampleRateHz(NetEqDecoder::kDecoderArbitrary));
 }
 
 TEST(AudioDecoder, CodecSupported) {
-  EXPECT_TRUE(CodecSupported(kDecoderPCMu));
-  EXPECT_TRUE(CodecSupported(kDecoderPCMa));
-  EXPECT_TRUE(CodecSupported(kDecoderPCMu_2ch));
-  EXPECT_TRUE(CodecSupported(kDecoderPCMa_2ch));
-  EXPECT_EQ(has_ilbc, CodecSupported(kDecoderILBC));
-  EXPECT_EQ(has_isac, CodecSupported(kDecoderISAC));
-  EXPECT_EQ(has_isac_swb, CodecSupported(kDecoderISACswb));
-  EXPECT_TRUE(CodecSupported(kDecoderPCM16B));
-  EXPECT_TRUE(CodecSupported(kDecoderPCM16Bwb));
-  EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb32kHz));
-  EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb48kHz));
-  EXPECT_TRUE(CodecSupported(kDecoderPCM16B_2ch));
-  EXPECT_TRUE(CodecSupported(kDecoderPCM16Bwb_2ch));
-  EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb32kHz_2ch));
-  EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb48kHz_2ch));
-  EXPECT_TRUE(CodecSupported(kDecoderPCM16B_5ch));
-  EXPECT_EQ(has_g722, CodecSupported(kDecoderG722));
-  EXPECT_EQ(has_g722, CodecSupported(kDecoderG722_2ch));
-  EXPECT_TRUE(CodecSupported(kDecoderRED));
-  EXPECT_TRUE(CodecSupported(kDecoderAVT));
-  EXPECT_TRUE(CodecSupported(kDecoderCNGnb));
-  EXPECT_TRUE(CodecSupported(kDecoderCNGwb));
-  EXPECT_TRUE(CodecSupported(kDecoderCNGswb32kHz));
-  EXPECT_TRUE(CodecSupported(kDecoderCNGswb48kHz));
-  EXPECT_TRUE(CodecSupported(kDecoderArbitrary));
-  EXPECT_EQ(has_opus, CodecSupported(kDecoderOpus));
-  EXPECT_EQ(has_opus, CodecSupported(kDecoderOpus_2ch));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCMu));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCMa));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCMu_2ch));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCMa_2ch));
+  EXPECT_EQ(has_ilbc, CodecSupported(NetEqDecoder::kDecoderILBC));
+  EXPECT_EQ(has_isac, CodecSupported(NetEqDecoder::kDecoderISAC));
+  EXPECT_EQ(has_isac_swb, CodecSupported(NetEqDecoder::kDecoderISACswb));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCM16B));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCM16Bwb));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCM16Bswb32kHz));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCM16Bswb48kHz));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCM16B_2ch));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCM16Bwb_2ch));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderPCM16B_5ch));
+  EXPECT_EQ(has_g722, CodecSupported(NetEqDecoder::kDecoderG722));
+  EXPECT_EQ(has_g722, CodecSupported(NetEqDecoder::kDecoderG722_2ch));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderRED));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderAVT));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGnb));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGwb));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb32kHz));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb48kHz));
+  EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderArbitrary));
+  EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus));
+  EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus_2ch));
 }
 
 }  // namespace webrtc
diff --git a/webrtc/modules/audio_coding/neteq/decoder_database.cc b/webrtc/modules/audio_coding/neteq/decoder_database.cc
index 97dc00d..41803f7 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database.cc
+++ b/webrtc/modules/audio_coding/neteq/decoder_database.cc
@@ -150,10 +150,10 @@
 }
 
 bool DecoderDatabase::IsComfortNoise(uint8_t rtp_payload_type) const {
-  if (IsType(rtp_payload_type, kDecoderCNGnb) ||
-      IsType(rtp_payload_type, kDecoderCNGwb) ||
-      IsType(rtp_payload_type, kDecoderCNGswb32kHz) ||
-      IsType(rtp_payload_type, kDecoderCNGswb48kHz)) {
+  if (IsType(rtp_payload_type, NetEqDecoder::kDecoderCNGnb) ||
+      IsType(rtp_payload_type, NetEqDecoder::kDecoderCNGwb) ||
+      IsType(rtp_payload_type, NetEqDecoder::kDecoderCNGswb32kHz) ||
+      IsType(rtp_payload_type, NetEqDecoder::kDecoderCNGswb48kHz)) {
     return true;
   } else {
     return false;
@@ -161,11 +161,11 @@
 }
 
 bool DecoderDatabase::IsDtmf(uint8_t rtp_payload_type) const {
-  return IsType(rtp_payload_type, kDecoderAVT);
+  return IsType(rtp_payload_type, NetEqDecoder::kDecoderAVT);
 }
 
 bool DecoderDatabase::IsRed(uint8_t rtp_payload_type) const {
-  return IsType(rtp_payload_type, kDecoderRED);
+  return IsType(rtp_payload_type, NetEqDecoder::kDecoderRED);
 }
 
 int DecoderDatabase::SetActiveDecoder(uint8_t rtp_payload_type,
diff --git a/webrtc/modules/audio_coding/neteq/decoder_database.h b/webrtc/modules/audio_coding/neteq/decoder_database.h
index 8ce0b69..ea70997 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database.h
+++ b/webrtc/modules/audio_coding/neteq/decoder_database.h
@@ -37,11 +37,10 @@
   struct DecoderInfo {
     // Constructors.
     DecoderInfo()
-        : codec_type(kDecoderArbitrary),
+        : codec_type(NetEqDecoder::kDecoderArbitrary),
           fs_hz(8000),
           decoder(NULL),
-          external(false) {
-    }
+          external(false) {}
     DecoderInfo(NetEqDecoder ct, int fs, AudioDecoder* dec, bool ext)
         : codec_type(ct),
           fs_hz(fs),
diff --git a/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc b/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
index af37ca9..e85d8d3 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc
@@ -33,7 +33,7 @@
   DecoderDatabase db;
   const uint8_t kPayloadType = 0;
   EXPECT_EQ(DecoderDatabase::kOK,
-            db.RegisterPayload(kPayloadType, kDecoderPCMu));
+            db.RegisterPayload(kPayloadType, NetEqDecoder::kDecoderPCMu));
   EXPECT_EQ(1, db.Size());
   EXPECT_FALSE(db.Empty());
   EXPECT_EQ(DecoderDatabase::kOK, db.Remove(kPayloadType));
@@ -45,11 +45,11 @@
   DecoderDatabase db;
   const uint8_t kPayloadType = 0;
   EXPECT_EQ(DecoderDatabase::kOK,
-            db.RegisterPayload(kPayloadType, kDecoderPCMu));
+            db.RegisterPayload(kPayloadType, NetEqDecoder::kDecoderPCMu));
   const DecoderDatabase::DecoderInfo* info;
   info = db.GetDecoderInfo(kPayloadType);
   ASSERT_TRUE(info != NULL);
-  EXPECT_EQ(kDecoderPCMu, info->codec_type);
+  EXPECT_EQ(NetEqDecoder::kDecoderPCMu, info->codec_type);
   EXPECT_EQ(NULL, info->decoder);
   EXPECT_EQ(8000, info->fs_hz);
   EXPECT_FALSE(info->external);
@@ -61,18 +61,19 @@
   DecoderDatabase db;
   const uint8_t kPayloadType = 0;
   EXPECT_EQ(DecoderDatabase::kOK,
-            db.RegisterPayload(kPayloadType, kDecoderPCMu));
-  EXPECT_EQ(kPayloadType, db.GetRtpPayloadType(kDecoderPCMu));
+            db.RegisterPayload(kPayloadType, NetEqDecoder::kDecoderPCMu));
+  EXPECT_EQ(kPayloadType, db.GetRtpPayloadType(NetEqDecoder::kDecoderPCMu));
   const uint8_t expected_value = DecoderDatabase::kRtpPayloadTypeError;
   EXPECT_EQ(expected_value,
-            db.GetRtpPayloadType(kDecoderISAC));  // iSAC is not registered.
+            db.GetRtpPayloadType(
+                NetEqDecoder::kDecoderISAC));  // iSAC is not registered.
 }
 
 TEST(DecoderDatabase, GetDecoder) {
   DecoderDatabase db;
   const uint8_t kPayloadType = 0;
   EXPECT_EQ(DecoderDatabase::kOK,
-            db.RegisterPayload(kPayloadType, kDecoderPCM16B));
+            db.RegisterPayload(kPayloadType, NetEqDecoder::kDecoderPCM16B));
   AudioDecoder* dec = db.GetDecoder(kPayloadType);
   ASSERT_TRUE(dec != NULL);
 }
@@ -86,13 +87,13 @@
   const uint8_t kPayloadNotUsed = 102;
   // Load into database.
   EXPECT_EQ(DecoderDatabase::kOK,
-            db.RegisterPayload(kPayloadTypePcmU, kDecoderPCMu));
+            db.RegisterPayload(kPayloadTypePcmU, NetEqDecoder::kDecoderPCMu));
   EXPECT_EQ(DecoderDatabase::kOK,
-            db.RegisterPayload(kPayloadTypeCng, kDecoderCNGnb));
+            db.RegisterPayload(kPayloadTypeCng, NetEqDecoder::kDecoderCNGnb));
   EXPECT_EQ(DecoderDatabase::kOK,
-            db.RegisterPayload(kPayloadTypeDtmf, kDecoderAVT));
+            db.RegisterPayload(kPayloadTypeDtmf, NetEqDecoder::kDecoderAVT));
   EXPECT_EQ(DecoderDatabase::kOK,
-            db.RegisterPayload(kPayloadTypeRed, kDecoderRED));
+            db.RegisterPayload(kPayloadTypeRed, NetEqDecoder::kDecoderRED));
   EXPECT_EQ(4, db.Size());
   // Test.
   EXPECT_FALSE(db.IsComfortNoise(kPayloadNotUsed));
@@ -101,8 +102,8 @@
   EXPECT_FALSE(db.IsComfortNoise(kPayloadTypePcmU));
   EXPECT_FALSE(db.IsDtmf(kPayloadTypePcmU));
   EXPECT_FALSE(db.IsRed(kPayloadTypePcmU));
-  EXPECT_FALSE(db.IsType(kPayloadTypePcmU, kDecoderISAC));
-  EXPECT_TRUE(db.IsType(kPayloadTypePcmU, kDecoderPCMu));
+  EXPECT_FALSE(db.IsType(kPayloadTypePcmU, NetEqDecoder::kDecoderISAC));
+  EXPECT_TRUE(db.IsType(kPayloadTypePcmU, NetEqDecoder::kDecoderPCMu));
   EXPECT_TRUE(db.IsComfortNoise(kPayloadTypeCng));
   EXPECT_TRUE(db.IsDtmf(kPayloadTypeDtmf));
   EXPECT_TRUE(db.IsRed(kPayloadTypeRed));
@@ -114,8 +115,8 @@
   MockAudioDecoder decoder;
   // Load into database.
   EXPECT_EQ(DecoderDatabase::kOK,
-            db.InsertExternal(kPayloadType, kDecoderPCMu, 8000,
-                               &decoder));
+            db.InsertExternal(kPayloadType, NetEqDecoder::kDecoderPCMu, 8000,
+                              &decoder));
   EXPECT_EQ(1, db.Size());
   // Get decoder and make sure we get the external one.
   EXPECT_EQ(&decoder, db.GetDecoder(kPayloadType));
@@ -123,7 +124,7 @@
   const DecoderDatabase::DecoderInfo* info;
   info = db.GetDecoderInfo(kPayloadType);
   ASSERT_TRUE(info != NULL);
-  EXPECT_EQ(kDecoderPCMu, info->codec_type);
+  EXPECT_EQ(NetEqDecoder::kDecoderPCMu, info->codec_type);
   EXPECT_EQ(&decoder, info->decoder);
   EXPECT_EQ(8000, info->fs_hz);
   EXPECT_TRUE(info->external);
@@ -143,8 +144,9 @@
   // matter for the test).
   const int kNumPayloads = 10;
   for (uint8_t payload_type = 0; payload_type < kNumPayloads; ++payload_type) {
-    EXPECT_EQ(DecoderDatabase::kOK,
-              db.RegisterPayload(payload_type, kDecoderArbitrary));
+    EXPECT_EQ(
+        DecoderDatabase::kOK,
+        db.RegisterPayload(payload_type, NetEqDecoder::kDecoderArbitrary));
   }
   PacketList packet_list;
   for (int i = 0; i < kNumPayloads + 1; ++i) {
@@ -182,9 +184,12 @@
 TEST(DecoderDatabase, IF_ISAC(ActiveDecoders)) {
   DecoderDatabase db;
   // Load payload types.
-  ASSERT_EQ(DecoderDatabase::kOK, db.RegisterPayload(0, kDecoderPCMu));
-  ASSERT_EQ(DecoderDatabase::kOK, db.RegisterPayload(103, kDecoderISAC));
-  ASSERT_EQ(DecoderDatabase::kOK, db.RegisterPayload(13, kDecoderCNGnb));
+  ASSERT_EQ(DecoderDatabase::kOK,
+            db.RegisterPayload(0, NetEqDecoder::kDecoderPCMu));
+  ASSERT_EQ(DecoderDatabase::kOK,
+            db.RegisterPayload(103, NetEqDecoder::kDecoderISAC));
+  ASSERT_EQ(DecoderDatabase::kOK,
+            db.RegisterPayload(13, NetEqDecoder::kDecoderCNGnb));
   // Verify that no decoders are active from the start.
   EXPECT_EQ(NULL, db.GetActiveDecoder());
   EXPECT_EQ(NULL, db.GetActiveCngDecoder());
diff --git a/webrtc/modules/audio_coding/neteq/delay_manager.cc b/webrtc/modules/audio_coding/neteq/delay_manager.cc
index ea968aa..5140c06 100644
--- a/webrtc/modules/audio_coding/neteq/delay_manager.cc
+++ b/webrtc/modules/audio_coding/neteq/delay_manager.cc
@@ -373,11 +373,11 @@
 }
 
 void DelayManager::LastDecoderType(NetEqDecoder decoder_type) {
-  if (decoder_type == kDecoderAVT ||
-      decoder_type == kDecoderCNGnb ||
-      decoder_type == kDecoderCNGwb ||
-      decoder_type == kDecoderCNGswb32kHz ||
-      decoder_type == kDecoderCNGswb48kHz) {
+  if (decoder_type == NetEqDecoder::kDecoderAVT ||
+      decoder_type == NetEqDecoder::kDecoderCNGnb ||
+      decoder_type == NetEqDecoder::kDecoderCNGwb ||
+      decoder_type == NetEqDecoder::kDecoderCNGswb32kHz ||
+      decoder_type == NetEqDecoder::kDecoderCNGswb48kHz) {
     last_pack_cng_or_dtmf_ = 1;
   } else if (last_pack_cng_or_dtmf_ != 0) {
     last_pack_cng_or_dtmf_ = -1;
diff --git a/webrtc/modules/audio_coding/neteq/include/neteq.h b/webrtc/modules/audio_coding/neteq/include/neteq.h
index 4067ba5..205a0df 100644
--- a/webrtc/modules/audio_coding/neteq/include/neteq.h
+++ b/webrtc/modules/audio_coding/neteq/include/neteq.h
@@ -175,7 +175,7 @@
 
   // Associates |rtp_payload_type| with |codec| and stores the information in
   // the codec database. Returns 0 on success, -1 on failure.
-  virtual int RegisterPayloadType(enum NetEqDecoder codec,
+  virtual int RegisterPayloadType(NetEqDecoder codec,
                                   uint8_t rtp_payload_type) = 0;
 
   // Provides an externally created decoder object |decoder| to insert in the
@@ -183,7 +183,7 @@
   // associates it with |rtp_payload_type|. The decoder will produce samples
   // at the rate |sample_rate_hz|. Returns kOK on success, kFail on failure.
   virtual int RegisterExternalDecoder(AudioDecoder* decoder,
-                                      enum NetEqDecoder codec,
+                                      NetEqDecoder codec,
                                       uint8_t rtp_payload_type,
                                       int sample_rate_hz) = 0;
 
diff --git a/webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc
index 2a11616..09eb561 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc
@@ -170,18 +170,20 @@
   static const size_t kMaxBlockSize = 480;  // 10 ms @ 48 kHz.
 
   NetEqExternalVsInternalDecoderTest()
-      : NetEqExternalDecoderUnitTest(kDecoderPCM16Bswb32kHz,
+      : NetEqExternalDecoderUnitTest(NetEqDecoder::kDecoderPCM16Bswb32kHz,
                                      new MockExternalPcm16B),
-        sample_rate_hz_(CodecSampleRateHz(kDecoderPCM16Bswb32kHz)) {
+        sample_rate_hz_(
+            CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb32kHz)) {
     NetEq::Config config;
-    config.sample_rate_hz = CodecSampleRateHz(kDecoderPCM16Bswb32kHz);
+    config.sample_rate_hz =
+        CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb32kHz);
     neteq_internal_.reset(NetEq::Create(config));
   }
 
   void SetUp() override {
     ASSERT_EQ(NetEq::kOK,
-              neteq_internal_->RegisterPayloadType(kDecoderPCM16Bswb32kHz,
-                                                   kPayloadType));
+              neteq_internal_->RegisterPayloadType(
+                  NetEqDecoder::kDecoderPCM16Bswb32kHz, kPayloadType));
   }
 
   void GetAndVerifyOutput() override {
@@ -250,7 +252,7 @@
   };
 
   LargeTimestampJumpTest()
-      : NetEqExternalDecoderUnitTest(kDecoderPCM16B,
+      : NetEqExternalDecoderUnitTest(NetEqDecoder::kDecoderPCM16B,
                                      new MockExternalPcm16B),
         test_state_(kInitialPhase) {
     EXPECT_CALL(*external_decoder(), HasDecodePlc())
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index ecd1ad9..92ce41e 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -174,11 +174,12 @@
   return kOK;
 }
 
-int NetEqImpl::RegisterPayloadType(enum NetEqDecoder codec,
+int NetEqImpl::RegisterPayloadType(NetEqDecoder codec,
                                    uint8_t rtp_payload_type) {
   CriticalSectionScoped lock(crit_sect_.get());
   LOG(LS_VERBOSE) << "RegisterPayloadType "
-                  << static_cast<int>(rtp_payload_type) << " " << codec;
+                  << static_cast<int>(rtp_payload_type) << " "
+                  << static_cast<int>(codec);
   int ret = decoder_database_->RegisterPayload(rtp_payload_type, codec);
   if (ret != DecoderDatabase::kOK) {
     switch (ret) {
@@ -200,12 +201,13 @@
 }
 
 int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder,
-                                       enum NetEqDecoder codec,
+                                       NetEqDecoder codec,
                                        uint8_t rtp_payload_type,
                                        int sample_rate_hz) {
   CriticalSectionScoped lock(crit_sect_.get());
   LOG(LS_VERBOSE) << "RegisterExternalDecoder "
-                  << static_cast<int>(rtp_payload_type) << " " << codec;
+                  << static_cast<int>(rtp_payload_type) << " "
+                  << static_cast<int>(codec);
   if (!decoder) {
     LOG(LS_ERROR) << "Cannot register external decoder with NULL pointer";
     assert(false);
@@ -1677,16 +1679,16 @@
       // Clearly wrong, but will maintain bit-exactness with legacy.
       if (fs_hz_ == 8000) {
         packet->header.payloadType =
-            decoder_database_->GetRtpPayloadType(kDecoderCNGnb);
+            decoder_database_->GetRtpPayloadType(NetEqDecoder::kDecoderCNGnb);
       } else if (fs_hz_ == 16000) {
         packet->header.payloadType =
-            decoder_database_->GetRtpPayloadType(kDecoderCNGwb);
+            decoder_database_->GetRtpPayloadType(NetEqDecoder::kDecoderCNGwb);
       } else if (fs_hz_ == 32000) {
-        packet->header.payloadType =
-            decoder_database_->GetRtpPayloadType(kDecoderCNGswb32kHz);
+        packet->header.payloadType = decoder_database_->GetRtpPayloadType(
+            NetEqDecoder::kDecoderCNGswb32kHz);
       } else if (fs_hz_ == 48000) {
-        packet->header.payloadType =
-            decoder_database_->GetRtpPayloadType(kDecoderCNGswb48kHz);
+        packet->header.payloadType = decoder_database_->GetRtpPayloadType(
+            NetEqDecoder::kDecoderCNGswb48kHz);
       }
       assert(decoder_database_->IsComfortNoise(packet->header.payloadType));
 #else
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.h b/webrtc/modules/audio_coding/neteq/neteq_impl.h
index 4f253bd..c001e53 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.h
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.h
@@ -111,7 +111,7 @@
 
   // Associates |rtp_payload_type| with |codec| and stores the information in
   // the codec database. Returns kOK on success, kFail on failure.
-  int RegisterPayloadType(enum NetEqDecoder codec,
+  int RegisterPayloadType(NetEqDecoder codec,
                           uint8_t rtp_payload_type) override;
 
   // Provides an externally created decoder object |decoder| to insert in the
@@ -119,7 +119,7 @@
   // associates it with |rtp_payload_type|. The decoder will produce samples
   // at the rate |sample_rate_hz|. Returns kOK on success, kFail on failure.
   int RegisterExternalDecoder(AudioDecoder* decoder,
-                              enum NetEqDecoder codec,
+                              NetEqDecoder codec,
                               uint8_t rtp_payload_type,
                               int sample_rate_hz) override;
 
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc
index 5cacce6..90640ca 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc
@@ -239,7 +239,7 @@
 TEST_F(NetEqImplTest, RegisterPayloadType) {
   CreateInstance();
   uint8_t rtp_payload_type = 0;
-  NetEqDecoder codec_type = kDecoderPCMu;
+  NetEqDecoder codec_type = NetEqDecoder::kDecoderPCMu;
   EXPECT_CALL(*mock_decoder_database_,
               RegisterPayload(rtp_payload_type, codec_type));
   neteq_->RegisterPayloadType(codec_type, rtp_payload_type);
@@ -300,7 +300,7 @@
   EXPECT_CALL(*mock_decoder_database_, IsComfortNoise(kPayloadType))
       .WillRepeatedly(Return(false));  // This is not CNG.
   DecoderDatabase::DecoderInfo info;
-  info.codec_type = kDecoderPCMu;
+  info.codec_type = NetEqDecoder::kDecoderPCMu;
   EXPECT_CALL(*mock_decoder_database_, GetDecoderInfo(kPayloadType))
       .WillRepeatedly(Return(&info));
 
@@ -334,7 +334,8 @@
     // All expectations within this block must be called in this specific order.
     InSequence sequence;  // Dummy variable.
     // Expectations when the first packet is inserted.
-    EXPECT_CALL(*mock_delay_manager_, LastDecoderType(kDecoderPCMu))
+    EXPECT_CALL(*mock_delay_manager_,
+                LastDecoderType(NetEqDecoder::kDecoderPCMu))
         .Times(1);
     EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf())
         .Times(2)
@@ -343,7 +344,8 @@
         .Times(1);
     EXPECT_CALL(*mock_delay_manager_, ResetPacketIatCount()).Times(1);
     // Expectations when the second packet is inserted. Slightly different.
-    EXPECT_CALL(*mock_delay_manager_, LastDecoderType(kDecoderPCMu))
+    EXPECT_CALL(*mock_delay_manager_,
+                LastDecoderType(NetEqDecoder::kDecoderPCMu))
         .Times(1);
     EXPECT_CALL(*mock_delay_manager_, last_pack_cng_or_dtmf())
         .WillOnce(Return(0));
@@ -381,8 +383,8 @@
   rtp_header.header.timestamp = 0x12345678;
   rtp_header.header.ssrc = 0x87654321;
 
-  EXPECT_EQ(NetEq::kOK,
-            neteq_->RegisterPayloadType(kDecoderPCM16B, kPayloadType));
+  EXPECT_EQ(NetEq::kOK, neteq_->RegisterPayloadType(
+                            NetEqDecoder::kDecoderPCM16B, kPayloadType));
 
   // Insert packets. The buffer should not flush.
   for (size_t i = 1; i <= config_.max_packets_in_buffer; ++i) {
@@ -455,9 +457,9 @@
     int16_t next_value_;
   } decoder_;
 
-  EXPECT_EQ(NetEq::kOK,
-            neteq_->RegisterExternalDecoder(&decoder_, kDecoderPCM16B,
-                                            kPayloadType, kSampleRateHz));
+  EXPECT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder(
+                            &decoder_, NetEqDecoder::kDecoderPCM16B,
+                            kPayloadType, kSampleRateHz));
 
   // Insert one packet.
   EXPECT_EQ(NetEq::kOK,
@@ -535,9 +537,9 @@
                                           dummy_output + kPayloadLengthSamples),
                       SetArgPointee<5>(AudioDecoder::kSpeech),
                       Return(kPayloadLengthSamples)));
-  EXPECT_EQ(NetEq::kOK,
-            neteq_->RegisterExternalDecoder(&mock_decoder, kDecoderPCM16B,
-                                            kPayloadType, kSampleRateHz));
+  EXPECT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder(
+                            &mock_decoder, NetEqDecoder::kDecoderPCM16B,
+                            kPayloadType, kSampleRateHz));
 
   // Insert one packet.
   EXPECT_EQ(NetEq::kOK,
@@ -639,8 +641,8 @@
   EXPECT_EQ(kOutputPLC, type);
 
   // Register the payload type.
-  EXPECT_EQ(NetEq::kOK,
-            neteq_->RegisterPayloadType(kDecoderPCM16B, kPayloadType));
+  EXPECT_EQ(NetEq::kOK, neteq_->RegisterPayloadType(
+                            NetEqDecoder::kDecoderPCM16B, kPayloadType));
 
   // Insert 10 packets.
   for (size_t i = 0; i < 10; ++i) {
@@ -723,8 +725,8 @@
                       Return(kPayloadLengthSamples)));
 
   EXPECT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder(
-                            &mock_decoder, kDecoderOpus, kPayloadType,
-                            kSampleRateKhz * 1000));
+                            &mock_decoder, NetEqDecoder::kDecoderOpus,
+                            kPayloadType, kSampleRateKhz * 1000));
 
   // Insert one packet (decoder will return speech).
   EXPECT_EQ(NetEq::kOK,
@@ -862,9 +864,9 @@
     .Times(AtLeast(1))
     .WillRepeatedly(Return(kNetEqMaxFrameSize));
 
-  EXPECT_EQ(NetEq::kOK,
-            neteq_->RegisterExternalDecoder(&decoder_, kDecoderPCM16B,
-                                            kPayloadType, kSampleRateHz));
+  EXPECT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder(
+                            &decoder_, NetEqDecoder::kDecoderPCM16B,
+                            kPayloadType, kSampleRateHz));
 
   // Insert one packet.
   payload[0] = kFirstPayloadValue;  // This will make Decode() fail.
@@ -923,8 +925,8 @@
   rtp_header.header.timestamp = 0x12345678;
   rtp_header.header.ssrc = 0x87654321;
 
-  EXPECT_EQ(NetEq::kOK,
-            neteq_->RegisterPayloadType(kDecoderPCM16B, kPayloadType));
+  EXPECT_EQ(NetEq::kOK, neteq_->RegisterPayloadType(
+                            NetEqDecoder::kDecoderPCM16B, kPayloadType));
 
   // Insert packets until the buffer flushes.
   for (size_t i = 0; i <= config_.max_packets_in_buffer; ++i) {
@@ -979,9 +981,9 @@
                                     dummy_output + kPayloadLengthSamples - 5),
                 SetArgPointee<5>(AudioDecoder::kSpeech),
                 Return(kPayloadLengthSamples - 5)));
-  EXPECT_EQ(NetEq::kOK,
-            neteq_->RegisterExternalDecoder(&mock_decoder, kDecoderPCM16B,
-                                            kPayloadType, kSampleRateHz));
+  EXPECT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder(
+                            &mock_decoder, NetEqDecoder::kDecoderPCM16B,
+                            kPayloadType, kSampleRateHz));
 
   // Insert one packet.
   EXPECT_EQ(NetEq::kOK,
@@ -1075,9 +1077,9 @@
                   Return(kFrameLengthSamples)));
   }
 
-  EXPECT_EQ(NetEq::kOK,
-            neteq_->RegisterExternalDecoder(&mock_decoder, kDecoderPCM16B,
-                                            kPayloadType, kSampleRateHz));
+  EXPECT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder(
+                            &mock_decoder, NetEqDecoder::kDecoderPCM16B,
+                            kPayloadType, kSampleRateHz));
 
   // Insert packets.
   for (int i = 0; i < 6; ++i) {
@@ -1197,9 +1199,9 @@
                   Return(kFrameLengthSamples)));
   }
 
-  EXPECT_EQ(NetEq::kOK,
-            neteq_->RegisterExternalDecoder(&mock_decoder, kDecoderPCM16B,
-                                            kPayloadType, kSampleRateHz));
+  EXPECT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder(
+                            &mock_decoder, NetEqDecoder::kDecoderPCM16B,
+                            kPayloadType, kSampleRateHz));
 
   // Insert 2 packets. This will make netEq into codec internal CNG mode.
   for (int i = 0; i < 2; ++i) {
diff --git a/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc
index e9ebe06..16fa04c 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc
@@ -274,21 +274,21 @@
 
 TEST(NetEqNetworkStatsTest, DecodeFec) {
   MockAudioDecoder decoder(1);
-  NetEqNetworkStatsTest test(kDecoderOpus, &decoder);
+  NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, &decoder);
   test.DecodeFecTest();
   EXPECT_CALL(decoder, Die()).Times(1);
 }
 
 TEST(NetEqNetworkStatsTest, StereoDecodeFec) {
   MockAudioDecoder decoder(2);
-  NetEqNetworkStatsTest test(kDecoderOpus, &decoder);
+  NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, &decoder);
   test.DecodeFecTest();
   EXPECT_CALL(decoder, Die()).Times(1);
 }
 
 TEST(NetEqNetworkStatsTest, NoiseExpansionTest) {
   MockAudioDecoder decoder(1);
-  NetEqNetworkStatsTest test(kDecoderOpus, &decoder);
+  NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, &decoder);
   test.NoiseExpansionTest();
   EXPECT_CALL(decoder, Die()).Times(1);
 }
diff --git a/webrtc/modules/audio_coding/neteq/neteq_stereo_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_stereo_unittest.cc
index 5d6f4ad..66874b8 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_stereo_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_stereo_unittest.cc
@@ -91,35 +91,35 @@
     NetEqDecoder multi_decoder;
     switch (sample_rate_hz_) {
       case 8000:
-        mono_decoder = kDecoderPCM16B;
+        mono_decoder = NetEqDecoder::kDecoderPCM16B;
         if (num_channels_ == 2) {
-          multi_decoder = kDecoderPCM16B_2ch;
+          multi_decoder = NetEqDecoder::kDecoderPCM16B_2ch;
         } else if (num_channels_ == 5) {
-          multi_decoder = kDecoderPCM16B_5ch;
+          multi_decoder = NetEqDecoder::kDecoderPCM16B_5ch;
         } else {
           FAIL() << "Only 2 and 5 channels supported for 8000 Hz.";
         }
         break;
       case 16000:
-        mono_decoder = kDecoderPCM16Bwb;
+        mono_decoder = NetEqDecoder::kDecoderPCM16Bwb;
         if (num_channels_ == 2) {
-          multi_decoder = kDecoderPCM16Bwb_2ch;
+          multi_decoder = NetEqDecoder::kDecoderPCM16Bwb_2ch;
         } else {
           FAIL() << "More than 2 channels is not supported for 16000 Hz.";
         }
         break;
       case 32000:
-        mono_decoder = kDecoderPCM16Bswb32kHz;
+        mono_decoder = NetEqDecoder::kDecoderPCM16Bswb32kHz;
         if (num_channels_ == 2) {
-          multi_decoder = kDecoderPCM16Bswb32kHz_2ch;
+          multi_decoder = NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch;
         } else {
           FAIL() << "More than 2 channels is not supported for 32000 Hz.";
         }
         break;
       case 48000:
-        mono_decoder = kDecoderPCM16Bswb48kHz;
+        mono_decoder = NetEqDecoder::kDecoderPCM16Bswb48kHz;
         if (num_channels_ == 2) {
-          multi_decoder = kDecoderPCM16Bswb48kHz_2ch;
+          multi_decoder = NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch;
         } else {
           FAIL() << "More than 2 channels is not supported for 48000 Hz.";
         }
diff --git a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
index 6499155..4340f54 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
@@ -304,31 +304,32 @@
 
 void NetEqDecodingTest::LoadDecoders() {
   // Load PCMu.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderPCMu, 0));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderPCMu, 0));
   // Load PCMa.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderPCMa, 8));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderPCMa, 8));
 #ifdef WEBRTC_CODEC_ILBC
   // Load iLBC.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderILBC, 102));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderILBC, 102));
 #endif
 #if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
   // Load iSAC.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderISAC, 103));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderISAC, 103));
 #endif
 #ifdef WEBRTC_CODEC_ISAC
   // Load iSAC SWB.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderISACswb, 104));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderISACswb, 104));
 #endif
   // Load PCM16B nb.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderPCM16B, 93));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderPCM16B, 93));
   // Load PCM16B wb.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderPCM16Bwb, 94));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderPCM16Bwb, 94));
   // Load PCM16B swb32.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderPCM16Bswb32kHz, 95));
+  ASSERT_EQ(
+      0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderPCM16Bswb32kHz, 95));
   // Load CNG 8 kHz.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderCNGnb, 13));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderCNGnb, 13));
   // Load CNG 16 kHz.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderCNGwb, 98));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderCNGwb, 98));
 }
 
 void NetEqDecodingTest::OpenInputFile(const std::string &rtp_file) {
@@ -1079,17 +1080,22 @@
   uint8_t kIsacPayloadType = 9;  // Payload type 8 is already registered.
 
   // Register decoders.
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderPCM16Bwb,
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderPCM16Bwb,
                                            kPcm16WbPayloadType));
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderCNGnb, kCngNbPayloadType));
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderCNGwb, kCngWbPayloadType));
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderCNGswb32kHz,
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderCNGnb,
+                                           kCngNbPayloadType));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderCNGwb,
+                                           kCngWbPayloadType));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderCNGswb32kHz,
                                            kCngSwb32PayloadType));
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderCNGswb48kHz,
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderCNGswb48kHz,
                                            kCngSwb48PayloadType));
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderAVT, kAvtPayloadType));
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderRED, kRedPayloadType));
-  ASSERT_EQ(0, neteq_->RegisterPayloadType(kDecoderISAC, kIsacPayloadType));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderAVT,
+                                           kAvtPayloadType));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderRED,
+                                           kRedPayloadType));
+  ASSERT_EQ(0, neteq_->RegisterPayloadType(NetEqDecoder::kDecoderISAC,
+                                           kIsacPayloadType));
 
   PopulateRtpInfo(0, 0, &rtp_info);
   rtp_info.header.payloadType = kPcm16WbPayloadType;
diff --git a/webrtc/modules/audio_coding/neteq/payload_splitter.cc b/webrtc/modules/audio_coding/neteq/payload_splitter.cc
index 2172eee..8530718 100644
--- a/webrtc/modules/audio_coding/neteq/payload_splitter.cc
+++ b/webrtc/modules/audio_coding/neteq/payload_splitter.cc
@@ -152,8 +152,8 @@
     }
 
     switch (info->codec_type) {
-      case kDecoderOpus:
-      case kDecoderOpus_2ch: {
+      case NetEqDecoder::kDecoderOpus:
+      case NetEqDecoder::kDecoderOpus_2ch: {
         // The main payload of this packet should be decoded as a primary
         // payload, even if it comes as a secondary payload in a RED packet.
         packet->primary = true;
@@ -236,69 +236,69 @@
     }
     PacketList new_packets;
     switch (info->codec_type) {
-      case kDecoderPCMu:
-      case kDecoderPCMa: {
+      case NetEqDecoder::kDecoderPCMu:
+      case NetEqDecoder::kDecoderPCMa: {
         // 8 bytes per ms; 8 timestamps per ms.
         SplitBySamples(packet, 8, 8, &new_packets);
         break;
       }
-      case kDecoderPCMu_2ch:
-      case kDecoderPCMa_2ch: {
+      case NetEqDecoder::kDecoderPCMu_2ch:
+      case NetEqDecoder::kDecoderPCMa_2ch: {
         // 2 * 8 bytes per ms; 8 timestamps per ms.
         SplitBySamples(packet, 2 * 8, 8, &new_packets);
         break;
       }
-      case kDecoderG722: {
+      case NetEqDecoder::kDecoderG722: {
         // 8 bytes per ms; 16 timestamps per ms.
         SplitBySamples(packet, 8, 16, &new_packets);
         break;
       }
-      case kDecoderPCM16B: {
+      case NetEqDecoder::kDecoderPCM16B: {
         // 16 bytes per ms; 8 timestamps per ms.
         SplitBySamples(packet, 16, 8, &new_packets);
         break;
       }
-      case kDecoderPCM16Bwb: {
+      case NetEqDecoder::kDecoderPCM16Bwb: {
         // 32 bytes per ms; 16 timestamps per ms.
         SplitBySamples(packet, 32, 16, &new_packets);
         break;
       }
-      case kDecoderPCM16Bswb32kHz: {
+      case NetEqDecoder::kDecoderPCM16Bswb32kHz: {
         // 64 bytes per ms; 32 timestamps per ms.
         SplitBySamples(packet, 64, 32, &new_packets);
         break;
       }
-      case kDecoderPCM16Bswb48kHz: {
+      case NetEqDecoder::kDecoderPCM16Bswb48kHz: {
         // 96 bytes per ms; 48 timestamps per ms.
         SplitBySamples(packet, 96, 48, &new_packets);
         break;
       }
-      case kDecoderPCM16B_2ch: {
+      case NetEqDecoder::kDecoderPCM16B_2ch: {
         // 2 * 16 bytes per ms; 8 timestamps per ms.
         SplitBySamples(packet, 2 * 16, 8, &new_packets);
         break;
       }
-      case kDecoderPCM16Bwb_2ch: {
+      case NetEqDecoder::kDecoderPCM16Bwb_2ch: {
         // 2 * 32 bytes per ms; 16 timestamps per ms.
         SplitBySamples(packet, 2 * 32, 16, &new_packets);
         break;
       }
-      case kDecoderPCM16Bswb32kHz_2ch: {
+      case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch: {
         // 2 * 64 bytes per ms; 32 timestamps per ms.
         SplitBySamples(packet, 2 * 64, 32, &new_packets);
         break;
       }
-      case kDecoderPCM16Bswb48kHz_2ch: {
+      case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch: {
         // 2 * 96 bytes per ms; 48 timestamps per ms.
         SplitBySamples(packet, 2 * 96, 48, &new_packets);
         break;
       }
-      case kDecoderPCM16B_5ch: {
+      case NetEqDecoder::kDecoderPCM16B_5ch: {
         // 5 * 16 bytes per ms; 8 timestamps per ms.
         SplitBySamples(packet, 5 * 16, 8, &new_packets);
         break;
       }
-      case kDecoderILBC: {
+      case NetEqDecoder::kDecoderILBC: {
         size_t bytes_per_frame;
         int timestamps_per_frame;
         if (packet->payload_length >= 950) {
diff --git a/webrtc/modules/audio_coding/neteq/payload_splitter_unittest.cc b/webrtc/modules/audio_coding/neteq/payload_splitter_unittest.cc
index 305e526..bf26a8f 100644
--- a/webrtc/modules/audio_coding/neteq/payload_splitter_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/payload_splitter_unittest.cc
@@ -310,10 +310,10 @@
   // easier to just register the payload types and let the actual implementation
   // do its job.
   DecoderDatabase decoder_database;
-  decoder_database.RegisterPayload(0, kDecoderCNGnb);
-  decoder_database.RegisterPayload(1, kDecoderPCMu);
-  decoder_database.RegisterPayload(2, kDecoderAVT);
-  decoder_database.RegisterPayload(3, kDecoderILBC);
+  decoder_database.RegisterPayload(0, NetEqDecoder::kDecoderCNGnb);
+  decoder_database.RegisterPayload(1, NetEqDecoder::kDecoderPCMu);
+  decoder_database.RegisterPayload(2, NetEqDecoder::kDecoderAVT);
+  decoder_database.RegisterPayload(3, NetEqDecoder::kDecoderILBC);
 
   PayloadSplitter splitter;
   splitter.CheckRedPayloads(&packet_list, decoder_database);
@@ -372,27 +372,33 @@
   // codec types.
   // Use scoped pointers to avoid having to delete them later.
   rtc::scoped_ptr<DecoderDatabase::DecoderInfo> info0(
-      new DecoderDatabase::DecoderInfo(kDecoderISAC, 16000, NULL, false));
+      new DecoderDatabase::DecoderInfo(NetEqDecoder::kDecoderISAC, 16000, NULL,
+                                       false));
   EXPECT_CALL(decoder_database, GetDecoderInfo(0))
       .WillRepeatedly(Return(info0.get()));
   rtc::scoped_ptr<DecoderDatabase::DecoderInfo> info1(
-      new DecoderDatabase::DecoderInfo(kDecoderISACswb, 32000, NULL, false));
+      new DecoderDatabase::DecoderInfo(NetEqDecoder::kDecoderISACswb, 32000,
+                                       NULL, false));
   EXPECT_CALL(decoder_database, GetDecoderInfo(1))
       .WillRepeatedly(Return(info1.get()));
   rtc::scoped_ptr<DecoderDatabase::DecoderInfo> info2(
-      new DecoderDatabase::DecoderInfo(kDecoderRED, 8000, NULL, false));
+      new DecoderDatabase::DecoderInfo(NetEqDecoder::kDecoderRED, 8000, NULL,
+                                       false));
   EXPECT_CALL(decoder_database, GetDecoderInfo(2))
       .WillRepeatedly(Return(info2.get()));
   rtc::scoped_ptr<DecoderDatabase::DecoderInfo> info3(
-      new DecoderDatabase::DecoderInfo(kDecoderAVT, 8000, NULL, false));
+      new DecoderDatabase::DecoderInfo(NetEqDecoder::kDecoderAVT, 8000, NULL,
+                                       false));
   EXPECT_CALL(decoder_database, GetDecoderInfo(3))
       .WillRepeatedly(Return(info3.get()));
   rtc::scoped_ptr<DecoderDatabase::DecoderInfo> info4(
-      new DecoderDatabase::DecoderInfo(kDecoderCNGnb, 8000, NULL, false));
+      new DecoderDatabase::DecoderInfo(NetEqDecoder::kDecoderCNGnb, 8000, NULL,
+                                       false));
   EXPECT_CALL(decoder_database, GetDecoderInfo(4))
       .WillRepeatedly(Return(info4.get()));
   rtc::scoped_ptr<DecoderDatabase::DecoderInfo> info5(
-      new DecoderDatabase::DecoderInfo(kDecoderArbitrary, 8000, NULL, false));
+      new DecoderDatabase::DecoderInfo(NetEqDecoder::kDecoderArbitrary, 8000,
+                                       NULL, false));
   EXPECT_CALL(decoder_database, GetDecoderInfo(5))
       .WillRepeatedly(Return(info5.get()));
 
@@ -452,53 +458,53 @@
   virtual void SetUp() {
     decoder_type_ = GetParam();
     switch (decoder_type_) {
-      case kDecoderPCMu:
-      case kDecoderPCMa:
+      case NetEqDecoder::kDecoderPCMu:
+      case NetEqDecoder::kDecoderPCMa:
         bytes_per_ms_ = 8;
         samples_per_ms_ = 8;
         break;
-      case kDecoderPCMu_2ch:
-      case kDecoderPCMa_2ch:
+      case NetEqDecoder::kDecoderPCMu_2ch:
+      case NetEqDecoder::kDecoderPCMa_2ch:
         bytes_per_ms_ = 2 * 8;
         samples_per_ms_ = 8;
         break;
-      case kDecoderG722:
+      case NetEqDecoder::kDecoderG722:
         bytes_per_ms_ = 8;
         samples_per_ms_ = 16;
         break;
-      case kDecoderPCM16B:
+      case NetEqDecoder::kDecoderPCM16B:
         bytes_per_ms_ = 16;
         samples_per_ms_ = 8;
         break;
-      case kDecoderPCM16Bwb:
+      case NetEqDecoder::kDecoderPCM16Bwb:
         bytes_per_ms_ = 32;
         samples_per_ms_ = 16;
         break;
-      case kDecoderPCM16Bswb32kHz:
+      case NetEqDecoder::kDecoderPCM16Bswb32kHz:
         bytes_per_ms_ = 64;
         samples_per_ms_ = 32;
         break;
-      case kDecoderPCM16Bswb48kHz:
+      case NetEqDecoder::kDecoderPCM16Bswb48kHz:
         bytes_per_ms_ = 96;
         samples_per_ms_ = 48;
         break;
-      case kDecoderPCM16B_2ch:
+      case NetEqDecoder::kDecoderPCM16B_2ch:
         bytes_per_ms_ = 2 * 16;
         samples_per_ms_ = 8;
         break;
-      case kDecoderPCM16Bwb_2ch:
+      case NetEqDecoder::kDecoderPCM16Bwb_2ch:
         bytes_per_ms_ = 2 * 32;
         samples_per_ms_ = 16;
         break;
-      case kDecoderPCM16Bswb32kHz_2ch:
+      case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch:
         bytes_per_ms_ = 2 * 64;
         samples_per_ms_ = 32;
         break;
-      case kDecoderPCM16Bswb48kHz_2ch:
+      case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch:
         bytes_per_ms_ = 2 * 96;
         samples_per_ms_ = 48;
         break;
-      case kDecoderPCM16B_5ch:
+      case NetEqDecoder::kDecoderPCM16B_5ch:
         bytes_per_ms_ = 5 * 16;
         samples_per_ms_ = 8;
         break;
@@ -569,14 +575,22 @@
 }
 
 INSTANTIATE_TEST_CASE_P(
-    PayloadSplitter, SplitBySamplesTest,
-    ::testing::Values(kDecoderPCMu, kDecoderPCMa, kDecoderPCMu_2ch,
-                      kDecoderPCMa_2ch, kDecoderG722, kDecoderPCM16B,
-                      kDecoderPCM16Bwb, kDecoderPCM16Bswb32kHz,
-                      kDecoderPCM16Bswb48kHz, kDecoderPCM16B_2ch,
-                      kDecoderPCM16Bwb_2ch, kDecoderPCM16Bswb32kHz_2ch,
-                      kDecoderPCM16Bswb48kHz_2ch, kDecoderPCM16B_5ch));
-
+    PayloadSplitter,
+    SplitBySamplesTest,
+    ::testing::Values(NetEqDecoder::kDecoderPCMu,
+                      NetEqDecoder::kDecoderPCMa,
+                      NetEqDecoder::kDecoderPCMu_2ch,
+                      NetEqDecoder::kDecoderPCMa_2ch,
+                      NetEqDecoder::kDecoderG722,
+                      NetEqDecoder::kDecoderPCM16B,
+                      NetEqDecoder::kDecoderPCM16Bwb,
+                      NetEqDecoder::kDecoderPCM16Bswb32kHz,
+                      NetEqDecoder::kDecoderPCM16Bswb48kHz,
+                      NetEqDecoder::kDecoderPCM16B_2ch,
+                      NetEqDecoder::kDecoderPCM16Bwb_2ch,
+                      NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch,
+                      NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch,
+                      NetEqDecoder::kDecoderPCM16B_5ch));
 
 class SplitIlbcTest : public ::testing::TestWithParam<std::pair<int, int> > {
  protected:
@@ -609,7 +623,8 @@
   // codec types.
   // Use scoped pointers to avoid having to delete them later.
   rtc::scoped_ptr<DecoderDatabase::DecoderInfo> info(
-      new DecoderDatabase::DecoderInfo(kDecoderILBC, 8000, NULL, false));
+      new DecoderDatabase::DecoderInfo(NetEqDecoder::kDecoderILBC, 8000, NULL,
+                                       false));
   EXPECT_CALL(decoder_database, GetDecoderInfo(kPayloadType))
       .WillRepeatedly(Return(info.get()));
 
@@ -672,7 +687,8 @@
 
   MockDecoderDatabase decoder_database;
   rtc::scoped_ptr<DecoderDatabase::DecoderInfo> info(
-      new DecoderDatabase::DecoderInfo(kDecoderILBC, 8000, NULL, false));
+      new DecoderDatabase::DecoderInfo(NetEqDecoder::kDecoderILBC, 8000, NULL,
+                                       false));
   EXPECT_CALL(decoder_database, GetDecoderInfo(kPayloadType))
       .WillRepeatedly(Return(info.get()));
 
@@ -703,7 +719,8 @@
 
   MockDecoderDatabase decoder_database;
   rtc::scoped_ptr<DecoderDatabase::DecoderInfo> info(
-      new DecoderDatabase::DecoderInfo(kDecoderILBC, 8000, NULL, false));
+      new DecoderDatabase::DecoderInfo(NetEqDecoder::kDecoderILBC, 8000, NULL,
+                                       false));
   EXPECT_CALL(decoder_database, GetDecoderInfo(kPayloadType))
       .WillRepeatedly(Return(info.get()));
 
@@ -728,8 +745,8 @@
   PacketList packet_list;
   DecoderDatabase decoder_database;
 
-  decoder_database.RegisterPayload(0, kDecoderOpus);
-  decoder_database.RegisterPayload(1, kDecoderPCMu);
+  decoder_database.RegisterPayload(0, NetEqDecoder::kDecoderOpus);
+  decoder_database.RegisterPayload(1, NetEqDecoder::kDecoderPCMu);
 
   Packet* packet = CreatePacket(0, 10, 0xFF, true);
   packet_list.push_back(packet);
@@ -785,7 +802,7 @@
 
   const int kTimestampOffset = 20 * 48;  // 20 ms * 48 kHz.
   uint8_t payload_types[] = {0, 0};
-  decoder_database.RegisterPayload(0, kDecoderOpus);
+  decoder_database.RegisterPayload(0, NetEqDecoder::kDecoderOpus);
   Packet* packet = CreateRedPayload(2, payload_types, kTimestampOffset, true);
   packet_list.push_back(packet);
 
diff --git a/webrtc/modules/audio_coding/neteq/test/RTPencode.cc b/webrtc/modules/audio_coding/neteq/test/RTPencode.cc
index e90b986..cbb7436 100644
--- a/webrtc/modules/audio_coding/neteq/test/RTPencode.cc
+++ b/webrtc/modules/audio_coding/neteq/test/RTPencode.cc
@@ -90,7 +90,7 @@
                           size_t numChannels);
 void defineCodecs(webrtc::NetEqDecoder* usedCodec, int* noOfCodecs);
 int NetEQTest_free_coders(webrtc::NetEqDecoder coder, size_t numChannels);
-size_t NetEQTest_encode(int coder,
+size_t NetEQTest_encode(webrtc::NetEqDecoder coder,
                         int16_t* indata,
                         size_t frameLen,
                         unsigned char* encoded,
@@ -488,17 +488,17 @@
   if (usingStereo) {
     switch (usedCodec) {
       // sample based codecs
-      case webrtc::kDecoderPCMu:
-      case webrtc::kDecoderPCMa:
-      case webrtc::kDecoderG722: {
+      case webrtc::NetEqDecoder::kDecoderPCMu:
+      case webrtc::NetEqDecoder::kDecoderPCMa:
+      case webrtc::NetEqDecoder::kDecoderG722: {
         // 1 octet per sample
         stereoMode = STEREO_MODE_SAMPLE_1;
         break;
       }
-      case webrtc::kDecoderPCM16B:
-      case webrtc::kDecoderPCM16Bwb:
-      case webrtc::kDecoderPCM16Bswb32kHz:
-      case webrtc::kDecoderPCM16Bswb48kHz: {
+      case webrtc::NetEqDecoder::kDecoderPCM16B:
+      case webrtc::NetEqDecoder::kDecoderPCM16Bwb:
+      case webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz:
+      case webrtc::NetEqDecoder::kDecoderPCM16Bswb48kHz: {
         // 2 octets per sample
         stereoMode = STEREO_MODE_SAMPLE_2;
         break;
@@ -512,10 +512,10 @@
     }
   }
 
-  if ((usedCodec == webrtc::kDecoderISAC) ||
-      (usedCodec == webrtc::kDecoderISACswb)) {
+  if ((usedCodec == webrtc::NetEqDecoder::kDecoderISAC) ||
+      (usedCodec == webrtc::NetEqDecoder::kDecoderISACswb)) {
     if (argc != 7) {
-      if (usedCodec == webrtc::kDecoderISAC) {
+      if (usedCodec == webrtc::NetEqDecoder::kDecoderISAC) {
         bitrate = 32000;
         printf("Running iSAC at default bitrate of 32000 bps (to specify "
                "explicitly add the bps as last parameter)\n");
@@ -527,7 +527,7 @@
       }
     } else {
       bitrate = atoi(argv[6]);
-      if (usedCodec == webrtc::kDecoderISAC) {
+      if (usedCodec == webrtc::NetEqDecoder::kDecoderISAC) {
         if ((bitrate < 10000) || (bitrate > 32000)) {
           printf("Error: iSAC bitrate must be between 10000 and 32000 bps (%i "
                  "is invalid)\n", bitrate);
@@ -554,7 +554,7 @@
   if (useRed) {
     printf("Redundancy engaged. ");
   }
-  printf("Used codec: %i\n", usedCodec);
+  printf("Used codec: %i\n", static_cast<int>(usedCodec));
   printf("Payload type: %i\n", payloadType);
 
   NetEQTest_init_coders(usedCodec, packet_size, bitrate, fs, useVAD,
@@ -777,7 +777,7 @@
       if (useRed) {
 /* move data to redundancy store */
 #ifdef CODEC_ISAC
-        if (usedCodec == webrtc::kDecoderISAC) {
+        if (usedCodec == webrtc::NetEqDecoder::kDecoderISAC) {
           assert(!usingStereo);  // Cannot handle stereo yet
           red_len[0] = WebRtcIsac_GetRedPayload(ISAC_inst[0], red_data);
         } else {
@@ -830,53 +830,53 @@
   *useRed = 0;  /* Default no redundancy */
 
   if (!strcmp(name, "pcmu")) {
-    *codec = webrtc::kDecoderPCMu;
+    *codec = webrtc::NetEqDecoder::kDecoderPCMu;
     *PT = NETEQ_CODEC_PCMU_PT;
     *fs = 8000;
   } else if (!strcmp(name, "pcma")) {
-    *codec = webrtc::kDecoderPCMa;
+    *codec = webrtc::NetEqDecoder::kDecoderPCMa;
     *PT = NETEQ_CODEC_PCMA_PT;
     *fs = 8000;
   } else if (!strcmp(name, "pcm16b")) {
-    *codec = webrtc::kDecoderPCM16B;
+    *codec = webrtc::NetEqDecoder::kDecoderPCM16B;
     *PT = NETEQ_CODEC_PCM16B_PT;
     *fs = 8000;
   } else if (!strcmp(name, "pcm16b_wb")) {
-    *codec = webrtc::kDecoderPCM16Bwb;
+    *codec = webrtc::NetEqDecoder::kDecoderPCM16Bwb;
     *PT = NETEQ_CODEC_PCM16B_WB_PT;
     *fs = 16000;
   } else if (!strcmp(name, "pcm16b_swb32")) {
-    *codec = webrtc::kDecoderPCM16Bswb32kHz;
+    *codec = webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz;
     *PT = NETEQ_CODEC_PCM16B_SWB32KHZ_PT;
     *fs = 32000;
   } else if (!strcmp(name, "pcm16b_swb48")) {
-    *codec = webrtc::kDecoderPCM16Bswb48kHz;
+    *codec = webrtc::NetEqDecoder::kDecoderPCM16Bswb48kHz;
     *PT = NETEQ_CODEC_PCM16B_SWB48KHZ_PT;
     *fs = 48000;
   } else if (!strcmp(name, "g722")) {
-    *codec = webrtc::kDecoderG722;
+    *codec = webrtc::NetEqDecoder::kDecoderG722;
     *PT = NETEQ_CODEC_G722_PT;
     *fs = 16000;
   } else if ((!strcmp(name, "ilbc")) &&
              ((frameLen % 240 == 0) || (frameLen % 160 == 0))) {
     *fs = 8000;
-    *codec = webrtc::kDecoderILBC;
+    *codec = webrtc::NetEqDecoder::kDecoderILBC;
     *PT = NETEQ_CODEC_ILBC_PT;
   } else if (!strcmp(name, "isac")) {
     *fs = 16000;
-    *codec = webrtc::kDecoderISAC;
+    *codec = webrtc::NetEqDecoder::kDecoderISAC;
     *PT = NETEQ_CODEC_ISAC_PT;
   } else if (!strcmp(name, "isacswb")) {
     *fs = 32000;
-    *codec = webrtc::kDecoderISACswb;
+    *codec = webrtc::NetEqDecoder::kDecoderISACswb;
     *PT = NETEQ_CODEC_ISACSWB_PT;
   } else if (!strcmp(name, "red_pcm")) {
-    *codec = webrtc::kDecoderPCMa;
+    *codec = webrtc::NetEqDecoder::kDecoderPCMa;
     *PT = NETEQ_CODEC_PCMA_PT; /* this will be the PT for the sub-headers */
     *fs = 8000;
     *useRed = 1;
   } else if (!strcmp(name, "red_isac")) {
-    *codec = webrtc::kDecoderISAC;
+    *codec = webrtc::NetEqDecoder::kDecoderISAC;
     *PT = NETEQ_CODEC_ISAC_PT; /* this will be the PT for the sub-headers */
     *fs = 16000;
     *useRed = 1;
@@ -925,20 +925,20 @@
 
     switch (coder) {
 #ifdef CODEC_PCM16B
-      case webrtc::kDecoderPCM16B:
+      case webrtc::NetEqDecoder::kDecoderPCM16B:
 #endif
 #ifdef CODEC_PCM16B_WB
-      case webrtc::kDecoderPCM16Bwb:
+      case webrtc::NetEqDecoder::kDecoderPCM16Bwb:
 #endif
 #ifdef CODEC_PCM16B_32KHZ
-      case webrtc::kDecoderPCM16Bswb32kHz:
+      case webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz:
 #endif
 #ifdef CODEC_PCM16B_48KHZ
-      case webrtc::kDecoderPCM16Bswb48kHz:
+      case webrtc::NetEqDecoder::kDecoderPCM16Bswb48kHz:
 #endif
 #ifdef CODEC_G711
-      case webrtc::kDecoderPCMu:
-      case webrtc::kDecoderPCMa:
+      case webrtc::NetEqDecoder::kDecoderPCMu:
+      case webrtc::NetEqDecoder::kDecoderPCMa:
 #endif
         // do nothing
         break;
@@ -1188,7 +1188,7 @@
         break;
 #endif
 #ifdef CODEC_G722
-      case webrtc::kDecoderG722:
+      case webrtc::NetEqDecoder::kDecoderG722:
         if (sampfreq == 16000) {
           if (enc_frameSize % 2 == 0) {
           } else {
@@ -1271,7 +1271,7 @@
         break;
 #endif
 #ifdef CODEC_ILBC
-      case webrtc::kDecoderILBC:
+      case webrtc::NetEqDecoder::kDecoderILBC:
         if (sampfreq == 8000) {
           ok = WebRtcIlbcfix_EncoderCreate(&iLBCenc_inst[k]);
           if (ok != 0) {
@@ -1300,7 +1300,7 @@
         break;
 #endif
 #ifdef CODEC_ISAC
-      case webrtc::kDecoderISAC:
+      case webrtc::NetEqDecoder::kDecoderISAC:
         if (sampfreq == 16000) {
           ok = WebRtcIsac_Create(&ISAC_inst[k]);
           if (ok != 0) {
@@ -1356,7 +1356,7 @@
         break;
 #endif
 #ifdef CODEC_ISAC_SWB
-      case webrtc::kDecoderISACswb:
+      case webrtc::NetEqDecoder::kDecoderISACswb:
         if (sampfreq == 32000) {
           ok = WebRtcIsac_Create(&ISACSWB_inst[k]);
           if (ok != 0) {
@@ -1435,111 +1435,111 @@
 
     switch (coder) {
 #ifdef CODEC_PCM16B
-      case webrtc::kDecoderPCM16B:
+      case webrtc::NetEqDecoder::kDecoderPCM16B:
 #endif
 #ifdef CODEC_PCM16B_WB
-      case webrtc::kDecoderPCM16Bwb:
+      case webrtc::NetEqDecoder::kDecoderPCM16Bwb:
 #endif
 #ifdef CODEC_PCM16B_32KHZ
-      case webrtc::kDecoderPCM16Bswb32kHz:
+      case webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz:
 #endif
 #ifdef CODEC_PCM16B_48KHZ
-      case webrtc::kDecoderPCM16Bswb48kHz:
+      case webrtc::NetEqDecoder::kDecoderPCM16Bswb48kHz:
 #endif
 #ifdef CODEC_G711
-      case webrtc::kDecoderPCMu:
-      case webrtc::kDecoderPCMa:
+      case webrtc::NetEqDecoder::kDecoderPCMu:
+      case webrtc::NetEqDecoder::kDecoderPCMa:
 #endif
         // do nothing
         break;
 #ifdef CODEC_G729
-      case webrtc::kDecoderG729:
+      case webrtc::NetEqDecoder::kDecoderG729:
         WebRtcG729_FreeEnc(G729enc_inst[k]);
         break;
 #endif
 #ifdef CODEC_G729_1
-      case webrtc::kDecoderG729_1:
+      case webrtc::NetEqDecoder::kDecoderG729_1:
         WebRtcG7291_Free(G729_1_inst[k]);
         break;
 #endif
 #ifdef CODEC_SPEEX_8
-      case webrtc::kDecoderSPEEX_8:
+      case webrtc::NetEqDecoder::kDecoderSPEEX_8:
         WebRtcSpeex_FreeEnc(SPEEX8enc_inst[k]);
         break;
 #endif
 #ifdef CODEC_SPEEX_16
-      case webrtc::kDecoderSPEEX_16:
+      case webrtc::NetEqDecoder::kDecoderSPEEX_16:
         WebRtcSpeex_FreeEnc(SPEEX16enc_inst[k]);
         break;
 #endif
 
 #ifdef CODEC_G722_1_16
-      case webrtc::kDecoderG722_1_16:
+      case webrtc::NetEqDecoder::kDecoderG722_1_16:
         WebRtcG7221_FreeEnc16(G722_1_16enc_inst[k]);
         break;
 #endif
 #ifdef CODEC_G722_1_24
-      case webrtc::kDecoderG722_1_24:
+      case webrtc::NetEqDecoder::kDecoderG722_1_24:
         WebRtcG7221_FreeEnc24(G722_1_24enc_inst[k]);
         break;
 #endif
 #ifdef CODEC_G722_1_32
-      case webrtc::kDecoderG722_1_32:
+      case webrtc::NetEqDecoder::kDecoderG722_1_32:
         WebRtcG7221_FreeEnc32(G722_1_32enc_inst[k]);
         break;
 #endif
 #ifdef CODEC_G722_1C_24
-      case webrtc::kDecoderG722_1C_24:
+      case webrtc::NetEqDecoder::kDecoderG722_1C_24:
         WebRtcG7221C_FreeEnc24(G722_1C_24enc_inst[k]);
         break;
 #endif
 #ifdef CODEC_G722_1C_32
-      case webrtc::kDecoderG722_1C_32:
+      case webrtc::NetEqDecoder::kDecoderG722_1C_32:
         WebRtcG7221C_FreeEnc32(G722_1C_32enc_inst[k]);
         break;
 #endif
 #ifdef CODEC_G722_1C_48
-      case webrtc::kDecoderG722_1C_48:
+      case webrtc::NetEqDecoder::kDecoderG722_1C_48:
         WebRtcG7221C_FreeEnc48(G722_1C_48enc_inst[k]);
         break;
 #endif
 #ifdef CODEC_G722
-      case webrtc::kDecoderG722:
+      case webrtc::NetEqDecoder::kDecoderG722:
         WebRtcG722_FreeEncoder(g722EncState[k]);
         break;
 #endif
 #ifdef CODEC_AMR
-      case webrtc::kDecoderAMR:
+      case webrtc::NetEqDecoder::kDecoderAMR:
         WebRtcAmr_FreeEnc(AMRenc_inst[k]);
         break;
 #endif
 #ifdef CODEC_AMRWB
-      case webrtc::kDecoderAMRWB:
+      case webrtc::NetEqDecoder::kDecoderAMRWB:
         WebRtcAmrWb_FreeEnc(AMRWBenc_inst[k]);
         break;
 #endif
 #ifdef CODEC_ILBC
-      case webrtc::kDecoderILBC:
+      case webrtc::NetEqDecoder::kDecoderILBC:
         WebRtcIlbcfix_EncoderFree(iLBCenc_inst[k]);
         break;
 #endif
 #ifdef CODEC_ISAC
-      case webrtc::kDecoderISAC:
+      case webrtc::NetEqDecoder::kDecoderISAC:
         WebRtcIsac_Free(ISAC_inst[k]);
         break;
 #endif
 #ifdef NETEQ_ISACFIX_CODEC
-      case webrtc::kDecoderISAC:
+      case webrtc::NetEqDecoder::kDecoderISAC:
         WebRtcIsacfix_Free(ISAC_inst[k]);
         break;
 #endif
 #ifdef CODEC_ISAC_SWB
-      case webrtc::kDecoderISACswb:
+      case webrtc::NetEqDecoder::kDecoderISACswb:
         WebRtcIsac_Free(ISACSWB_inst[k]);
         break;
 #endif
 #ifdef CODEC_GSMFR
-      case webrtc::kDecoderGSMFR:
+      case webrtc::NetEqDecoder::kDecoderGSMFR:
         WebRtcGSMFR_FreeEnc(GSMFRenc_inst[k]);
         break;
 #endif
@@ -1553,7 +1553,7 @@
   return (0);
 }
 
-size_t NetEQTest_encode(int coder,
+size_t NetEQTest_encode(webrtc::NetEqDecoder coder,
                         int16_t* indata,
                         size_t frameLen,
                         unsigned char* encoded,
@@ -1625,33 +1625,33 @@
 
   for (size_t k = 0; k < numChannels; k++) {
     /* Encode with the selected coder type */
-    if (coder == webrtc::kDecoderPCMu) { /*g711 u-law */
+    if (coder == webrtc::NetEqDecoder::kDecoderPCMu) { /*g711 u-law */
 #ifdef CODEC_G711
       cdlen = WebRtcG711_EncodeU(indata, frameLen, encoded);
 #endif
-    } else if (coder == webrtc::kDecoderPCMa) { /*g711 A-law */
+    } else if (coder == webrtc::NetEqDecoder::kDecoderPCMa) { /*g711 A-law */
 #ifdef CODEC_G711
       cdlen = WebRtcG711_EncodeA(indata, frameLen, encoded);
     }
 #endif
 #ifdef CODEC_PCM16B
-    else if ((coder == webrtc::kDecoderPCM16B) ||
-             (coder == webrtc::kDecoderPCM16Bwb) ||
-             (coder == webrtc::kDecoderPCM16Bswb32kHz) ||
-             (coder == webrtc::
+    else if ((coder == webrtc::NetEqDecoder::kDecoderPCM16B) ||
+             (coder == webrtc::NetEqDecoder::kDecoderPCM16Bwb) ||
+             (coder == webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz) ||
+             (coder == webrtc::NetEqDecoder::
                            kDecoderPCM16Bswb48kHz)) { /*pcm16b (8kHz, 16kHz,
-                                                         32kHz or 48kHz) */
+                                                        32kHz or 48kHz) */
       cdlen = WebRtcPcm16b_Encode(indata, frameLen, encoded);
     }
 #endif
 #ifdef CODEC_G722
-    else if (coder == webrtc::kDecoderG722) { /*g722 */
+    else if (coder == webrtc::NetEqDecoder::kDecoderG722) { /*g722 */
       cdlen = WebRtcG722_Encode(g722EncState[k], indata, frameLen, encoded);
       assert(cdlen == frameLen >> 1);
     }
 #endif
 #ifdef CODEC_ILBC
-    else if (coder == webrtc::kDecoderILBC) { /*iLBC */
+    else if (coder == webrtc::NetEqDecoder::kDecoderILBC) { /*iLBC */
       cdlen = static_cast<size_t>(std::max(
           WebRtcIlbcfix_Encode(iLBCenc_inst[k], indata, frameLen, encoded), 0));
     }
@@ -1659,7 +1659,7 @@
 #if (defined(CODEC_ISAC) || \
      defined(NETEQ_ISACFIX_CODEC))            // TODO(hlundin): remove all
                                               // NETEQ_ISACFIX_CODEC
-    else if (coder == webrtc::kDecoderISAC) { /*iSAC */
+    else if (coder == webrtc::NetEqDecoder::kDecoderISAC) { /*iSAC */
       int noOfCalls = 0;
       int res = 0;
       while (res <= 0) {
@@ -1676,7 +1676,7 @@
     }
 #endif
 #ifdef CODEC_ISAC_SWB
-    else if (coder == webrtc::kDecoderISACswb) { /* iSAC SWB */
+    else if (coder == webrtc::NetEqDecoder::kDecoderISACswb) { /* iSAC SWB */
       int noOfCalls = 0;
       int res = 0;
       while (res <= 0) {
diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc
index 9dbef96..2042e0d 100644
--- a/webrtc/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc
+++ b/webrtc/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc
@@ -47,8 +47,7 @@
       : NetEqQualityTest(FLAGS_frame_size_ms,
                          kInputSampleRateKhz,
                          kOutputSampleRateKhz,
-                         kDecoderILBC) {
-  }
+                         NetEqDecoder::kDecoderILBC) {}
 
   void SetUp() override {
     ASSERT_EQ(1, channels_) << "iLBC supports only mono audio.";
diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
index 4965d0e..66b0903 100644
--- a/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
+++ b/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
@@ -54,10 +54,9 @@
     : NetEqQualityTest(kIsacBlockDurationMs,
                        kIsacInputSamplingKhz,
                        kIsacOutputSamplingKhz,
-                       kDecoderISAC),
+                       NetEqDecoder::kDecoderISAC),
       isac_encoder_(NULL),
-      bit_rate_kbps_(FLAGS_bit_rate_kbps) {
-}
+      bit_rate_kbps_(FLAGS_bit_rate_kbps) {}
 
 void NetEqIsacQualityTest::SetUp() {
   ASSERT_EQ(1, channels_) << "iSAC supports only mono audio.";
diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc
index d4da2b3..5e8b229 100644
--- a/webrtc/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc
+++ b/webrtc/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc
@@ -123,7 +123,7 @@
     : NetEqQualityTest(kOpusBlockDurationMs * FLAGS_sub_packets,
                        kOpusSamplingKhz,
                        kOpusSamplingKhz,
-                       kDecoderOpus),
+                       NetEqDecoder::kDecoderOpus),
       opus_encoder_(NULL),
       repacketizer_(NULL),
       sub_block_size_samples_(
@@ -137,7 +137,7 @@
       sub_packets_(FLAGS_sub_packets) {
   // Redefine decoder type if input is stereo.
   if (channels_ > 1) {
-    decoder_type_ = kDecoderOpus_2ch;
+    decoder_type_ = NetEqDecoder::kDecoderOpus_2ch;
   }
   application_ = FLAGS_application;
 }
diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc
index 0b89352..422a9fa 100644
--- a/webrtc/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc
+++ b/webrtc/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc
@@ -47,8 +47,7 @@
       : NetEqQualityTest(FLAGS_frame_size_ms,
                          kInputSampleRateKhz,
                          kOutputSampleRateKhz,
-                         kDecoderPCMu) {
-  }
+                         NetEqDecoder::kDecoderPCMu) {}
 
   void SetUp() override {
     ASSERT_EQ(1, channels_) << "PCMu supports only mono audio.";
diff --git a/webrtc/modules/audio_coding/neteq/timestamp_scaler.cc b/webrtc/modules/audio_coding/neteq/timestamp_scaler.cc
index 0b0c737..eb69ac7 100644
--- a/webrtc/modules/audio_coding/neteq/timestamp_scaler.cc
+++ b/webrtc/modules/audio_coding/neteq/timestamp_scaler.cc
@@ -44,15 +44,15 @@
     return external_timestamp;
   }
   switch (info->codec_type) {
-    case kDecoderG722:
-    case kDecoderG722_2ch: {
+    case NetEqDecoder::kDecoderG722:
+    case NetEqDecoder::kDecoderG722_2ch: {
       // Use timestamp scaling with factor 2 (two output samples per RTP
       // timestamp).
       numerator_ = 2;
       denominator_ = 1;
       break;
     }
-    case kDecoderCNGswb48kHz: {
+    case NetEqDecoder::kDecoderCNGswb48kHz: {
       // Use timestamp scaling with factor 2/3 (32 kHz sample rate, but RTP
       // timestamps run on 48 kHz).
       // TODO(tlegrand): Remove scaling for kDecoderCNGswb48kHz once ACM has
@@ -61,10 +61,10 @@
       denominator_ = 3;
       break;
     }
-    case kDecoderAVT:
-    case kDecoderCNGnb:
-    case kDecoderCNGwb:
-    case kDecoderCNGswb32kHz: {
+    case NetEqDecoder::kDecoderAVT:
+    case NetEqDecoder::kDecoderCNGnb:
+    case NetEqDecoder::kDecoderCNGwb:
+    case NetEqDecoder::kDecoderCNGswb32kHz: {
       // Do not change the timestamp scaling settings for DTMF or CNG.
       break;
     }
diff --git a/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc b/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
index aed8a46..b1cb45d 100644
--- a/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
@@ -24,7 +24,8 @@
 TEST(TimestampScaler, TestNoScaling) {
   MockDecoderDatabase db;
   DecoderDatabase::DecoderInfo info;
-  info.codec_type = kDecoderPCMu;  // Does not use scaled timestamps.
+  info.codec_type =
+      NetEqDecoder::kDecoderPCMu;  // Does not use scaled timestamps.
   static const uint8_t kRtpPayloadType = 0;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -44,7 +45,8 @@
 TEST(TimestampScaler, TestNoScalingLargeStep) {
   MockDecoderDatabase db;
   DecoderDatabase::DecoderInfo info;
-  info.codec_type = kDecoderPCMu;  // Does not use scaled timestamps.
+  info.codec_type =
+      NetEqDecoder::kDecoderPCMu;  // Does not use scaled timestamps.
   static const uint8_t kRtpPayloadType = 0;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -69,7 +71,7 @@
 TEST(TimestampScaler, TestG722) {
   MockDecoderDatabase db;
   DecoderDatabase::DecoderInfo info;
-  info.codec_type = kDecoderG722;  // Uses a factor 2 scaling.
+  info.codec_type = NetEqDecoder::kDecoderG722;  // Uses a factor 2 scaling.
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -93,7 +95,7 @@
 TEST(TimestampScaler, TestG722LargeStep) {
   MockDecoderDatabase db;
   DecoderDatabase::DecoderInfo info;
-  info.codec_type = kDecoderG722;  // Uses a factor 2 scaling.
+  info.codec_type = NetEqDecoder::kDecoderG722;  // Uses a factor 2 scaling.
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -121,8 +123,9 @@
 TEST(TimestampScaler, TestG722WithCng) {
   MockDecoderDatabase db;
   DecoderDatabase::DecoderInfo info_g722, info_cng;
-  info_g722.codec_type = kDecoderG722;  // Uses a factor 2 scaling.
-  info_cng.codec_type = kDecoderCNGwb;
+  info_g722.codec_type =
+      NetEqDecoder::kDecoderG722;  // Uses a factor 2 scaling.
+  info_cng.codec_type = NetEqDecoder::kDecoderCNGwb;
   static const uint8_t kRtpPayloadTypeG722 = 17;
   static const uint8_t kRtpPayloadTypeCng = 13;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadTypeG722))
@@ -162,7 +165,8 @@
 TEST(TimestampScaler, TestG722Packet) {
   MockDecoderDatabase db;
   DecoderDatabase::DecoderInfo info;
-  info.codec_type = kDecoderG722;  // Does uses a factor 2 scaling.
+  info.codec_type =
+      NetEqDecoder::kDecoderG722;  // Does uses a factor 2 scaling.
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -190,7 +194,7 @@
 TEST(TimestampScaler, TestG722PacketList) {
   MockDecoderDatabase db;
   DecoderDatabase::DecoderInfo info;
-  info.codec_type = kDecoderG722;  // Uses a factor 2 scaling.
+  info.codec_type = NetEqDecoder::kDecoderG722;  // Uses a factor 2 scaling.
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -219,7 +223,7 @@
 TEST(TimestampScaler, TestG722Reset) {
   MockDecoderDatabase db;
   DecoderDatabase::DecoderInfo info;
-  info.codec_type = kDecoderG722;  // Uses a factor 2 scaling.
+  info.codec_type = NetEqDecoder::kDecoderG722;  // Uses a factor 2 scaling.
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -259,7 +263,7 @@
 TEST(TimestampScaler, TestOpusLargeStep) {
   MockDecoderDatabase db;
   DecoderDatabase::DecoderInfo info;
-  info.codec_type = kDecoderOpus;
+  info.codec_type = NetEqDecoder::kDecoderOpus;
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_performance_test.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_performance_test.cc
index 7c5784d..9fe4dff 100644
--- a/webrtc/modules/audio_coding/neteq/tools/neteq_performance_test.cc
+++ b/webrtc/modules/audio_coding/neteq/tools/neteq_performance_test.cc
@@ -32,7 +32,8 @@
   const std::string kInputFileName =
       webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm");
   const int kSampRateHz = 32000;
-  const webrtc::NetEqDecoder kDecoderType = webrtc::kDecoderPCM16Bswb32kHz;
+  const webrtc::NetEqDecoder kDecoderType =
+      webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz;
   const int kPayloadType = 95;
 
   // Initialize NetEq instance.
diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc
index 0d3fb24..6826d1b 100644
--- a/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc
+++ b/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc
@@ -208,7 +208,7 @@
 NetEqQualityTest::NetEqQualityTest(int block_duration_ms,
                                    int in_sampling_khz,
                                    int out_sampling_khz,
-                                   enum NetEqDecoder decoder_type)
+                                   NetEqDecoder decoder_type)
     : decoder_type_(decoder_type),
       channels_(FLAGS_channels),
       decoded_time_ms_(0),
diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h b/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h
index 8e1c54c..e20be57 100644
--- a/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h
+++ b/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h
@@ -66,7 +66,7 @@
   NetEqQualityTest(int block_duration_ms,
                    int in_sampling_khz,
                    int out_sampling_khz,
-                   enum NetEqDecoder decoder_type);
+                   NetEqDecoder decoder_type);
   virtual ~NetEqQualityTest();
 
   void SetUp() override;
@@ -98,7 +98,7 @@
   // Write to log file. Usage Log() << ...
   std::ofstream& Log();
 
-  enum NetEqDecoder decoder_type_;
+  NetEqDecoder decoder_type_;
   const int channels_;
 
  private:
diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
index 756354b..0aaf8c7 100644
--- a/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
+++ b/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
@@ -147,39 +147,39 @@
 // Maps a codec type to a printable name string.
 std::string CodecName(webrtc::NetEqDecoder codec) {
   switch (codec) {
-    case webrtc::kDecoderPCMu:
+    case webrtc::NetEqDecoder::kDecoderPCMu:
       return "PCM-u";
-    case webrtc::kDecoderPCMa:
+    case webrtc::NetEqDecoder::kDecoderPCMa:
       return "PCM-a";
-    case webrtc::kDecoderILBC:
+    case webrtc::NetEqDecoder::kDecoderILBC:
       return "iLBC";
-    case webrtc::kDecoderISAC:
+    case webrtc::NetEqDecoder::kDecoderISAC:
       return "iSAC";
-    case webrtc::kDecoderISACswb:
+    case webrtc::NetEqDecoder::kDecoderISACswb:
       return "iSAC-swb (32 kHz)";
-    case webrtc::kDecoderOpus:
+    case webrtc::NetEqDecoder::kDecoderOpus:
       return "Opus";
-    case webrtc::kDecoderPCM16B:
+    case webrtc::NetEqDecoder::kDecoderPCM16B:
       return "PCM16b-nb (8 kHz)";
-    case webrtc::kDecoderPCM16Bwb:
+    case webrtc::NetEqDecoder::kDecoderPCM16Bwb:
       return "PCM16b-wb (16 kHz)";
-    case webrtc::kDecoderPCM16Bswb32kHz:
+    case webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz:
       return "PCM16b-swb32 (32 kHz)";
-    case webrtc::kDecoderPCM16Bswb48kHz:
+    case webrtc::NetEqDecoder::kDecoderPCM16Bswb48kHz:
       return "PCM16b-swb48 (48 kHz)";
-    case webrtc::kDecoderG722:
+    case webrtc::NetEqDecoder::kDecoderG722:
       return "G.722";
-    case webrtc::kDecoderRED:
+    case webrtc::NetEqDecoder::kDecoderRED:
       return "redundant audio (RED)";
-    case webrtc::kDecoderAVT:
+    case webrtc::NetEqDecoder::kDecoderAVT:
       return "AVT/DTMF";
-    case webrtc::kDecoderCNGnb:
+    case webrtc::NetEqDecoder::kDecoderCNGnb:
       return "comfort noise (8 kHz)";
-    case webrtc::kDecoderCNGwb:
+    case webrtc::NetEqDecoder::kDecoderCNGwb:
       return "comfort noise (16 kHz)";
-    case webrtc::kDecoderCNGswb32kHz:
+    case webrtc::NetEqDecoder::kDecoderCNGswb32kHz:
       return "comfort noise (32 kHz)";
-    case webrtc::kDecoderCNGswb48kHz:
+    case webrtc::NetEqDecoder::kDecoderCNGswb48kHz:
       return "comfort noise (48 kHz)";
     default:
       assert(false);
@@ -200,25 +200,30 @@
 // Registers all decoders in |neteq|.
 void RegisterPayloadTypes(NetEq* neteq) {
   assert(neteq);
-  RegisterPayloadType(neteq, webrtc::kDecoderPCMu, FLAGS_pcmu);
-  RegisterPayloadType(neteq, webrtc::kDecoderPCMa, FLAGS_pcma);
-  RegisterPayloadType(neteq, webrtc::kDecoderILBC, FLAGS_ilbc);
-  RegisterPayloadType(neteq, webrtc::kDecoderISAC, FLAGS_isac);
-  RegisterPayloadType(neteq, webrtc::kDecoderISACswb, FLAGS_isac_swb);
-  RegisterPayloadType(neteq, webrtc::kDecoderOpus, FLAGS_opus);
-  RegisterPayloadType(neteq, webrtc::kDecoderPCM16B, FLAGS_pcm16b);
-  RegisterPayloadType(neteq, webrtc::kDecoderPCM16Bwb, FLAGS_pcm16b_wb);
-  RegisterPayloadType(neteq, webrtc::kDecoderPCM16Bswb32kHz,
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCMu, FLAGS_pcmu);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCMa, FLAGS_pcma);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderILBC, FLAGS_ilbc);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderISAC, FLAGS_isac);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderISACswb,
+                      FLAGS_isac_swb);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderOpus, FLAGS_opus);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16B,
+                      FLAGS_pcm16b);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16Bwb,
+                      FLAGS_pcm16b_wb);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz,
                       FLAGS_pcm16b_swb32);
-  RegisterPayloadType(neteq, webrtc::kDecoderPCM16Bswb48kHz,
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16Bswb48kHz,
                       FLAGS_pcm16b_swb48);
-  RegisterPayloadType(neteq, webrtc::kDecoderG722, FLAGS_g722);
-  RegisterPayloadType(neteq, webrtc::kDecoderAVT, FLAGS_avt);
-  RegisterPayloadType(neteq, webrtc::kDecoderRED, FLAGS_red);
-  RegisterPayloadType(neteq, webrtc::kDecoderCNGnb, FLAGS_cn_nb);
-  RegisterPayloadType(neteq, webrtc::kDecoderCNGwb, FLAGS_cn_wb);
-  RegisterPayloadType(neteq, webrtc::kDecoderCNGswb32kHz, FLAGS_cn_swb32);
-  RegisterPayloadType(neteq, webrtc::kDecoderCNGswb48kHz, FLAGS_cn_swb48);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderG722, FLAGS_g722);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderAVT, FLAGS_avt);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderRED, FLAGS_red);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGnb, FLAGS_cn_nb);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGwb, FLAGS_cn_wb);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGswb32kHz,
+                      FLAGS_cn_swb32);
+  RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGswb48kHz,
+                      FLAGS_cn_swb48);
 }
 
 void PrintCodecMappingEntry(webrtc::NetEqDecoder codec, google::int32 flag) {
@@ -226,23 +231,28 @@
 }
 
 void PrintCodecMapping() {
-  PrintCodecMappingEntry(webrtc::kDecoderPCMu, FLAGS_pcmu);
-  PrintCodecMappingEntry(webrtc::kDecoderPCMa, FLAGS_pcma);
-  PrintCodecMappingEntry(webrtc::kDecoderILBC, FLAGS_ilbc);
-  PrintCodecMappingEntry(webrtc::kDecoderISAC, FLAGS_isac);
-  PrintCodecMappingEntry(webrtc::kDecoderISACswb, FLAGS_isac_swb);
-  PrintCodecMappingEntry(webrtc::kDecoderOpus, FLAGS_opus);
-  PrintCodecMappingEntry(webrtc::kDecoderPCM16B, FLAGS_pcm16b);
-  PrintCodecMappingEntry(webrtc::kDecoderPCM16Bwb, FLAGS_pcm16b_wb);
-  PrintCodecMappingEntry(webrtc::kDecoderPCM16Bswb32kHz, FLAGS_pcm16b_swb32);
-  PrintCodecMappingEntry(webrtc::kDecoderPCM16Bswb48kHz, FLAGS_pcm16b_swb48);
-  PrintCodecMappingEntry(webrtc::kDecoderG722, FLAGS_g722);
-  PrintCodecMappingEntry(webrtc::kDecoderAVT, FLAGS_avt);
-  PrintCodecMappingEntry(webrtc::kDecoderRED, FLAGS_red);
-  PrintCodecMappingEntry(webrtc::kDecoderCNGnb, FLAGS_cn_nb);
-  PrintCodecMappingEntry(webrtc::kDecoderCNGwb, FLAGS_cn_wb);
-  PrintCodecMappingEntry(webrtc::kDecoderCNGswb32kHz, FLAGS_cn_swb32);
-  PrintCodecMappingEntry(webrtc::kDecoderCNGswb48kHz, FLAGS_cn_swb48);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCMu, FLAGS_pcmu);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCMa, FLAGS_pcma);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderILBC, FLAGS_ilbc);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderISAC, FLAGS_isac);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderISACswb, FLAGS_isac_swb);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderOpus, FLAGS_opus);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCM16B, FLAGS_pcm16b);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCM16Bwb,
+                         FLAGS_pcm16b_wb);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz,
+                         FLAGS_pcm16b_swb32);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCM16Bswb48kHz,
+                         FLAGS_pcm16b_swb48);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderG722, FLAGS_g722);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderAVT, FLAGS_avt);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderRED, FLAGS_red);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderCNGnb, FLAGS_cn_nb);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderCNGwb, FLAGS_cn_wb);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderCNGswb32kHz,
+                         FLAGS_cn_swb32);
+  PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderCNGswb48kHz,
+                         FLAGS_cn_swb48);
 }
 
 bool IsComfortNoise(uint8_t payload_type) {