Skip to content

Commit

Permalink
Update libvpx up to M120
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265864
rdar://119184902

Reviewed by Alex Christensen.

* Source/ThirdParty/libwebrtc/Configurations/Base-libvpx.xcconfig:
* Source/ThirdParty/libwebrtc/Configurations/libvpx.xcconfig:
* Source/ThirdParty/libwebrtc/Source/third_party/libvpx: Resynced.
* Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/271870@main
  • Loading branch information
youennf committed Dec 11, 2023
1 parent 53b35aa commit 9a7b50c
Show file tree
Hide file tree
Showing 652 changed files with 104,280 additions and 31,622 deletions.
9 changes: 5 additions & 4 deletions Source/ThirdParty/libwebrtc/Configurations/libvpx.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ PRODUCT_NAME = vpx;
INSTALL_PATH = $(INSTALL_PATH_PREFIX)$(WK_LIBRARY_INSTALL_PATH);
PUBLIC_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/libwebrtc;

ARM_FILES = *_neon.c arm_cpudetect.c *_arm.c
ARM_FILES = *_neon.c arm_cpudetect.c *_arm.c *_neon.c *_neon_dotprod.c *_neon_asm.asm *_neon.asm
X86_FILES = *_sse2.c *_ssse3.c *_sse4.c *_avx2.c *_avx2.cc *_avx.c *.asm

EXCLUDED_SOURCE_FILE_NAMES[arch=x86_64] = $(ARM_FILES) $(EXCLUDED_SOURCE_FILE_NAMES_$(WK_IS_CATALYST));
EXCLUDED_SOURCE_FILE_NAMES_YES = *_sse4.c *_avx.c;
EXCLUDED_SOURCE_FILE_NAMES[arch=arm64*] = $(X86_FILES) *_mmx.c vp9_temporal_filter.c
EXCLUDED_SOURCE_FILE_NAMES[arch=x86_64] = $(ARM_FILES) $(EXCLUDED_SOURCE_FILE_NAMES_$(WK_IS_CATALYST))
EXCLUDED_SOURCE_FILE_NAMES_YES = *_sse4.c *_avx.c
EXCLUDED_SOURCE_FILE_NAMES[arch=arm64*] = $(X86_FILES) *_mmx.c
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*][arch=x86_64] = $(ARM_FILES) $(X86_FILES)
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*] = $(X86_FILES) *_mmx.c *_neon_dotprod.c

