Clean-up iLBC nits
Bug: webrtc:372395680
Change-Id: Ic33295bdc6e14abe35404dd969d5d51008e698f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366602
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43322}
diff --git a/common_audio/BUILD.gn b/common_audio/BUILD.gn
index 3d1688f..a3a2bb5 100644
--- a/common_audio/BUILD.gn
+++ b/common_audio/BUILD.gn
@@ -117,7 +117,6 @@
"signal_processing/filter_ma_fast_q12.c",
"signal_processing/get_hanning_window.c",
"signal_processing/get_scaling_square.c",
- "signal_processing/ilbc_specific_functions.c",
"signal_processing/include/real_fft.h",
"signal_processing/include/signal_processing_library.h",
"signal_processing/include/spl_inl.h",
@@ -139,6 +138,7 @@
"signal_processing/spl_sqrt.c",
"signal_processing/splitting_filter.c",
"signal_processing/sqrt_of_one_minus_x_squared.c",
+ "signal_processing/vector_operations.c",
"signal_processing/vector_scaling_operations.c",
"vad/include/webrtc_vad.h",
"vad/vad_core.c",
diff --git a/common_audio/signal_processing/include/signal_processing_library.h b/common_audio/signal_processing/include/signal_processing_library.h
index ac0d277..d6e9d5e 100644
--- a/common_audio/signal_processing/include/signal_processing_library.h
+++ b/common_audio/signal_processing/include/signal_processing_library.h
@@ -389,36 +389,121 @@
#endif
// End: Vector scaling operations.
-// iLBC specific functions. Implementations in ilbc_specific_functions.c.
-// Description at bottom of file.
+//
+// WebRtcSpl_ReverseOrderMultArrayElements(...)
+//
+// Performs the vector operation:
+// out_vector[n] = (in_vector[n]*window[-n])>>right_shifts
+//
+// Input:
+// - in_vector : Input vector
+// - window : Window vector (should be reversed). The pointer
+// should be set to the last value in the vector
+// - right_shifts : Number of right bit shift to be applied after the
+// multiplication
+// - vector_length : Number of elements in `in_vector`
+//
+// Output:
+// - out_vector : Output vector (can be same as `in_vector`)
+//
void WebRtcSpl_ReverseOrderMultArrayElements(int16_t* out_vector,
const int16_t* in_vector,
const int16_t* window,
size_t vector_length,
int16_t right_shifts);
+
+//
+// WebRtcSpl_ElementwiseVectorMult(...)
+//
+// Performs the vector operation:
+// out_vector[n] = (in_vector[n]*window[n])>>right_shifts
+//
+// Input:
+// - in_vector : Input vector
+// - window : Window vector.
+// - right_shifts : Number of right bit shift to be applied after the
+// multiplication
+// - vector_length : Number of elements in `in_vector`
+//
+// Output:
+// - out_vector : Output vector (can be same as `in_vector`)
+//
void WebRtcSpl_ElementwiseVectorMult(int16_t* out_vector,
const int16_t* in_vector,
const int16_t* window,
size_t vector_length,
int16_t right_shifts);
+
+//
+// WebRtcSpl_AddVectorsAndShift(...)
+//
+// Performs the vector operation:
+// out_vector[k] = (in_vector1[k] + in_vector2[k])>>right_shifts
+//
+// Input:
+// - in_vector1 : Input vector 1
+// - in_vector2 : Input vector 2
+// - right_shifts : Number of right bit shift to be applied after the
+// multiplication
+// - vector_length : Number of elements in `in_vector1` and `in_vector2`
+//
+// Output:
+// - out_vector : Output vector (can be same as `in_vector1`)
+//
void WebRtcSpl_AddVectorsAndShift(int16_t* out_vector,
const int16_t* in_vector1,
const int16_t* in_vector2,
size_t vector_length,
int16_t right_shifts);
+
+//
+// WebRtcSpl_AddAffineVectorToVector(...)
+//
+// Adds an affine transformed vector to another vector `out_vector`, i.e,
+// performs
+// out_vector[k] += (in_vector[k]*gain+add_constant)>>right_shifts
+//
+// Input:
+// - in_vector : Input vector
+// - gain : Gain value, used to multiply the in vector with
+// - add_constant : Constant value to add (usually 1<<(right_shifts-1),
+// but others can be used as well
+// - right_shifts : Number of right bit shifts (0-16)
+// - vector_length : Number of samples in `in_vector` and `out_vector`
+//
+// Output:
+// - out_vector : Vector with the output
+//
void WebRtcSpl_AddAffineVectorToVector(int16_t* out_vector,
const int16_t* in_vector,
int16_t gain,
int32_t add_constant,
int16_t right_shifts,
size_t vector_length);
+
+//
+// WebRtcSpl_AffineTransformVector(...)
+//
+// Affine transforms a vector, i.e, performs
+// out_vector[k] = (in_vector[k]*gain+add_constant)>>right_shifts
+//
+// Input:
+// - in_vector : Input vector
+// - gain : Gain value, used to multiply the in vector with
+// - add_constant : Constant value to add (usually 1<<(right_shifts-1),
+// but others can be used as well
+// - right_shifts : Number of right bit shifts (0-16)
+// - vector_length : Number of samples in `in_vector` and `out_vector`
+//
+// Output:
+// - out_vector : Vector with the output
+//
void WebRtcSpl_AffineTransformVector(int16_t* out_vector,
const int16_t* in_vector,
int16_t gain,
int32_t add_constant,
int16_t right_shifts,
size_t vector_length);
-// End: iLBC specific functions.
// Signal processing operations.
@@ -1187,95 +1272,6 @@
//
//
-// WebRtcSpl_ReverseOrderMultArrayElements(...)
-//
-// Performs the vector operation:
-// out_vector[n] = (in_vector[n]*window[-n])>>right_shifts
-//
-// Input:
-// - in_vector : Input vector
-// - window : Window vector (should be reversed). The pointer
-// should be set to the last value in the vector
-// - right_shifts : Number of right bit shift to be applied after the
-// multiplication
-// - vector_length : Number of elements in `in_vector`
-//
-// Output:
-// - out_vector : Output vector (can be same as `in_vector`)
-//
-
-//
-// WebRtcSpl_ElementwiseVectorMult(...)
-//
-// Performs the vector operation:
-// out_vector[n] = (in_vector[n]*window[n])>>right_shifts
-//
-// Input:
-// - in_vector : Input vector
-// - window : Window vector.
-// - right_shifts : Number of right bit shift to be applied after the
-// multiplication
-// - vector_length : Number of elements in `in_vector`
-//
-// Output:
-// - out_vector : Output vector (can be same as `in_vector`)
-//
-
-//
-// WebRtcSpl_AddVectorsAndShift(...)
-//
-// Performs the vector operation:
-// out_vector[k] = (in_vector1[k] + in_vector2[k])>>right_shifts
-//
-// Input:
-// - in_vector1 : Input vector 1
-// - in_vector2 : Input vector 2
-// - right_shifts : Number of right bit shift to be applied after the
-// multiplication
-// - vector_length : Number of elements in `in_vector1` and `in_vector2`
-//
-// Output:
-// - out_vector : Output vector (can be same as `in_vector1`)
-//
-
-//
-// WebRtcSpl_AddAffineVectorToVector(...)
-//
-// Adds an affine transformed vector to another vector `out_vector`, i.e,
-// performs
-// out_vector[k] += (in_vector[k]*gain+add_constant)>>right_shifts
-//
-// Input:
-// - in_vector : Input vector
-// - gain : Gain value, used to multiply the in vector with
-// - add_constant : Constant value to add (usually 1<<(right_shifts-1),
-// but others can be used as well
-// - right_shifts : Number of right bit shifts (0-16)
-// - vector_length : Number of samples in `in_vector` and `out_vector`
-//
-// Output:
-// - out_vector : Vector with the output
-//
-
-//
-// WebRtcSpl_AffineTransformVector(...)
-//
-// Affine transforms a vector, i.e, performs
-// out_vector[k] = (in_vector[k]*gain+add_constant)>>right_shifts
-//
-// Input:
-// - in_vector : Input vector
-// - gain : Gain value, used to multiply the in vector with
-// - add_constant : Constant value to add (usually 1<<(right_shifts-1),
-// but others can be used as well
-// - right_shifts : Number of right bit shifts (0-16)
-// - vector_length : Number of samples in `in_vector` and `out_vector`
-//
-// Output:
-// - out_vector : Vector with the output
-//
-
-//
// WebRtcSpl_IncreaseSeed(...)
//
// Increases the seed (and returns the new value)
diff --git a/common_audio/signal_processing/ilbc_specific_functions.c b/common_audio/signal_processing/vector_operations.c
similarity index 90%
rename from common_audio/signal_processing/ilbc_specific_functions.c
rename to common_audio/signal_processing/vector_operations.c
index cbdd3dc..604a785 100644
--- a/common_audio/signal_processing/ilbc_specific_functions.c
+++ b/common_audio/signal_processing/vector_operations.c
@@ -8,17 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
-/*
- * This file contains implementations of the iLBC specific functions
- * WebRtcSpl_ReverseOrderMultArrayElements()
- * WebRtcSpl_ElementwiseVectorMult()
- * WebRtcSpl_AddVectorsAndShift()
- * WebRtcSpl_AddAffineVectorToVector()
- * WebRtcSpl_AffineTransformVector()
- *
- */
-
#include "common_audio/signal_processing/include/signal_processing_library.h"
void WebRtcSpl_ReverseOrderMultArrayElements(int16_t *out, const int16_t *in,
diff --git a/docs/faq.md b/docs/faq.md
index 6753585..ccaf104 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -56,15 +56,6 @@
project.
-### What is the iLBC audio codec?
-
-iLBC is a free narrowband voice codec that was developed by Global IP
-Solutions, and is used in many Voice over IP (VoIP) and streaming audio
-applications. In 2004, the final IETF RFC versions of the iLBC codec
-specification and the iLBC RTP Profile draft became available. This codec is
-included as part of the WebRTC project.
-
-
### What is the VP8 video codec?
VP8 is a highly-efficient video compression technology developed by the WebM Project. It is the video codec included with WebRTC.
diff --git a/modules/audio_coding/acm2/audio_coding_module_unittest.cc b/modules/audio_coding/acm2/audio_coding_module_unittest.cc
index aa7dbb5..56726cf 100644
--- a/modules/audio_coding/acm2/audio_coding_module_unittest.cc
+++ b/modules/audio_coding/acm2/audio_coding_module_unittest.cc
@@ -898,23 +898,6 @@
/*expected_channels=*/test::AcmReceiveTestOldApi::kStereoOutput);
}
-#if defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_LINUX) && \
- defined(WEBRTC_ARCH_X86_64)
-
-// TODO(bugs.webrtc.org/345525069): Either fix/enable or remove iLBC.
-#if defined(__has_feature) && __has_feature(undefined_behavior_sanitizer)
-TEST_F(AcmSenderBitExactnessOldApi, DISABLED_Ilbc_30ms) {
-#else
-TEST_F(AcmSenderBitExactnessOldApi, Ilbc_30ms) {
-#endif
- ASSERT_NO_FATAL_FAILURE(SetUpTest("ILBC", 8000, 1, 102, 240, 240));
- Run(/*audio_checksum_ref=*/"a739434bec8a754e9356ce2115603ce5",
- /*payload_checksum_ref=*/"cfae2e9f6aba96e145f2bcdd5050ce78",
- /*expected_packets=*/33,
- /*expected_channels=*/test::AcmReceiveTestOldApi::kMonoOutput);
-}
-#endif
-
#if defined(WEBRTC_LINUX) && defined(WEBRTC_ARCH_X86_64)
// TODO(bugs.webrtc.org/345525069): Either fix/enable or remove G722.
diff --git a/modules/audio_coding/codecs/builtin_audio_decoder_factory_unittest.cc b/modules/audio_coding/codecs/builtin_audio_decoder_factory_unittest.cc
index 3383ffb..7cd2dc0 100644
--- a/modules/audio_coding/codecs/builtin_audio_decoder_factory_unittest.cc
+++ b/modules/audio_coding/codecs/builtin_audio_decoder_factory_unittest.cc
@@ -54,21 +54,6 @@
adf->Create(env, SdpAudioFormat("pcma", 16000, 1), std::nullopt));
}
-TEST(AudioDecoderFactoryTest, CreateIlbc) {
- const Environment env = CreateEnvironment();
- rtc::scoped_refptr<AudioDecoderFactory> adf =
- CreateBuiltinAudioDecoderFactory();
- ASSERT_TRUE(adf);
- // iLBC supports 8 kHz, 1 channel.
- EXPECT_FALSE(adf->Create(env, SdpAudioFormat("ilbc", 8000, 0), std::nullopt));
-#ifdef WEBRTC_CODEC_ILBC
- EXPECT_TRUE(adf->Create(env, SdpAudioFormat("ilbc", 8000, 1), std::nullopt));
-#endif
- EXPECT_FALSE(adf->Create(env, SdpAudioFormat("ilbc", 8000, 2), std::nullopt));
- EXPECT_FALSE(
- adf->Create(env, SdpAudioFormat("ilbc", 16000, 1), std::nullopt));
-}
-
TEST(AudioDecoderFactoryTest, CreateL16) {
const Environment env = CreateEnvironment();
rtc::scoped_refptr<AudioDecoderFactory> adf =
@@ -96,9 +81,6 @@
#ifdef WEBRTC_CODEC_OPUS
"opus",
#endif
-#ifdef WEBRTC_CODEC_ILBC
- "ilbc",
-#endif
"pcmu", "pcma", "l16", "G722", "G711",
};
diff --git a/modules/audio_coding/codecs/builtin_audio_encoder_factory_unittest.cc b/modules/audio_coding/codecs/builtin_audio_encoder_factory_unittest.cc
index 6ca08b5..d29db46 100644
--- a/modules/audio_coding/codecs/builtin_audio_encoder_factory_unittest.cc
+++ b/modules/audio_coding/codecs/builtin_audio_encoder_factory_unittest.cc
@@ -145,9 +145,6 @@
{"isac", 32000, 1},
#endif
{"G722", 8000, 1},
-#ifdef WEBRTC_CODEC_ILBC
- {"ilbc", 8000, 1},
-#endif
{"pcmu", 8000, 1},
{"pcma", 8000, 1}
};
@@ -167,9 +164,6 @@
#if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
"isac",
#endif
-#ifdef WEBRTC_CODEC_ILBC
- "ilbc",
-#endif
"pcmu",
"pcma",
"l16",
diff --git a/modules/audio_coding/neteq/neteq_unittest.cc b/modules/audio_coding/neteq/neteq_unittest.cc
index 394c5a7..0d204d9 100644
--- a/modules/audio_coding/neteq/neteq_unittest.cc
+++ b/modules/audio_coding/neteq/neteq_unittest.cc
@@ -43,15 +43,8 @@
namespace webrtc {
-#if defined(WEBRTC_LINUX) && defined(WEBRTC_ARCH_X86_64) && \
- defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \
- (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \
- defined(WEBRTC_CODEC_ILBC)
-#define MAYBE_TestBitExactness TestBitExactness
-#else
-#define MAYBE_TestBitExactness DISABLED_TestBitExactness
-#endif
-TEST_F(NetEqDecodingTest, MAYBE_TestBitExactness) {
+// TODO(bugs.webrtc.org/345525069): Either fix/enable or remove.
+TEST_F(NetEqDecodingTest, DISABLED_TestBitExactness) {
const std::string input_rtp_file =
webrtc::test::ResourcePath("audio_coding/neteq_universal_new", "rtp");
diff --git a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
index a7db337..a4a8ef1 100644
--- a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
+++ b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
@@ -36,7 +36,6 @@
" will assign the group Enable to field trial WebRTC-FooFeature.");
ABSL_FLAG(int, pcmu, TestConfig::default_pcmu(), "RTP payload type for PCM-u");
ABSL_FLAG(int, pcma, TestConfig::default_pcma(), "RTP payload type for PCM-a");
-ABSL_FLAG(int, ilbc, TestConfig::default_ilbc(), "RTP payload type for iLBC");
ABSL_FLAG(int, isac, TestConfig::default_isac(), "RTP payload type for iSAC");
ABSL_FLAG(int,
isac_swb,
@@ -212,7 +211,6 @@
void PrintCodecMapping() {
PrintCodecMappingEntry("PCM-u", absl::GetFlag(FLAGS_pcmu));
PrintCodecMappingEntry("PCM-a", absl::GetFlag(FLAGS_pcma));
- PrintCodecMappingEntry("iLBC", absl::GetFlag(FLAGS_ilbc));
PrintCodecMappingEntry("iSAC", absl::GetFlag(FLAGS_isac));
PrintCodecMappingEntry("iSAC-swb (32 kHz)", absl::GetFlag(FLAGS_isac_swb));
PrintCodecMappingEntry("Opus", absl::GetFlag(FLAGS_opus));
@@ -314,7 +312,6 @@
output_files_base_name, output_audio_filename));
RTC_CHECK(ValidatePayloadType(absl::GetFlag(FLAGS_pcmu)));
RTC_CHECK(ValidatePayloadType(absl::GetFlag(FLAGS_pcma)));
- RTC_CHECK(ValidatePayloadType(absl::GetFlag(FLAGS_ilbc)));
RTC_CHECK(ValidatePayloadType(absl::GetFlag(FLAGS_isac)));
RTC_CHECK(ValidatePayloadType(absl::GetFlag(FLAGS_isac_swb)));
RTC_CHECK(ValidatePayloadType(absl::GetFlag(FLAGS_opus)));
@@ -348,7 +345,6 @@
webrtc::test::NetEqTestFactory::Config config;
config.pcmu = absl::GetFlag(FLAGS_pcmu);
config.pcma = absl::GetFlag(FLAGS_pcma);
- config.ilbc = absl::GetFlag(FLAGS_ilbc);
config.isac = absl::GetFlag(FLAGS_isac);
config.isac_swb = absl::GetFlag(FLAGS_isac_swb);
config.opus = absl::GetFlag(FLAGS_opus);
diff --git a/modules/audio_coding/neteq/tools/neteq_test.cc b/modules/audio_coding/neteq/tools/neteq_test.cc
index 7c496b4..4f4ff8c 100644
--- a/modules/audio_coding/neteq/tools/neteq_test.cc
+++ b/modules/audio_coding/neteq/tools/neteq_test.cc
@@ -312,9 +312,6 @@
NetEqTest::DecoderMap NetEqTest::StandardDecoderMap() {
DecoderMap codecs = {{0, SdpAudioFormat("pcmu", 8000, 1)},
{8, SdpAudioFormat("pcma", 8000, 1)},
-#ifdef WEBRTC_CODEC_ILBC
- {102, SdpAudioFormat("ilbc", 8000, 1)},
-#endif
#ifdef WEBRTC_CODEC_OPUS
{111, SdpAudioFormat("opus", 48000, 2)},
{63, SdpAudioFormat("red", 48000, 2)},
diff --git a/modules/audio_coding/neteq/tools/neteq_test_factory.cc b/modules/audio_coding/neteq/tools/neteq_test_factory.cc
index 1f79c44..909a535 100644
--- a/modules/audio_coding/neteq/tools/neteq_test_factory.cc
+++ b/modules/audio_coding/neteq/tools/neteq_test_factory.cc
@@ -51,8 +51,8 @@
uint8_t payload_type,
webrtc::test::NetEqTestFactory::Config config) {
if (payload_type == config.pcmu || payload_type == config.pcma ||
- payload_type == config.ilbc || payload_type == config.pcm16b ||
- payload_type == config.cn_nb || payload_type == config.avt)
+ payload_type == config.pcm16b || payload_type == config.cn_nb ||
+ payload_type == config.avt)
return 8000;
if (payload_type == config.isac || payload_type == config.pcm16b_wb ||
payload_type == config.g722 || payload_type == config.cn_wb ||
diff --git a/modules/audio_coding/neteq/tools/neteq_test_factory.h b/modules/audio_coding/neteq/tools/neteq_test_factory.h
index 3a34171..f991591 100644
--- a/modules/audio_coding/neteq/tools/neteq_test_factory.h
+++ b/modules/audio_coding/neteq/tools/neteq_test_factory.h
@@ -41,9 +41,6 @@
// RTP payload type for PCM-a.
static constexpr int default_pcma() { return 8; }
int pcma = default_pcma();
- // RTP payload type for iLBC.
- static constexpr int default_ilbc() { return 102; }
- int ilbc = default_ilbc();
// RTP payload type for iSAC.
static constexpr int default_isac() { return 103; }
int isac = default_isac();
diff --git a/modules/audio_coding/test/EncodeDecodeTest.cc b/modules/audio_coding/test/EncodeDecodeTest.cc
index 048029e..69838f9 100644
--- a/modules/audio_coding/test/EncodeDecodeTest.cc
+++ b/modules/audio_coding/test/EncodeDecodeTest.cc
@@ -117,7 +117,6 @@
{109, {"L16", 32000, 1}},
{0, {"PCMU", 8000, 1}},
{8, {"PCMA", 8000, 1}},
- {102, {"ILBC", 8000, 1}},
{9, {"G722", 8000, 1}},
{120, {"OPUS", 48000, 2}},
{13, {"CN", 8000, 1}},
@@ -239,11 +238,8 @@
{107, {"L16", 8000, 1}}, {108, {"L16", 16000, 1}},
{109, {"L16", 32000, 1}}, {0, {"PCMU", 8000, 1}},
{8, {"PCMA", 8000, 1}},
-// TODO(bugs.webrtc.org/345525069): Either fix/enable or remove G722 and iLBC.
+// TODO(bugs.webrtc.org/345525069): Either fix/enable or remove G722.
#if defined(__has_feature) && !__has_feature(undefined_behavior_sanitizer)
-#ifdef WEBRTC_CODEC_ILBC
- {102, {"ILBC", 8000, 1}},
-#endif
{9, {"G722", 8000, 1}},
#endif
};
diff --git a/modules/audio_coding/test/TestAllCodecs.cc b/modules/audio_coding/test/TestAllCodecs.cc
index ca5cdf9..b7beca4 100644
--- a/modules/audio_coding/test/TestAllCodecs.cc
+++ b/modules/audio_coding/test/TestAllCodecs.cc
@@ -142,7 +142,6 @@
{110, {"PCMU", 8000, 2}},
{8, {"PCMA", 8000, 1}},
{118, {"PCMA", 8000, 2}},
- {102, {"ILBC", 8000, 1}},
{9, {"G722", 8000, 1}},
{119, {"G722", 8000, 2}},
{120, {"OPUS", 48000, 2, {{"stereo", "1"}}}},
@@ -177,23 +176,6 @@
Run(channel_a_to_b_);
outfile_b_.Close();
#endif
-// TODO(bugs.webrtc.org/345525069): Either fix/enable or remove iLBC.
-#if defined(__has_feature) && !__has_feature(undefined_behavior_sanitizer)
-#ifdef WEBRTC_CODEC_ILBC
- test_count_++;
- OpenOutFile(test_count_);
- char codec_ilbc[] = "ILBC";
- RegisterSendCodec(codec_ilbc, 8000, 13300, 240, 0);
- Run(channel_a_to_b_);
- RegisterSendCodec(codec_ilbc, 8000, 13300, 480, 0);
- Run(channel_a_to_b_);
- RegisterSendCodec(codec_ilbc, 8000, 15200, 160, 0);
- Run(channel_a_to_b_);
- RegisterSendCodec(codec_ilbc, 8000, 15200, 320, 0);
- Run(channel_a_to_b_);
- outfile_b_.Close();
-#endif
-#endif
test_count_++;
OpenOutFile(test_count_);
char codec_l16[] = "L16";