IWYU common_audio

et al followed by
  find common_audio/ -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner
followed by
    tools_webrtc/gn_check_autofix.py -C out/Default/
and
  git cl format

C style headers were replaced with their C++ equivalents where they
showed up in the diff.

Bug: webrtc:42226242
Change-Id: Ic3f87925c93141c72dc8ce2ed7cf673dfd74851a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/397062
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45135}
This commit is contained in:
Philipp Hancke 2025-07-09 09:38:08 -07:00 committed by WebRTC LUCI CQ
parent fb1f65a8d1
commit 9f42d00a21
38 changed files with 93 additions and 25 deletions

View File

@ -58,6 +58,7 @@ rtc_library("common_audio") {
"../rtc_base/system:arch",
"../rtc_base/system:file_wrapper",
"third_party/ooura:fft_size_256",
"//third_party/abseil-cpp/absl/strings:string_view",
]
defines = []
@ -373,6 +374,7 @@ if (rtc_include_tests && !build_with_chromium) {
":fir_filter_factory",
":sinc_resampler",
"../api/audio:audio_frame_api",
"../api/units:time_delta",
"../rtc_base:checks",
"../rtc_base:cpu_info",
"../rtc_base:logging",

View File

@ -18,7 +18,6 @@
#include "common_audio/channel_buffer.h"
#include "common_audio/resampler/push_sinc_resampler.h"
#include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_conversions.h"
namespace webrtc {

View File

@ -10,6 +10,9 @@
#include "common_audio/include/audio_util.h"
#include <cstddef>
#include <cstdint>
namespace webrtc {
void FloatToS16(const float* src, size_t size, int16_t* dest) {

View File

@ -10,6 +10,7 @@
#include "common_audio/channel_buffer.h"
#include <cstddef>
#include <cstdint>
#include "common_audio/include/audio_util.h"

View File

@ -11,15 +11,14 @@
#ifndef COMMON_AUDIO_CHANNEL_BUFFER_H_
#define COMMON_AUDIO_CHANNEL_BUFFER_H_
#include <string.h>
#include <cstdint>
#include <cstring>
#include <memory>
#include <vector>
#include "api/array_view.h"
#include "common_audio/include/audio_util.h"
#include "api/audio/audio_view.h"
#include "rtc_base/checks.h"
#include "rtc_base/gtest_prod_util.h"
namespace webrtc {

View File

@ -10,6 +10,9 @@
#include "common_audio/channel_buffer.h"
#include <cstddef>
#include "rtc_base/checks.h"
#include "test/gtest.h"
#include "test/testsupport/rtc_expect_death.h"

View File

@ -10,6 +10,8 @@
#include "common_audio/fir_filter_factory.h"
#include <cstddef>
#include "common_audio/fir_filter_c.h"
#include "rtc_base/checks.h"
#include "rtc_base/cpu_info.h"

View File

@ -11,6 +11,8 @@
#ifndef COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_
#define COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_
#include <optional>
#include "common_audio/smoothing_filter.h"
#include "test/gmock.h"

View File

@ -10,9 +10,16 @@
#include "common_audio/real_fourier.h"
#include <complex>
#include <cstddef>
#include <cstdint>
#include <memory>
#include "common_audio/real_fourier_ooura.h"
#include "common_audio/signal_processing/include/signal_processing_library.h"
#include "common_audio/signal_processing/include/signal_processing_library.h" // IWYU pragma: keep
#include "common_audio/signal_processing/include/spl_inl.h"
#include "rtc_base/checks.h"
#include "rtc_base/memory/aligned_malloc.h"
namespace webrtc {

View File

@ -12,6 +12,8 @@
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstddef>
#include "common_audio/third_party/ooura/fft_size_256/fft4g.h"
#include "rtc_base/checks.h"

View File

@ -10,7 +10,9 @@
#include "common_audio/real_fourier.h"
#include <stdlib.h>
#include <complex>
#include <cstdint>
#include <cstdlib>
#include "common_audio/real_fourier_ooura.h"
#include "test/gtest.h"

View File

@ -10,6 +10,8 @@
#include "common_audio/resampler/include/push_resampler.h"
#include <cstdint>
#include "rtc_base/checks.h" // RTC_DCHECK_IS_ON
#include "test/gtest.h"
#include "test/testsupport/rtc_expect_death.h"

View File

@ -10,9 +10,11 @@
#include "common_audio/resampler/push_sinc_resampler.h"
#include <cstdint>
#include <cstring>
#include "common_audio/include/audio_util.h"
#include "common_audio/resampler/sinc_resampler.h"
#include "rtc_base/checks.h"
namespace webrtc {

View File

@ -12,13 +12,16 @@
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <memory>
#include <tuple>
#include "common_audio/include/audio_util.h"
#include "common_audio/resampler/sinc_resampler.h"
#include "common_audio/resampler/sinusoidal_linear_chirp_source.h"
#include "rtc_base/time_utils.h"
#include "test/gmock.h"
#include "test/gtest.h"
namespace webrtc {

View File

@ -11,6 +11,9 @@
#include "common_audio/resampler/include/resampler.h"
#include <array>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include "rtc_base/strings/string_builder.h"
#include "test/gtest.h"

View File

@ -14,6 +14,8 @@
#ifndef COMMON_AUDIO_RESAMPLER_SINUSOIDAL_LINEAR_CHIRP_SOURCE_H_
#define COMMON_AUDIO_RESAMPLER_SINUSOIDAL_LINEAR_CHIRP_SOURCE_H_
#include <cstddef>
#include "common_audio/resampler/sinc_resampler.h"
namespace webrtc {

View File

@ -14,6 +14,7 @@
#include <time.h>
#include <algorithm>
#include <cstdio>
#include <memory>
#include "test/gtest.h"

View File

@ -10,6 +10,9 @@
#include "common_audio/signal_processing/dot_product_with_scale.h"
#include <cstddef>
#include <cstdint>
#include "rtc_base/numerics/safe_conversions.h"
int32_t WebRtcSpl_DotProductWithScale(const int16_t* vector1,

View File

@ -17,10 +17,9 @@
#ifndef COMMON_AUDIO_SIGNAL_PROCESSING_INCLUDE_SIGNAL_PROCESSING_LIBRARY_H_
#define COMMON_AUDIO_SIGNAL_PROCESSING_INCLUDE_SIGNAL_PROCESSING_LIBRARY_H_
#include <stdint.h>
#include <string.h>
#include "common_audio/signal_processing/dot_product_with_scale.h"
// Macros specific for the fixed point implementation
#define WEBRTC_SPL_WORD16_MAX 32767
#define WEBRTC_SPL_WORD16_MIN -32768
@ -95,7 +94,7 @@ extern "C" {
memcpy(v1, v2, (length) * sizeof(int16_t))
// inline functions:
#include "common_audio/signal_processing/include/spl_inl.h"
#include "common_audio/signal_processing/include/spl_inl.h" // IWYU pragma: keep
// third party math functions
#include "common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h"

View File

@ -10,6 +10,10 @@
#include "common_audio/signal_processing/include/real_fft.h"
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include "common_audio/signal_processing/include/signal_processing_library.h"
#include "test/gtest.h"

View File

@ -13,6 +13,8 @@
#include <math.h>
#include <cmath>
#include <cstdint>
#include <optional>
#include "rtc_base/checks.h"
#include "rtc_base/time_utils.h"

View File

@ -11,8 +11,9 @@
#include "common_audio/smoothing_filter.h"
#include <cmath>
#include <memory>
#include <cstdint>
#include "api/units/time_delta.h"
#include "rtc_base/fake_clock.h"
#include "test/gtest.h"

View File

@ -11,7 +11,7 @@
#ifndef MODULES_AUDIO_PROCESSING_UTILITY_OOURA_FFT_TABLES_COMMON_H_
#define MODULES_AUDIO_PROCESSING_UTILITY_OOURA_FFT_TABLES_COMMON_H_
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h" // IWYU pragma: keep
namespace webrtc {

View File

@ -11,7 +11,7 @@
#ifndef MODULES_AUDIO_PROCESSING_UTILITY_OOURA_FFT_TABLES_NEON_SSE2_H_
#define MODULES_AUDIO_PROCESSING_UTILITY_OOURA_FFT_TABLES_NEON_SSE2_H_
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h"
#include "common_audio/third_party/ooura/fft_size_128/ooura_fft.h" // IWYU pragma: keep
#include "rtc_base/system/arch.h"
#ifdef _MSC_VER /* visual c++ */

View File

@ -11,10 +11,10 @@
#ifndef COMMON_AUDIO_VAD_INCLUDE_VAD_H_
#define COMMON_AUDIO_VAD_INCLUDE_VAD_H_
#include <cstddef>
#include <cstdint>
#include <memory>
#include "common_audio/vad/include/webrtc_vad.h"
#include "rtc_base/checks.h"
namespace webrtc {

View File

@ -11,6 +11,9 @@
#ifndef COMMON_AUDIO_VAD_MOCK_MOCK_VAD_H_
#define COMMON_AUDIO_VAD_MOCK_MOCK_VAD_H_
#include <cstddef>
#include <cstdint>
#include "common_audio/vad/include/vad.h"
#include "test/gmock.h"

View File

@ -10,6 +10,8 @@
#include "common_audio/vad/include/vad.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include "common_audio/vad/include/webrtc_vad.h"

View File

@ -15,6 +15,9 @@
#ifndef COMMON_AUDIO_VAD_VAD_CORE_H_
#define COMMON_AUDIO_VAD_VAD_CORE_H_
#include <stddef.h>
#include <stdint.h>
#include "common_audio/signal_processing/include/signal_processing_library.h"
// TODO(https://bugs.webrtc.org/14476): When converted to C++, remove the macro.

View File

@ -10,6 +10,9 @@
#include <stdlib.h>
#include <cstdint>
#include <cstring>
#include "common_audio/vad/vad_unittest.h"
#include "test/gtest.h"

View File

@ -15,6 +15,9 @@
#ifndef COMMON_AUDIO_VAD_VAD_FILTERBANK_H_
#define COMMON_AUDIO_VAD_VAD_FILTERBANK_H_
#include <stddef.h>
#include <stdint.h>
#include "common_audio/vad/vad_core.h"
// Takes `data_length` samples of `data_in` and calculates the logarithm of the

View File

@ -8,7 +8,9 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <stdlib.h>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include "common_audio/vad/vad_unittest.h"
#include "test/gtest.h"

View File

@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <cstdint>
#include "common_audio/vad/vad_unittest.h"
#include "test/gtest.h"

View File

@ -13,6 +13,9 @@
#ifndef COMMON_AUDIO_VAD_VAD_SP_H_
#define COMMON_AUDIO_VAD_VAD_SP_H_
#include <stddef.h>
#include <stdint.h>
#include "common_audio/vad/vad_core.h"
// Downsamples the signal by a factor 2, eg. 32->16 or 16->8.

View File

@ -8,7 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <stdlib.h>
#include <cstdint>
#include <cstdlib>
#include "common_audio/vad/vad_unittest.h"
#include "test/gtest.h"

View File

@ -10,17 +10,19 @@
#include "common_audio/wav_file.h"
#include <errno.h>
#include <algorithm>
#include <array>
#include <cstdint>
#include <cstdio>
#include <type_traits>
#include <utility>
#include "absl/strings/string_view.h"
#include "common_audio/include/audio_util.h"
#include "common_audio/wav_header.h"
#include "rtc_base/checks.h"
#include "rtc_base/system/arch.h"
#include "rtc_base/system/file_wrapper.h"
namespace webrtc {
namespace {

View File

@ -11,11 +11,10 @@
#ifndef COMMON_AUDIO_WAV_FILE_H_
#define COMMON_AUDIO_WAV_FILE_H_
#include <stdint.h>
#include <cstddef>
#include <string>
#include <cstdint>
#include "absl/strings/string_view.h"
#include "common_audio/wav_header.h"
#include "rtc_base/system/file_wrapper.h"

View File

@ -14,6 +14,7 @@
#include "common_audio/wav_header.h"
#include <cstdint>
#include <cstring>
#include <limits>
#include <string>

View File

@ -10,8 +10,8 @@
#include "common_audio/wav_header.h"
#include <string.h>
#include <cstdint>
#include <cstring>
#include <limits>
#include "test/gtest.h"