Bug 1148639 - Update libvpx import script and patches. r=kinetik

From 3f94fd4fc68971f0dc2148aa19b4e146262d15af Mon Sep 17 00:00:00 2001
Matched against upstream commit afad1a84c1.
This commit is contained in:
Ralph Giles 2015-03-27 14:38:35 -07:00
parent 24e58b253c
commit ce8120b484
4 changed files with 80 additions and 46 deletions

View File

@ -1,29 +1,71 @@
diff --git a/media/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c b/media/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c
index 0ffb1bc..733693d 100644
--- a/media/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c
+++ b/media/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c
@@ -27,21 +27,24 @@ DECLARE_ALIGNED(32, static const uint8_t
4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12
};
DECLARE_ALIGNED(32, static const uint8_t, filt4_global_avx2[32]) = {
@@ -28,6 +28,26 @@ DECLARE_ALIGNED(32, const unsigned char, filt4_global_avx2[32])= {
6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14,
6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14
};
6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14};
#if defined(__clang__)
# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ <= 3) || \
- (defined(__APPLE__) && __clang_major__ == 5 && __clang_minor__ == 0)
+ (defined(__APPLE__) && \
+ (__clang_major__ == 4 && __clang_minor__ >= 0 && \
+ __clang_minor__ <= 2) || \
+ (__clang_major__ == 5 && __clang_minor__ == 0))
# define MM256_BROADCASTSI128_SI256(x) \
_mm_broadcastsi128_si256((__m128i const *)&(x))
# else // clang > 3.3, and not 5.0 on macosx.
# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x)
# endif // clang <= 3.3
#elif defined(__GNUC__)
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 6)
# define MM256_BROADCASTSI128_SI256(x) \
_mm_broadcastsi128_si256((__m128i const *)&(x))
# elif __GNUC__ == 4 && __GNUC_MINOR__ == 7
+#if defined(__clang__)
+# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ <= 3) || \
+ (defined(__APPLE__) && __clang_major__ == 5 && __clang_minor__ == 0)
+# define MM256_BROADCASTSI128_SI256(x) \
+ _mm_broadcastsi128_si256((__m128i const *)&(x))
+# else // clang > 3.3, and not 5.0 on macosx.
+# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x)
+# endif // clang <= 3.3
+#elif defined(__GNUC__)
+# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 6)
+# define MM256_BROADCASTSI128_SI256(x) \
+ _mm_broadcastsi128_si256((__m128i const *)&(x))
+# elif __GNUC__ == 4 && __GNUC_MINOR__ == 7
+# define MM256_BROADCASTSI128_SI256(x) _mm_broadcastsi128_si256(x)
+# else // gcc > 4.7
+# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x)
+# endif // gcc <= 4.6
+#else // !(gcc || clang)
+# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x)
+#endif // __clang__
void vp9_filter_block1d16_h8_avx2(unsigned char *src_ptr,
unsigned int src_pixels_per_line,
@@ -50,18 +70,7 @@ void vp9_filter_block1d16_h8_avx2(unsigned char *src_ptr,
// in both lanes of 128 bit register.
filtersReg =_mm_packs_epi16(filtersReg, filtersReg);
// have the same data in both lanes of a 256 bit register
-#if defined (__GNUC__)
-#if ( __GNUC__ < 4 || (__GNUC__ == 4 && \
-(__GNUC_MINOR__ < 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0))))
- filtersReg32 = _mm_broadcastsi128_si256((__m128i const *)&filtersReg);
-#elif(__GNUC__ == 4 && (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ > 0))
- filtersReg32 = _mm_broadcastsi128_si256(filtersReg);
-#else
- filtersReg32 = _mm256_broadcastsi128_si256(filtersReg);
-#endif
-#else
- filtersReg32 = _mm256_broadcastsi128_si256(filtersReg);
-#endif
+ filtersReg32 = MM256_BROADCASTSI128_SI256(filtersReg);
// duplicate only the first 16 bits (first and second byte)
// across 256 bit register
@@ -306,18 +315,7 @@ void vp9_filter_block1d16_v8_avx2(unsigned char *src_ptr,
// same data in both lanes of 128 bit register.
filtersReg =_mm_packs_epi16(filtersReg, filtersReg);
// have the same data in both lanes of a 256 bit register
-#if defined (__GNUC__)
-#if ( __GNUC__ < 4 || (__GNUC__ == 4 && \
-(__GNUC_MINOR__ < 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0))))
- filtersReg32 = _mm_broadcastsi128_si256((__m128i const *)&filtersReg);
-#elif(__GNUC__ == 4 && (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ > 0))
- filtersReg32 = _mm_broadcastsi128_si256(filtersReg);
-#else
- filtersReg32 = _mm256_broadcastsi128_si256(filtersReg);
-#endif
-#else
- filtersReg32 = _mm256_broadcastsi128_si256(filtersReg);
-#endif
+ filtersReg32 = MM256_BROADCASTSI128_SI256(filtersReg);
// duplicate only the first 16 bits (first and second byte)
// across 256 bit register

View File

@ -5,11 +5,11 @@ diff --git a/media/libvpx/vp9/common/vp9_systemdependent.h b/media/libvpx/vp9/co
#define VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
#ifdef _MSC_VER
# include <math.h> // the ceil() definition must precede intrin.h
# if _MSC_VER > 1310 && (defined(_M_X64) || defined(_M_IX86))
# include <intrin.h>
# define USE_MSC_INTRIN
# endif
# include <math.h>
-# define snprintf _snprintf
+# if _MSC_VER < 1900
+# define snprintf _snprintf

