|
From 157530b8d95d6b0a9b12a8f61c44dfe1327cb351 Mon Sep 17 00:00:00 2001 |
|
From: Gustave Monce <gustave.monce@outlook.com> |
|
Date: Sun, 5 Dec 2021 16:55:01 +0100 |
|
Subject: [PATCH] Disabling switch without case warning for aec3 |
|
|
|
--- |
|
modules/audio_processing/aec3/adaptive_fir_filter.cc | 9 +++++++++ |
|
modules/audio_processing/aec3/adaptive_fir_filter_erl.cc | 3 +++ |
|
modules/audio_processing/aec3/matched_filter.cc | 3 +++ |
|
modules/audio_processing/aec3/vector_math.h | 9 +++++++++ |
|
4 files changed, 24 insertions(+) |
|
|
|
diff --git a/modules/audio_processing/aec3/adaptive_fir_filter.cc b/modules/audio_processing/aec3/adaptive_fir_filter.cc |
|
index bf3a7809f4..167c5328b1 100644 |
|
--- a/modules/audio_processing/aec3/adaptive_fir_filter.cc |
|
+++ b/modules/audio_processing/aec3/adaptive_fir_filter.cc |
|
@@ -551,6 +551,8 @@ void AdaptiveFirFilter::UpdateSize() { |
|
void AdaptiveFirFilter::Filter(const RenderBuffer& render_buffer, |
|
FftData* S) const { |
|
RTC_DCHECK(S); |
|
+#pragma warning(push) |
|
+#pragma warning(disable:4065) |
|
switch (optimization_) { |
|
#if defined(WEBRTC_ARCH_X86_FAMILY) |
|
case Aec3Optimization::kSse2: |
|
@@ -568,6 +570,7 @@ void AdaptiveFirFilter::Filter(const RenderBuffer& render_buffer, |
|
default: |
|
aec3::ApplyFilter(render_buffer, current_size_partitions_, H_, S); |
|
} |
|
+#pragma warning(pop) |
|
} |
|
|
|
void AdaptiveFirFilter::Adapt(const RenderBuffer& render_buffer, |
|
@@ -595,6 +598,8 @@ void AdaptiveFirFilter::ComputeFrequencyResponse( |
|
|
|
H2->resize(current_size_partitions_); |
|
|
|
+#pragma warning(push) |
|
+#pragma warning(disable:4065) |
|
switch (optimization_) { |
|
#if defined(WEBRTC_ARCH_X86_FAMILY) |
|
case Aec3Optimization::kSse2: |
|
@@ -612,6 +617,7 @@ void AdaptiveFirFilter::ComputeFrequencyResponse( |
|
default: |
|
aec3::ComputeFrequencyResponse(current_size_partitions_, H_, H2); |
|
} |
|
+#pragma warning(pop) |
|
} |
|
|
|
void AdaptiveFirFilter::AdaptAndUpdateSize(const RenderBuffer& render_buffer, |
|
@@ -620,6 +626,8 @@ void AdaptiveFirFilter::AdaptAndUpdateSize(const RenderBuffer& render_buffer, |
|
UpdateSize(); |
|
|
|
// Adapt the filter. |
|
+#pragma warning(push) |
|
+#pragma warning(disable:4065) |
|
switch (optimization_) { |
|
#if defined(WEBRTC_ARCH_X86_FAMILY) |
|
case Aec3Optimization::kSse2: |
|
@@ -640,6 +648,7 @@ void AdaptiveFirFilter::AdaptAndUpdateSize(const RenderBuffer& render_buffer, |
|
default: |
|
aec3::AdaptPartitions(render_buffer, G, current_size_partitions_, &H_); |
|
} |
|
+#pragma warning(pop) |
|
} |
|
|
|
// Constrains the partition of the frequency domain filter to be limited in |
|
diff --git a/modules/audio_processing/aec3/adaptive_fir_filter_erl.cc b/modules/audio_processing/aec3/adaptive_fir_filter_erl.cc |
|
index 45b8813979..d6ae61b2bf 100644 |
|
--- a/modules/audio_processing/aec3/adaptive_fir_filter_erl.cc |
|
+++ b/modules/audio_processing/aec3/adaptive_fir_filter_erl.cc |
|
@@ -80,6 +80,8 @@ void ComputeErl(const Aec3Optimization& optimization, |
|
rtc::ArrayView<float> erl) { |
|
RTC_DCHECK_EQ(kFftLengthBy2Plus1, erl.size()); |
|
// Update the frequency response and echo return loss for the filter. |
|
+#pragma warning(push) |
|
+#pragma warning(disable:4065) |
|
switch (optimization) { |
|
#if defined(WEBRTC_ARCH_X86_FAMILY) |
|
case Aec3Optimization::kSse2: |
|
@@ -97,6 +99,7 @@ void ComputeErl(const Aec3Optimization& optimization, |
|
default: |
|
aec3::ErlComputer(H2, erl); |
|
} |
|
+#pragma warning(pop) |
|
} |
|
|
|
} // namespace webrtc |
|
diff --git a/modules/audio_processing/aec3/matched_filter.cc b/modules/audio_processing/aec3/matched_filter.cc |
|
index 64b2d4e697..7f438cd9d8 100644 |
|
--- a/modules/audio_processing/aec3/matched_filter.cc |
|
+++ b/modules/audio_processing/aec3/matched_filter.cc |
|
@@ -357,6 +357,8 @@ void MatchedFilter::Update(const DownsampledRenderBuffer& render_buffer, |
|
(render_buffer.read + alignment_shift + sub_block_size_ - 1) % |
|
render_buffer.buffer.size(); |
|
|
|
+#pragma warning(push) |
|
+#pragma warning(disable:4065) |
|
switch (optimization_) { |
|
#if defined(WEBRTC_ARCH_X86_FAMILY) |
|
case Aec3Optimization::kSse2: |
|
@@ -382,6 +384,7 @@ void MatchedFilter::Update(const DownsampledRenderBuffer& render_buffer, |
|
render_buffer.buffer, y, filters_[n], |
|
&filters_updated, &error_sum); |
|
} |
|
+#pragma warning(pop) |
|
|
|
// Compute anchor for the matched filter error. |
|
const float error_sum_anchor = |
|
diff --git a/modules/audio_processing/aec3/vector_math.h b/modules/audio_processing/aec3/vector_math.h |
|
index e4d1381ae1..a1caf27014 100644 |
|
--- a/modules/audio_processing/aec3/vector_math.h |
|
+++ b/modules/audio_processing/aec3/vector_math.h |
|
@@ -42,6 +42,8 @@ class VectorMath { |
|
// Elementwise square root. |
|
void SqrtAVX2(rtc::ArrayView<float> x); |
|
void Sqrt(rtc::ArrayView<float> x) { |
|
+#pragma warning(push) |
|
+#pragma warning(disable:4065) |
|
switch (optimization_) { |
|
#if defined(WEBRTC_ARCH_X86_FAMILY) |
|
case Aec3Optimization::kSse2: { |
|
@@ -111,6 +113,7 @@ class VectorMath { |
|
default: |
|
std::for_each(x.begin(), x.end(), [](float& a) { a = sqrtf(a); }); |
|
} |
|
+#pragma warning(pop) |
|
} |
|
|
|
// Elementwise vector multiplication z = x * y. |
|
@@ -122,6 +125,8 @@ class VectorMath { |
|
rtc::ArrayView<float> z) { |
|
RTC_DCHECK_EQ(z.size(), x.size()); |
|
RTC_DCHECK_EQ(z.size(), y.size()); |
|
+#pragma warning(push) |
|
+#pragma warning(disable:4065) |
|
switch (optimization_) { |
|
#if defined(WEBRTC_ARCH_X86_FAMILY) |
|
case Aec3Optimization::kSse2: { |
|
@@ -166,12 +171,15 @@ class VectorMath { |
|
std::transform(x.begin(), x.end(), y.begin(), z.begin(), |
|
std::multiplies<float>()); |
|
} |
|
+#pragma warning(pop) |
|
} |
|
|
|
// Elementwise vector accumulation z += x. |
|
void AccumulateAVX2(rtc::ArrayView<const float> x, rtc::ArrayView<float> z); |
|
void Accumulate(rtc::ArrayView<const float> x, rtc::ArrayView<float> z) { |
|
RTC_DCHECK_EQ(z.size(), x.size()); |
|
+#pragma warning(push) |
|
+#pragma warning(disable:4065) |
|
switch (optimization_) { |
|
#if defined(WEBRTC_ARCH_X86_FAMILY) |
|
case Aec3Optimization::kSse2: { |
|
@@ -216,6 +224,7 @@ class VectorMath { |
|
std::transform(x.begin(), x.end(), z.begin(), z.begin(), |
|
std::plus<float>()); |
|
} |
|
+#pragma warning(pop) |
|
} |
|
|
|
private: |
|
-- |
|
2.33.0.windows.1 |
|
|