Skip to content

Commit

Permalink
Remove optimized functions
Browse files Browse the repository at this point in the history
  • Loading branch information
synesthesiam committed Sep 28, 2023
1 parent 6785962 commit 54c6bac
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ FIRFilter* CreateFirFilter(const float* coefficients,
// If we know the minimum architecture at compile time, avoid CPU detection.
#if defined(WEBRTC_ARCH_X86_FAMILY)
// x86 CPU detection required.
if (GetCPUInfo(kAVX2)) {
filter =
new FIRFilterAVX2(coefficients, coefficients_length, max_input_length);
} else if (GetCPUInfo(kSSE2)) {
filter =
new FIRFilterSSE2(coefficients, coefficients_length, max_input_length);
} else {
filter = new FIRFilterC(coefficients, coefficients_length);
}
// if (GetCPUInfo(kAVX2)) {
// filter =
// new FIRFilterAVX2(coefficients, coefficients_length, max_input_length);
// } else if (GetCPUInfo(kSSE2)) {
// filter =
// new FIRFilterSSE2(coefficients, coefficients_length, max_input_length);
// } else {
// filter = new FIRFilterC(coefficients, coefficients_length);
// }

filter = new FIRFilterC(coefficients, coefficients_length);
#elif defined(WEBRTC_HAS_NEON)
filter =
new FIRFilterNEON(coefficients, coefficients_length, max_input_length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ const size_t SincResampler::kKernelSize;
void SincResampler::InitializeCPUSpecificFeatures() {
#if defined(WEBRTC_HAS_NEON)
convolve_proc_ = Convolve_NEON;
#elif defined(WEBRTC_ARCH_X86_FAMILY)
// Using AVX2 instead of SSE2 when AVX2 supported.
if (GetCPUInfo(kAVX2))
convolve_proc_ = Convolve_AVX2;
else if (GetCPUInfo(kSSE2))
convolve_proc_ = Convolve_SSE;
else
convolve_proc_ = Convolve_C;
#else
// #elif defined(WEBRTC_ARCH_X86_FAMILY)
// // Using AVX2 instead of SSE2 when AVX2 supported.
// if (GetCPUInfo(kAVX2))
// convolve_proc_ = Convolve_AVX2;
// else if (GetCPUInfo(kSSE2))
// convolve_proc_ = Convolve_SSE;
// else
// convolve_proc_ = Convolve_C;
// #else
// Unknown architecture.
convolve_proc_ = Convolve_C;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,9 @@ void AdaptiveFirFilter::Filter(const RenderBuffer& render_buffer,
case Aec3Optimization::kSse2:
aec3::ApplyFilter_Sse2(render_buffer, current_size_partitions_, H_, S);
break;
case Aec3Optimization::kAvx2:
aec3::ApplyFilter_Avx2(render_buffer, current_size_partitions_, H_, S);
break;
// case Aec3Optimization::kAvx2:
// aec3::ApplyFilter_Avx2(render_buffer, current_size_partitions_, H_, S);
// break;
#endif
#if defined(WEBRTC_HAS_NEON)
case Aec3Optimization::kNeon:
Expand Down Expand Up @@ -600,9 +600,9 @@ void AdaptiveFirFilter::ComputeFrequencyResponse(
case Aec3Optimization::kSse2:
aec3::ComputeFrequencyResponse_Sse2(current_size_partitions_, H_, H2);
break;
case Aec3Optimization::kAvx2:
aec3::ComputeFrequencyResponse_Avx2(current_size_partitions_, H_, H2);
break;
// case Aec3Optimization::kAvx2:
// aec3::ComputeFrequencyResponse_Avx2(current_size_partitions_, H_, H2);
// break;
#endif
#if defined(WEBRTC_HAS_NEON)
case Aec3Optimization::kNeon:
Expand All @@ -626,10 +626,10 @@ void AdaptiveFirFilter::AdaptAndUpdateSize(const RenderBuffer& render_buffer,
aec3::AdaptPartitions_Sse2(render_buffer, G, current_size_partitions_,
&H_);
break;
case Aec3Optimization::kAvx2:
aec3::AdaptPartitions_Avx2(render_buffer, G, current_size_partitions_,
&H_);
break;
// case Aec3Optimization::kAvx2:
// aec3::AdaptPartitions_Avx2(render_buffer, G, current_size_partitions_,
// &H_);
// break;
#endif
#if defined(WEBRTC_HAS_NEON)
case Aec3Optimization::kNeon:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ void ComputeErl(const Aec3Optimization& optimization,
case Aec3Optimization::kSse2:
aec3::ErlComputer_SSE2(H2, erl);
break;
case Aec3Optimization::kAvx2:
aec3::ErlComputer_AVX2(H2, erl);
break;
// case Aec3Optimization::kAvx2:
// aec3::ErlComputer_AVX2(H2, erl);
// break;
#endif
#if defined(WEBRTC_HAS_NEON)
case Aec3Optimization::kNeon:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ struct FftData {
power_spectrum[kFftLengthBy2] = re[kFftLengthBy2] * re[kFftLengthBy2] +
im[kFftLengthBy2] * im[kFftLengthBy2];
} break;
case Aec3Optimization::kAvx2:
SpectrumAVX2(power_spectrum);
break;
// case Aec3Optimization::kAvx2:
// SpectrumAVX2(power_spectrum);
// break;
#endif
default:
std::transform(re.begin(), re.end(), im.begin(), power_spectrum.begin(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,11 @@ void MatchedFilter::Update(const DownsampledRenderBuffer& render_buffer,
smoothing_, render_buffer.buffer, y,
filters_[n], &filters_updated, &error_sum);
break;
case Aec3Optimization::kAvx2:
aec3::MatchedFilterCore_AVX2(x_start_index, x2_sum_threshold,
smoothing_, render_buffer.buffer, y,
filters_[n], &filters_updated, &error_sum);
break;
// case Aec3Optimization::kAvx2:
// aec3::MatchedFilterCore_AVX2(x_start_index, x2_sum_threshold,
// smoothing_, render_buffer.buffer, y,
// filters_[n], &filters_updated, &error_sum);
// break;
#endif
#if defined(WEBRTC_HAS_NEON)
case Aec3Optimization::kNeon:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class VectorMath {
x[j] = sqrtf(x[j]);
}
} break;
case Aec3Optimization::kAvx2:
SqrtAVX2(x);
break;
// case Aec3Optimization::kAvx2:
// SqrtAVX2(x);
// break;
#endif
#if defined(WEBRTC_HAS_NEON)
case Aec3Optimization::kNeon: {
Expand Down Expand Up @@ -140,9 +140,9 @@ class VectorMath {
z[j] = x[j] * y[j];
}
} break;
case Aec3Optimization::kAvx2:
MultiplyAVX2(x, y, z);
break;
// case Aec3Optimization::kAvx2:
// MultiplyAVX2(x, y, z);
// break;
#endif
#if defined(WEBRTC_HAS_NEON)
case Aec3Optimization::kNeon: {
Expand Down Expand Up @@ -190,9 +190,9 @@ class VectorMath {
z[j] += x[j];
}
} break;
case Aec3Optimization::kAvx2:
AccumulateAVX2(x, z);
break;
// case Aec3Optimization::kAvx2:
// AccumulateAVX2(x, z);
// break;
#endif
#if defined(WEBRTC_HAS_NEON)
case Aec3Optimization::kNeon: {
Expand Down

0 comments on commit 54c6bac

Please sign in to comment.