blob: d3724994e63b315c9498c562016347df5f8877c4 [file] [log] [blame]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +00001# Copyright (c) 2014 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../../webrtc.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000010
kjellander@webrtc.org72273912015-02-23 19:08:31 +000011build_video_processing_sse2 = current_cpu == "x86" || current_cpu == "x64"
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000012
kjellanderb62dbbe2016-09-23 00:38:52 -070013rtc_static_library("video_processing") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000014 visibility = [ "*" ]
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000015 sources = [
jackychen8f9902a2015-11-26 02:59:48 -080016 "util/denoiser_filter.cc",
jackychen8f9902a2015-11-26 02:59:48 -080017 "util/denoiser_filter_c.cc",
18 "util/denoiser_filter_c.h",
jackychenfa0befe2016-04-01 07:46:58 -070019 "util/noise_estimation.cc",
20 "util/noise_estimation.h",
jackychen8f9902a2015-11-26 02:59:48 -080021 "util/skin_detection.cc",
22 "util/skin_detection.h",
jackychen8f9902a2015-11-26 02:59:48 -080023 "video_denoiser.cc",
24 "video_denoiser.h",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000025 ]
26
27 deps = [
kjellander34b7a912017-03-08 01:41:14 -080028 ":denoiser_filter",
mbonadei1140f972017-04-26 03:38:35 -070029 "..:module_api",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000030 "../../common_audio",
31 "../../common_video",
32 "../../modules/utility",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010033 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070034 "../../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +020035 "../../rtc_base/system:arch",
Mirko Bonadeia498ae82017-12-06 09:17:14 +010036 "../../system_wrappers:cpu_features_api",
Mirko Bonadei401d0562017-12-14 11:24:00 +010037 "//third_party/libyuv",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000038 ]
39 if (build_video_processing_sse2) {
40 deps += [ ":video_processing_sse2" ]
41 }
jackychen8f9902a2015-11-26 02:59:48 -080042 if (rtc_build_with_neon) {
43 deps += [ ":video_processing_neon" ]
44 }
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000045
kjellandere40a7ee2016-10-16 23:56:12 -070046 if (!build_with_chromium && is_clang) {
47 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070048 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000049 }
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000050}
51
kjellander34b7a912017-03-08 01:41:14 -080052rtc_source_set("denoiser_filter") {
53 # Target that only exists to avoid cyclic depdency errors for the SSE2 and
54 # Neon implementations below.
55 sources = [
56 "util/denoiser_filter.h",
57 ]
mbonadei1140f972017-04-26 03:38:35 -070058 deps = [
59 "..:module_api",
60 ]
kjellander34b7a912017-03-08 01:41:14 -080061}
62
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000063if (build_video_processing_sse2) {
kjellanderb62dbbe2016-09-23 00:38:52 -070064 rtc_static_library("video_processing_sse2") {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020065 sources = [
jackychen8f9902a2015-11-26 02:59:48 -080066 "util/denoiser_filter_sse2.cc",
67 "util/denoiser_filter_sse2.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020068 ]
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000069
mbonadei6d3c5732016-12-27 06:32:08 -080070 deps = [
kjellander34b7a912017-03-08 01:41:14 -080071 ":denoiser_filter",
ehmaldonadof6a861a2017-07-19 10:40:47 -070072 "../../rtc_base:rtc_base_approved",
mbonadei6d3c5732016-12-27 06:32:08 -080073 "../../system_wrappers",
74 ]
75
kjellandere40a7ee2016-10-16 23:56:12 -070076 if (!build_with_chromium && is_clang) {
77 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070078 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000079 }
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000080
Fabrice de Gans-Riberi09a6cd52018-03-30 10:38:06 -070081 if (is_posix || is_fuchsia) {
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000082 cflags = [ "-msse2" ]
83 }
84 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000085}
jackychen8f9902a2015-11-26 02:59:48 -080086
87if (rtc_build_with_neon) {
kjellanderb62dbbe2016-09-23 00:38:52 -070088 rtc_static_library("video_processing_neon") {
jackychen8f9902a2015-11-26 02:59:48 -080089 sources = [
90 "util/denoiser_filter_neon.cc",
91 "util/denoiser_filter_neon.h",
92 ]
mbonadei6d3c5732016-12-27 06:32:08 -080093
kjellander34b7a912017-03-08 01:41:14 -080094 deps = [
95 ":denoiser_filter",
96 ]
97
jackychen8f9902a2015-11-26 02:59:48 -080098 if (current_cpu != "arm64") {
ehmaldonado38a21322016-09-02 04:10:34 -070099 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
jackychen8f9902a2015-11-26 02:59:48 -0800100 cflags = [ "-mfpu=neon" ]
101 }
102 }
103}
ehmaldonado36268652017-01-19 08:27:11 -0800104
105if (rtc_include_tests) {
106 rtc_source_set("video_processing_unittests") {
107 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700108
ehmaldonado36268652017-01-19 08:27:11 -0800109 sources = [
110 "test/denoiser_test.cc",
111 ]
112 deps = [
113 ":video_processing",
114 "../../common_video:common_video",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100115 "../../test:fileutils",
ehmaldonado36268652017-01-19 08:27:11 -0800116 "../../test:test_support",
117 "../../test:video_test_common",
118 ]
119 if (!build_with_chromium && is_clang) {
120 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
121 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
122 }
123 }
124}