# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS.  All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

import("../webrtc.gni")

visibility = [ ":*" ]

rtc_library("common_audio") {
  visibility += [ "*" ]
  sources = [
    "audio_converter.cc",
    "audio_converter.h",
    "audio_util.cc",
    "channel_buffer.cc",
    "channel_buffer.h",
    "include/audio_util.h",
    "real_fourier.cc",
    "real_fourier.h",
    "real_fourier_ooura.cc",
    "real_fourier_ooura.h",
    "resampler/include/push_resampler.h",
    "resampler/include/resampler.h",
    "resampler/push_resampler.cc",
    "resampler/push_sinc_resampler.cc",
    "resampler/push_sinc_resampler.h",
    "resampler/resampler.cc",
    "resampler/sinc_resampler.cc",
    "smoothing_filter.cc",
    "smoothing_filter.h",
    "vad/include/vad.h",
    "vad/vad.cc",
    "wav_file.cc",
    "wav_file.h",
    "wav_header.cc",
    "wav_header.h",
    "window_generator.cc",
    "window_generator.h",
  ]

  deps = [
    ":common_audio_c",
    ":sinc_resampler",
    "../api:array_view",
    "../api/audio:audio_frame_api",
    "../rtc_base:checks",
    "../rtc_base:gtest_prod",
    "../rtc_base:logging",
    "../rtc_base:safe_conversions",
    "../rtc_base:sanitizer",
    "../rtc_base:timeutils",
    "../rtc_base/memory:aligned_malloc",
    "../rtc_base/system:arch",
    "../rtc_base/system:file_wrapper",
    "../system_wrappers",
    "third_party/ooura:fft_size_256",
  ]

  defines = []

  if (rtc_build_with_neon) {
    deps += [ ":common_audio_neon" ]
  }

  if (current_cpu == "x86" || current_cpu == "x64") {
    deps += [ ":common_audio_sse2" ]
    deps += [ ":common_audio_avx2" ]
  }
}

rtc_source_set("mock_common_audio") {
  visibility += webrtc_default_visibility
  testonly = true
  sources = [
    "mocks/mock_smoothing_filter.h",
    "vad/mock/mock_vad.h",
  ]
  deps = [
    ":common_audio",
    "../test:test_support",
  ]
}

rtc_source_set("common_audio_c_arm_asm") {
  sources = []
  deps = []
  if (current_cpu == "arm") {
    sources += [ "signal_processing/complex_bit_reverse_arm.S" ]

    if (arm_version >= 7) {
      sources += [ "signal_processing/filter_ar_fast_q12_armv7.S" ]
    } else {
      sources += [ "signal_processing/filter_ar_fast_q12.c" ]
    }
    deps += [ "../rtc_base/system:asm_defines" ]
  }
}

