bromite/build/patches/openH264-enable-ARM-ARM64-optimizations.patch
2021-01-26 01:12:38 +01:00

77 lines
2.5 KiB
Diff

From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 20 Jan 2018 21:17:27 +0100
Subject: openH264: enable ARM/ARM64 optimizations
Enable the optimizations not only for ChromeOS but for all compatbile ARM/ARM64 architectures
Limit threads auto-detect only for iOS
---
.../modules/mediarecorder/h264_encoder.cc | 6 +++---
third_party/openh264/BUILD.gn | 18 +++++++++++++++---
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/third_party/blink/renderer/modules/mediarecorder/h264_encoder.cc b/third_party/blink/renderer/modules/mediarecorder/h264_encoder.cc
--- a/third_party/blink/renderer/modules/mediarecorder/h264_encoder.cc
+++ b/third_party/blink/renderer/modules/mediarecorder/h264_encoder.cc
@@ -154,11 +154,11 @@ void H264Encoder::ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) {
init_params.iRCMode = RC_OFF_MODE;
}
-#if BUILDFLAG(IS_ASH)
- init_params.iMultipleThreadIdc = 0;
-#else
+#if BUILDFLAG(OS_MACOSX)
// Threading model: Set to 1 due to https://crbug.com/583348.
init_params.iMultipleThreadIdc = 1;
+#else
+ init_params.iMultipleThreadIdc = 0;
#endif
// TODO(mcasas): consider reducing complexity if there are few CPUs available.
diff --git a/third_party/openh264/BUILD.gn b/third_party/openh264/BUILD.gn
--- a/third_party/openh264/BUILD.gn
+++ b/third_party/openh264/BUILD.gn
@@ -132,8 +132,12 @@ if (use_assembler) {
source_set("common") {
sources = openh264_common_sources
- if (is_ash && current_cpu == "arm") {
+ if (is_ash || is_android) {
+ if (current_cpu == "arm") {
sources += openh264_common_sources_asm_arm
+ } else if (current_cpu == "arm64") {
+ sources += openh264_common_sources_asm_arm64
+ }
}
include_dirs = openh264_common_include_dirs
@@ -158,8 +162,12 @@ source_set("common") {
source_set("processing") {
sources = openh264_processing_sources
- if (is_ash && current_cpu == "arm") {
+ if (is_ash || is_android) {
+ if (current_cpu == "arm") {
sources += openh264_processing_sources_asm_arm
+ } else {
+ sources += openh264_processing_sources_asm_arm64
+ }
}
include_dirs = openh264_processing_include_dirs
@@ -175,8 +183,12 @@ source_set("processing") {
source_set("encoder") {
sources = openh264_encoder_sources
- if (is_ash && current_cpu == "arm") {
+ if (is_ash || is_android) {
+ if (current_cpu == "arm") {
sources += openh264_encoder_sources_asm_arm
+ } else {
+ sources += openh264_encoder_sources_asm_arm64
+ }
}
include_dirs = openh264_encoder_include_dirs
--
2.17.1