update libyuv to hash bcd8238 from https://chromium.googlesource.com/libyuv/libyuv/
parent
d6bf6705de
commit
93591e2f47
|
@ -53,6 +53,12 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
|||
source/scale_neon.cc.neon
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),mips)
|
||||
LOCAL_CFLAGS += -DLIBYUV_MSA
|
||||
LOCAL_SRC_FILES += \
|
||||
source/row_msa.cc
|
||||
endif
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
|
||||
|
||||
|
|
|
@ -6,19 +6,20 @@
|
|||
# in the file PATENTS. All contributing project authors may
|
||||
# be found in the AUTHORS file in the root of the source tree.
|
||||
|
||||
import("//build/config/arm.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("libyuv.gni")
|
||||
import("//testing/test.gni")
|
||||
|
||||
config("libyuv_config") {
|
||||
include_dirs = [
|
||||
".",
|
||||
"include",
|
||||
]
|
||||
include_dirs = [ "include" ]
|
||||
if (is_android && current_cpu=="arm64") {
|
||||
ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker64" ]
|
||||
}
|
||||
if (is_android && current_cpu != "arm64") {
|
||||
ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker" ]
|
||||
}
|
||||
}
|
||||
|
||||
use_neon = current_cpu == "arm64" || (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon))
|
||||
|
||||
source_set("libyuv") {
|
||||
static_library("libyuv") {
|
||||
sources = [
|
||||
# Headers
|
||||
"include/libyuv.h",
|
||||
|
@ -79,31 +80,24 @@ source_set("libyuv") {
|
|||
"source/video_common.cc",
|
||||
]
|
||||
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
|
||||
public_configs = [ ":libyuv_config" ]
|
||||
|
||||
defines = []
|
||||
deps = []
|
||||
|
||||
if (!is_ios) {
|
||||
defines += [ "HAVE_JPEG" ]
|
||||
deps += [ "//third_party:jpeg" ]
|
||||
}
|
||||
|
||||
if (is_msan) {
|
||||
# MemorySanitizer does not support assembly code yet.
|
||||
# http://crbug.com/344505
|
||||
defines += [ "LIBYUV_DISABLE_X86" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
"//third_party:jpeg",
|
||||
]
|
||||
|
||||
if (use_neon) {
|
||||
if (libyuv_use_neon) {
|
||||
deps += [ ":libyuv_neon" ]
|
||||
}
|
||||
|
||||
if (libyuv_use_msa) {
|
||||
deps += [ ":libyuv_msa" ]
|
||||
}
|
||||
|
||||
if (is_nacl) {
|
||||
# Always enable optimization under NaCl to workaround crbug.com/538243 .
|
||||
configs -= [ "//build/config/compiler:default_optimization" ]
|
||||
|
@ -111,7 +105,7 @@ source_set("libyuv") {
|
|||
}
|
||||
}
|
||||
|
||||
if (use_neon) {
|
||||
if (libyuv_use_neon) {
|
||||
static_library("libyuv_neon") {
|
||||
sources = [
|
||||
# ARM Source Files
|
||||
|
@ -133,3 +127,147 @@ if (use_neon) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (libyuv_use_msa) {
|
||||
static_library("libyuv_msa") {
|
||||
sources = [
|
||||
# MSA Source Files
|
||||
"source/row_msa.cc",
|
||||
]
|
||||
|
||||
public_configs = [ ":libyuv_config" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (libyuv_include_tests) {
|
||||
config("libyuv_unittest_warnings_config") {
|
||||
if (!is_win) {
|
||||
cflags = [
|
||||
# TODO(fbarchard): Fix sign and unused variable warnings.
|
||||
"-Wno-sign-compare",
|
||||
"-Wno-unused-variable"
|
||||
]
|
||||
}
|
||||
if (is_win) {
|
||||
cflags = [
|
||||
"/wd4245", # signed/unsigned mismatch
|
||||
"/wd4189", # local variable is initialized but not referenced
|
||||
]
|
||||
}
|
||||
}
|
||||
config("libyuv_unittest_config") {
|
||||
defines = [ "GTEST_RELATIVE_PATH" ]
|
||||
}
|
||||
|
||||
test("libyuv_unittest") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
# headers
|
||||
"unit_test/unit_test.h",
|
||||
# sources
|
||||
"unit_test/basictypes_test.cc",
|
||||
"unit_test/compare_test.cc",
|
||||
"unit_test/color_test.cc",
|
||||
"unit_test/convert_test.cc",
|
||||
"unit_test/cpu_test.cc",
|
||||
"unit_test/math_test.cc",
|
||||
"unit_test/planar_test.cc",
|
||||
"unit_test/rotate_argb_test.cc",
|
||||
"unit_test/rotate_test.cc",
|
||||
"unit_test/scale_argb_test.cc",
|
||||
"unit_test/scale_test.cc",
|
||||
"unit_test/unit_test.cc",
|
||||
"unit_test/video_common_test.cc",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":libyuv",
|
||||
"//testing/gtest",
|
||||
"//third_party/gflags",
|
||||
]
|
||||
|
||||
configs += [ ":libyuv_unittest_warnings_config" ]
|
||||
|
||||
public_deps = [ "//testing/gtest" ]
|
||||
public_configs = [ ":libyuv_unittest_config" ]
|
||||
|
||||
defines = []
|
||||
|
||||
if (is_linux) {
|
||||
cflags = [ "-fexceptions" ]
|
||||
}
|
||||
if (is_ios) {
|
||||
configs -= [ "//build/config/compiler:default_symbols" ]
|
||||
configs += [ "//build/config/compiler:symbols" ]
|
||||
cflags = [ "-Wno-sometimes-uninitialized" ]
|
||||
}
|
||||
if (!is_ios && !libyuv_disable_jpeg) {
|
||||
defines += [ "HAVE_JPEG" ]
|
||||
}
|
||||
if (is_android) {
|
||||
deps += [ "//testing/android/native_test:native_test_native_code" ]
|
||||
}
|
||||
|
||||
# TODO(YangZhang): These lines can be removed when high accuracy
|
||||
# YUV to RGB to Neon is ported.
|
||||
if ((target_cpu=="armv7" || target_cpu=="armv7s" ||
|
||||
(target_cpu=="arm" && arm_version >= 7) || target_cpu=="arm64") &&
|
||||
(arm_use_neon || arm_optionally_use_neon)) {
|
||||
defines += [ "LIBYUV_NEON" ]
|
||||
}
|
||||
|
||||
defines += [
|
||||
# Enable the following 3 macros to turn off assembly for specified CPU.
|
||||
# "LIBYUV_DISABLE_X86",
|
||||
# "LIBYUV_DISABLE_NEON",
|
||||
# "LIBYUV_DISABLE_MIPS",
|
||||
# Enable the following macro to build libyuv as a shared library (dll).
|
||||
# "LIBYUV_USING_SHARED_LIBRARY"
|
||||
]
|
||||
}
|
||||
|
||||
executable("compare") {
|
||||
sources = [
|
||||
# sources
|
||||
"util/compare.cc"
|
||||
]
|
||||
deps = [ ":libyuv" ]
|
||||
if (is_linux) {
|
||||
cflags = [ "-fexceptions" ]
|
||||
}
|
||||
}
|
||||
|
||||
executable("convert") {
|
||||
sources = [
|
||||
# sources
|
||||
"util/convert.cc"
|
||||
]
|
||||
deps = [ ":libyuv" ]
|
||||
if (is_linux) {
|
||||
cflags = [ "-fexceptions" ]
|
||||
}
|
||||
}
|
||||
|
||||
executable("psnr") {
|
||||
sources = [
|
||||
# sources
|
||||
"util/psnr_main.cc",
|
||||
"util/psnr.cc",
|
||||
"util/ssim.cc"
|
||||
]
|
||||
deps = [ ":libyuv" ]
|
||||
|
||||
if (!is_ios && !libyuv_disable_jpeg) {
|
||||
defines = [ "HAVE_JPEG" ]
|
||||
}
|
||||
}
|
||||
|
||||
executable("cpuid") {
|
||||
sources = [
|
||||
# sources
|
||||
"util/cpuid.c"
|
||||
]
|
||||
deps = [ ":libyuv" ]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ set(ly_source_files
|
|||
${ly_src_dir}/row_any.cc
|
||||
${ly_src_dir}/row_common.cc
|
||||
${ly_src_dir}/row_mips.cc
|
||||
${ly_src_dir}/row_msa.cc
|
||||
${ly_src_dir}/row_neon.cc
|
||||
${ly_src_dir}/row_neon64.cc
|
||||
${ly_src_dir}/row_gcc.cc
|
||||
|
@ -80,6 +81,7 @@ set(ly_header_files
|
|||
${ly_inc_dir}/libyuv/convert_from.h
|
||||
${ly_inc_dir}/libyuv/convert_from_argb.h
|
||||
${ly_inc_dir}/libyuv/cpu_id.h
|
||||
${ly_inc_dir}/libyuv/macros_msa.h
|
||||
${ly_inc_dir}/libyuv/planar_functions.h
|
||||
${ly_inc_dir}/libyuv/rotate.h
|
||||
${ly_inc_dir}/libyuv/rotate_argb.h
|
||||
|
|
|
@ -7,14 +7,14 @@ vars = {
|
|||
|
||||
# Roll the Chromium Git hash to pick up newer versions of all the
|
||||
# dependencies and tools linked to in setup_links.py.
|
||||
'chromium_revision': '1d144ca7f86e0c684c67d6c1b6d5414ca9074615',
|
||||
'chromium_revision': '941118827f5240dedb40082cffb1ead6c6d621cc',
|
||||
}
|
||||
|
||||
# NOTE: Prefer revision numbers to tags for svn deps. Use http rather than
|
||||
# https; the latter can cause problems for users behind proxies.
|
||||
# NOTE: Use http rather than https; the latter can cause problems for users
|
||||
# behind proxies.
|
||||
deps = {
|
||||
Var('root_dir') + '/third_party/gflags/src':
|
||||
Var('chromium_git') + '/external/gflags/src@e7390f9185c75f8d902c05ed7d20bb94eb914d0c', # from svn revision 82
|
||||
Var('chromium_git') + '/external/github.com/gflags/gflags@03bebcb065c83beff83d50ae025a55a4bf94dfca',
|
||||
}
|
||||
|
||||
# Define rules for which include paths are allowed in our source.
|
||||
|
|
|
@ -28,6 +28,9 @@ def GetPreferredTryMasters(project, change):
|
|||
'win_x64_rel',
|
||||
'win_x64_gn',
|
||||
'win_x64_gn_rel',
|
||||
'win_clang',
|
||||
'win_clang_rel',
|
||||
'win_x64_clang_rel',
|
||||
'mac',
|
||||
'mac_rel',
|
||||
'mac_gn',
|
||||
|
@ -51,6 +54,9 @@ def GetPreferredTryMasters(project, change):
|
|||
'android_rel',
|
||||
'android_clang',
|
||||
'android_arm64',
|
||||
'android_mips',
|
||||
'android_x64',
|
||||
'android_x86',
|
||||
'android_gn',
|
||||
'android_gn_rel',
|
||||
]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 1586
|
||||
Version: 1620
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
|
|
@ -13,3 +13,10 @@
|
|||
# remove this when Chromium drops 10.6 support and also requires 10.7.
|
||||
mac_sdk_min_build_override = "10.11"
|
||||
mac_deployment_target_build_override = "10.7"
|
||||
|
||||
# Variable that can be used to support multiple build scenarios, like having
|
||||
# Chromium specific targets in a client project's GN file etc.
|
||||
build_with_chromium = false
|
||||
|
||||
# Some non-Chromium builds don't support building java targets.
|
||||
enable_java_templates = true
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# Copyright (c) 2016 The LibYuv project authors. All Rights Reserved.
|
||||
#
|
||||
# Use of this source code is governed by a BSD-style license
|
||||
# that can be found in the LICENSE file in the root of the source
|
||||
# tree. An additional intellectual property rights grant can be found
|
||||
# in the file PATENTS. All contributing project authors may
|
||||
# be found in the AUTHORS file in the root of the source tree.
|
||||
|
||||
# Include support for registering main function in multi-process tests.
|
||||
gtest_include_multiprocess = true
|
||||
|
||||
# Include support for platform-specific operations across unit tests.
|
||||
gtest_include_platform_test = true
|
||||
|
||||
# Exclude support for testing Objective C code on OS X and iOS.
|
||||
gtest_include_objc_support = true
|
||||
|
||||
# Exclude support for flushing coverage files on iOS.
|
||||
gtest_include_ios_coverage = true
|
|
@ -7,6 +7,5 @@ FORCE_HTTPS_COMMIT_URL: True
|
|||
PROJECT: libyuv
|
||||
TRY_ON_UPLOAD: False
|
||||
TRYSERVER_ROOT: src
|
||||
TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-libyuv
|
||||
#GITCL_PREUPLOAD:
|
||||
#GITCL_PREDCOMMIT:
|
||||
|
|
|
@ -22,7 +22,7 @@ By default the cpu is detected and the most advanced form of SIMD is used. But
|
|||
|
||||
# Test Width/Height/Repeat
|
||||
|
||||
The unittests default to a small image (32x18) to run fast. This can be set by environment variable to test a specific resolutions.
|
||||
The unittests default to a small image (128x72) to run fast. This can be set by environment variable to test a specific resolutions.
|
||||
You can also repeat the test a specified number of iterations, allowing benchmarking and profiling.
|
||||
|
||||
set LIBYUV_WIDTH=1280
|
||||
|
|
|
@ -102,6 +102,15 @@ The following is extracted from video_common.h as a complete list of formats sup
|
|||
// 1 Auxiliary compressed YUV format set aside for capturer.
|
||||
FOURCC_H264 = FOURCC('H', '2', '6', '4'),
|
||||
|
||||
# Planar YUV
|
||||
The following formats contains a full size Y plane followed by 1 or 2
|
||||
planes for UV: I420, I422, I444, I411, I400, NV21, NV12, I400
|
||||
The size (subsampling) of the UV varies.
|
||||
I420, NV12 and NV21 are half width, half height
|
||||
I422, NV16 and NV61 are half width, full height
|
||||
I444, NV24 and NV42 are full width, full height
|
||||
I400 and J400 have no chroma channel.
|
||||
|
||||
# The ARGB FOURCC
|
||||
|
||||
There are 4 ARGB layouts - ARGB, BGRA, ABGR and RGBA. ARGB is most common by far, used for screen formats, and windows webcam drivers.
|
||||
|
|
|
@ -55,6 +55,7 @@ Then run:
|
|||
gclient sync
|
||||
|
||||
Caveat: Theres an error with Google Play services updates. If you get the error "Your version of the Google Play services library is not up to date", run the following:
|
||||
|
||||
cd chromium/src
|
||||
./build/android/play_services/update.py download
|
||||
cd ../..
|
||||
|
@ -64,6 +65,7 @@ For Windows the gclient sync must be done from an Administrator command prompt.
|
|||
The sync will generate native build files for your environment using gyp (Windows: Visual Studio, OSX: XCode, Linux: make). This generation can also be forced manually: `gclient runhooks`
|
||||
|
||||
To get just the source (not buildable):
|
||||
|
||||
git clone https://chromium.googlesource.com/libyuv/libyuv
|
||||
|
||||
|
||||
|
@ -82,8 +84,7 @@ To get just the source (not buildable):
|
|||
ninja -C out\Release_x64
|
||||
|
||||
#### Building with clangcl
|
||||
set GYP_DEFINES=clang=1 target_arch=ia32 libyuv_enable_svn=1
|
||||
set LLVM_REPO_URL=svn://svn.chromium.org/llvm-project
|
||||
set GYP_DEFINES=clang=1 target_arch=ia32
|
||||
call python tools\clang\scripts\update.py
|
||||
call python gyp_libyuv -fninja libyuv_test.gyp
|
||||
ninja -C out\Debug
|
||||
|
@ -138,29 +139,29 @@ Add to .gclient last line: `target_os=['android'];`
|
|||
armv7
|
||||
|
||||
GYP_DEFINES="OS=android" GYP_CROSSCOMPILE=1 ./gyp_libyuv
|
||||
ninja -j7 -C out/Debug libyuv_unittest_apk
|
||||
ninja -j7 -C out/Release libyuv_unittest_apk
|
||||
ninja -j7 -C out/Debug yuv_unittest_apk
|
||||
ninja -j7 -C out/Release yuv_unittest_apk
|
||||
|
||||
arm64
|
||||
|
||||
GYP_DEFINES="OS=android target_arch=arm64 target_subarch=arm64" GYP_CROSSCOMPILE=1 ./gyp_libyuv
|
||||
ninja -j7 -C out/Debug libyuv_unittest_apk
|
||||
ninja -j7 -C out/Release libyuv_unittest_apk
|
||||
ninja -j7 -C out/Debug yuv_unittest_apk
|
||||
ninja -j7 -C out/Release yuv_unittest_apk
|
||||
|
||||
ia32
|
||||
|
||||
GYP_DEFINES="OS=android target_arch=ia32" GYP_CROSSCOMPILE=1 ./gyp_libyuv
|
||||
ninja -j7 -C out/Debug libyuv_unittest_apk
|
||||
ninja -j7 -C out/Release libyuv_unittest_apk
|
||||
ninja -j7 -C out/Debug yuv_unittest_apk
|
||||
ninja -j7 -C out/Release yuv_unittest_apk
|
||||
|
||||
GYP_DEFINES="OS=android target_arch=ia32 android_full_debug=1" GYP_CROSSCOMPILE=1 ./gyp_libyuv
|
||||
ninja -j7 -C out/Debug libyuv_unittest_apk
|
||||
ninja -j7 -C out/Debug yuv_unittest_apk
|
||||
|
||||
mipsel
|
||||
|
||||
GYP_DEFINES="OS=android target_arch=mipsel" GYP_CROSSCOMPILE=1 ./gyp_libyuv
|
||||
ninja -j7 -C out/Debug libyuv_unittest_apk
|
||||
ninja -j7 -C out/Release libyuv_unittest_apk
|
||||
ninja -j7 -C out/Debug yuv_unittest_apk
|
||||
ninja -j7 -C out/Release yuv_unittest_apk
|
||||
|
||||
arm32 disassembly:
|
||||
|
||||
|
@ -180,7 +181,7 @@ Running test as benchmark:
|
|||
|
||||
Running test with C code:
|
||||
|
||||
util/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=0 --libyuv_cpu_info=0"
|
||||
util/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=1 --libyuv_cpu_info=1"
|
||||
|
||||
#### Building with GN
|
||||
|
||||
|
@ -194,6 +195,16 @@ Running test with C code:
|
|||
gn gen out/Official "--args=is_debug=false is_official_build=true is_chrome_branded=true"
|
||||
ninja -C out/Official
|
||||
|
||||
#### Building mips with GN
|
||||
|
||||
mipsel
|
||||
gn gen out/Default "--args=is_debug=false target_cpu=\"mipsel\" target_os = \"android\" mips_arch_variant = \"r6\" mips_use_msa = true is_component_build = true is_clang = false"
|
||||
ninja -C out/Default
|
||||
|
||||
mips64el
|
||||
gn gen out/Default "--args=is_debug=false target_cpu=\"mips64el\" target_os = \"android\" mips_arch_variant = \"r6\" mips_use_msa = true is_component_build = true is_clang = false"
|
||||
ninja -C out/Default
|
||||
|
||||
### Linux
|
||||
|
||||
GYP_DEFINES="target_arch=x64" ./gyp_libyuv
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_H_
|
||||
#define INCLUDE_LIBYUV_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -29,4 +29,4 @@
|
|||
#include "libyuv/version.h"
|
||||
#include "libyuv/video_common.h"
|
||||
|
||||
#endif // INCLUDE_LIBYUV_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_H_
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_
|
||||
#define INCLUDE_LIBYUV_BASIC_TYPES_H_
|
||||
|
||||
#include <stddef.h> // for NULL, size_t
|
||||
|
||||
#if defined(__ANDROID__) || (defined(_MSC_VER) && (_MSC_VER < 1600))
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
#include <sys/types.h> // for uintptr_t on x86
|
||||
#else
|
||||
#include <stdint.h> // for uintptr_t
|
||||
|
@ -115,4 +115,4 @@ typedef signed char int8;
|
|||
#define LIBYUV_LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_COMPARE_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_COMPARE_H_
|
||||
#define INCLUDE_LIBYUV_COMPARE_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -75,4 +75,4 @@ double I420Ssim(const uint8* src_y_a, int stride_y_a,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_COMPARE_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_COMPARE_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_COMPARE_ROW_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_COMPARE_ROW_H_
|
||||
#define INCLUDE_LIBYUV_COMPARE_ROW_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -81,4 +81,4 @@ uint32 HashDjb2_AVX2(const uint8* src, int count, uint32 seed);
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_COMPARE_ROW_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_COMPARE_ROW_H_
|
||||
|
|
|
@ -8,14 +8,17 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_CONVERT_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_CONVERT_H_
|
||||
#define INCLUDE_LIBYUV_CONVERT_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
// TODO(fbarchard): Remove the following headers includes.
|
||||
#include "libyuv/convert_from.h"
|
||||
#include "libyuv/planar_functions.h"
|
||||
#include "libyuv/rotate.h"
|
||||
|
||||
#include "libyuv/rotate.h" // For enum RotationMode.
|
||||
|
||||
// TODO(fbarchard): fix WebRTC source to include following libyuv headers:
|
||||
#include "libyuv/convert_argb.h" // For WebRTC I420ToARGB. b/620
|
||||
#include "libyuv/convert_from.h" // For WebRTC ConvertFromI420. b/620
|
||||
#include "libyuv/planar_functions.h" // For WebRTC I420Rect, CopyPlane. b/618
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace libyuv {
|
||||
|
@ -115,6 +118,17 @@ int M420ToI420(const uint8* src_m420, int src_stride_m420,
|
|||
uint8* dst_v, int dst_stride_v,
|
||||
int width, int height);
|
||||
|
||||
// Convert Android420 to I420.
|
||||
LIBYUV_API
|
||||
int Android420ToI420(const uint8* src_y, int src_stride_y,
|
||||
const uint8* src_u, int src_stride_u,
|
||||
const uint8* src_v, int src_stride_v,
|
||||
int pixel_stride_uv,
|
||||
uint8* dst_y, int dst_stride_y,
|
||||
uint8* dst_u, int dst_stride_u,
|
||||
uint8* dst_v, int dst_stride_v,
|
||||
int width, int height);
|
||||
|
||||
// ARGB little endian (bgra in memory) to I420.
|
||||
LIBYUV_API
|
||||
int ARGBToI420(const uint8* src_frame, int src_stride_frame,
|
||||
|
@ -242,4 +256,4 @@ int ConvertToI420(const uint8* src_frame, size_t src_size,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_CONVERT_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_CONVERT_H_
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_CONVERT_ARGB_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_CONVERT_ARGB_H_
|
||||
#define INCLUDE_LIBYUV_CONVERT_ARGB_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
// TODO(fbarchard): Remove the following headers includes
|
||||
#include "libyuv/convert_from.h"
|
||||
#include "libyuv/planar_functions.h"
|
||||
#include "libyuv/rotate.h"
|
||||
|
||||
#include "libyuv/rotate.h" // For enum RotationMode.
|
||||
|
||||
// TODO(fbarchard): This set of functions should exactly match convert.h
|
||||
// TODO(fbarchard): Add tests. Create random content of right size and convert
|
||||
|
@ -44,6 +42,14 @@ int I420ToARGB(const uint8* src_y, int src_stride_y,
|
|||
uint8* dst_argb, int dst_stride_argb,
|
||||
int width, int height);
|
||||
|
||||
// Duplicate prototype for function in convert_from.h for remoting.
|
||||
LIBYUV_API
|
||||
int I420ToABGR(const uint8* src_y, int src_stride_y,
|
||||
const uint8* src_u, int src_stride_u,
|
||||
const uint8* src_v, int src_stride_v,
|
||||
uint8* dst_argb, int dst_stride_argb,
|
||||
int width, int height);
|
||||
|
||||
// Convert I422 to ARGB.
|
||||
LIBYUV_API
|
||||
int I422ToARGB(const uint8* src_y, int src_stride_y,
|
||||
|
@ -310,4 +316,4 @@ int ConvertToARGB(const uint8* src_frame, size_t src_size,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_CONVERT_ARGB_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_CONVERT_ARGB_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_CONVERT_FROM_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_CONVERT_FROM_H_
|
||||
#define INCLUDE_LIBYUV_CONVERT_FROM_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -56,8 +56,6 @@ int I400Copy(const uint8* src_y, int src_stride_y,
|
|||
uint8* dst_y, int dst_stride_y,
|
||||
int width, int height);
|
||||
|
||||
// TODO(fbarchard): I420ToM420
|
||||
|
||||
LIBYUV_API
|
||||
int I420ToNV12(const uint8* src_y, int src_stride_y,
|
||||
const uint8* src_u, int src_stride_u,
|
||||
|
@ -178,4 +176,4 @@ int ConvertFromI420(const uint8* y, int y_stride,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_CONVERT_FROM_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_CONVERT_FROM_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
|
||||
#define INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -187,4 +187,4 @@ int ARGBToUYVY(const uint8* src_argb, int src_stride_argb,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_CPU_ID_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_CPU_ID_H_
|
||||
#define INCLUDE_LIBYUV_CPU_ID_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -42,6 +42,7 @@ static const int kCpuHasAVX3 = 0x2000;
|
|||
// These flags are only valid on MIPS processors.
|
||||
static const int kCpuHasMIPS = 0x10000;
|
||||
static const int kCpuHasDSPR2 = 0x20000;
|
||||
static const int kCpuHasMSA = 0x40000;
|
||||
|
||||
// Internal function used to auto-init.
|
||||
LIBYUV_API
|
||||
|
@ -62,7 +63,7 @@ static __inline int TestCpuFlag(int test_flag) {
|
|||
// For testing, allow CPU flags to be disabled.
|
||||
// ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3.
|
||||
// MaskCpuFlags(-1) to enable all cpu specific optimizations.
|
||||
// MaskCpuFlags(0) to disable all cpu specific optimizations.
|
||||
// MaskCpuFlags(1) to disable all cpu specific optimizations.
|
||||
LIBYUV_API
|
||||
void MaskCpuFlags(int enable_flags);
|
||||
|
||||
|
@ -77,4 +78,4 @@ void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info);
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_CPU_ID_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_CPU_ID_H_
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright 2016 The LibYuv Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_MACROS_MSA_H_
|
||||
#define INCLUDE_LIBYUV_MACROS_MSA_H_
|
||||
|
||||
#if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
|
||||
#include <stdint.h>
|
||||
#include <msa.h>
|
||||
|
||||
#define LD_B(RTYPE, psrc) *((RTYPE*)(psrc)) /* NOLINT */
|
||||
#define LD_UB(...) LD_B(v16u8, __VA_ARGS__)
|
||||
|
||||
#define ST_B(RTYPE, in, pdst) *((RTYPE*)(pdst)) = (in) /* NOLINT */
|
||||
#define ST_UB(...) ST_B(v16u8, __VA_ARGS__)
|
||||
|
||||
/* Description : Load two vectors with 16 'byte' sized elements
|
||||
Arguments : Inputs - psrc, stride
|
||||
Outputs - out0, out1
|
||||
Return Type - as per RTYPE
|
||||
Details : Load 16 byte elements in 'out0' from (psrc)
|
||||
Load 16 byte elements in 'out1' from (psrc + stride)
|
||||
*/
|
||||
#define LD_B2(RTYPE, psrc, stride, out0, out1) { \
|
||||
out0 = LD_B(RTYPE, (psrc)); \
|
||||
out1 = LD_B(RTYPE, (psrc) + stride); \
|
||||
}
|
||||
#define LD_UB2(...) LD_B2(v16u8, __VA_ARGS__)
|
||||
|
||||
#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) { \
|
||||
LD_B2(RTYPE, (psrc), stride, out0, out1); \
|
||||
LD_B2(RTYPE, (psrc) + 2 * stride , stride, out2, out3); \
|
||||
}
|
||||
#define LD_UB4(...) LD_B4(v16u8, __VA_ARGS__)
|
||||
|
||||
/* Description : Store two vectors with stride each having 16 'byte' sized
|
||||
elements
|
||||
Arguments : Inputs - in0, in1, pdst, stride
|
||||
Details : Store 16 byte elements from 'in0' to (pdst)
|
||||
Store 16 byte elements from 'in1' to (pdst + stride)
|
||||
*/
|
||||
#define ST_B2(RTYPE, in0, in1, pdst, stride) { \
|
||||
ST_B(RTYPE, in0, (pdst)); \
|
||||
ST_B(RTYPE, in1, (pdst) + stride); \
|
||||
}
|
||||
#define ST_UB2(...) ST_B2(v16u8, __VA_ARGS__)
|
||||
#
|
||||
#define ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride) { \
|
||||
ST_B2(RTYPE, in0, in1, (pdst), stride); \
|
||||
ST_B2(RTYPE, in2, in3, (pdst) + 2 * stride, stride); \
|
||||
}
|
||||
#define ST_UB4(...) ST_B4(v16u8, __VA_ARGS__)
|
||||
#
|
||||
/* Description : Shuffle byte vector elements as per mask vector
|
||||
Arguments : Inputs - in0, in1, in2, in3, mask0, mask1
|
||||
Outputs - out0, out1
|
||||
Return Type - as per RTYPE
|
||||
Details : Byte elements from 'in0' & 'in1' are copied selectively to
|
||||
'out0' as per control vector 'mask0'
|
||||
*/
|
||||
#define VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) { \
|
||||
out0 = (RTYPE) __msa_vshf_b((v16i8) mask0, (v16i8) in1, (v16i8) in0); \
|
||||
out1 = (RTYPE) __msa_vshf_b((v16i8) mask1, (v16i8) in3, (v16i8) in2); \
|
||||
}
|
||||
#define VSHF_B2_UB(...) VSHF_B2(v16u8, __VA_ARGS__)
|
||||
|
||||
#endif /* !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) */
|
||||
|
||||
#endif // INCLUDE_LIBYUV_MACROS_MSA_H_
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_MJPEG_DECODER_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_MJPEG_DECODER_H_
|
||||
#define INCLUDE_LIBYUV_MJPEG_DECODER_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -189,4 +189,4 @@ class LIBYUV_API MJpegDecoder {
|
|||
} // namespace libyuv
|
||||
|
||||
#endif // __cplusplus
|
||||
#endif // INCLUDE_LIBYUV_MJPEG_DECODER_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_MJPEG_DECODER_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_
|
||||
#define INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -39,6 +39,20 @@ void SetPlane(uint8* dst_y, int dst_stride_y,
|
|||
int width, int height,
|
||||
uint32 value);
|
||||
|
||||
// Split interleaved UV plane into separate U and V planes.
|
||||
LIBYUV_API
|
||||
void SplitUVPlane(const uint8* src_uv, int src_stride_uv,
|
||||
uint8* dst_u, int dst_stride_u,
|
||||
uint8* dst_v, int dst_stride_v,
|
||||
int width, int height);
|
||||
|
||||
// Merge separate U and V planes into one interleaved UV plane.
|
||||
LIBYUV_API
|
||||
void MergeUVPlane(const uint8* src_u, int src_stride_u,
|
||||
const uint8* src_v, int src_stride_v,
|
||||
uint8* dst_uv, int dst_stride_uv,
|
||||
int width, int height);
|
||||
|
||||
// Copy I400. Supports inverting.
|
||||
LIBYUV_API
|
||||
int I400ToI400(const uint8* src_y, int src_stride_y,
|
||||
|
@ -288,6 +302,12 @@ int ARGBCopyAlpha(const uint8* src_argb, int src_stride_argb,
|
|||
uint8* dst_argb, int dst_stride_argb,
|
||||
int width, int height);
|
||||
|
||||
// Extract the alpha channel from ARGB.
|
||||
LIBYUV_API
|
||||
int ARGBExtractAlpha(const uint8* src_argb, int src_stride_argb,
|
||||
uint8* dst_a, int dst_stride_a,
|
||||
int width, int height);
|
||||
|
||||
// Copy Y channel to Alpha of ARGB.
|
||||
LIBYUV_API
|
||||
int ARGBCopyYToAlpha(const uint8* src_y, int src_stride_y,
|
||||
|
@ -498,4 +518,4 @@ int ARGBSobelXY(const uint8* src_argb, int src_stride_argb,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_ROTATE_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_ROTATE_H_
|
||||
#define INCLUDE_LIBYUV_ROTATE_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -114,4 +114,4 @@ void TransposeUV(const uint8* src, int src_stride,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_ROTATE_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_ROTATE_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_ROTATE_ARGB_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_ROTATE_ARGB_H_
|
||||
#define INCLUDE_LIBYUV_ROTATE_ARGB_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -30,4 +30,4 @@ int ARGBRotate(const uint8* src_argb, int src_stride_argb,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_ROTATE_ARGB_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_ROTATE_ARGB_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_ROTATE_ROW_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_ROTATE_ROW_H_
|
||||
#define INCLUDE_LIBYUV_ROTATE_ROW_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -118,4 +118,4 @@ void TransposeUVWx8_Any_DSPR2(const uint8* src, int src_stride,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_ROTATE_ROW_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_ROTATE_ROW_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_ROW_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_ROW_H_
|
||||
#define INCLUDE_LIBYUV_ROW_H_
|
||||
|
||||
#include <stdlib.h> // For malloc.
|
||||
|
@ -22,16 +22,9 @@ extern "C" {
|
|||
|
||||
#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define align_buffer_64(var, size) \
|
||||
uint8* var##_mem = reinterpret_cast<uint8*>(malloc((size) + 63)); \
|
||||
uint8* var = reinterpret_cast<uint8*> \
|
||||
((reinterpret_cast<intptr_t>(var##_mem) + 63) & ~63)
|
||||
#else
|
||||
#define align_buffer_64(var, size) \
|
||||
uint8* var##_mem = (uint8*)(malloc((size) + 63)); /* NOLINT */ \
|
||||
uint8* var = (uint8*)(((intptr_t)(var##_mem) + 63) & ~63) /* NOLINT */
|
||||
#endif
|
||||
|
||||
#define free_aligned_buffer_64(var) \
|
||||
free(var##_mem); \
|
||||
|
@ -104,6 +97,7 @@ extern "C" {
|
|||
#define HAS_ARGBTOUVROW_SSSE3
|
||||
#define HAS_ARGBTOYJROW_SSSE3
|
||||
#define HAS_ARGBTOYROW_SSSE3
|
||||
#define HAS_ARGBEXTRACTALPHAROW_SSE2
|
||||
#define HAS_BGRATOUVROW_SSSE3
|
||||
#define HAS_BGRATOYROW_SSSE3
|
||||
#define HAS_COPYROW_ERMS
|
||||
|
@ -261,7 +255,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
// The following are also available on x64 Visual C.
|
||||
#if !defined(LIBYUV_DISABLE_X86) && defined (_M_X64) && \
|
||||
#if !defined(LIBYUV_DISABLE_X86) && defined(_MSC_VER) && defined(_M_X64) && \
|
||||
(!defined(__clang__) || defined(__SSSE3__))
|
||||
#define HAS_I422ALPHATOARGBROW_SSSE3
|
||||
#define HAS_I422TOARGBROW_SSSE3
|
||||
|
@ -291,6 +285,7 @@ extern "C" {
|
|||
#define HAS_ARGBTOUVROW_NEON
|
||||
#define HAS_ARGBTOYJROW_NEON
|
||||
#define HAS_ARGBTOYROW_NEON
|
||||
#define HAS_ARGBEXTRACTALPHAROW_NEON
|
||||
#define HAS_BGRATOUVROW_NEON
|
||||
#define HAS_BGRATOYROW_NEON
|
||||
#define HAS_COPYROW_NEON
|
||||
|
@ -370,9 +365,17 @@ extern "C" {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__CLR_VER)
|
||||
#if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
|
||||
#define HAS_MIRRORROW_MSA
|
||||
#define HAS_ARGBMIRRORROW_MSA
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__)
|
||||
#if defined(VISUALC_HAS_AVX2)
|
||||
#define SIMD_ALIGNED(var) __declspec(align(32)) var
|
||||
#else
|
||||
#define SIMD_ALIGNED(var) __declspec(align(16)) var
|
||||
#define SIMD_ALIGNED32(var) __declspec(align(64)) var
|
||||
#endif
|
||||
typedef __declspec(align(16)) int16 vec16[8];
|
||||
typedef __declspec(align(16)) int32 vec32[4];
|
||||
typedef __declspec(align(16)) int8 vec8[16];
|
||||
|
@ -385,10 +388,13 @@ typedef __declspec(align(32)) int8 lvec8[32];
|
|||
typedef __declspec(align(32)) uint16 ulvec16[16];
|
||||
typedef __declspec(align(32)) uint32 ulvec32[8];
|
||||
typedef __declspec(align(32)) uint8 ulvec8[32];
|
||||
#elif defined(__GNUC__) && !defined(__pnacl__)
|
||||
#elif !defined(__pnacl__) && (defined(__GNUC__) || defined(__clang__))
|
||||
// Caveat GCC 4.2 to 4.7 have a known issue using vectors with const.
|
||||
#if defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)
|
||||
#define SIMD_ALIGNED(var) var __attribute__((aligned(32)))
|
||||
#else
|
||||
#define SIMD_ALIGNED(var) var __attribute__((aligned(16)))
|
||||
#define SIMD_ALIGNED32(var) var __attribute__((aligned(64)))
|
||||
#endif
|
||||
typedef int16 __attribute__((vector_size(16))) vec16;
|
||||
typedef int32 __attribute__((vector_size(16))) vec32;
|
||||
typedef int8 __attribute__((vector_size(16))) vec8;
|
||||
|
@ -403,7 +409,6 @@ typedef uint32 __attribute__((vector_size(32))) ulvec32;
|
|||
typedef uint8 __attribute__((vector_size(32))) ulvec8;
|
||||
#else
|
||||
#define SIMD_ALIGNED(var) var
|
||||
#define SIMD_ALIGNED32(var) var
|
||||
typedef int16 vec16[8];
|
||||
typedef int32 vec32[4];
|
||||
typedef int8 vec8[16];
|
||||
|
@ -439,13 +444,13 @@ struct YuvConstants {
|
|||
#else
|
||||
// This struct is for Intel color conversion.
|
||||
struct YuvConstants {
|
||||
lvec8 kUVToB;
|
||||
lvec8 kUVToG;
|
||||
lvec8 kUVToR;
|
||||
lvec16 kUVBiasB;
|
||||
lvec16 kUVBiasG;
|
||||
lvec16 kUVBiasR;
|
||||
lvec16 kYToRgb;
|
||||
int8 kUVToB[32];
|
||||
int8 kUVToG[32];
|
||||
int8 kUVToR[32];
|
||||
int16 kUVBiasB[16];
|
||||
int16 kUVBiasG[16];
|
||||
int16 kUVBiasR[16];
|
||||
int16 kYToRgb[16];
|
||||
};
|
||||
|
||||
// Offsets into YuvConstants structure
|
||||
|
@ -459,14 +464,14 @@ struct YuvConstants {
|
|||
#endif
|
||||
|
||||
// Conversion matrix for YUV to RGB
|
||||
extern const struct YuvConstants kYuvI601Constants; // BT.601
|
||||
extern const struct YuvConstants kYuvJPEGConstants; // JPeg color space
|
||||
extern const struct YuvConstants kYuvH709Constants; // BT.709
|
||||
extern const struct YuvConstants SIMD_ALIGNED(kYuvI601Constants); // BT.601
|
||||
extern const struct YuvConstants SIMD_ALIGNED(kYuvJPEGConstants); // JPeg
|
||||
extern const struct YuvConstants SIMD_ALIGNED(kYuvH709Constants); // BT.709
|
||||
|
||||
// Conversion matrix for YVU to BGR
|
||||
extern const struct YuvConstants kYvuI601Constants; // BT.601
|
||||
extern const struct YuvConstants kYvuJPEGConstants; // JPeg color space
|
||||
extern const struct YuvConstants kYvuH709Constants; // BT.709
|
||||
extern const struct YuvConstants SIMD_ALIGNED(kYvuI601Constants); // BT.601
|
||||
extern const struct YuvConstants SIMD_ALIGNED(kYvuJPEGConstants); // JPeg
|
||||
extern const struct YuvConstants SIMD_ALIGNED(kYvuH709Constants); // BT.709
|
||||
|
||||
#if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__)
|
||||
#define OMITFP
|
||||
|
@ -802,11 +807,13 @@ void MirrorRow_AVX2(const uint8* src, uint8* dst, int width);
|
|||
void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width);
|
||||
void MirrorRow_NEON(const uint8* src, uint8* dst, int width);
|
||||
void MirrorRow_DSPR2(const uint8* src, uint8* dst, int width);
|
||||
void MirrorRow_MSA(const uint8* src, uint8* dst, int width);
|
||||
void MirrorRow_C(const uint8* src, uint8* dst, int width);
|
||||
void MirrorRow_Any_AVX2(const uint8* src, uint8* dst, int width);
|
||||
void MirrorRow_Any_SSSE3(const uint8* src, uint8* dst, int width);
|
||||
void MirrorRow_Any_SSE2(const uint8* src, uint8* dst, int width);
|
||||
void MirrorRow_Any_NEON(const uint8* src, uint8* dst, int width);
|
||||
void MirrorRow_Any_MSA(const uint8* src, uint8* dst, int width);
|
||||
|
||||
void MirrorUVRow_SSSE3(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
|
||||
int width);
|
||||
|
@ -819,10 +826,12 @@ void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width);
|
|||
void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width);
|
||||
void ARGBMirrorRow_SSE2(const uint8* src, uint8* dst, int width);
|
||||
void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width);
|
||||
void ARGBMirrorRow_MSA(const uint8* src, uint8* dst, int width);
|
||||
void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width);
|
||||
void ARGBMirrorRow_Any_AVX2(const uint8* src, uint8* dst, int width);
|
||||
void ARGBMirrorRow_Any_SSE2(const uint8* src, uint8* dst, int width);
|
||||
void ARGBMirrorRow_Any_NEON(const uint8* src, uint8* dst, int width);
|
||||
void ARGBMirrorRow_Any_MSA(const uint8* src, uint8* dst, int width);
|
||||
|
||||
void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width);
|
||||
void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
|
||||
|
@ -877,6 +886,14 @@ void ARGBCopyAlphaRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb,
|
|||
void ARGBCopyAlphaRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb,
|
||||
int width);
|
||||
|
||||
void ARGBExtractAlphaRow_C(const uint8* src_argb, uint8* dst_a, int width);
|
||||
void ARGBExtractAlphaRow_SSE2(const uint8* src_argb, uint8* dst_a, int width);
|
||||
void ARGBExtractAlphaRow_NEON(const uint8* src_argb, uint8* dst_a, int width);
|
||||
void ARGBExtractAlphaRow_Any_SSE2(const uint8* src_argb, uint8* dst_a,
|
||||
int width);
|
||||
void ARGBExtractAlphaRow_Any_NEON(const uint8* src_argb, uint8* dst_a,
|
||||
int width);
|
||||
|
||||
void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width);
|
||||
void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width);
|
||||
void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width);
|
||||
|
@ -1926,4 +1943,4 @@ void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_ROW_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_ROW_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_SCALE_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_SCALE_H_
|
||||
#define INCLUDE_LIBYUV_SCALE_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -100,4 +100,4 @@ void SetUseReferenceImpl(LIBYUV_BOOL use);
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_SCALE_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_SCALE_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_SCALE_ARGB_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_SCALE_ARGB_H_
|
||||
#define INCLUDE_LIBYUV_SCALE_ARGB_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -53,4 +53,4 @@ int YUVToARGBScaleClip(const uint8* src_y, int src_stride_y,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_SCALE_ARGB_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_SCALE_ARGB_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_SCALE_ROW_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_SCALE_ROW_H_
|
||||
#define INCLUDE_LIBYUV_SCALE_ROW_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -500,4 +500,4 @@ void ScaleRowDown38_3_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_SCALE_ROW_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_SCALE_ROW_H_
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 1586
|
||||
#define LIBYUV_VERSION 1620
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// Common definitions for video, including fourcc and VideoFormat.
|
||||
|
||||
#ifndef INCLUDE_LIBYUV_VIDEO_COMMON_H_ // NOLINT
|
||||
#ifndef INCLUDE_LIBYUV_VIDEO_COMMON_H_
|
||||
#define INCLUDE_LIBYUV_VIDEO_COMMON_H_
|
||||
|
||||
#include "libyuv/basic_types.h"
|
||||
|
@ -181,4 +181,4 @@ LIBYUV_API uint32 CanonicalFourCC(uint32 fourcc);
|
|||
} // namespace libyuv
|
||||
#endif
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VIDEO_COMMON_H_ NOLINT
|
||||
#endif // INCLUDE_LIBYUV_VIDEO_COMMON_H_
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright 2016 The LibYuv Project Authors. All rights reserved.
|
||||
#
|
||||
# Use of this source code is governed by a BSD-style license
|
||||
# that can be found in the LICENSE file in the root of the source
|
||||
# tree. An additional intellectual property rights grant can be found
|
||||
# in the file PATENTS. All contributing project authors may
|
||||
# be found in the AUTHORS file in the root of the source tree.
|
||||
|
||||
import("//build_overrides/build.gni")
|
||||
import("//build/config/arm.gni")
|
||||
import("//build/config/mips.gni")
|
||||
|
||||
declare_args() {
|
||||
libyuv_include_tests = !build_with_chromium
|
||||
libyuv_disable_jpeg = false
|
||||
libyuv_use_neon = (current_cpu == "arm64" ||
|
||||
(current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon)))
|
||||
libyuv_use_msa = (current_cpu == "mips64el" || current_cpu == "mipsel") &&
|
||||
mips_use_msa
|
||||
}
|
|
@ -25,14 +25,20 @@
|
|||
'clang%': 0,
|
||||
# Link-Time Optimizations.
|
||||
'use_lto%': 0,
|
||||
'mips_msa%': 0, # Default to msa off.
|
||||
'build_neon': 0,
|
||||
'build_msa': 0,
|
||||
'conditions': [
|
||||
['(target_arch == "armv7" or target_arch == "armv7s" or \
|
||||
(target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\
|
||||
and (arm_neon == 1 or arm_neon_optional == 1)',
|
||||
{
|
||||
and (arm_neon == 1 or arm_neon_optional == 1)', {
|
||||
'build_neon': 1,
|
||||
}],
|
||||
['(target_arch == "mipsel" or target_arch == "mips64el")\
|
||||
and (mips_msa == 1)',
|
||||
{
|
||||
'build_msa': 1,
|
||||
}],
|
||||
],
|
||||
},
|
||||
|
||||
|
@ -61,6 +67,7 @@
|
|||
'-mfpu=vfp',
|
||||
'-mfpu=vfpv3',
|
||||
'-mfpu=vfpv3-d16',
|
||||
# '-mthumb', # arm32 not thumb
|
||||
],
|
||||
'conditions': [
|
||||
# Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug.
|
||||
|
@ -74,10 +81,16 @@
|
|||
['target_arch != "arm64"', {
|
||||
'cflags': [
|
||||
'-mfpu=neon',
|
||||
# '-marm', # arm32 not thumb
|
||||
],
|
||||
}],
|
||||
],
|
||||
}],
|
||||
['build_msa != 0', {
|
||||
'defines': [
|
||||
'LIBYUV_MSA',
|
||||
],
|
||||
}],
|
||||
['OS != "ios" and libyuv_disable_jpeg != 1', {
|
||||
'defines': [
|
||||
'HAVE_JPEG'
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
'include/libyuv/convert_from.h',
|
||||
'include/libyuv/convert_from_argb.h',
|
||||
'include/libyuv/cpu_id.h',
|
||||
'include/libyuv/macros_msa.h',
|
||||
'include/libyuv/mjpeg_decoder.h',
|
||||
'include/libyuv/planar_functions.h',
|
||||
'include/libyuv/rotate.h',
|
||||
|
@ -61,6 +62,7 @@
|
|||
'source/row_common.cc',
|
||||
'source/row_gcc.cc',
|
||||
'source/row_mips.cc',
|
||||
'source/row_msa.cc',
|
||||
'source/row_neon.cc',
|
||||
'source/row_neon64.cc',
|
||||
'source/row_win.cc',
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
{
|
||||
'variables': {
|
||||
'libyuv_disable_jpeg%': 0,
|
||||
'mips_msa%': 0, # Default to msa off.
|
||||
},
|
||||
'targets': [
|
||||
{
|
||||
|
@ -52,11 +53,6 @@
|
|||