kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 1 | # 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 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 9 | import("../../webrtc.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 10 | |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 11 | build_video_processing_sse2 = current_cpu == "x86" || current_cpu == "x64" |
stefan@webrtc.org | 73823ca | 2014-07-07 11:46:43 +0000 | [diff] [blame] | 12 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 13 | rtc_static_library("video_processing") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 14 | visibility = [ "*" ] |
stefan@webrtc.org | 73823ca | 2014-07-07 11:46:43 +0000 | [diff] [blame] | 15 | sources = [ |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 16 | "util/denoiser_filter.cc", |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 17 | "util/denoiser_filter_c.cc", |
| 18 | "util/denoiser_filter_c.h", |
jackychen | fa0befe | 2016-04-01 07:46:58 -0700 | [diff] [blame] | 19 | "util/noise_estimation.cc", |
| 20 | "util/noise_estimation.h", |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 21 | "util/skin_detection.cc", |
| 22 | "util/skin_detection.h", |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 23 | "video_denoiser.cc", |
| 24 | "video_denoiser.h", |
stefan@webrtc.org | 73823ca | 2014-07-07 11:46:43 +0000 | [diff] [blame] | 25 | ] |
| 26 | |
| 27 | deps = [ |
kjellander | 34b7a91 | 2017-03-08 01:41:14 -0800 | [diff] [blame] | 28 | ":denoiser_filter", |
mbonadei | 1140f97 | 2017-04-26 03:38:35 -0700 | [diff] [blame] | 29 | "..:module_api", |
stefan@webrtc.org | 73823ca | 2014-07-07 11:46:43 +0000 | [diff] [blame] | 30 | "../../common_audio", |
| 31 | "../../common_video", |
| 32 | "../../modules/utility", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 33 | "../../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 34 | "../../rtc_base:rtc_base_approved", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 35 | "../../rtc_base/system:arch", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 36 | "../../system_wrappers:cpu_features_api", |
Mirko Bonadei | 401d056 | 2017-12-14 11:24:00 +0100 | [diff] [blame] | 37 | "//third_party/libyuv", |
stefan@webrtc.org | 73823ca | 2014-07-07 11:46:43 +0000 | [diff] [blame] | 38 | ] |
| 39 | if (build_video_processing_sse2) { |
| 40 | deps += [ ":video_processing_sse2" ] |
| 41 | } |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 42 | if (rtc_build_with_neon) { |
| 43 | deps += [ ":video_processing_neon" ] |
| 44 | } |
kjellander@webrtc.org | 42ee5b5 | 2014-08-25 14:15:35 +0000 | [diff] [blame] | 45 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 46 | if (!build_with_chromium && is_clang) { |
| 47 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 48 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 42ee5b5 | 2014-08-25 14:15:35 +0000 | [diff] [blame] | 49 | } |
stefan@webrtc.org | 73823ca | 2014-07-07 11:46:43 +0000 | [diff] [blame] | 50 | } |
| 51 | |
kjellander | 34b7a91 | 2017-03-08 01:41:14 -0800 | [diff] [blame] | 52 | rtc_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 | ] |
mbonadei | 1140f97 | 2017-04-26 03:38:35 -0700 | [diff] [blame] | 58 | deps = [ |
| 59 | "..:module_api", |
| 60 | ] |
kjellander | 34b7a91 | 2017-03-08 01:41:14 -0800 | [diff] [blame] | 61 | } |
| 62 | |
stefan@webrtc.org | 73823ca | 2014-07-07 11:46:43 +0000 | [diff] [blame] | 63 | if (build_video_processing_sse2) { |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 64 | rtc_static_library("video_processing_sse2") { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 65 | sources = [ |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 66 | "util/denoiser_filter_sse2.cc", |
| 67 | "util/denoiser_filter_sse2.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 68 | ] |
kjellander@webrtc.org | 4a25199 | 2014-08-18 17:56:28 +0000 | [diff] [blame] | 69 | |
mbonadei | 6d3c573 | 2016-12-27 06:32:08 -0800 | [diff] [blame] | 70 | deps = [ |
kjellander | 34b7a91 | 2017-03-08 01:41:14 -0800 | [diff] [blame] | 71 | ":denoiser_filter", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 72 | "../../rtc_base:rtc_base_approved", |
mbonadei | 6d3c573 | 2016-12-27 06:32:08 -0800 | [diff] [blame] | 73 | "../../system_wrappers", |
| 74 | ] |
| 75 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 76 | if (!build_with_chromium && is_clang) { |
| 77 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 78 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 42ee5b5 | 2014-08-25 14:15:35 +0000 | [diff] [blame] | 79 | } |
kjellander@webrtc.org | 4a25199 | 2014-08-18 17:56:28 +0000 | [diff] [blame] | 80 | |
Fabrice de Gans-Riberi | 09a6cd5 | 2018-03-30 10:38:06 -0700 | [diff] [blame] | 81 | if (is_posix || is_fuchsia) { |
stefan@webrtc.org | 73823ca | 2014-07-07 11:46:43 +0000 | [diff] [blame] | 82 | cflags = [ "-msse2" ] |
| 83 | } |
| 84 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 85 | } |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 86 | |
| 87 | if (rtc_build_with_neon) { |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 88 | rtc_static_library("video_processing_neon") { |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 89 | sources = [ |
| 90 | "util/denoiser_filter_neon.cc", |
| 91 | "util/denoiser_filter_neon.h", |
| 92 | ] |
mbonadei | 6d3c573 | 2016-12-27 06:32:08 -0800 | [diff] [blame] | 93 | |
kjellander | 34b7a91 | 2017-03-08 01:41:14 -0800 | [diff] [blame] | 94 | deps = [ |
| 95 | ":denoiser_filter", |
| 96 | ] |
| 97 | |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 98 | if (current_cpu != "arm64") { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 99 | suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ] |
jackychen | 8f9902a | 2015-11-26 02:59:48 -0800 | [diff] [blame] | 100 | cflags = [ "-mfpu=neon" ] |
| 101 | } |
| 102 | } |
| 103 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 104 | |
| 105 | if (rtc_include_tests) { |
| 106 | rtc_source_set("video_processing_unittests") { |
| 107 | testonly = true |
kjellander | e0629c0 | 2017-04-25 04:04:50 -0700 | [diff] [blame] | 108 | |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 109 | sources = [ |
| 110 | "test/denoiser_test.cc", |
| 111 | ] |
| 112 | deps = [ |
| 113 | ":video_processing", |
| 114 | "../../common_video:common_video", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 115 | "../../test:fileutils", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 116 | "../../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 | } |