Skip to content

Commit e547ef8

Browse files
youennfphiln
authored andcommitted
Update libaom up to M120
https://bugs.webkit.org/show_bug.cgi?id=265863 rdar://119182695 Reviewed by Jean-Yves Avenard. * Source/ThirdParty/libwebrtc/Configurations/libaom.xcconfig: Moving from iOS to minux arm64-cpu-detect. * Source/ThirdParty/libwebrtc/Source/third_party/libaom/source/libaom/: Resynced. * Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/271613@main
1 parent fb00d1f commit e547ef8

553 files changed

Lines changed: 79057 additions & 40551 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Source/ThirdParty/libwebrtc/Configurations/libaom.xcconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ WARNING_CFLAGS = -Wno-implicit-function-declaration -Wno-strict-prototypes;
1414

1515
// FIXME: Enable x86 optimization
1616
HEADER_SEARCH_PATHS[arch=x86_64] = Source/third_party/libaom/source/config/linux/generic Source/third_party/libaom/source/libaom Source/third_party/libaom/source/config;
17-
HEADER_SEARCH_PATHS[arch=arm64*] = Source/third_party/libaom/source/config/ios/arm64 Source/third_party/libaom/source/libaom Source/third_party/libaom/source/config;
17+
HEADER_SEARCH_PATHS[arch=arm64*] = Source/third_party/libaom/source/config/linux/arm64-cpu-detect Source/third_party/libaom/source/libaom Source/third_party/libaom/source/config;
1818

1919
INSTALL_PATH = $(INSTALL_PATH_PREFIX)$(WK_LIBRARY_INSTALL_PATH);
2020
PUBLIC_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/libwebrtc;
@@ -26,12 +26,13 @@ GCC_PREPROCESSOR_DEFINITIONS[sdk=iphonesimulator*] = $(inherited);
2626
GCC_PREPROCESSOR_DEFINITIONS[sdk=macosx*] = $(inherited) $(GCC_PREPROCESSOR_DEFINITIONS_$(WK_IS_CATALYST))
2727
GCC_PREPROCESSOR_DEFINITIONS_YES = WEBRTC_WEBKIT_MAC_CATALIST
2828

29-
ARM_FILES = *_neon.c arm_cpudetect.c *_arm.c
29+
ARM_FILES = *_neon.c arm_cpudetect.c *_arm.c hash_arm_crc32.c *_neon_dotprod.c *_neon.c
3030
X86_FILES = *_sse2.c *_ssse3.c *_sse4.c *_avx2.c *_avx2.cc *_avx.c *.asm
3131

3232
EXCLUDED_SOURCE_FILE_NAMES[arch=x86_64] = $(ARM_FILES) $(EXCLUDED_SOURCE_FILE_NAMES_$(WK_IS_CATALYST));
3333
EXCLUDED_SOURCE_FILE_NAMES_YES = *_sse4.c *_avx.c;
3434
EXCLUDED_SOURCE_FILE_NAMES[arch=arm64*] = $(X86_FILES) *_mmx.c
3535
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*][arch=x86_64] = $(ARM_FILES) $(X86_FILES)
36+
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*] = $(X86_FILES) *_mmx.c hash_arm_crc32.c *_neon_dotprod.c
3637

3738
OTHER_LDFLAGS = $(inherited) $(SOURCE_VERSION_LDFLAGS);

Source/ThirdParty/libwebrtc/Source/third_party/libaom/BUILD.gn

Lines changed: 101 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import("//build/config/arm.gni")
88
import("//build/config/sanitizers/sanitizers.gni")
99
import("//testing/libfuzzer/fuzzer_test.gni")
1010
import("//third_party/libaom/libaom_srcs.gni")
11+
import("//third_party/libaom/libaom_test_srcs.gni")
1112
import("//third_party/libaom/options.gni")
1213
import("//third_party/nasm/nasm_assemble.gni")
1314

