blob: da889a89412236e5383f65c1e65bd2401a156739 [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
jackychen8f9902a2015-11-26 02:59:48 -08009import("//build/config/arm.gni")
mbonadei9aa3f0a2017-01-24 06:58:22 -080010import("../../webrtc.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000011
kjellander@webrtc.org72273912015-02-23 19:08:31 +000012build_video_processing_sse2 = current_cpu == "x86" || current_cpu == "x64"
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000013
kjellanderb62dbbe2016-09-23 00:38:52 -070014rtc_static_library("video_processing") {
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",
Mirko Bonadei0250be52017-12-01 13:53:04 +010029 "$rtc_libyuv_dir",
mbonadei1140f972017-04-26 03:38:35 -070030 "..:module_api",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000031 "../../common_audio",
32 "../../common_video",
33 "../../modules/utility",
ehmaldonadof6a861a2017-07-19 10:40:47 -070034 "../../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +010035 "../../system_wrappers:cpu_features_api",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000036 ]
37 if (build_video_processing_sse2) {
38 deps += [ ":video_processing_sse2" ]
39 }
jackychen8f9902a2015-11-26 02:59:48 -080040 if (rtc_build_with_neon) {
41 deps += [ ":video_processing_neon" ]
42 }
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000043
kjellandere40a7ee2016-10-16 23:56:12 -070044 if (!build_with_chromium && is_clang) {
45 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070046 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000047 }
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000048}
49
kjellander34b7a912017-03-08 01:41:14 -080050rtc_source_set("denoiser_filter") {
51 # Target that only exists to avoid cyclic depdency errors for the SSE2 and
52 # Neon implementations below.
53 sources = [
54 "util/denoiser_filter.h",
55 ]
mbonadei1140f972017-04-26 03:38:35 -070056 deps = [
57 "..:module_api",
58 ]
kjellander34b7a912017-03-08 01:41:14 -080059}
60
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000061if (build_video_processing_sse2) {
kjellanderb62dbbe2016-09-23 00:38:52 -070062 rtc_static_library("video_processing_sse2") {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020063 sources = [
jackychen8f9902a2015-11-26 02:59:48 -080064 "util/denoiser_filter_sse2.cc",
65 "util/denoiser_filter_sse2.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020066 ]
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000067
mbonadei6d3c5732016-12-27 06:32:08 -080068 deps = [
kjellander34b7a912017-03-08 01:41:14 -080069 ":denoiser_filter",
ehmaldonadof6a861a2017-07-19 10:40:47 -070070 "../../rtc_base:rtc_base_approved",
mbonadei6d3c5732016-12-27 06:32:08 -080071 "../../system_wrappers",
72 ]
73
kjellandere40a7ee2016-10-16 23:56:12 -070074 if (!build_with_chromium && is_clang) {
75 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070076 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000077 }
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000078
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000079 if (is_posix) {
80 cflags = [ "-msse2" ]
81 }
82 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000083}
jackychen8f9902a2015-11-26 02:59:48 -080084
85if (rtc_build_with_neon) {
kjellanderb62dbbe2016-09-23 00:38:52 -070086 rtc_static_library("video_processing_neon") {
jackychen8f9902a2015-11-26 02:59:48 -080087 sources = [
88 "util/denoiser_filter_neon.cc",
89 "util/denoiser_filter_neon.h",
90 ]
mbonadei6d3c5732016-12-27 06:32:08 -080091
kjellander34b7a912017-03-08 01:41:14 -080092 deps = [
93 ":denoiser_filter",
94 ]
95
jackychen8f9902a2015-11-26 02:59:48 -080096 if (current_cpu != "arm64") {
ehmaldonado38a21322016-09-02 04:10:34 -070097 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
jackychen8f9902a2015-11-26 02:59:48 -080098 cflags = [ "-mfpu=neon" ]
99 }
100 }
101}
ehmaldonado36268652017-01-19 08:27:11 -0800102
103if (rtc_include_tests) {
104 rtc_source_set("video_processing_unittests") {
105 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700106
ehmaldonado36268652017-01-19 08:27:11 -0800107 sources = [
108 "test/denoiser_test.cc",
109 ]
110 deps = [
111 ":video_processing",
112 "../../common_video:common_video",
113 "../../test:test_support",
114 "../../test:video_test_common",
115 ]
116 if (!build_with_chromium && is_clang) {
117 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
118 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
119 }
120 }
121}