rtc_library("common_audio_c") {
  visibility += webrtc_default_visibility
  sources = [
    "ring_buffer.c",
    "ring_buffer.h",
    "signal_processing/auto_corr_to_refl_coef.c",
    "signal_processing/auto_correlation.c",
    "signal_processing/complex_fft_tables.h",
    "signal_processing/copy_set_operations.c",
    "signal_processing/cross_correlation.c",
    "signal_processing/division_operations.c",
    "signal_processing/downsample_fast.c",
    "signal_processing/energy.c",
    "signal_processing/filter_ar.c",
    "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",
    "signal_processing/include/spl_inl_armv7.h",
    "signal_processing/levinson_durbin.c",
    "signal_processing/lpc_to_refl_coef.c",
    "signal_processing/min_max_operations.c",
    "signal_processing/randomization_functions.c",
    "signal_processing/real_fft.c",
    "signal_processing/refl_coef_to_lpc.c",
    "signal_processing/resample.c",
    "signal_processing/resample_48khz.c",
    "signal_processing/resample_by_2.c",
    "signal_processing/resample_by_2_internal.c",
    "signal_processing/resample_by_2_internal.h",
    "signal_processing/resample_fractional.c",
    "signal_processing/spl_init.c",
    "signal_processing/spl_inl.c",
    "signal_processing/spl_sqrt.c",
    "signal_processing/splitting_filter.c",
    "signal_processing/sqrt_of_one_minus_x_squared.c",
    "signal_processing/vector_scaling_operations.c",
    "vad/include/webrtc_vad.h",
    "vad/vad_core.c",
    "vad/vad_core.h",
    "vad/vad_filterbank.c",
    "vad/vad_filterbank.h",
    "vad/vad_gmm.c",
    "vad/vad_gmm.h",
    "vad/vad_sp.c",
    "vad/vad_sp.h",
    "vad/webrtc_vad.c",
  ]

  if (current_cpu == "mipsel") {
    sources += [
      "signal_processing/complex_bit_reverse_mips.c",
      "signal_processing/complex_fft_mips.c",
      "signal_processing/cross_correlation_mips.c",
      "signal_processing/downsample_fast_mips.c",
      "signal_processing/filter_ar_fast_q12_mips.c",
      "signal_processing/include/spl_inl_mips.h",
      "signal_processing/min_max_operations_mips.c",
      "signal_processing/resample_by_2_mips.c",
    ]
    if (mips_dsp_rev > 0) {
      sources += [ "signal_processing/vector_scaling_operations_mips.c" ]
    }
  } else {
    sources += [ "signal_processing/complex_fft.c" ]
  }

  if (current_cpu != "arm" && current_cpu != "mipsel") {
    sources += [
      "signal_processing/complex_bit_reverse.c",
      "signal_processing/filter_ar_fast_q12.c",
    ]
  }

  deps = [
    ":common_audio_c_arm_asm",
    ":common_audio_cc",
    "../rtc_base:checks",
    "../rtc_base:compile_assert_c",
    "../rtc_base:sanitizer",
    "../rtc_base/system:arch",
    "../system_wrappers",
    "third_party/ooura:fft_size_256",
    "third_party/spl_sqrt_floor",
  ]
}

rtc_library("common_audio_cc") {
  sources = [
    "signal_processing/dot_product_with_scale.cc",
    "signal_processing/dot_product_with_scale.h",
  ]

  deps = [
    "../rtc_base:safe_conversions",
    "../system_wrappers",
  ]
}

rtc_source_set("sinc_resampler") {
  sources = [ "resampler/sinc_resampler.h" ]
  deps = [
    "../rtc_base:gtest_prod",
    "../rtc_base/memory:aligned_malloc",
    "../rtc_base/system:arch",
    "../system_wrappers",
  ]
}

rtc_source_set("fir_filter") {
  visibility += webrtc_default_visibility
  sources = [ "fir_filter.h" ]
}

rtc_library("fir_filter_factory") {
  visibility += webrtc_default_visibility
  sources = [
    "fir_filter_c.cc",
    "fir_filter_c.h",
    "fir_filter_factory.cc",
    "fir_filter_factory.h",
  ]
  deps = [
    ":fir_filter",
    "../rtc_base:checks",
    "../rtc_base/system:arch",
    "../system_wrappers",
  ]
  if (current_cpu == "x86" || current_cpu == "x64") {
    deps += [ ":common_audio_sse2" ]
    deps += [ ":common_audio_avx2" ]
  }
  if (rtc_build_with_neon) {
    deps += [ ":common_audio_neon" ]
  }
}

