From b54a2dc247ed38b715a3330c958e62c8d4af5dc7 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 21 Apr 2016 15:17:30 -0400 Subject: [PATCH] FS-9091: update libyuv to hash 69245902 from https://chromium.googlesource.com/libyuv/libyuv/ --- libs/libyuv/BUILD.gn | 4 +- libs/libyuv/CMakeLists.txt | 11 ++- libs/libyuv/DEPS | 2 +- libs/libyuv/PRESUBMIT.py | 10 +- libs/libyuv/README.chromium | 2 +- libs/libyuv/README.md | 4 +- libs/libyuv/build_overrides/build.gni | 15 +++ libs/libyuv/chromium/.gclient | 4 - libs/libyuv/docs/getting_started.md | 13 ++- libs/libyuv/gyp_libyuv | 4 + libs/libyuv/include/libyuv/compare_row.h | 6 ++ libs/libyuv/include/libyuv/planar_functions.h | 6 ++ libs/libyuv/include/libyuv/rotate_row.h | 7 +- libs/libyuv/include/libyuv/row.h | 6 ++ libs/libyuv/include/libyuv/scale_row.h | 6 ++ libs/libyuv/include/libyuv/version.h | 2 +- libs/libyuv/libyuv.gyp | 13 ++- libs/libyuv/libyuv_test.gyp | 7 -- libs/libyuv/linux.mk | 93 ++++++++++++------- libs/libyuv/setup_links.py | 3 +- libs/libyuv/source/convert_to_argb.cc | 12 +-- libs/libyuv/source/cpu_id.cc | 17 ++-- libs/libyuv/source/planar_functions.cc | 3 +- libs/libyuv/source/rotate_neon.cc | 8 +- libs/libyuv/source/rotate_neon64.cc | 8 +- libs/libyuv/source/row_common.cc | 8 +- libs/libyuv/source/row_gcc.cc | 86 ++++++++--------- libs/libyuv/source/row_mips.cc | 6 +- libs/libyuv/source/row_neon.cc | 35 +++---- libs/libyuv/source/row_neon64.cc | 4 +- libs/libyuv/source/scale_gcc.cc | 60 ++++++------ libs/libyuv/source/scale_neon.cc | 30 +++--- libs/libyuv/source/scale_neon64.cc | 30 +++--- libs/libyuv/sync_chromium.py | 2 - 34 files changed, 300 insertions(+), 227 deletions(-) create mode 100644 libs/libyuv/build_overrides/build.gni diff --git a/libs/libyuv/BUILD.gn b/libs/libyuv/BUILD.gn index d1e55de16c..b091cbc22d 100644 --- a/libs/libyuv/BUILD.gn +++ b/libs/libyuv/BUILD.gn @@ -20,6 +20,7 @@ use_neon = current_cpu == "arm64" || (current_cpu == "arm" && (arm_use_neon || a source_set("libyuv") { sources = [ + # Headers "include/libyuv.h", "include/libyuv/basic_types.h", "include/libyuv/compare.h", @@ -40,7 +41,7 @@ source_set("libyuv") { "include/libyuv/version.h", "include/libyuv/video_common.h", - # sources. + # Source Files "source/compare.cc", "source/compare_common.cc", "source/compare_gcc.cc", @@ -113,6 +114,7 @@ source_set("libyuv") { if (use_neon) { static_library("libyuv_neon") { sources = [ + # ARM Source Files "source/compare_neon.cc", "source/compare_neon64.cc", "source/rotate_neon.cc", diff --git a/libs/libyuv/CMakeLists.txt b/libs/libyuv/CMakeLists.txt index f74c05f6b7..718b47ad32 100644 --- a/libs/libyuv/CMakeLists.txt +++ b/libs/libyuv/CMakeLists.txt @@ -128,14 +128,15 @@ if(TEST) if (JPEG_FOUND) target_link_libraries(libyuv_unittest ${JPEG_LIBRARY}) endif() -endif() + + if(NACL AND NACL_LIBC STREQUAL "newlib") + target_link_libraries(libyuv_unittest glibc-compat) + endif() -if(NACL AND NACL_LIBC STREQUAL "newlib") - target_link_libraries(libyuv_unittest glibc-compat) + target_link_libraries(libyuv_unittest gflags) + endif() -target_link_libraries(libyuv_unittest gflags) - install(TARGETS ${ly_lib_name} DESTINATION lib) install(FILES ${ly_header_files} DESTINATION include/libyuv) install(FILES ${ly_inc_dir}/libyuv.h DESTINATION include/) diff --git a/libs/libyuv/DEPS b/libs/libyuv/DEPS index f53bb6be1a..fcab73166d 100644 --- a/libs/libyuv/DEPS +++ b/libs/libyuv/DEPS @@ -7,7 +7,7 @@ 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': '3c455872750c9d0f74266b04f97701a516ac9075', + 'chromium_revision': '1d144ca7f86e0c684c67d6c1b6d5414ca9074615', } # NOTE: Prefer revision numbers to tags for svn deps. Use http rather than diff --git a/libs/libyuv/PRESUBMIT.py b/libs/libyuv/PRESUBMIT.py index 61d92aea17..efb1ca5c58 100755 --- a/libs/libyuv/PRESUBMIT.py +++ b/libs/libyuv/PRESUBMIT.py @@ -26,15 +26,21 @@ def GetPreferredTryMasters(project, change): 'win', 'win_rel', 'win_x64_rel', + 'win_x64_gn', + 'win_x64_gn_rel', 'mac', 'mac_rel', + 'mac_gn', + 'mac_gn_rel', + 'mac_asan', 'ios', 'ios_rel', 'ios_arm64', 'ios_arm64_rel', - 'mac_asan', 'linux', 'linux_rel', + 'linux_gn', + 'linux_gn_rel', 'linux_memcheck', 'linux_tsan2', 'linux_asan', @@ -45,6 +51,8 @@ def GetPreferredTryMasters(project, change): 'android_rel', 'android_clang', 'android_arm64', + 'android_gn', + 'android_gn_rel', ] if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files): return {} diff --git a/libs/libyuv/README.chromium b/libs/libyuv/README.chromium index d5401f6b14..db3f6ff51c 100644 --- a/libs/libyuv/README.chromium +++ b/libs/libyuv/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1577 +Version: 1586 License: BSD License File: LICENSE diff --git a/libs/libyuv/README.md b/libs/libyuv/README.md index 7b11325d37..b59b71c5d2 100644 --- a/libs/libyuv/README.md +++ b/libs/libyuv/README.md @@ -14,5 +14,5 @@ See [Getting started] [1] for instructions on how to get started developing. You can also browse the [docs directory] [2] for more documentation. -[1]: docs/getting_started.md -[2]: docs/ +[1]: https://chromium.googlesource.com/libyuv/libyuv/+/master/docs/getting_started.md +[2]: https://chromium.googlesource.com/libyuv/libyuv/+/master/docs/ diff --git a/libs/libyuv/build_overrides/build.gni b/libs/libyuv/build_overrides/build.gni new file mode 100644 index 0000000000..6d3aa1ebc7 --- /dev/null +++ b/libs/libyuv/build_overrides/build.gni @@ -0,0 +1,15 @@ +# 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. + +# Using same overrides as WebRTC +# See https://bugs.chromium.org/p/webrtc/issues/detail?id=5453. +# Some WebRTC targets require the 10.7 deployment version of the Mac SDK and a +# 10.11 min SDK but those targets are only used in non-Chromium builds. We can +# 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" diff --git a/libs/libyuv/chromium/.gclient b/libs/libyuv/chromium/.gclient index 330ce6365e..c1a86ecfeb 100644 --- a/libs/libyuv/chromium/.gclient +++ b/libs/libyuv/chromium/.gclient @@ -5,10 +5,6 @@ solutions = [{ 'managed': False, 'custom_deps': { # Skip syncing some large dependencies Libyuv will never need. - 'src/chrome/tools/test/reference_build/chrome_linux': None, - 'src/chrome/tools/test/reference_build/chrome_mac': None, - 'src/chrome/tools/test/reference_build/chrome_win': None, - 'src/native_client': None, 'src/third_party/cld_2/src': None, 'src/third_party/ffmpeg': None, 'src/third_party/hunspell_dictionaries': None, diff --git a/libs/libyuv/docs/getting_started.md b/libs/libyuv/docs/getting_started.md index 68e6d49432..d4b7a9b78c 100644 --- a/libs/libyuv/docs/getting_started.md +++ b/libs/libyuv/docs/getting_started.md @@ -162,6 +162,10 @@ mipsel ninja -j7 -C out/Debug libyuv_unittest_apk ninja -j7 -C out/Release libyuv_unittest_apk +arm32 disassembly: + + third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-objdump -d out/Release/obj/source/libyuv.row_neon.o + arm64 disassembly: third_party/android_tools/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d out/Release/obj/source/libyuv.row_neon64.o @@ -180,11 +184,16 @@ Running test with C code: #### Building with GN - call gn gen out/Release "--args=is_debug=false target_cpu=\"x86\"" - call gn gen out/Debug "--args=is_debug=true target_cpu=\"x86\"" + gn gen out/Release "--args=is_debug=false target_cpu=\"x86\"" + gn gen out/Debug "--args=is_debug=true target_cpu=\"x86\"" ninja -C out/Release ninja -C out/Debug +### Building Offical with GN + + gn gen out/Official "--args=is_debug=false is_official_build=true is_chrome_branded=true" + ninja -C out/Official + ### Linux GYP_DEFINES="target_arch=x64" ./gyp_libyuv diff --git a/libs/libyuv/gyp_libyuv b/libs/libyuv/gyp_libyuv index 645d3ad45c..445b924f16 100755 --- a/libs/libyuv/gyp_libyuv +++ b/libs/libyuv/gyp_libyuv @@ -37,6 +37,10 @@ def GetSupplementalFiles(): if __name__ == '__main__': args = sys.argv[1:] + if int(os.environ.get('GYP_CHROMIUM_NO_ACTION', 0)): + print 'Skipping gyp_libyuv due to GYP_CHROMIUM_NO_ACTION env var.' + sys.exit(0) + # This could give false positives since it doesn't actually do real option # parsing. Oh well. gyp_file_specified = False diff --git a/libs/libyuv/include/libyuv/compare_row.h b/libs/libyuv/include/libyuv/compare_row.h index f5836da11d..38a957b2ce 100644 --- a/libs/libyuv/include/libyuv/compare_row.h +++ b/libs/libyuv/include/libyuv/compare_row.h @@ -22,6 +22,12 @@ extern "C" { (defined(__i386__) && !defined(__SSE2__)) #define LIBYUV_DISABLE_X86 #endif +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif // Visual C 2012 required for AVX2. #if defined(_M_IX86) && !defined(__clang__) && \ diff --git a/libs/libyuv/include/libyuv/planar_functions.h b/libs/libyuv/include/libyuv/planar_functions.h index 95870b9aea..9c19a59dfe 100644 --- a/libs/libyuv/include/libyuv/planar_functions.h +++ b/libs/libyuv/include/libyuv/planar_functions.h @@ -447,6 +447,12 @@ int I420Interpolate(const uint8* src0_y, int src0_stride_y, (defined(__i386__) && !defined(__SSE2__)) #define LIBYUV_DISABLE_X86 #endif +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif // The following are available on all x86 platforms: #if !defined(LIBYUV_DISABLE_X86) && \ (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) diff --git a/libs/libyuv/include/libyuv/rotate_row.h b/libs/libyuv/include/libyuv/rotate_row.h index d9f4d07928..ebc487f9ab 100644 --- a/libs/libyuv/include/libyuv/rotate_row.h +++ b/libs/libyuv/include/libyuv/rotate_row.h @@ -22,7 +22,12 @@ extern "C" { (defined(__i386__) && !defined(__SSE2__)) #define LIBYUV_DISABLE_X86 #endif - +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif // The following are available for Visual C and clangcl 32 bit: #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) #define HAS_TRANSPOSEWX8_SSSE3 diff --git a/libs/libyuv/include/libyuv/row.h b/libs/libyuv/include/libyuv/row.h index 6011524487..b5d9aaa17a 100644 --- a/libs/libyuv/include/libyuv/row.h +++ b/libs/libyuv/include/libyuv/row.h @@ -41,6 +41,12 @@ extern "C" { (defined(__i386__) && !defined(__SSE2__)) #define LIBYUV_DISABLE_X86 #endif +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif // True if compiling for SSSE3 as a requirement. #if defined(__SSSE3__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 3)) #define LIBYUV_SSSE3_ONLY diff --git a/libs/libyuv/include/libyuv/scale_row.h b/libs/libyuv/include/libyuv/scale_row.h index a3b3ede60e..df699e6c22 100644 --- a/libs/libyuv/include/libyuv/scale_row.h +++ b/libs/libyuv/include/libyuv/scale_row.h @@ -23,6 +23,12 @@ extern "C" { (defined(__i386__) && !defined(__SSE2__)) #define LIBYUV_DISABLE_X86 #endif +// MemorySanitizer does not support assembly code yet. http://crbug.com/344505 +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define LIBYUV_DISABLE_X86 +#endif +#endif // GCC >= 4.7.0 required for AVX2. #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) diff --git a/libs/libyuv/include/libyuv/version.h b/libs/libyuv/include/libyuv/version.h index c7800d56a5..f1e6ae2f2a 100644 --- a/libs/libyuv/include/libyuv/version.h +++ b/libs/libyuv/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1577 +#define LIBYUV_VERSION 1586 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/libs/libyuv/libyuv.gyp b/libs/libyuv/libyuv.gyp index 44dec09eec..ed7c40c7c4 100644 --- a/libs/libyuv/libyuv.gyp +++ b/libs/libyuv/libyuv.gyp @@ -47,6 +47,12 @@ # Allows libyuv.a redistributable library without external dependencies. 'standalone_static_library': 1, 'conditions': [ + # Disable -Wunused-parameter + ['clang == 1', { + 'cflags': [ + '-Wno-unused-parameter', + ], + }], ['build_neon != 0', { 'defines': [ 'LIBYUV_NEON', @@ -96,13 +102,6 @@ }], ], }], - # MemorySanitizer does not support assembly code yet. - # http://crbug.com/344505 - [ 'msan == 1', { - 'defines': [ - 'LIBYUV_DISABLE_X86', - ], - }], ], #conditions 'defines': [ # Enable the following 3 macros to turn off assembly for specified CPU. diff --git a/libs/libyuv/libyuv_test.gyp b/libs/libyuv/libyuv_test.gyp index 0b1c825aae..7188e76332 100644 --- a/libs/libyuv/libyuv_test.gyp +++ b/libs/libyuv/libyuv_test.gyp @@ -91,13 +91,6 @@ 'LIBYUV_NEON' ], }], - # MemorySanitizer does not support assembly code yet. - # http://crbug.com/344505 - [ 'msan == 1', { - 'defines': [ - 'LIBYUV_DISABLE_X86', - ], - }], ], # conditions 'defines': [ # Enable the following 3 macros to turn off assembly for specified CPU. diff --git a/libs/libyuv/linux.mk b/libs/libyuv/linux.mk index 563f8ef45d..ee5a3a7070 100644 --- a/libs/libyuv/linux.mk +++ b/libs/libyuv/linux.mk @@ -1,52 +1,81 @@ # This is a generic makefile for libyuv for gcc. # make -f linux.mk CXX=clang++ +CC?=gcc +CFLAGS?=-O2 -fomit-frame-pointer +CFLAGS+=-Iinclude/ + CXX?=g++ CXXFLAGS?=-O2 -fomit-frame-pointer CXXFLAGS+=-Iinclude/ LOCAL_OBJ_FILES := \ - source/compare.o \ - source/compare_common.o \ - source/compare_gcc.o \ - source/convert.o \ - source/convert_argb.o \ - source/convert_from.o \ - source/convert_from_argb.o \ - source/convert_to_argb.o \ - source/convert_to_i420.o \ - source/cpu_id.o \ - source/planar_functions.o \ - source/rotate.o \ - source/rotate_any.o \ - source/rotate_argb.o \ - source/rotate_common.o \ - source/rotate_gcc.o \ - source/rotate_mips.o \ - source/row_any.o \ - source/row_common.o \ - source/row_mips.o \ - source/row_gcc.o \ - source/scale.o \ - source/scale_any.o \ - source/scale_argb.o \ - source/scale_common.o \ - source/scale_gcc.o \ - source/scale_mips.o \ - source/video_common.o + source/compare.o \ + source/compare_common.o \ + source/compare_gcc.o \ + source/compare_neon64.o \ + source/compare_neon.o \ + source/compare_win.o \ + source/convert_argb.o \ + source/convert.o \ + source/convert_from_argb.o \ + source/convert_from.o \ + source/convert_jpeg.o \ + source/convert_to_argb.o \ + source/convert_to_i420.o \ + source/cpu_id.o \ + source/mjpeg_decoder.o \ + source/mjpeg_validate.o \ + source/planar_functions.o \ + source/rotate_any.o \ + source/rotate_argb.o \ + source/rotate.o \ + source/rotate_common.o \ + source/rotate_gcc.o \ + source/rotate_mips.o \ + source/rotate_neon64.o \ + source/rotate_neon.o \ + source/rotate_win.o \ + source/row_any.o \ + source/row_common.o \ + source/row_gcc.o \ + source/row_mips.o \ + source/row_neon64.o \ + source/row_neon.o \ + source/row_win.o \ + source/scale_any.o \ + source/scale_argb.o \ + source/scale.o \ + source/scale_common.o \ + source/scale_gcc.o \ + source/scale_mips.o \ + source/scale_neon64.o \ + source/scale_neon.o \ + source/scale_win.o \ + source/video_common.o .cc.o: $(CXX) -c $(CXXFLAGS) $*.cc -o $*.o -all: libyuv.a convert +.c.o: + $(CC) -c $(CFLAGS) $*.c -o $*.o + +all: libyuv.a convert cpuid psnr libyuv.a: $(LOCAL_OBJ_FILES) $(AR) $(ARFLAGS) $@ $(LOCAL_OBJ_FILES) -# A test utility that uses libyuv conversion. +# A C++ test utility that uses libyuv conversion. convert: util/convert.cc libyuv.a $(CXX) $(CXXFLAGS) -Iutil/ -o $@ util/convert.cc libyuv.a -clean: - /bin/rm -f source/*.o *.ii *.s libyuv.a convert +# A standalone test utility +psnr: util/psnr.cc + $(CXX) $(CXXFLAGS) -Iutil/ -o $@ util/psnr.cc util/psnr_main.cc util/ssim.cc +# A C test utility that uses libyuv conversion from C. +cpuid: util/cpuid.c libyuv.a + $(CC) $(CFLAGS) -o $@ util/cpuid.c libyuv.a + +clean: + /bin/rm -f source/*.o *.ii *.s libyuv.a convert cpuid psnr diff --git a/libs/libyuv/setup_links.py b/libs/libyuv/setup_links.py index 975ef90471..947bf2a8d6 100755 --- a/libs/libyuv/setup_links.py +++ b/libs/libyuv/setup_links.py @@ -35,6 +35,7 @@ DIRECTORIES = [ 'build', 'buildtools', 'google_apis', # Needed by build/common.gypi. + 'native_client', 'net', 'testing', 'third_party/binutils', @@ -49,7 +50,7 @@ DIRECTORIES = [ 'third_party/libjpeg_turbo', 'third_party/libsrtp', 'third_party/libudev', - 'third_party/libvpx_new', + 'third_party/libvpx', 'third_party/libyuv', 'third_party/llvm-build', 'third_party/lss', diff --git a/libs/libyuv/source/convert_to_argb.cc b/libs/libyuv/source/convert_to_argb.cc index af829fbd32..7533f50109 100644 --- a/libs/libyuv/source/convert_to_argb.cc +++ b/libs/libyuv/source/convert_to_argb.cc @@ -23,7 +23,7 @@ namespace libyuv { extern "C" { #endif -// Convert camera sample to I420 with cropping, rotation and vertical flip. +// Convert camera sample to ARGB with cropping, rotation and vertical flip. // src_width is used for source stride computation // src_height is used to compute location of planes, and indicate inversion // sample_size is measured in bytes and is the size of the frame. @@ -51,8 +51,8 @@ int ConvertToARGB(const uint8* sample, size_t sample_size, // also enable temporary buffer. LIBYUV_BOOL need_buf = (rotation && format != FOURCC_ARGB) || crop_argb == sample; - uint8* tmp_argb = crop_argb; - int tmp_argb_stride = argb_stride; + uint8* dest_argb = crop_argb; + int dest_argb_stride = argb_stride; uint8* rotate_buffer = NULL; int abs_crop_height = (crop_height < 0) ? -crop_height : crop_height; @@ -66,13 +66,13 @@ int ConvertToARGB(const uint8* sample, size_t sample_size, } if (need_buf) { - int argb_size = crop_width * abs_crop_height * 4; + int argb_size = crop_width * 4 * abs_crop_height; rotate_buffer = (uint8*)malloc(argb_size); if (!rotate_buffer) { return 1; // Out of memory runtime error. } crop_argb = rotate_buffer; - argb_stride = crop_width; + argb_stride = crop_width * 4; } switch (format) { @@ -291,7 +291,7 @@ int ConvertToARGB(const uint8* sample, size_t sample_size, if (need_buf) { if (!r) { r = ARGBRotate(crop_argb, argb_stride, - tmp_argb, tmp_argb_stride, + dest_argb, dest_argb_stride, crop_width, abs_crop_height, rotation); } free(rotate_buffer); diff --git a/libs/libyuv/source/cpu_id.cc b/libs/libyuv/source/cpu_id.cc index 8d2c3a4957..84927ebc3e 100644 --- a/libs/libyuv/source/cpu_id.cc +++ b/libs/libyuv/source/cpu_id.cc @@ -10,12 +10,12 @@ #include "libyuv/cpu_id.h" -#if defined(_MSC_VER) && !defined(__clang__) +#if defined(_MSC_VER) #include // For __cpuidex() #endif #if !defined(__pnacl__) && !defined(__CLR_VER) && \ !defined(__native_client__) && (defined(_M_IX86) || defined(_M_X64)) && \ - defined(_MSC_VER) && !defined(__clang__) && (_MSC_FULL_VER >= 160040219) + defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160040219) #include // For _xgetbv() #endif @@ -36,7 +36,8 @@ extern "C" { // For functions that use the stack and have runtime checks for overflow, // use SAFEBUFFERS to avoid additional check. -#if (defined(_MSC_VER) && !defined(__clang__)) && (_MSC_FULL_VER >= 160040219) +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160040219) && \ + !defined(__clang__) #define SAFEBUFFERS __declspec(safebuffers) #else #define SAFEBUFFERS @@ -48,9 +49,9 @@ extern "C" { !defined(__pnacl__) && !defined(__CLR_VER) LIBYUV_API void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) { -#if defined(_MSC_VER) && !defined(__clang__) +#if defined(_MSC_VER) // Visual C version uses intrinsic or inline x86 assembly. -#if (_MSC_FULL_VER >= 160040219) +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160040219) __cpuidex((int*)(cpu_info), info_eax, info_ecx); #elif defined(_M_IX86) __asm { @@ -71,7 +72,7 @@ void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) { } #endif // GCC version uses inline x86 assembly. -#else // defined(_MSC_VER) && !defined(__clang__) +#else // defined(_MSC_VER) uint32 info_ebx, info_edx; asm volatile ( #if defined( __i386__) && defined(__PIC__) @@ -89,7 +90,7 @@ void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) { cpu_info[1] = info_ebx; cpu_info[2] = info_ecx; cpu_info[3] = info_edx; -#endif // defined(_MSC_VER) && !defined(__clang__) +#endif // defined(_MSC_VER) } #else // (defined(_M_IX86) || defined(_M_X64) ... LIBYUV_API @@ -117,7 +118,7 @@ void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info) { // X86 CPUs have xgetbv to detect OS saves high parts of ymm registers. int GetXCR0() { uint32 xcr0 = 0u; -#if (_MSC_FULL_VER >= 160040219) +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160040219) xcr0 = (uint32)(_xgetbv(0)); // VS2010 SP1 required. #elif defined(__i386__) || defined(__x86_64__) asm(".byte 0x0f, 0x01, 0xd0" : "=a" (xcr0) : "c" (0) : "%edx"); diff --git a/libs/libyuv/source/planar_functions.cc b/libs/libyuv/source/planar_functions.cc index 851c0fea91..73fa7d284a 100644 --- a/libs/libyuv/source/planar_functions.cc +++ b/libs/libyuv/source/planar_functions.cc @@ -1917,8 +1917,7 @@ int InterpolatePlane(const uint8* src0, int src_stride0, #endif for (y = 0; y < height; ++y) { - InterpolateRow(dst, src0, src1 - src0, - width, interpolation); + InterpolateRow(dst, src0, src1 - src0, width, interpolation); src0 += src_stride0; src1 += src_stride1; dst += dst_stride; diff --git a/libs/libyuv/source/rotate_neon.cc b/libs/libyuv/source/rotate_neon.cc index 9e4ecd80d9..1c22b472bc 100644 --- a/libs/libyuv/source/rotate_neon.cc +++ b/libs/libyuv/source/rotate_neon.cc @@ -27,7 +27,7 @@ static uvec8 kVTbl4x4Transpose = void TransposeWx8_NEON(const uint8* src, int src_stride, uint8* dst, int dst_stride, int width) { - const uint8* src_temp = NULL; + const uint8* src_temp; asm volatile ( // loops are on blocks of 8. loop will stop when // counter gets to or below 0. starting the counter @@ -229,7 +229,7 @@ void TransposeWx8_NEON(const uint8* src, int src_stride, "4: \n" - : "+r"(src_temp), // %0 + : "=&r"(src_temp), // %0 "+r"(src), // %1 "+r"(src_stride), // %2 "+r"(dst), // %3 @@ -247,7 +247,7 @@ void TransposeUVWx8_NEON(const uint8* src, int src_stride, uint8* dst_a, int dst_stride_a, uint8* dst_b, int dst_stride_b, int width) { - const uint8* src_temp = NULL; + const uint8* src_temp; asm volatile ( // loops are on blocks of 8. loop will stop when // counter gets to or below 0. starting the counter @@ -512,7 +512,7 @@ void TransposeUVWx8_NEON(const uint8* src, int src_stride, "4: \n" - : "+r"(src_temp), // %0 + : "=&r"(src_temp), // %0 "+r"(src), // %1 "+r"(src_stride), // %2 "+r"(dst_a), // %3 diff --git a/libs/libyuv/source/rotate_neon64.cc b/libs/libyuv/source/rotate_neon64.cc index f52c082b3f..1ab448f3ab 100644 --- a/libs/libyuv/source/rotate_neon64.cc +++ b/libs/libyuv/source/rotate_neon64.cc @@ -26,7 +26,7 @@ static uvec8 kVTbl4x4Transpose = void TransposeWx8_NEON(const uint8* src, int src_stride, uint8* dst, int dst_stride, int width) { - const uint8* src_temp = NULL; + const uint8* src_temp; int64 width64 = (int64) width; // Work around clang 3.4 warning. asm volatile ( // loops are on blocks of 8. loop will stop when @@ -235,7 +235,7 @@ void TransposeWx8_NEON(const uint8* src, int src_stride, "4: \n" - : "+r"(src_temp), // %0 + : "=&r"(src_temp), // %0 "+r"(src), // %1 "+r"(dst), // %2 "+r"(width64) // %3 @@ -255,7 +255,7 @@ void TransposeUVWx8_NEON(const uint8* src, int src_stride, uint8* dst_a, int dst_stride_a, uint8* dst_b, int dst_stride_b, int width) { - const uint8* src_temp = NULL; + const uint8* src_temp; int64 width64 = (int64) width; // Work around clang 3.4 warning. asm volatile ( // loops are on blocks of 8. loop will stop when @@ -520,7 +520,7 @@ void TransposeUVWx8_NEON(const uint8* src, int src_stride, "4: \n" - : "+r"(src_temp), // %0 + : "=&r"(src_temp), // %0 "+r"(src), // %1 "+r"(dst_a), // %2 "+r"(dst_b), // %3 diff --git a/libs/libyuv/source/row_common.cc b/libs/libyuv/source/row_common.cc index 2b80d074ce..0c47e1016b 100644 --- a/libs/libyuv/source/row_common.cc +++ b/libs/libyuv/source/row_common.cc @@ -2147,7 +2147,7 @@ void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride, } // Blend 2 rows into 1. -static void HalfRow_C(const uint8* src_uv, int src_uv_stride, +static void HalfRow_C(const uint8* src_uv, ptrdiff_t src_uv_stride, uint8* dst_uv, int width) { int x; for (x = 0; x < width; ++x) { @@ -2155,7 +2155,7 @@ static void HalfRow_C(const uint8* src_uv, int src_uv_stride, } } -static void HalfRow_16_C(const uint16* src_uv, int src_uv_stride, +static void HalfRow_16_C(const uint16* src_uv, ptrdiff_t src_uv_stride, uint16* dst_uv, int width) { int x; for (x = 0; x < width; ++x) { @@ -2176,7 +2176,7 @@ void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr, return; } if (y1_fraction == 128) { - HalfRow_C(src_ptr, (int)(src_stride), dst_ptr, width); + HalfRow_C(src_ptr, src_stride, dst_ptr, width); return; } for (x = 0; x < width - 1; x += 2) { @@ -2206,7 +2206,7 @@ void InterpolateRow_16_C(uint16* dst_ptr, const uint16* src_ptr, return; } if (source_y_fraction == 128) { - HalfRow_16_C(src_ptr, (int)(src_stride), dst_ptr, width); + HalfRow_16_C(src_ptr, src_stride, dst_ptr, width); return; } for (x = 0; x < width - 1; x += 2) { diff --git a/libs/libyuv/source/row_gcc.cc b/libs/libyuv/source/row_gcc.cc index d5174516e7..866bded790 100644 --- a/libs/libyuv/source/row_gcc.cc +++ b/libs/libyuv/source/row_gcc.cc @@ -1811,7 +1811,7 @@ void OMITFP I411ToARGBRow_SSSE3(const uint8* y_buf, uint8* dst_argb, const struct YuvConstants* yuvconstants, int width) { - int temp = 0; + int temp; asm volatile ( YUVTORGB_SETUP(yuvconstants) "sub %[u_buf],%[v_buf] \n" @@ -1823,15 +1823,15 @@ void OMITFP I411ToARGBRow_SSSE3(const uint8* y_buf, STOREARGB "subl $0x8,%[width] \n" "jg 1b \n" - : [y_buf]"+r"(y_buf), // %[y_buf] - [u_buf]"+r"(u_buf), // %[u_buf] - [v_buf]"+r"(v_buf), // %[v_buf] + : [y_buf]"+r"(y_buf), // %[y_buf] + [u_buf]"+r"(u_buf), // %[u_buf] + [v_buf]"+r"(v_buf), // %[v_buf] [dst_argb]"+r"(dst_argb), // %[dst_argb] - [temp]"+r"(temp), // %[temp] + [temp]"=&r"(temp), // %[temp] #if defined(__i386__) && defined(__pic__) - [width]"+m"(width) // %[width] + [width]"+m"(width) // %[width] #else - [width]"+rm"(width) // %[width] + [width]"+rm"(width) // %[width] #endif : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] : "memory", "cc", NACL_R14 YUVTORGB_REGS @@ -3732,7 +3732,7 @@ void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width) { // Unattenuate 4 pixels at a time. void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width) { - uintptr_t alpha = 0; + uintptr_t alpha; asm volatile ( // 4 pixel loop. LABELALIGN @@ -3763,10 +3763,10 @@ void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, "lea " MEMLEA(0x10,1) ",%1 \n" "sub $0x4,%2 \n" "jg 1b \n" - : "+r"(src_argb), // %0 - "+r"(dst_argb), // %1 - "+r"(width), // %2 - "+r"(alpha) // %3 + : "+r"(src_argb), // %0 + "+r"(dst_argb), // %1 + "+r"(width), // %2 + "=&r"(alpha) // %3 : "r"(fixed_invtbl8) // %4 : "memory", "cc", NACL_R14 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" @@ -3782,7 +3782,7 @@ static const uvec8 kUnattenShuffleAlpha_AVX2 = { // Unattenuate 8 pixels at a time. void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width) { - uintptr_t alpha = 0; + uintptr_t alpha; asm volatile ( "sub %0,%1 \n" "vbroadcastf128 %5,%%ymm5 \n" @@ -3831,10 +3831,10 @@ void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, "sub $0x8,%2 \n" "jg 1b \n" "vzeroupper \n" - : "+r"(src_argb), // %0 - "+r"(dst_argb), // %1 - "+r"(width), // %2 - "+r"(alpha) // %3 + : "+r"(src_argb), // %0 + "+r"(dst_argb), // %1 + "+r"(width), // %2 + "=&r"(alpha) // %3 : "r"(fixed_invtbl8), // %4 "m"(kUnattenShuffleAlpha_AVX2) // %5 : "memory", "cc", NACL_R14 @@ -4759,7 +4759,7 @@ LIBYUV_API void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride, uint8* dst_argb, const float* src_dudv, int width) { intptr_t src_argb_stride_temp = src_argb_stride; - intptr_t temp = 0; + intptr_t temp; asm volatile ( "movq " MEMACCESS(3) ",%%xmm2 \n" "movq " MEMACCESS2(0x08,3) ",%%xmm7 \n" @@ -4831,7 +4831,7 @@ void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride, "+r"(dst_argb), // %2 "+r"(src_dudv), // %3 "+rm"(width), // %4 - "+r"(temp) // %5 + "=&r"(temp) // %5 : : "memory", "cc", NACL_R14 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7" @@ -5057,7 +5057,7 @@ void ARGBShuffleRow_AVX2(const uint8* src_argb, uint8* dst_argb, // For BGRAToARGB, ABGRToARGB, RGBAToARGB, and ARGBToRGBA. void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb, const uint8* shuffler, int width) { - uintptr_t pixel_temp = 0u; + uintptr_t pixel_temp; asm volatile ( "pxor %%xmm5,%%xmm5 \n" "mov " MEMACCESS(4) ",%k2 \n" @@ -5162,11 +5162,11 @@ void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb, "jg 3012b \n" "99: \n" - : "+r"(src_argb), // %0 - "+r"(dst_argb), // %1 - "+d"(pixel_temp), // %2 + : "+r"(src_argb), // %0 + "+r"(dst_argb), // %1 + "=&d"(pixel_temp), // %2 "+r"(width) // %3 - : "r"(shuffler) // %4 + : "r"(shuffler) // %4 : "memory", "cc", NACL_R14 "xmm0", "xmm1", "xmm5" ); @@ -5343,7 +5343,7 @@ void ARGBPolynomialRow_AVX2(const uint8* src_argb, // Tranform ARGB pixels with color table. void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width) { - uintptr_t pixel_temp = 0u; + uintptr_t pixel_temp; asm volatile ( // 1 pixel loop. LABELALIGN @@ -5363,10 +5363,10 @@ void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, "mov %b1," MEMACCESS2(-0x1,0) " \n" "dec %2 \n" "jg 1b \n" - : "+r"(dst_argb), // %0 - "+d"(pixel_temp), // %1 - "+r"(width) // %2 - : "r"(table_argb) // %3 + : "+r"(dst_argb), // %0 + "=&d"(pixel_temp), // %1 + "+r"(width) // %2 + : "r"(table_argb) // %3 : "memory", "cc"); } #endif // HAS_ARGBCOLORTABLEROW_X86 @@ -5374,7 +5374,7 @@ void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, #ifdef HAS_RGBCOLORTABLEROW_X86 // Tranform RGB pixels with color table. void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width) { - uintptr_t pixel_temp = 0u; + uintptr_t pixel_temp; asm volatile ( // 1 pixel loop. LABELALIGN @@ -5391,10 +5391,10 @@ void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width) { "mov %b1," MEMACCESS2(-0x2,0) " \n" "dec %2 \n" "jg 1b \n" - : "+r"(dst_argb), // %0 - "+d"(pixel_temp), // %1 - "+r"(width) // %2 - : "r"(table_argb) // %3 + : "+r"(dst_argb), // %0 + "=&d"(pixel_temp), // %1 + "+r"(width) // %2 + : "r"(table_argb) // %3 : "memory", "cc"); } #endif // HAS_RGBCOLORTABLEROW_X86 @@ -5404,8 +5404,8 @@ void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width) { void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width, const uint8* luma, uint32 lumacoeff) { - uintptr_t pixel_temp = 0u; - uintptr_t table_temp = 0u; + uintptr_t pixel_temp; + uintptr_t table_temp; asm volatile ( "movd %6,%%xmm3 \n" "pshufd $0x0,%%xmm3,%%xmm3 \n" @@ -5487,13 +5487,13 @@ void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb, "lea " MEMLEA(0x10,3) ",%3 \n" "sub $0x4,%4 \n" "jg 1b \n" - : "+d"(pixel_temp), // %0 - "+a"(table_temp), // %1 - "+r"(src_argb), // %2 - "+r"(dst_argb), // %3 - "+rm"(width) // %4 - : "r"(luma), // %5 - "rm"(lumacoeff) // %6 + : "=&d"(pixel_temp), // %0 + "=&a"(table_temp), // %1 + "+r"(src_argb), // %2 + "+r"(dst_argb), // %3 + "+rm"(width) // %4 + : "r"(luma), // %5 + "rm"(lumacoeff) // %6 : "memory", "cc", "xmm0", "xmm3", "xmm4", "xmm5" ); } diff --git a/libs/libyuv/source/row_mips.cc b/libs/libyuv/source/row_mips.cc index 2c55b786b2..ca6ecce94f 100644 --- a/libs/libyuv/source/row_mips.cc +++ b/libs/libyuv/source/row_mips.cc @@ -498,8 +498,8 @@ void MirrorRow_DSPR2(const uint8* src, uint8* dst, int width) { void MirrorUVRow_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width) { - int x = 0; - int y = 0; + int x; + int y; __asm__ __volatile__ ( ".set push \n" ".set noreorder \n" @@ -579,7 +579,7 @@ void MirrorUVRow_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, [dst_u] "+r" (dst_u), [dst_v] "+r" (dst_v), [x] "=&r" (x), - [y] "+r" (y) + [y] "=&r" (y) : [width] "r" (width) : "t0", "t1", "t2", "t3", "t4", "t5", "t7", "t8", "t9" diff --git a/libs/libyuv/source/row_neon.cc b/libs/libyuv/source/row_neon.cc index 13fe95cb7c..91d6aa857b 100644 --- a/libs/libyuv/source/row_neon.cc +++ b/libs/libyuv/source/row_neon.cc @@ -317,16 +317,11 @@ void I422ToRGB24Row_NEON(const uint8* src_y, } #define ARGBTORGB565 \ - "vshr.u8 d20, d20, #3 \n" /* B */ \ - "vshr.u8 d21, d21, #2 \n" /* G */ \ - "vshr.u8 d22, d22, #3 \n" /* R */ \ - "vmovl.u8 q8, d20 \n" /* B */ \ - "vmovl.u8 q9, d21 \n" /* G */ \ - "vmovl.u8 q10, d22 \n" /* R */ \ - "vshl.u16 q9, q9, #5 \n" /* G */ \ - "vshl.u16 q10, q10, #11 \n" /* R */ \ - "vorr q0, q8, q9 \n" /* BG */ \ - "vorr q0, q0, q10 \n" /* BGR */ + "vshll.u8 q0, d22, #8 \n" /* R */ \ + "vshll.u8 q8, d21, #8 \n" /* G */ \ + "vshll.u8 q9, d20, #8 \n" /* B */ \ + "vsri.16 q0, q8, #5 \n" /* RG */ \ + "vsri.16 q0, q9, #11 \n" /* RGB */ void I422ToRGB565Row_NEON(const uint8* src_y, const uint8* src_u, @@ -359,19 +354,13 @@ void I422ToRGB565Row_NEON(const uint8* src_y, } #define ARGBTOARGB1555 \ - "vshr.u8 q10, q10, #3 \n" /* B */ \ - "vshr.u8 d22, d22, #3 \n" /* R */ \ - "vshr.u8 d23, d23, #7 \n" /* A */ \ - "vmovl.u8 q8, d20 \n" /* B */ \ - "vmovl.u8 q9, d21 \n" /* G */ \ - "vmovl.u8 q10, d22 \n" /* R */ \ - "vmovl.u8 q11, d23 \n" /* A */ \ - "vshl.u16 q9, q9, #5 \n" /* G */ \ - "vshl.u16 q10, q10, #10 \n" /* R */ \ - "vshl.u16 q11, q11, #15 \n" /* A */ \ - "vorr q0, q8, q9 \n" /* BG */ \ - "vorr q1, q10, q11 \n" /* RA */ \ - "vorr q0, q0, q1 \n" /* BGRA */ + "vshll.u8 q0, d23, #8 \n" /* A */ \ + "vshll.u8 q8, d22, #8 \n" /* R */ \ + "vshll.u8 q9, d21, #8 \n" /* G */ \ + "vshll.u8 q10, d20, #8 \n" /* B */ \ + "vsri.16 q0, q8, #1 \n" /* AR */ \ + "vsri.16 q0, q9, #6 \n" /* ARG */ \ + "vsri.16 q0, q10, #11 \n" /* ARGB */ void I422ToARGB1555Row_NEON(const uint8* src_y, const uint8* src_u, diff --git a/libs/libyuv/source/row_neon64.cc b/libs/libyuv/source/row_neon64.cc index 0b5ca05bfb..ee42af12e3 100644 --- a/libs/libyuv/source/row_neon64.cc +++ b/libs/libyuv/source/row_neon64.cc @@ -323,8 +323,8 @@ void I422ToRGB24Row_NEON(const uint8* src_y, #define ARGBTORGB565 \ "shll v0.8h, v22.8b, #8 \n" /* R */ \ - "shll v20.8h, v20.8b, #8 \n" /* B */ \ "shll v21.8h, v21.8b, #8 \n" /* G */ \ + "shll v20.8h, v20.8b, #8 \n" /* B */ \ "sri v0.8h, v21.8h, #5 \n" /* RG */ \ "sri v0.8h, v20.8h, #11 \n" /* RGB */ @@ -363,8 +363,8 @@ void I422ToRGB565Row_NEON(const uint8* src_y, #define ARGBTOARGB1555 \ "shll v0.8h, v23.8b, #8 \n" /* A */ \ "shll v22.8h, v22.8b, #8 \n" /* R */ \ - "shll v20.8h, v20.8b, #8 \n" /* B */ \ "shll v21.8h, v21.8b, #8 \n" /* G */ \ + "shll v20.8h, v20.8b, #8 \n" /* B */ \ "sri v0.8h, v22.8h, #1 \n" /* AR */ \ "sri v0.8h, v21.8h, #6 \n" /* ARG */ \ "sri v0.8h, v20.8h, #11 \n" /* ARGB */ diff --git a/libs/libyuv/source/scale_gcc.cc b/libs/libyuv/source/scale_gcc.cc index a1ae4e2773..400f2fde9b 100644 --- a/libs/libyuv/source/scale_gcc.cc +++ b/libs/libyuv/source/scale_gcc.cc @@ -316,7 +316,7 @@ void ScaleRowDown4_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, void ScaleRowDown4Box_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, uint8* dst_ptr, int dst_width) { - intptr_t stridex3 = 0; + intptr_t stridex3; asm volatile ( "pcmpeqb %%xmm4,%%xmm4 \n" "psrlw $0xf,%%xmm4 \n" @@ -361,7 +361,7 @@ void ScaleRowDown4Box_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, : "+r"(src_ptr), // %0 "+r"(dst_ptr), // %1 "+r"(dst_width), // %2 - "+r"(stridex3) // %3 + "=&r"(stridex3) // %3 : "r"((intptr_t)(src_stride)) // %4 : "memory", "cc", NACL_R14 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" @@ -824,7 +824,7 @@ void ScaleAddRow_AVX2(const uint8* src_ptr, uint16* dst_ptr, int src_width) { // Bilinear column filtering. SSSE3 version. void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr, int dst_width, int x, int dx) { - intptr_t x0 = 0, x1 = 0, temp_pixel = 0; + intptr_t x0, x1, temp_pixel; asm volatile ( "movd %6,%%xmm2 \n" "movd %7,%%xmm3 \n" @@ -880,14 +880,14 @@ void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr, "movd %%xmm0,%k2 \n" "mov %b2," MEMACCESS(0) " \n" "99: \n" - : "+r"(dst_ptr), // %0 - "+r"(src_ptr), // %1 - "+a"(temp_pixel), // %2 - "+r"(x0), // %3 - "+r"(x1), // %4 - "+rm"(dst_width) // %5 - : "rm"(x), // %6 - "rm"(dx) // %7 + : "+r"(dst_ptr), // %0 + "+r"(src_ptr), // %1 + "=&a"(temp_pixel), // %2 + "=&r"(x0), // %3 + "=&r"(x1), // %4 + "+rm"(dst_width) // %5 + : "rm"(x), // %6 + "rm"(dx) // %7 : "memory", "cc", NACL_R14 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6" ); @@ -998,7 +998,7 @@ void ScaleARGBRowDown2Box_SSE2(const uint8* src_argb, void ScaleARGBRowDownEven_SSE2(const uint8* src_argb, ptrdiff_t src_stride, int src_stepx, uint8* dst_argb, int dst_width) { intptr_t src_stepx_x4 = (intptr_t)(src_stepx); - intptr_t src_stepx_x12 = 0; + intptr_t src_stepx_x12; asm volatile ( "lea " MEMLEA3(0x00,1,4) ",%1 \n" "lea " MEMLEA4(0x00,1,1,2) ",%4 \n" @@ -1016,11 +1016,11 @@ void ScaleARGBRowDownEven_SSE2(const uint8* src_argb, ptrdiff_t src_stride, "lea " MEMLEA(0x10,2) ",%2 \n" "sub $0x4,%3 \n" "jg 1b \n" - : "+r"(src_argb), // %0 - "+r"(src_stepx_x4), // %1 - "+r"(dst_argb), // %2 - "+r"(dst_width), // %3 - "+r"(src_stepx_x12) // %4 + : "+r"(src_argb), // %0 + "+r"(src_stepx_x4), // %1 + "+r"(dst_argb), // %2 + "+r"(dst_width), // %3 + "=&r"(src_stepx_x12) // %4 :: "memory", "cc", NACL_R14 "xmm0", "xmm1", "xmm2", "xmm3" ); @@ -1032,7 +1032,7 @@ void ScaleARGBRowDownEvenBox_SSE2(const uint8* src_argb, ptrdiff_t src_stride, int src_stepx, uint8* dst_argb, int dst_width) { intptr_t src_stepx_x4 = (intptr_t)(src_stepx); - intptr_t src_stepx_x12 = 0; + intptr_t src_stepx_x12; intptr_t row1 = (intptr_t)(src_stride); asm volatile ( "lea " MEMLEA3(0x00,1,4) ",%1 \n" @@ -1061,12 +1061,12 @@ void ScaleARGBRowDownEvenBox_SSE2(const uint8* src_argb, "lea " MEMLEA(0x10,2) ",%2 \n" "sub $0x4,%3 \n" "jg 1b \n" - : "+r"(src_argb), // %0 - "+r"(src_stepx_x4), // %1 - "+r"(dst_argb), // %2 - "+rm"(dst_width), // %3 - "+r"(src_stepx_x12), // %4 - "+r"(row1) // %5 + : "+r"(src_argb), // %0 + "+r"(src_stepx_x4), // %1 + "+r"(dst_argb), // %2 + "+rm"(dst_width), // %3 + "=&r"(src_stepx_x12), // %4 + "+r"(row1) // %5 :: "memory", "cc", NACL_R14 "xmm0", "xmm1", "xmm2", "xmm3" ); @@ -1074,7 +1074,7 @@ void ScaleARGBRowDownEvenBox_SSE2(const uint8* src_argb, void ScaleARGBCols_SSE2(uint8* dst_argb, const uint8* src_argb, int dst_width, int x, int dx) { - intptr_t x0 = 0, x1 = 0; + intptr_t x0, x1; asm volatile ( "movd %5,%%xmm2 \n" "movd %6,%%xmm3 \n" @@ -1127,8 +1127,8 @@ void ScaleARGBCols_SSE2(uint8* dst_argb, const uint8* src_argb, MEMOPREG(movd,0x00,3,0,4,xmm0) // movd (%3,%0,4),%%xmm0 "movd %%xmm0," MEMACCESS(2) " \n" "99: \n" - : "+a"(x0), // %0 - "+d"(x1), // %1 + : "=&a"(x0), // %0 + "=&d"(x1), // %1 "+r"(dst_argb), // %2 "+r"(src_argb), // %3 "+r"(dst_width) // %4 @@ -1179,7 +1179,7 @@ static uvec8 kShuffleFractions = { // Bilinear row filtering combines 4x2 -> 4x1. SSSE3 version void ScaleARGBFilterCols_SSSE3(uint8* dst_argb, const uint8* src_argb, int dst_width, int x, int dx) { - intptr_t x0 = 0, x1 = 0; + intptr_t x0, x1; asm volatile ( "movdqa %0,%%xmm4 \n" "movdqa %1,%%xmm5 \n" @@ -1242,8 +1242,8 @@ void ScaleARGBFilterCols_SSSE3(uint8* dst_argb, const uint8* src_argb, : "+r"(dst_argb), // %0 "+r"(src_argb), // %1 "+rm"(dst_width), // %2 - "+r"(x0), // %3 - "+r"(x1) // %4 + "=&r"(x0), // %3 + "=&r"(x1) // %4 : "rm"(x), // %5 "rm"(dx) // %6 : "memory", "cc", NACL_R14 diff --git a/libs/libyuv/source/scale_neon.cc b/libs/libyuv/source/scale_neon.cc index 10856cf847..95f3362a48 100644 --- a/libs/libyuv/source/scale_neon.cc +++ b/libs/libyuv/source/scale_neon.cc @@ -532,7 +532,7 @@ void ScaleRowDown38_2_Box_NEON(const uint8* src_ptr, void ScaleAddRows_NEON(const uint8* src_ptr, ptrdiff_t src_stride, uint16* dst_ptr, int src_width, int src_height) { - const uint8* src_tmp = NULL; + const uint8* src_tmp; asm volatile ( "1: \n" "mov %0, %1 \n" @@ -552,12 +552,12 @@ void ScaleAddRows_NEON(const uint8* src_ptr, ptrdiff_t src_stride, "add %1, %1, #16 \n" "subs %4, %4, #16 \n" // 16 processed per loop "bgt 1b \n" - : "+r"(src_tmp), // %0 - "+r"(src_ptr), // %1 - "+r"(dst_ptr), // %2 - "+r"(src_stride), // %3 - "+r"(src_width), // %4 - "+r"(src_height) // %5 + : "=&r"(src_tmp), // %0 + "+r"(src_ptr), // %1 + "+r"(dst_ptr), // %2 + "+r"(src_stride), // %3 + "+r"(src_width), // %4 + "+r"(src_height) // %5 : : "memory", "cc", "r12", "q0", "q1", "q2", "q3" // Clobber List ); @@ -909,7 +909,7 @@ void ScaleARGBRowDownEvenBox_NEON(const uint8* src_argb, ptrdiff_t src_stride, void ScaleARGBCols_NEON(uint8* dst_argb, const uint8* src_argb, int dst_width, int x, int dx) { - int tmp = 0; + int tmp; const uint8* src_tmp = src_argb; asm volatile ( "1: \n" @@ -926,13 +926,13 @@ void ScaleARGBCols_NEON(uint8* dst_argb, const uint8* src_argb, "vst1.32 {q0, q1}, [%0]! \n" // store pixels "subs %2, %2, #8 \n" // 8 processed per loop "bgt 1b \n" - : "+r"(dst_argb), // %0 - "+r"(src_argb), // %1 - "+r"(dst_width), // %2 - "+r"(x), // %3 - "+r"(dx), // %4 - "+r"(tmp), // %5 - "+r"(src_tmp) // %6 + : "+r"(dst_argb), // %0 + "+r"(src_argb), // %1 + "+r"(dst_width), // %2 + "+r"(x), // %3 + "+r"(dx), // %4 + "=&r"(tmp), // %5 + "+r"(src_tmp) // %6 : : "memory", "cc", "q0", "q1" ); diff --git a/libs/libyuv/source/scale_neon64.cc b/libs/libyuv/source/scale_neon64.cc index 1d55193579..3a62db5b8d 100644 --- a/libs/libyuv/source/scale_neon64.cc +++ b/libs/libyuv/source/scale_neon64.cc @@ -547,7 +547,7 @@ void ScaleRowDown38_2_Box_NEON(const uint8* src_ptr, void ScaleAddRows_NEON(const uint8* src_ptr, ptrdiff_t src_stride, uint16* dst_ptr, int src_width, int src_height) { - const uint8* src_tmp = NULL; + const uint8* src_tmp; asm volatile ( "1: \n" "mov %0, %1 \n" @@ -567,12 +567,12 @@ void ScaleAddRows_NEON(const uint8* src_ptr, ptrdiff_t src_stride, "add %1, %1, #16 \n" "subs %w4, %w4, #16 \n" // 16 processed per loop "b.gt 1b \n" - : "+r"(src_tmp), // %0 - "+r"(src_ptr), // %1 - "+r"(dst_ptr), // %2 - "+r"(src_stride), // %3 - "+r"(src_width), // %4 - "+r"(src_height) // %5 + : "=&r"(src_tmp), // %0 + "+r"(src_ptr), // %1 + "+r"(dst_ptr), // %2 + "+r"(src_stride), // %3 + "+r"(src_width), // %4 + "+r"(src_height) // %5 : : "memory", "cc", "w12", "v0", "v1", "v2", "v3" // Clobber List ); @@ -931,7 +931,7 @@ void ScaleARGBCols_NEON(uint8* dst_argb, const uint8* src_argb, int64 dst_width64 = (int64) dst_width; // Work around ios 64 bit warning. int64 x64 = (int64) x; int64 dx64 = (int64) dx; - int64 tmp64 = 0; + int64 tmp64; asm volatile ( "1: \n" LOAD1_DATA32_LANE(v0, 0) @@ -947,13 +947,13 @@ void ScaleARGBCols_NEON(uint8* dst_argb, const uint8* src_argb, "st1 {v0.4s, v1.4s}, [%0], #32 \n" // store pixels "subs %w2, %w2, #8 \n" // 8 processed per loop "b.gt 1b \n" - : "+r"(dst_argb), // %0 - "+r"(src_argb), // %1 - "+r"(dst_width64), // %2 - "+r"(x64), // %3 - "+r"(dx64), // %4 - "+r"(tmp64), // %5 - "+r"(src_tmp) // %6 + : "+r"(dst_argb), // %0 + "+r"(src_argb), // %1 + "+r"(dst_width64), // %2 + "+r"(x64), // %3 + "+r"(dx64), // %4 + "=&r"(tmp64), // %5 + "+r"(src_tmp) // %6 : : "memory", "cc", "v0", "v1" ); diff --git a/libs/libyuv/sync_chromium.py b/libs/libyuv/sync_chromium.py index 53341a78a3..4e51b6bd6b 100755 --- a/libs/libyuv/sync_chromium.py +++ b/libs/libyuv/sync_chromium.py @@ -86,8 +86,6 @@ def main(): env = os.environ.copy() # Avoid downloading NaCl toolchain as part of the Chromium hooks. - env.setdefault('GYP_DEFINES', '') - env['GYP_DEFINES'] += ' disable_nacl=1' env['GYP_CHROMIUM_NO_ACTION'] = '1' gclient_cmd = 'gclient.bat' if sys.platform.startswith('win') else 'gclient' args = [