@@ -36,6 +37,8 @@ if (current_cpu == "x86") {
3637
} else {
3738
cpu_arch_full = "arm"
3839
}
40+
} else if (current_cpu == "arm64") {
41+
cpu_arch_full = "arm64-cpu-detect"
3942
} else if (current_cpu == "riscv64") {
4043
cpu_arch_full = "generic"
4144
} else if (current_cpu == "loong64") {
@@ -47,10 +50,8 @@ if (current_cpu == "x86") {
4750
if (is_nacl) {
4851
platform_include_dir = "source/config/linux/generic"
4952
} else {
50-
if (is_ios && current_cpu == "arm") {
51-
os_category = current_os
52-
} else if (is_posix || is_fuchsia) {
53-
# Should cover linux, fuchsia, mac, and the ios simulator.
53+
if (is_posix || is_fuchsia) {
54+
# Should cover linux, fuchsia, mac, and ios.
5455
os_category = "linux"
5556
} else { # This should only match windows.
5657
os_category = current_os
@@ -208,7 +209,47 @@ if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
208209
}
209210
}
210211

212+
if (current_cpu == "arm64") {
213+
source_set("libaom_intrinsics_arm_crc32") {
214+
check_includes = false
215+
configs -= [ "//build/config/compiler:chromium_code" ]
216+
configs += [ "//build/config/compiler:no_chromium_code" ]
217+
configs += [ ":libaom_config" ]
218+
if (!is_win || is_clang) {
219+
cflags = [ "-march=armv8-a+crc" ]
220+
}
221+
sources = aom_av1_encoder_intrin_arm_crc32
222+
}
223+
224+
source_set("libaom_intrinsics_neon_dotprod") {
225+
check_includes = false
226+
configs -= [ "//build/config/compiler:chromium_code" ]
227+
configs += [ "//build/config/compiler:no_chromium_code" ]
228+
configs += [ ":libaom_config" ]
229+
if (!is_win || is_clang) {
230+
cflags = [ "-march=armv8.2-a+dotprod" ]
231+
}
232+
sources = aom_av1_common_intrin_neon_dotprod
233+
sources += aom_dsp_common_intrin_neon_dotprod
234+
sources += aom_av1_encoder_intrin_neon_dotprod
235+
sources += aom_dsp_encoder_intrin_neon_dotprod
236+
}
237+
238+
source_set("libaom_intrinsics_neon_i8mm") {
239+
check_includes = false
240+
configs -= [ "//build/config/compiler:chromium_code" ]
241+
configs += [ "//build/config/compiler:no_chromium_code" ]
242+
configs += [ ":libaom_config" ]
243+
if (!is_win || is_clang) {
244+
cflags = [ "-march=armv8.2-a+dotprod+i8mm" ]
245+
}
246+
sources = aom_av1_common_intrin_neon_i8mm
247+
sources += aom_dsp_common_intrin_neon_i8mm
248+
}
249+
}
250+
211251
static_library("libaom") {
252+
check_includes = false
212253
if (!is_debug && is_win) {
213254
configs -= [ "//build/config/compiler:default_optimization" ]
214255
configs += [ "//build/config/compiler:optimize_max" ]
@@ -258,13 +299,21 @@ static_library("libaom") {
258299
cpu_arch_full == "arm-neon-cpu-detect") {
259300
deps += [ ":libaom_intrinsics_neon" ]
260301
}
261-
if (current_cpu == "arm64" || current_cpu == "arm") {
302+
if (current_cpu == "arm64") {
262303
# This is needed by all arm boards due to aom_arm_cpu_caps()
263-
sources +=
264-
[ "//third_party/libaom/source/libaom/aom_ports/arm_cpudetect.c" ]
304+
sources += [ "source/libaom/aom_ports/aarch64_cpudetect.c" ]
305+
deps += [
306+
":libaom_intrinsics_arm_crc32",
307+
":libaom_intrinsics_neon_dotprod",
308+
":libaom_intrinsics_neon_i8mm",
309+
]
310+
}
311+
if (current_cpu == "arm") {
312+
# This is needed by all arm boards due to aom_arm_cpu_caps()
313+
sources += [ "source/libaom/aom_ports/aarch32_cpudetect.c" ]
265314
}
266315
if (is_android) {
267-
deps += [ "//third_party/android_ndk:cpu_features" ]
316+
deps += [ "//third_party/cpu_features:ndk_compat" ]
268317
}
269318
public_configs = [ ":libaom_external_config" ]
270319
public_deps = [ ":libaom_buildflags" ]
@@ -294,3 +343,47 @@ fuzzer_test("libaom_av1_dec_fuzzer") {
294343
deps = [ ":libaom" ]
295344
additional_configs = [ ":libaom_config" ]
296345
}
346+
347+
config("test_libaom_config") {
348+
include_dirs = [ "//third_party/libaom/source/libaom/third_party/libwebm" ]
349+
}
350+
351+
test("test_libaom") {
352+
sources = aom_libwebm_sources
353+
sources += aom_webm_decoder_sources
354+
sources += aom_webm_encoder_sources
355+
sources += aom_common_app_util_sources
356+
sources += aom_decoder_app_util_sources
357+
sources += aom_encoder_app_util_sources
358+
sources += aom_unit_test_common_sources
359+
sources += aom_unit_test_decoder_sources
360+
sources += aom_unit_test_encoder_sources
361+
sources += aom_unit_test_wrapper_sources
362+
sources += [ "source/gen_src/usage_exit.c" ]
363+
364+
deps = [
365+
":libaom",
366+
"//third_party/googletest:gtest",
367+
]
368+
369+
defines = [ "CHROMIUM" ]
370+
371+
if (is_android) {
372+
use_raw_android_executable = true
373+
defines += [ "LIBAOM_TEST_DATA_PATH=/data/local/tmp/chromium_tests_root/third_party/libaom/testdata" ]
374+
data = [ "testdata/" ]
375+
} else {
376+
defines += [ string_join("",
377+
[
378+
"LIBAOM_TEST_DATA_PATH=",
379+
rebase_path("testdata", root_build_dir),
380+
]) ]
381+
}
382+
383+
configs -= [ "//build/config/compiler:chromium_code" ]
384+
configs += [
385+
"//build/config/compiler:no_chromium_code",
386+
":libaom_config",
387+
":test_libaom_config",
388+
]
389+
}

Source/ThirdParty/libwebrtc/Source/third_party/libaom/OWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
jzern@chromium.org
33
jzern@google.com
44
wtc@google.com
5+
6+
# Secondary OWNERS
7+
dalecurtis@chromium.org
8+
eugene@chromium.org

Source/ThirdParty/libwebrtc/Source/third_party/libaom/README.chromium

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Name: Alliance for Open Media Video Codec
22
Short Name: libaom
33
URL: https://aomedia.googlesource.com/aom/
4-
Version: 0
5-
Date: Wednesday May 10 2023
6-
Revision: 5f516275fb8761562bd877f2a8f185cd76c2a274
7-
CPEPrefix: cpe:/a:aomedia:aomedia:3.6.0
4+
Version: N/A
5+
Revision: 1dbe1c7fae2456f91ccc79fecb919e9ffea0727a
6+
CPEPrefix: cpe:/a:aomedia:aomedia:3.6.1
87
License: BSD
98
License File: source/libaom/LICENSE
109
Security Critical: yes
10+
Shipped: yes
1111

1212
Description:
1313
Provides tools for:
@@ -40,7 +40,7 @@ after running roll_dep.py.
4040
./cmake_update.sh
4141

4242
This will also update this file with the new revision.
43-
Update 'Version' and 'CPEPrefix' in this file if necessary.
43+
Update 'Revision' and 'CPEPrefix' in this file if necessary.
4444

4545
3. Amend the commit created by the first step:
4646

Source/ThirdParty/libwebrtc/Source/third_party/libaom/cmake_update.sh

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
# - gcc-aarch64-linux-gnu
2323
# - g++-aarch64-linux-gnu
2424
# 32bit build environment for cmake. Including but potentially not limited to:
25-
# - lib32gcc-12-dev
26-
# - lib32stdc++-12-dev
25+
# - lib32gcc-13-dev
26+
# - lib32stdc++-13-dev
2727
# Alternatively: treat 32bit builds like Windows and manually tweak aom_config.h
2828

2929
set -eE
@@ -80,21 +80,15 @@ function gen_config_files() {
8080
}
8181

8282
function update_readme() {
83-
local IFS=$'\n'
84-
# Split git log output '<date>\n<commit hash>' on the newline to produce 2
85-
# array entries.
86-
local vals=($(git -C "${SRC}" --no-pager log -1 --format="%cd%n%H" \
87-
--date=format:"%A %B %d %Y"))
83+
local revision=$(git -C "${SRC}" --no-pager log -1 --format="%H")
8884
sed -E -i.bak \
89-
-e "s/^(Date:)[[:space:]]+.*$/\1 ${vals[0]}/" \
90-
-e "s/^(Revision:)[[:space:]]+[a-f0-9]{40}/\1 ${vals[1]}/" \
85+
-e "s/^(Revision:)[[:space:]]+[a-f0-9]{40}/\1 ${revision}/" \
9186
${BASE}/README.chromium
9287
rm ${BASE}/README.chromium.bak
9388
cat <<EOF
9489
9590
README.chromium updated with:
96-
Date: ${vals[0]}
97-
Revision: ${vals[1]}
91+
Revision: ${revision}
9892
EOF
9993
}
10094

@@ -143,8 +137,11 @@ gen_config_files linux/generic "-DAOM_TARGET_CPU=generic ${all_platforms}"
143137
# Strip .pl files from gni
144138
sed -i.bak '/\.pl",$/d' libaom_srcs.gni
145139
rm libaom_srcs.gni.bak
146-
# libaom_srcs.gni and aom_version.h are shared.
140+
# libaom_srcs.gni, libaom_test_srcs.gni, usage_exit.c
141+
# and aom_version.h are shared.
147142
cp libaom_srcs.gni "${BASE}"
143+
cp libaom_test_srcs.gni "${BASE}"
144+
cp gen_src/usage_exit.c "${BASE}/source/gen_src"
148145
cp config/aom_version.h "${CFG}/config/"
149146

150147
reset_dirs linux/ia32
@@ -177,34 +174,24 @@ gen_config_files linux/arm \
177174

178175
reset_dirs linux/arm-neon
179176
gen_config_files linux/arm-neon \
180-
"${toolchain}/armv7-linux-gcc.cmake ${all_platforms}"
177+
"${toolchain}/armv7-linux-gcc.cmake -DCONFIG_RUNTIME_CPU_DETECT=0 \
178+
${all_platforms}"
181179

182180
reset_dirs linux/arm-neon-cpu-detect
183181
gen_config_files linux/arm-neon-cpu-detect \
184182
"${toolchain}/armv7-linux-gcc.cmake -DCONFIG_RUNTIME_CPU_DETECT=1 \
185183
${all_platforms}"
186184

187-
reset_dirs linux/arm64
188-
gen_config_files linux/arm64 \
189-
"${toolchain}/arm64-linux-gcc.cmake ${all_platforms}"
190-
191-
# CMAKE_INSTALL_NAME_TOOL is set to a non-empty/true value to allow this
192-
# configuration to complete on platforms without `install_name`. The build
193-
# commands are not invoked so the value doesn't matter.
194-
reset_dirs ios/arm-neon
195-
gen_config_files ios/arm-neon \
196-
"${toolchain}/armv7-ios.cmake -DCMAKE_INSTALL_NAME_TOOL=no-such-command \
197-
${all_platforms}"
198-
199-
reset_dirs ios/arm64
200-
gen_config_files ios/arm64 \
201-
"${toolchain}/arm64-ios.cmake -DCMAKE_INSTALL_NAME_TOOL=no-such-command \
185+
reset_dirs linux/arm64-cpu-detect
186+
gen_config_files linux/arm64-cpu-detect \
187+
"${toolchain}/arm64-linux-gcc.cmake -DCONFIG_RUNTIME_CPU_DETECT=1 \
202188
${all_platforms}"
203189

204190
# Copy linux configurations and modify for Windows.
205-
reset_dirs win/arm64
206-
cp "${CFG}/linux/arm64/config"/* "${CFG}/win/arm64/config/"
207-
convert_to_windows "${CFG}/win/arm64/config/aom_config.h"
191+
reset_dirs win/arm64-cpu-detect
192+
cp "${CFG}/linux/arm64-cpu-detect/config"/* \
193+
"${CFG}/win/arm64-cpu-detect/config/"
194+
convert_to_windows "${CFG}/win/arm64-cpu-detect/config/aom_config.h"
208195
)
209196

210197
update_readme

0 commit comments

Comments
 (0)