if (current_cpu == "x86" || current_cpu == "x64") {
  rtc_library("common_audio_sse2") {
    sources = [
      "fir_filter_sse.cc",
      "fir_filter_sse.h",
      "resampler/sinc_resampler_sse.cc",
    ]

    if (is_posix || is_fuchsia) {
      cflags = [ "-msse2" ]
    }

    deps = [
      ":fir_filter",
      ":sinc_resampler",
      "../rtc_base:checks",
      "../rtc_base/memory:aligned_malloc",
    ]
  }

  rtc_library("common_audio_avx2") {
    sources = [
      "fir_filter_avx2.cc",
      "fir_filter_avx2.h",
      "resampler/sinc_resampler_avx2.cc",
    ]

    if (is_win) {
      cflags = [ "/arch:AVX2" ]
    } else {
      cflags = [
        "-mavx2",
        "-mfma",
      ]
    }

    deps = [
      ":fir_filter",
      ":sinc_resampler",
      "../rtc_base:checks",
      "../rtc_base/memory:aligned_malloc",
    ]
  }
}

if (rtc_build_with_neon) {
  rtc_library("common_audio_neon") {
    sources = [
      "fir_filter_neon.cc",
      "fir_filter_neon.h",
      "resampler/sinc_resampler_neon.cc",
    ]

    if (current_cpu != "arm64") {
      # Enable compilation for the NEON instruction set.
      suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
      cflags = [ "-mfpu=neon" ]
    }

    deps = [
      ":common_audio_neon_c",
      ":fir_filter",
      ":sinc_resampler",
      "../rtc_base:checks",
      "../rtc_base/memory:aligned_malloc",
    ]
  }

  rtc_library("common_audio_neon_c") {
    visibility += webrtc_default_visibility
    sources = [
      "signal_processing/cross_correlation_neon.c",
      "signal_processing/downsample_fast_neon.c",
      "signal_processing/min_max_operations_neon.c",
    ]

    if (current_cpu != "arm64") {
      # Enable compilation for the NEON instruction set.
      suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
      cflags = [ "-mfpu=neon" ]
    }

    deps = [
      ":common_audio_c",
      "../rtc_base:checks",
      "../rtc_base/system:arch",
    ]
  }
}

if (rtc_include_tests && !build_with_chromium) {
  rtc_test("common_audio_unittests") {
    visibility += webrtc_default_visibility
    testonly = true

    sources = [
      "audio_converter_unittest.cc",
      "audio_util_unittest.cc",
      "channel_buffer_unittest.cc",
      "fir_filter_unittest.cc",
      "real_fourier_unittest.cc",
      "resampler/push_resampler_unittest.cc",
      "resampler/push_sinc_resampler_unittest.cc",
      "resampler/resampler_unittest.cc",
      "resampler/sinusoidal_linear_chirp_source.cc",
      "resampler/sinusoidal_linear_chirp_source.h",
      "ring_buffer_unittest.cc",
      "signal_processing/real_fft_unittest.cc",
      "signal_processing/signal_processing_unittest.cc",
      "smoothing_filter_unittest.cc",
      "vad/vad_core_unittest.cc",
      "vad/vad_filterbank_unittest.cc",
      "vad/vad_gmm_unittest.cc",
      "vad/vad_sp_unittest.cc",
      "vad/vad_unittest.cc",
      "vad/vad_unittest.h",
      "wav_file_unittest.cc",
      "wav_header_unittest.cc",
      "window_generator_unittest.cc",
    ]

    # Does not compile on iOS for arm: webrtc:5544.
    if (!is_ios || target_cpu != "arm") {
      sources += [ "resampler/sinc_resampler_unittest.cc" ]
    }

    deps = [
      ":common_audio",
      ":common_audio_c",
      ":fir_filter",
      ":fir_filter_factory",
      ":sinc_resampler",
      "../rtc_base:checks",
      "../rtc_base:macromagic",
      "../rtc_base:rtc_base_tests_utils",
      "../rtc_base:stringutils",
      "../rtc_base:timeutils",
      "../rtc_base/system:arch",
      "../system_wrappers",
      "../test:fileutils",
      "../test:rtc_expect_death",
      "../test:test_main",
      "../test:test_support",
      "//testing/gtest",
    ]

    if (is_android) {
      deps += [ "//testing/android/native_test:native_test_support" ]

      shard_timeout = 900
    }
  }
}
