blob: a73ac479fa579bf2563b5b9cc6fc8ff3edff3c10 [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
Mirko Bonadei86d053c2019-10-17 21:32:04 +020013rtc_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",
Mirko Bonadeid9708072019-01-25 20:26:48 +010030 "../../api:scoped_refptr",
Yves Gerey3e707812018-11-28 16:47:49 +010031 "../../api/video:video_frame",
32 "../../api/video:video_frame_i420",
Chen Xing5d24b162019-06-10 12:59:38 +020033 "../../api/video:video_rtp_headers",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000034 "../../common_audio",
35 "../../common_video",
36 "../../modules/utility",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010037 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070038 "../../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +020039 "../../rtc_base/system:arch",
Mirko Bonadeia498ae82017-12-06 09:17:14 +010040 "../../system_wrappers:cpu_features_api",
Mirko Bonadei401d0562017-12-14 11:24:00 +010041 "//third_party/libyuv",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000042 ]
43 if (build_video_processing_sse2) {
44 deps += [ ":video_processing_sse2" ]
45 }
jackychen8f9902a2015-11-26 02:59:48 -080046 if (rtc_build_with_neon) {
47 deps += [ ":video_processing_neon" ]
48 }
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000049}
50
kjellander34b7a912017-03-08 01:41:14 -080051rtc_source_set("denoiser_filter") {
52 # Target that only exists to avoid cyclic depdency errors for the SSE2 and
53 # Neon implementations below.
54 sources = [
55 "util/denoiser_filter.h",
56 ]
mbonadei1140f972017-04-26 03:38:35 -070057 deps = [
58 "..:module_api",
59 ]
kjellander34b7a912017-03-08 01:41:14 -080060}
61
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000062if (build_video_processing_sse2) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020063 rtc_library("video_processing_sse2") {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020064 sources = [
jackychen8f9902a2015-11-26 02:59:48 -080065 "util/denoiser_filter_sse2.cc",
66 "util/denoiser_filter_sse2.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020067 ]
kjellander@webrtc.org4a251992014-08-18 17:56:28 +000068
mbonadei6d3c5732016-12-27 06:32:08 -080069 deps = [
kjellander34b7a912017-03-08 01:41:14 -080070 ":denoiser_filter",
ehmaldonadof6a861a2017-07-19 10:40:47 -070071 "../../rtc_base:rtc_base_approved",
mbonadei6d3c5732016-12-27 06:32:08 -080072 "../../system_wrappers",
73 ]
74
Fabrice de Gans-Riberi09a6cd52018-03-30 10:38:06 -070075 if (is_posix || is_fuchsia) {
stefan@webrtc.org73823ca2014-07-07 11:46:43 +000076 cflags = [ "-msse2" ]
77 }
78 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000079}
jackychen8f9902a2015-11-26 02:59:48 -080080
81if (rtc_build_with_neon) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020082 rtc_library("video_processing_neon") {
jackychen8f9902a2015-11-26 02:59:48 -080083 sources = [
84 "util/denoiser_filter_neon.cc",
85 "util/denoiser_filter_neon.h",
86 ]
mbonadei6d3c5732016-12-27 06:32:08 -080087
kjellander34b7a912017-03-08 01:41:14 -080088 deps = [
89 ":denoiser_filter",
90 ]
91
jackychen8f9902a2015-11-26 02:59:48 -080092 if (current_cpu != "arm64") {
ehmaldonado38a21322016-09-02 04:10:34 -070093 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
jackychen8f9902a2015-11-26 02:59:48 -080094 cflags = [ "-mfpu=neon" ]
95 }
96 }
97}
ehmaldonado36268652017-01-19 08:27:11 -080098
99if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200100 rtc_library("video_processing_unittests") {
ehmaldonado36268652017-01-19 08:27:11 -0800101 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700102
ehmaldonado36268652017-01-19 08:27:11 -0800103 sources = [
104 "test/denoiser_test.cc",
105 ]
106 deps = [
Yves Gerey3e707812018-11-28 16:47:49 +0100107 ":denoiser_filter",
ehmaldonado36268652017-01-19 08:27:11 -0800108 ":video_processing",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100109 "../../api:scoped_refptr",
Yves Gerey3e707812018-11-28 16:47:49 +0100110 "../../api/video:video_frame",
111 "../../api/video:video_frame_i420",
Chen Xing5d24b162019-06-10 12:59:38 +0200112 "../../api/video:video_rtp_headers",
Artem Titov94b57c02019-03-21 13:35:10 +0100113 "../../common_video",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100114 "../../test:fileutils",
ehmaldonado36268652017-01-19 08:27:11 -0800115 "../../test:test_support",
116 "../../test:video_test_common",
117 ]
ehmaldonado36268652017-01-19 08:27:11 -0800118 }
119}