1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
From: Boyuan Yang <byang@debian.org>
Date: Sat, 27 Jan 2024 16:20:08 -0500
Subject: use system libyuv
---
CMakeLists.txt | 27 ++++++---------------------
aom_dsp/butteraugli.c | 2 +-
apps/aomdec.c | 2 +-
apps/aomenc.c | 2 +-
4 files changed, 9 insertions(+), 24 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50b4261..801ed6d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -473,22 +473,12 @@ if(CONFIG_AV1_DECODER AND ENABLE_EXAMPLES)
endif()
if(CONFIG_LIBYUV OR CONFIG_TUNE_BUTTERAUGLI)
- add_library(yuv OBJECT ${AOM_LIBYUV_SOURCES})
- if(NOT MSVC)
- target_compile_options(yuv PRIVATE -Wno-shadow)
- # Many functions in libyuv trigger this warning when enabled with gcc and
- # clang.
- is_flag_present(AOM_CXX_FLAGS "-Wmissing-declarations" flag_present)
- if(flag_present)
- target_compile_options(yuv PRIVATE -Wno-missing-declarations)
- endif()
- # Many functions in libyuv trigger this warning when enabled with clang.
- is_flag_present(AOM_CXX_FLAGS "-Wmissing-prototypes" flag_present)
- if(flag_present)
- target_compile_options(yuv PRIVATE -Wno-missing-prototypes)
- endif()
+ target_link_libraries(aom ${AOM_LIB_LINK_TYPE} yuv)
+ target_include_directories(aom PRIVATE ${CMAKE_INCLUDE_PATH}/libyuv)
+ if(BUILD_SHARED_LIBS)
+ target_link_libraries(aom_static ${AOM_LIB_LINK_TYPE} yuv)
+ target_include_directories(aom_static PRIVATE ${CMAKE_INCLUDE_PATH}/libyuv)
endif()
- include_directories("${AOM_ROOT}/third_party/libyuv/include")
endif()
if(CONFIG_AV1_ENCODER)
@@ -611,11 +601,6 @@ if(CONFIG_AV1_ENCODER)
set_target_properties(aom_static PROPERTIES LINKER_LANGUAGE CXX)
endif()
- list(APPEND AOM_LIB_TARGETS yuv)
- target_sources(aom PRIVATE $<TARGET_OBJECTS:yuv>)
- if(BUILD_SHARED_LIBS)
- target_sources(aom_static PRIVATE $<TARGET_OBJECTS:yuv>)
- endif()
endif()
if(CONFIG_TFLITE)
@@ -763,7 +748,7 @@ if(ENABLE_EXAMPLES OR ENABLE_TESTS OR ENABLE_TOOLS)
if(CONFIG_LIBYUV)
# Add to existing targets.
foreach(aom_app ${AOM_APP_TARGETS})
- target_sources(${aom_app} PRIVATE $<TARGET_OBJECTS:yuv>)
+ target_link_libraries(${aom_app} ${AOM_LIB_LINK_TYPE} yuv)
set_property(TARGET ${aom_app} PROPERTY LINKER_LANGUAGE CXX)
endforeach()
endif()
diff --git a/aom_dsp/butteraugli.c b/aom_dsp/butteraugli.c
index b373e12..5020f25 100644
--- a/aom_dsp/butteraugli.c
+++ b/aom_dsp/butteraugli.c
@@ -14,7 +14,7 @@
#include "aom_dsp/butteraugli.h"
#include "aom_mem/aom_mem.h"
-#include "third_party/libyuv/include/libyuv/convert_argb.h"
+#include <libyuv/convert_argb.h>
int aom_calc_butteraugli(const YV12_BUFFER_CONFIG *source,
const YV12_BUFFER_CONFIG *distorted, int bit_depth,
diff --git a/apps/aomdec.c b/apps/aomdec.c
index 59fed36..fd9437c 100644
--- a/apps/aomdec.c
+++ b/apps/aomdec.c
@@ -43,7 +43,7 @@
#include "common/y4menc.h"
#if CONFIG_LIBYUV
-#include "third_party/libyuv/include/libyuv/scale.h"
+#include <libyuv/scale.h>
#endif
static const char *exec_name;
diff --git a/apps/aomenc.c b/apps/aomenc.c
index 3d58a89..2cb590b 100644
--- a/apps/aomenc.c
+++ b/apps/aomenc.c
@@ -47,7 +47,7 @@
#include "stats/rate_hist.h"
#if CONFIG_LIBYUV
-#include "third_party/libyuv/include/libyuv/scale.h"
+#include <libyuv/scale.h>
#endif
/* Swallow warnings about unused results of fread/fwrite */
|