View File

@ -6,9 +6,9 @@
+#if !defined(VPX_DONT_DEFINE_STDINT_TYPES)
+
#if defined(_MSC_VER)
#define VPX_FORCE_INLINE __forceinline
#define VPX_INLINE __inline
#if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES)
typedef signed char int8_t;
typedef signed short int16_t;
@@ -56,6 +58,8 @@
#endif

View File

@ -217,8 +217,8 @@ files = {
],
'X86-64_ASM': [
'third_party/x86inc/x86inc.asm',
'vp8/common/x86/loopfilter_block_sse2_x86_64.asm',
'vp9/encoder/x86/vp9_quantize_ssse3_x86_64.asm',
'vp8/common/x86/loopfilter_block_sse2.asm',
'vp9/encoder/x86/vp9_quantize_ssse3.asm',
],
'SOURCES': [
'vp8/common/rtcd.c',
@ -226,6 +226,7 @@ files = {
'vp8/encoder/bitstream.c',
'vp8/encoder/onyx_if.c',
'vp8/vp8_dx_iface.c',
'vp9/common/generic/vp9_systemdependent.c',
'vp9/common/vp9_alloccommon.c',
'vp9/common/vp9_blockd.c',
'vp9/common/vp9_common_data.c',
@ -249,48 +250,39 @@ files = {
'vp9/common/vp9_scale.c',
'vp9/common/vp9_scan.c',
'vp9/common/vp9_seg_common.c',
'vp9/common/vp9_thread.c',
'vp9/common/vp9_tile_common.c',
'vp9/decoder/vp9_decodeframe.c',
'vp9/decoder/vp9_decodemv.c',
'vp9/decoder/vp9_decoder.c',
'vp9/decoder/vp9_detokenize.c',
'vp9/decoder/vp9_dsubexp.c',
'vp9/decoder/vp9_dthread.c',
'vp9/decoder/vp9_onyxd_if.c',
'vp9/decoder/vp9_reader.c',
'vp9/encoder/vp9_bitstream.c',
'vp9/encoder/vp9_aq_complexity.c',
'vp9/encoder/vp9_aq_cyclicrefresh.c',
'vp9/encoder/vp9_aq_variance.c',
'vp9/encoder/vp9_context_tree.c',
'vp9/encoder/vp9_cost.c',
'vp9/encoder/vp9_dct.c',
'vp9/encoder/vp9_encodeframe.c',
'vp9/encoder/vp9_encodemb.c',
'vp9/encoder/vp9_encodemv.c',
'vp9/encoder/vp9_encoder.c',
'vp9/encoder/vp9_extend.c',
'vp9/encoder/vp9_firstpass.c',
'vp9/encoder/vp9_lookahead.c',
'vp9/encoder/vp9_mbgraph.c',
'vp9/encoder/vp9_mcomp.c',
'vp9/encoder/vp9_onyx_if.c',
'vp9/encoder/vp9_picklpf.c',
'vp9/encoder/vp9_pickmode.c',
'vp9/encoder/vp9_quantize.c',
'vp9/encoder/vp9_ratectrl.c',
'vp9/encoder/vp9_rd.c',
'vp9/encoder/vp9_rdopt.c',
'vp9/encoder/vp9_resize.c',
'vp9/encoder/vp9_sad.c',
'vp9/encoder/vp9_segmentation.c',
'vp9/encoder/vp9_speed_features.c',
'vp9/encoder/vp9_subexp.c',
'vp9/encoder/vp9_svc_layercontext.c',
'vp9/encoder/vp9_temporal_filter.c',
'vp9/encoder/vp9_tokenize.c',
'vp9/encoder/vp9_treewriter.c',
'vp9/encoder/vp9_vaq.c',
'vp9/encoder/vp9_variance.c',
'vp9/encoder/vp9_write_bit_buffer.c',
'vp9/encoder/vp9_writer.c',
'vp9/vp9_cx_iface.c',
'vp9/vp9_dx_iface.c',
@ -307,9 +299,9 @@ manual = [
# special case in moz.build
'vp8/encoder/boolhuff.c',
# 64bit only
'vp8/common/x86/loopfilter_block_sse2_x86_64.asm',
'vp9/encoder/x86/vp9_quantize_ssse3_x86_64.asm',
# These 64-bit only files end up in X86_ASM. Filter them out.
'vp8/common/x86/loopfilter_block_sse2.asm',
'vp9/encoder/x86/vp9_quantize_ssse3.asm',
# offsets are special cased in Makefile.in
'vp8/encoder/vp8_asm_enc_offsets.c',
@ -530,7 +522,7 @@ def update_and_remove_files(prefix, libvpx_files, files):
def apply_patches():
# Patch to permit vpx users to specify their own <stdint.h> types.
os.system("patch -p0 < stdint.patch")
# Patch to allow older versions of Apple's clang to build libvpx.
# Patch for AVX intrinsic support with Apple's clang.
os.system("patch -p3 < apple-clang.patch")
# Patch to allow MSVC 2015 to compile libvpx
os.system("patch -p3 < msvc2015.patch")