OTHER_LDFLAGS = $(inherited) $(SOURCE_VERSION_LDFLAGS);
168 changes: 121 additions & 47 deletions Source/ThirdParty/libwebrtc/Source/third_party/libvpx/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/android/config.gni")
import("//build/config/arm.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/ios/config.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//third_party/libvpx/libvpx_srcs.gni")
import("//third_party/nasm/nasm_assemble.gni")
Expand All @@ -20,7 +19,7 @@ if (current_cpu == "x86") {
cpu_arch_full = "x64"
}
} else if (current_cpu == "arm") {
if (is_chromeos_ash) {
if (is_chromeos) {
# ChromeOS gets highbd vp9 but other arm targets do not.
cpu_arch_full = "arm-neon-highbd"
} else if (arm_use_neon) {
Expand All @@ -31,11 +30,18 @@ if (current_cpu == "x86") {
cpu_arch_full = "arm"
}
} else if (current_cpu == "arm64") {
if (is_chromeos_ash || is_mac) {
if (is_win || is_chromeos || is_mac) {
# This is necessary for CrOS and macOS as they reuse the Linux
# configuration, of which there are two (see the later definition of
# os_category).
cpu_arch_full = "arm64-highbd"
} else {
cpu_arch_full = current_cpu
}
} else if (current_cpu == "riscv64") {
cpu_arch_full = "generic"
} else if (current_cpu == "loong64") {
cpu_arch_full = "loongarch"
} else {
cpu_arch_full = current_cpu
}
Expand Down Expand Up @@ -81,16 +87,6 @@ config("libvpx_config") {
# libvpx has many static functions in header, which trigger this warning.
"-Wno-unused-function",
]

# Fixes a mac / ios simulator link error for vpx_scaled_2d:
# Undefined symbols for architecture x86_64:
# "_vpx_scaled_2d", referenced from:
# _vp9_scale_and_extend_frame_c in libvpx.a(vp9_frame_scale.o)
# (maybe you meant: _vpx_scaled_2d_ssse3)
# ld: symbol(s) not found for architecture x86_64
if (is_mac || (is_ios && (current_cpu == "x86" || current_cpu == "x64"))) {
cflags += [ "-fno-common" ]
}
} else if (!is_win) {
cflags = [
"-Wno-unused-function",
Expand Down Expand Up @@ -256,13 +252,78 @@ if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
}
}

if (cpu_arch_full == "arm-neon-cpu-detect") {
static_library("libvpx_intrinsics_neon") {
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
if (current_cpu == "loong64") {
source_set("libvpx_loongarch_lsx") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":libvpx_config" ]
cflags = [ "-mlsx" ]
sources = libvpx_srcs_loongarch_lsx
}
}

if (current_cpu == "arm" || current_cpu == "arm64") {
source_set("libvpx_intrinsics_neon") {
check_includes = false
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":libvpx_config" ]
if (current_cpu == "arm") {
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
if (cpu_arch_full == "arm-neon") {
sources = libvpx_srcs_arm_neon_neon
deps = [ ":libvpx_arm_neon_headers" ]
} else if (cpu_arch_full == "arm-neon-highbd") {
sources = libvpx_srcs_arm_neon_highbd_neon
deps = [ ":libvpx_arm_neon_highbd_headers" ]
} else if (cpu_arch_full == "arm-neon-cpu-detect") {
sources = libvpx_srcs_arm_neon_cpu_detect_neon
deps = [ ":libvpx_arm_neon_cpu_detect_headers" ]
} else if (cpu_arch_full == "arm64") {
sources = libvpx_srcs_arm64_neon
deps = [ ":libvpx_arm64_headers" ]
} else if (cpu_arch_full == "arm64-highbd") {
sources = libvpx_srcs_arm64_highbd_neon
deps = [ ":libvpx_arm64_highbd_headers" ]
}
}
}

if (current_cpu == "arm64") {
source_set("libvpx_intrinsics_neon_dotprod") {
check_includes = false
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":libvpx_config" ]
if (!is_win || is_clang) {
cflags = [ "-march=armv8.2-a+dotprod" ]
}
if (cpu_arch_full == "arm64") {
sources = libvpx_srcs_arm64_neon_dotprod
deps = [ ":libvpx_arm64_headers" ]
} else if (cpu_arch_full == "arm64-highbd") {
sources = libvpx_srcs_arm64_highbd_neon_dotprod
deps = [ ":libvpx_arm64_highbd_headers" ]
}
}

source_set("libvpx_intrinsics_neon_i8mm") {
check_includes = false
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":libvpx_config" ]
cflags = [ "-mfpu=neon" ]
sources = libvpx_srcs_arm_neon_cpu_detect_neon
deps = [ ":libvpx_arm_neon_cpu_detect_headers" ]
if (!is_win || is_clang) {
cflags = [ "-march=armv8.2-a+i8mm" ]
}
if (cpu_arch_full == "arm64") {
sources = libvpx_srcs_arm64_neon_i8mm
deps = [ ":libvpx_arm64_headers" ]
} else if (cpu_arch_full == "arm64-highbd") {
sources = libvpx_srcs_arm64_highbd_neon_i8mm
deps = [ ":libvpx_arm64_highbd_headers" ]
}
}
}

Expand Down Expand Up @@ -329,6 +390,10 @@ source_set("libvpx_x86_64_headers") {
sources = libvpx_srcs_x86_64_headers
}

source_set("libvpx_loongarch_headers") {
sources = libvpx_srcs_loongarch_headers
}

source_set("libvpx_arm_headers") {
sources = libvpx_srcs_arm_headers
}
Expand Down Expand Up @@ -371,15 +436,7 @@ static_library("libvpx") {
configs += [ "//build/config/compiler:optimize_max" ]
}

# As "nasm" does not embed the required LC_BUILD_VERSION section in object
# files, it is not possible to build optimised version of the code if the
# target is iOS under "catalyst" environment. This version is not shipped,
# so there is no concern about performance.
# TODO(crbug.com/1145197): Remove this exception once "nasm" has support
# for embedding the correct LD_BUILD_VERSION section.
_force_generic_srcs = is_ios && target_environment == "catalyst"

