tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

BUILD.gn (12629B)


      1 # Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
      2 #
      3 # Use of this source code is governed by a BSD-style license
      4 # that can be found in the LICENSE file in the root of the source
      5 # tree. An additional intellectual property rights grant can be found
      6 # in the file PATENTS.  All contributing project authors may
      7 # be found in the AUTHORS file in the root of the source tree.
      8 
      9 import("../../../webrtc.gni")
     10 if (rtc_enable_protobuf) {
     11   import("//third_party/protobuf/proto_library.gni")
     12 }
     13 
     14 rtc_library("aec3") {
     15   visibility = [ "*" ]
     16   configs += [ "..:apm_debug_dump" ]
     17   sources = [
     18     "adaptive_fir_filter.cc",
     19     "adaptive_fir_filter_erl.cc",
     20     "aec3_common.cc",
     21     "aec3_fft.cc",
     22     "aec_state.cc",
     23     "aec_state.h",
     24     "alignment_mixer.cc",
     25     "alignment_mixer.h",
     26     "api_call_jitter_metrics.cc",
     27     "api_call_jitter_metrics.h",
     28     "block.h",
     29     "block_buffer.cc",
     30     "block_delay_buffer.cc",
     31     "block_delay_buffer.h",
     32     "block_framer.cc",
     33     "block_framer.h",
     34     "block_processor.cc",
     35     "block_processor.h",
     36     "block_processor_metrics.cc",
     37     "block_processor_metrics.h",
     38     "clockdrift_detector.cc",
     39     "clockdrift_detector.h",
     40     "coarse_filter_update_gain.cc",
     41     "coarse_filter_update_gain.h",
     42     "comfort_noise_generator.cc",
     43     "comfort_noise_generator.h",
     44     "config_selector.cc",
     45     "config_selector.h",
     46     "decimator.cc",
     47     "decimator.h",
     48     "delay_estimate.h",
     49     "dominant_nearend_detector.cc",
     50     "dominant_nearend_detector.h",
     51     "downsampled_render_buffer.cc",
     52     "downsampled_render_buffer.h",
     53     "echo_audibility.cc",
     54     "echo_audibility.h",
     55     "echo_canceller3.cc",
     56     "echo_canceller3.h",
     57     "echo_path_delay_estimator.cc",
     58     "echo_path_delay_estimator.h",
     59     "echo_path_variability.cc",
     60     "echo_path_variability.h",
     61     "echo_remover.cc",
     62     "echo_remover.h",
     63     "echo_remover_metrics.cc",
     64     "echo_remover_metrics.h",
     65     "erl_estimator.cc",
     66     "erl_estimator.h",
     67     "erle_estimator.cc",
     68     "erle_estimator.h",
     69     "fft_buffer.cc",
     70     "filter_analyzer.cc",
     71     "filter_analyzer.h",
     72     "frame_blocker.cc",
     73     "frame_blocker.h",
     74     "fullband_erle_estimator.cc",
     75     "fullband_erle_estimator.h",
     76     "matched_filter.cc",
     77     "matched_filter_lag_aggregator.cc",
     78     "matched_filter_lag_aggregator.h",
     79     "moving_average.cc",
     80     "moving_average.h",
     81     "multi_channel_content_detector.cc",
     82     "multi_channel_content_detector.h",
     83     "nearend_detector.h",
     84     "refined_filter_update_gain.cc",
     85     "refined_filter_update_gain.h",
     86     "render_buffer.cc",
     87     "render_delay_buffer.cc",
     88     "render_delay_buffer.h",
     89     "render_delay_controller.cc",
     90     "render_delay_controller.h",
     91     "render_delay_controller_metrics.cc",
     92     "render_delay_controller_metrics.h",
     93     "render_signal_analyzer.cc",
     94     "render_signal_analyzer.h",
     95     "residual_echo_estimator.cc",
     96     "residual_echo_estimator.h",
     97     "reverb_decay_estimator.cc",
     98     "reverb_decay_estimator.h",
     99     "reverb_frequency_response.cc",
    100     "reverb_frequency_response.h",
    101     "reverb_model.cc",
    102     "reverb_model.h",
    103     "reverb_model_estimator.cc",
    104     "reverb_model_estimator.h",
    105     "signal_dependent_erle_estimator.cc",
    106     "signal_dependent_erle_estimator.h",
    107     "spectrum_buffer.cc",
    108     "stationarity_estimator.cc",
    109     "stationarity_estimator.h",
    110     "subband_erle_estimator.cc",
    111     "subband_erle_estimator.h",
    112     "subband_nearend_detector.cc",
    113     "subband_nearend_detector.h",
    114     "subtractor.cc",
    115     "subtractor.h",
    116     "subtractor_output.cc",
    117     "subtractor_output.h",
    118     "subtractor_output_analyzer.cc",
    119     "subtractor_output_analyzer.h",
    120     "suppression_filter.cc",
    121     "suppression_filter.h",
    122     "suppression_gain.cc",
    123     "suppression_gain.h",
    124     "transparent_mode.cc",
    125     "transparent_mode.h",
    126   ]
    127 
    128   defines = []
    129   if (rtc_build_with_neon && target_cpu != "arm64") {
    130     suppressed_configs += [ "//chromium/build/config/compiler:compiler_arm_fpu" ]
    131     cflags = [ "-mfpu=neon" ]
    132   }
    133 
    134   deps = [
    135     ":adaptive_fir_filter",
    136     ":adaptive_fir_filter_erl",
    137     ":aec3_common",
    138     ":aec3_fft",
    139     ":fft_data",
    140     ":matched_filter",
    141     ":render_buffer",
    142     ":vector_math",
    143     "..:apm_logging",
    144     "..:audio_buffer",
    145     "..:high_pass_filter",
    146     "../../../api:array_view",
    147     "../../../api:field_trials_view",
    148     "../../../api/audio:aec3_config",
    149     "../../../api/audio:echo_control",
    150     "../../../api/audio:neural_residual_echo_estimator_api",
    151     "../../../api/environment",
    152     "../../../common_audio:common_audio_c",
    153     "../../../rtc_base:checks",
    154     "../../../rtc_base:cpu_info",
    155     "../../../rtc_base:gtest_prod",
    156     "../../../rtc_base:logging",
    157     "../../../rtc_base:macromagic",
    158     "../../../rtc_base:race_checker",
    159     "../../../rtc_base:safe_minmax",
    160     "../../../rtc_base:swap_queue",
    161     "../../../rtc_base/experiments:field_trial_parser",
    162     "../../../rtc_base/system:arch",
    163     "../../../system_wrappers:metrics",
    164     "../utility:cascaded_biquad_filter",
    165     "//third_party/abseil-cpp/absl/strings:string_view",
    166   ]
    167 
    168   if (target_cpu == "x86" || target_cpu == "x64") {
    169     deps += [ ":aec3_avx2" ]
    170   }
    171 }
    172 
    173 rtc_source_set("aec3_common") {
    174   sources = [ "aec3_common.h" ]
    175 }
    176 
    177 rtc_source_set("aec3_fft") {
    178   sources = [ "aec3_fft.h" ]
    179   deps = [
    180     ":aec3_common",
    181     ":fft_data",
    182     "../../../api:array_view",
    183     "../../../common_audio/third_party/ooura:fft_size_128",
    184     "../../../rtc_base:checks",
    185     "../../../rtc_base/system:arch",
    186   ]
    187 }
    188 
    189 rtc_source_set("render_buffer") {
    190   sources = [
    191     "block.h",
    192     "block_buffer.h",
    193     "fft_buffer.h",
    194     "render_buffer.h",
    195     "spectrum_buffer.h",
    196   ]
    197   deps = [
    198     ":aec3_common",
    199     ":fft_data",
    200     "../../../api:array_view",
    201     "../../../rtc_base:checks",
    202     "../../../rtc_base/system:arch",
    203   ]
    204 }
    205 
    206 rtc_source_set("adaptive_fir_filter") {
    207   sources = [ "adaptive_fir_filter.h" ]
    208   deps = [
    209     ":aec3_common",
    210     ":aec3_fft",
    211     ":fft_data",
    212     ":render_buffer",
    213     "..:apm_logging",
    214     "../../../api:array_view",
    215     "../../../rtc_base/system:arch",
    216     "//third_party/abseil-cpp/absl/strings:string_view",
    217   ]
    218 }
    219 
    220 rtc_source_set("adaptive_fir_filter_erl") {
    221   sources = [ "adaptive_fir_filter_erl.h" ]
    222   deps = [
    223     ":aec3_common",
    224     "../../../api:array_view",
    225     "../../../rtc_base/system:arch",
    226   ]
    227 }
    228 
    229 rtc_source_set("matched_filter") {
    230   sources = [ "matched_filter.h" ]
    231   deps = [
    232     ":aec3_common",
    233     "../../../api:array_view",
    234     "../../../rtc_base:gtest_prod",
    235     "../../../rtc_base/system:arch",
    236   ]
    237 }
    238 
    239 rtc_source_set("vector_math") {
    240   sources = [ "vector_math.h" ]
    241   deps = [
    242     ":aec3_common",
    243     "../../../api:array_view",
    244     "../../../rtc_base:checks",
    245     "../../../rtc_base/system:arch",
    246   ]
    247 }
    248 
    249 rtc_source_set("fft_data") {
    250   sources = [ "fft_data.h" ]
    251   deps = [
    252     ":aec3_common",
    253     "../../../api:array_view",
    254     "../../../rtc_base:checks",
    255     "../../../rtc_base/system:arch",
    256   ]
    257 }
    258 
    259 if (target_cpu == "x86" || target_cpu == "x64") {
    260   rtc_library("aec3_avx2") {
    261     configs += [ "..:apm_debug_dump" ]
    262     sources = [
    263       "adaptive_fir_filter_avx2.cc",
    264       "adaptive_fir_filter_erl_avx2.cc",
    265       "fft_data_avx2.cc",
    266       "matched_filter_avx2.cc",
    267       "vector_math_avx2.cc",
    268     ]
    269 
    270     cflags = [
    271       "-mavx",
    272       "-mavx2",
    273       "-mfma",
    274     ]
    275 
    276     deps = [
    277       ":adaptive_fir_filter",
    278       ":adaptive_fir_filter_erl",
    279       ":aec3_common",
    280       ":fft_data",
    281       ":matched_filter",
    282       ":render_buffer",
    283       ":vector_math",
    284       "../../../api:array_view",
    285       "../../../rtc_base:checks",
    286     ]
    287   }
    288 }
    289 
    290 if (rtc_enable_protobuf) {
    291   proto_library("neural_residual_echo_estimator_proto") {
    292     sources = [ "neural_residual_echo_estimator.proto" ]
    293     proto_out_dir = "modules/audio_processing/aec3"
    294   }
    295 
    296   rtc_library("neural_residual_echo_estimator_impl") {
    297     visibility = [ "*" ]
    298     poisonous = [ "default_neural_residual_echo_estimator" ]
    299     configs += [
    300       "..:apm_debug_dump",
    301       "//third_party/tflite:tflite_config_no_undef",
    302     ]
    303     sources = [
    304       "neural_feature_extractor.cc",
    305       "neural_feature_extractor.h",
    306       "neural_residual_echo_estimator_impl.cc",
    307       "neural_residual_echo_estimator_impl.h",
    308     ]
    309     deps = [
    310       ":aec3_common",
    311       ":neural_residual_echo_estimator_proto",
    312       "..:apm_logging",
    313       "../../../api:array_view",
    314       "../../../api/audio:neural_residual_echo_estimator_api",
    315       "../../../common_audio",
    316       "../../../rtc_base:checks",
    317       "../../../rtc_base:logging",
    318       "//third_party/abseil-cpp/absl/strings:string_view",
    319       "//third_party/pffft",
    320     ]
    321     if (build_with_chromium) {
    322       deps += [
    323         "//third_party/tflite",
    324         "//third_party/tflite:tflite_builtin_op_resolver",
    325       ]
    326     } else {
    327       deps += [
    328         "//third_party/tflite:tflite_builtin_op_resolver_standalone",
    329         "//third_party/tflite:tflite_standalone",
    330       ]
    331     }
    332   }
    333 }
    334 
    335 if (rtc_include_tests) {
    336   rtc_library("aec3_unittests") {
    337     testonly = true
    338 
    339     configs += [ "..:apm_debug_dump" ]
    340     sources = [
    341       "mock/mock_block_processor.cc",
    342       "mock/mock_block_processor.h",
    343       "mock/mock_echo_remover.cc",
    344       "mock/mock_echo_remover.h",
    345       "mock/mock_render_delay_buffer.cc",
    346       "mock/mock_render_delay_buffer.h",
    347       "mock/mock_render_delay_controller.cc",
    348       "mock/mock_render_delay_controller.h",
    349     ]
    350 
    351     deps = [
    352       ":adaptive_fir_filter",
    353       ":adaptive_fir_filter_erl",
    354       ":aec3",
    355       ":aec3_common",
    356       ":aec3_fft",
    357       ":fft_data",
    358       ":matched_filter",
    359       ":render_buffer",
    360       ":vector_math",
    361       "..:apm_logging",
    362       "..:audio_buffer",
    363       "..:audio_processing",
    364       "..:high_pass_filter",
    365       "../../../api:array_view",
    366       "../../../api:field_trials",
    367       "../../../api/audio:aec3_config",
    368       "../../../api/audio:echo_control",
    369       "../../../api/audio:neural_residual_echo_estimator_api",
    370       "../../../api/environment",
    371       "../../../api/environment:environment_factory",
    372       "../../../rtc_base:checks",
    373       "../../../rtc_base:cpu_info",
    374       "../../../rtc_base:gunit_helpers",
    375       "../../../rtc_base:random",
    376       "../../../rtc_base:safe_minmax",
    377       "../../../rtc_base:stringutils",
    378       "../../../rtc_base/system:arch",
    379       "../../../system_wrappers:metrics",
    380       "../../../test:create_test_field_trials",
    381       "../../../test:fileutils",
    382       "../../../test:test_support",
    383       "../utility:cascaded_biquad_filter",
    384     ]
    385 
    386     defines = []
    387 
    388     if (rtc_enable_protobuf) {
    389       sources += [
    390         "adaptive_fir_filter_erl_unittest.cc",
    391         "adaptive_fir_filter_unittest.cc",
    392         "aec3_fft_unittest.cc",
    393         "aec_state_unittest.cc",
    394         "alignment_mixer_unittest.cc",
    395         "api_call_jitter_metrics_unittest.cc",
    396         "block_delay_buffer_unittest.cc",
    397         "block_framer_unittest.cc",
    398         "block_processor_metrics_unittest.cc",
    399         "block_processor_unittest.cc",
    400         "clockdrift_detector_unittest.cc",
    401         "coarse_filter_update_gain_unittest.cc",
    402         "comfort_noise_generator_unittest.cc",
    403         "config_selector_unittest.cc",
    404         "decimator_unittest.cc",
    405         "echo_canceller3_unittest.cc",
    406         "echo_path_delay_estimator_unittest.cc",
    407         "echo_path_variability_unittest.cc",
    408         "echo_remover_metrics_unittest.cc",
    409         "echo_remover_unittest.cc",
    410         "erl_estimator_unittest.cc",
    411         "erle_estimator_unittest.cc",
    412         "fft_data_unittest.cc",
    413         "filter_analyzer_unittest.cc",
    414         "frame_blocker_unittest.cc",
    415         "matched_filter_lag_aggregator_unittest.cc",
    416         "matched_filter_unittest.cc",
    417         "moving_average_unittest.cc",
    418         "multi_channel_content_detector_unittest.cc",
    419         "neural_feature_extractor_unittest.cc",
    420         "neural_residual_echo_estimator_impl_unittest.cc",
    421         "refined_filter_update_gain_unittest.cc",
    422         "render_buffer_unittest.cc",
    423         "render_delay_buffer_unittest.cc",
    424         "render_delay_controller_metrics_unittest.cc",
    425         "render_delay_controller_unittest.cc",
    426         "render_signal_analyzer_unittest.cc",
    427         "residual_echo_estimator_unittest.cc",
    428         "reverb_model_estimator_unittest.cc",
    429         "signal_dependent_erle_estimator_unittest.cc",
    430         "subtractor_unittest.cc",
    431         "suppression_filter_unittest.cc",
    432         "suppression_gain_unittest.cc",
    433         "vector_math_unittest.cc",
    434       ]
    435       deps += [
    436         ":neural_residual_echo_estimator_impl",
    437         ":neural_residual_echo_estimator_proto",
    438       ]
    439     }
    440 
    441     if (!build_with_chromium) {
    442       deps += [ "..:audio_processing_unittests" ]
    443     }
    444   }
    445 }