if (is_nacl || _force_generic_srcs) {
if (is_nacl) {
sources = libvpx_srcs_generic
public_deps = [ ":libvpx_generic_headers" ]
} else if (current_cpu == "x86") {
Expand All @@ -397,7 +454,7 @@ static_library("libvpx") {
sources = libvpx_srcs_mips
public_deps = [ ":libvpx_mips_headers" ]
} else if (current_cpu == "arm") {
if (is_chromeos_ash) {
if (is_chromeos) {
sources = libvpx_srcs_arm_neon_highbd
public_deps = [ ":libvpx_arm_neon_highbd_headers" ]
} else if (arm_use_neon) {
Expand All @@ -411,55 +468,72 @@ static_library("libvpx") {
public_deps = [ ":libvpx_arm_headers" ]
}
} else if (current_cpu == "arm64") {
if (is_chromeos_ash || is_win || is_mac) {
if (is_chromeos || is_win || is_mac) {
sources = libvpx_srcs_arm64_highbd
public_deps = [ ":libvpx_arm64_highbd_headers" ]
} else {
sources = libvpx_srcs_arm64
public_deps = [ ":libvpx_arm64_headers" ]
}
} else if (current_cpu == "ppc64") {
sources = libvpx_srcs_ppc64
} else if (current_cpu == "riscv64") {
sources = libvpx_srcs_generic
public_deps = [ ":libvpx_generic_headers" ]
} else if (current_cpu == "loong64") {
sources = libvpx_srcs_loongarch
public_deps = [ ":libvpx_loongarch_headers" ]
}

configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":libvpx_config" ]
deps = []
if (!_force_generic_srcs) {
if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
deps += [
":libvpx_asm",
":libvpx_intrinsics_avx",
":libvpx_intrinsics_avx2",
":libvpx_intrinsics_avx512",
":libvpx_intrinsics_mmx",
":libvpx_intrinsics_sse2",
":libvpx_intrinsics_sse4_1",
":libvpx_intrinsics_ssse3",
]
}
if (current_cpu == "x86" || (current_cpu == "x64" && !is_msan)) {
deps += [
":libvpx_asm",
":libvpx_intrinsics_avx",
":libvpx_intrinsics_avx2",
":libvpx_intrinsics_avx512",
":libvpx_intrinsics_mmx",
":libvpx_intrinsics_sse2",
":libvpx_intrinsics_sse4_1",
":libvpx_intrinsics_ssse3",
]
}
if (cpu_arch_full == "arm-neon-cpu-detect") {
if (cpu_arch_full == "arm-neon-highbd" || cpu_arch_full == "arm-neon" ||
cpu_arch_full == "arm-neon-cpu-detect" || current_cpu == "arm64") {
deps += [ ":libvpx_intrinsics_neon" ]
}
if (current_cpu == "arm64") {
deps += [ ":libvpx_intrinsics_neon_dotprod" ]
deps += [ ":libvpx_intrinsics_neon_i8mm" ]
}
if (is_android) {
deps += [ "//third_party/android_ndk:cpu_features" ]
deps += [ "//third_party/cpu_features:ndk_compat" ]
}
if (current_cpu == "arm" && arm_assembly_sources != []) {
deps += [ ":libvpx_assembly_arm" ]
}
if (current_cpu == "loong64") {
deps += [ ":libvpx_loongarch_lsx" ]
}

public_configs = [ ":libvpx_external_config" ]
}

static_library("libvp9rc") {
static_library("libvpxrc") {
if (!is_debug && is_win) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}

sources = [
"//third_party/libvpx/source/libvpx/vp8/vp8_ratectrl_rtc.cc",
"//third_party/libvpx/source/libvpx/vp8/vp8_ratectrl_rtc.h",
"//third_party/libvpx/source/libvpx/vp9/ratectrl_rtc.cc",
"//third_party/libvpx/source/libvpx/vp9/ratectrl_rtc.h",
"//third_party/libvpx/source/libvpx/vpx/internal/vpx_ratectrl_rtc.h",
]

configs -= [ "//build/config/compiler:chromium_code" ]
Expand Down
8 changes: 6 additions & 2 deletions Source/ThirdParty/libwebrtc/Source/third_party/libvpx/OWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
tomfinegan@chromium.org
johannkoenig@google.com
# Primary OWNERS
jzern@chromium.org
jzern@google.com
wtc@google.com

# Secondary OWNERS
dalecurtis@chromium.org
eugene@chromium.org
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
Name: libvpx
URL: http://www.webmproject.org
Version: v1.8.2
CPEPrefix: cpe:/a:john_koleszar:libvpx:1.8.2
URL: https://chromium.googlesource.com/webm/libvpx
Version: N/A
Revision: 424723dc025ce451dab9568239a46b18d0919b4d
CPEPrefix: cpe:/a:webmproject:libvpx:1.13.1
License: BSD
License File: source/libvpx/LICENSE
Security Critical: yes

Date: Friday January 29 2021
Branch: master
Commit: 61edec1efbea1c02d71857e2aff9426d9cd2df4e
Shipped: yes

Description:
Contains the sources used to compile libvpx binaries used by Google Chrome and
Chromium.

The libvpx source is from webmproject.org:
http://www.webmproject.org/code/
https://chromium.googlesource.com/webm/libvpx
https://www.webmproject.org/code/

Please follow these steps to update libvpx source code:

Expand All @@ -34,11 +31,11 @@ Please follow these steps to update libvpx source code:
cd third_party/libvpx
./generate_gni.sh

Amend the commit created by the first step:
Update 'Revision' and 'CPEPrefix' in this file if necessary.

git commit -a --amend
3. Amend the commit created by the first step:

3. Update 'Branch' in README.chromium if necessary.
git commit -a --amend

4. Upload the change to Gerrit:

Expand Down
Loading

0 comments on commit 9a7b50c

Please sign in to comment.