deleted file mode 100644
--- a/media/libvpx/apple-clang.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-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
-@@ -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};
-
-+#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
--- a/media/libvpx/update.py
+++ b/media/libvpx/update.py
@@ -72,60 +72,74 @@ MODULES = {
'API_SRCS-$(CONFIG_VP9_ENCODER)',
'VP8_CX_EXPORTS',
'VP8_CX_SRCS-$(CONFIG_MULTI_RES_ENCODING)',
'VP8_CX_SRCS-$(CONFIG_MULTITHREAD)',
'VP8_CX_SRCS-$(CONFIG_TEMPORAL_DENOISING)',
'VP8_CX_SRCS-no',
'VP8_CX_SRCS_REMOVE-no',
'VP8_CX_SRCS_REMOVE-yes',
+ 'VP8_CX_SRCS_REMOVE-yes+$(CONFIG_REALTIME_ONLY)',
'VP8_CX_SRCS-yes',
'VP9_CX_EXPORTS',
'VP9_CX_SRCS-no',
'VP9_CX_SRCS_REMOVE-no',
'VP9_CX_SRCS_REMOVE-yes',
'VP9_CX_SRCS-yes',
],
'X86_ASM': [
'PORTS_SRCS-$(BUILD_LIBVPX)',
+ 'PORTS_SRCS-$(BUILD_LIBVPX)+$(ARCH_X86)$(ARCH_X86_64)',
'VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64)',
'VP8_COMMON_SRCS-$(HAVE_MMX)',
+ 'VP8_COMMON_SRCS-$(HAVE_MMX)+$(CONFIG_POSTPROC)',
'VP8_COMMON_SRCS-$(HAVE_SSE2)',
+ 'VP8_COMMON_SRCS-$(HAVE_SSE2)+$(CONFIG_POSTPROC)',
'VP8_COMMON_SRCS-$(HAVE_SSE3)',
'VP8_COMMON_SRCS-$(HAVE_SSE4_1)',
'VP8_COMMON_SRCS-$(HAVE_SSSE3)',
+ 'VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64)',
+ 'VP8_CX_SRCS-$(HAVE_MMX)',
+ 'VP8_CX_SRCS-$(HAVE_SSE2)',
+ 'VP8_CX_SRCS-$(HAVE_SSE2)+$(CONFIG_TEMPORAL_DENOISING)',
+ 'VP8_CX_SRCS-$(HAVE_SSE4_1)',
+ 'VP8_CX_SRCS-$(HAVE_SSSE3)',
+ 'VP8_CX_SRCS_REMOVE-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MMON_SRCS-$(ARCH_ARM)',
'VP8_COMMON_SRCS-$(HAVE_MEDIA)',
'VP8_COMMON_SRCS-$(HAVE_NEON)',
'VP9_COMMON_SRCS-$(HAVE_NEON)',
'VP9_COMMON_SRCS-$(HAVE_NEON_ASM)',
+ 'VP9_COMMON_SRCS-yes+$(HAVE_NEON_ASM)',
'VP8_CX_SRCS-$(ARCH_ARM)',
'VP8_CX_SRCS-$(HAVE_EDSP)',
'VP8_CX_SRCS-$(HAVE_MEDIA)',
'VP8_CX_SRCS-$(HAVE_NEON)',
'VP8_CX_SRCS-$(HAVE_NEON_ASM)',
'VP9_CX_SRCS-$(HAVE_NEON)',
],
'ERROR_CONCEALMENT': [
@@ -135,38 +149,48 @@ MODULES = {
'VP9_COMMON_SRCS-$(HAVE_AVX2)',
'VP9_CX_SRCS-$(HAVE_AVX2)',
],
'VP8_POSTPROC': [
'VP8_COMMON_SRCS-$(CONFIG_POSTPROC)',
],
'VP9_POSTPROC': [
'VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC)',
+ 'VP9_COMMON_SRCS-$(HAVE_SSE2)+$(CONFIG_VP9_POSTPROC)',
]
}
DISABLED_MODULES = [
'API_SRCS-$(CONFIG_SPATIAL_SVC)',
+ 'API_SRCS-$(CONFIG_SPATIAL_SVC)+$(CONFIG_VP9_ENCODER)',
'MEM_SRCS-$(CONFIG_MEM_MANAGER)',
'MEM_SRCS-$(CONFIG_MEM_TRACKER)',
'VP8_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER)',
'VP9_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER)',
'VP8_CX_SRCS-$(CONFIG_INTERNAL_STATS)',
'VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS)',
+ 'VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS)+$(CONFIG_VP9_POSTPROC)',
'VP9_CX_SRCS-$(CONFIG_VP9_TEMPORAL_DENOISING)',
+ 'VP9_CX_SRCS-$(HAVE_SSE2)+$(CONFIG_VP9_TEMPORAL_DENOISING)',
+ 'VP9_COMMON_SRCS-$(HAVE_SSE2)+$(CONFIG_VP9_HIGHBITDEPTH)',
+ 'VP9_CX_SRCS-$(HAVE_SSE2)+$(CONFIG_VP9_HIGHBITDEPTH)',
+
+ # use asm implementations instead of intrinsics
+ # neon exists as assembly and intrinsics implementations.
+ # If both are available prefer assembly (HAVE_NEON_ASM)
+ 'VP9_COMMON_SRCS-yes+$(HAVE_NEON)',
# mips files are also ignored via ignored_folders
'SCALE_SRCS-$(HAVE_DSPR2)',
'VP8_COMMON_SRCS-$(HAVE_DSPR2)',
'VP9_COMMON_SRCS-$(HAVE_DSPR2)',
'VP8_CX_SRCS_REMOVE-$(HAVE_EDSP)',
]
libvpx_files = [
- 'build/make/obj_int_extract.c',
'build/make/ads2gas.pl',
'build/make/thumb.pm',
'LICENSE',
'PATENTS',
]
ignore_files = [
'vp8/common/context.c',
@@ -190,16 +214,22 @@ ignore_folders = [
'libyuv/',
'mips/',
'nestegg/',
'objdir/',
'ppc/',
'test/',
'vpx_mem/memory_manager/',
]
+
+rename_files = {
+ #avoid clash with common/arm/neon/vp9_avg_neon.c
+ 'vp9/encoder/arm/neon/vp9_avg_neon.c': 'vp9/encoder/arm/neon/vp9enc_avg_neon.c'
+}
+
files = {
'EXPORTS': [
'vpx_mem/include/vpx_mem_intrnl.h',
'vpx_mem/vpx_mem.h',
'vpx_ports/arm.h',
'vpx_ports/mem.h',
'vpx_ports/vpx_timer.h',
'vpx_ports/x86.h',
@@ -212,26 +242,23 @@ files = {
'vpx/vpx_decoder.h',
'vpx/vpx_encoder.h',
'vpx/vpx_frame_buffer.h',
'vpx/vpx_image.h',
'vpx/vpx_integer.h',
],
'X86-64_ASM': [
'third_party/x86inc/x86inc.asm',
- 'vp8/common/x86/loopfilter_block_sse2.asm',
- 'vp9/encoder/x86/vp9_quantize_ssse3.asm',
],
'SOURCES': [
'vp8/common/rtcd.c',
'vp8/common/sad_c.c',
'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',
'vp9/common/vp9_convolve.c',
'vp9/common/vp9_debugmodes.c',
'vp9/common/vp9_entropy.c',
'vp9/common/vp9_entropymode.c',
'vp9/common/vp9_entropymv.c',
@@ -251,47 +278,43 @@ files = {
'vp9/common/vp9_scan.c',
'vp9/common/vp9_seg_common.c',
'vp9/common/vp9_tile_common.c',
'vp9/decoder/vp9_decodeframe.c',
'vp9/decoder/vp9_decodemv.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_dct.c',
'vp9/encoder/vp9_encodeframe.c',
'vp9/encoder/vp9_encodemb.c',
'vp9/encoder/vp9_encodemv.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_rdopt.c',
'vp9/encoder/vp9_resize.c',
'vp9/encoder/vp9_sad.c',
'vp9/encoder/vp9_segmentation.c',
'vp9/encoder/vp9_subexp.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_writer.c',
'vp9/vp9_cx_iface.c',
'vp9/vp9_dx_iface.c',
- 'vpx/src/svc_encodeframe.c',
'vpx/src/vpx_encoder.c',
'vpx_mem/vpx_mem.c',
'vpx_scale/vpx_scale_rtcd.c',
'vpx_scale/generic/yv12config.c',
'vpx_scale/generic/yv12extend.c',
]
}
@@ -398,29 +421,37 @@ def get_libvpx_files(prefix):
def get_sources(prefix):
source = {}
unknown = {}
disabled = {}
for mk in mk_files:
with open(os.path.join(prefix, mk)) as f:
base = os.path.dirname(mk)
+ extra = ''
for l in f:
+ m = re.compile('ifeq +\((.*?\)), *yes\)').findall(l)
+ if m:
+ extra = '+' + m[0]
+ if extra and l.startswith('else') or l.startswith('endif'):
+ extra = ''
if '+=' in l:
l = l.split('+=')
key = l[0].strip()
+ key += extra
value = l[1].strip().replace('$(ASM)', '.asm')
value = os.path.join(base, value)
if not key.startswith('#') and os.path.splitext(value)[-1] in extensions:
if key not in source:
source[key] = []
source[key].append(value)
for key in source:
for f in source[key]:
+ f = rename_files.get(f, f)
if key.endswith('EXPORTS') and f.endswith('.h'):
files['EXPORTS'].append(f)
if os.path.splitext(f)[-1] in ('.c', '.asm') and not f in manual:
module = get_module(key)
if module:
if not module in files:
files[module] = []
t = files[module]
@@ -479,16 +510,17 @@ def update_and_remove_files(prefix, libv
# Update files
first = True
for f in libvpx_files:
fdir = os.path.dirname(f)
if fdir and not os.path.exists(fdir):
os.makedirs(fdir)
s = os.path.join(prefix, f)
+ f = rename_files.get(f, f)
if is_new(f, s):
if first:
print "Copy files:"
first = False
copy(s, f)
# Copy configuration files for each platform
for target in PLATFORMS:
@@ -505,30 +537,28 @@ def update_and_remove_files(prefix, libv
# Copy vpx_version.h from one of the build targets
s = os.path.join(prefix, 'objdir/x86-linux-gcc/vpx_version.h')
f = 'vpx_version.h'
if is_new(s, f):
copy(s, f)
# Remove unknown files from tree
- removed_files = [f for f in current_files if f not in libvpx_files]
+ removed_files = [f for f in current_files if f not in libvpx_files and f not in rename_files.values()]
if removed_files:
print "Remove files:"
for f in removed_files:
os.unlink(f)
print ' ', f
def apply_patches():
# Patch to permit vpx users to specify their own <stdint.h> types.
os.system("patch -p0 < stdint.patch")
- # 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")
+ os.system("patch -p1 < msvc2015.patch")
# Patch to fix a crash caused by MSVC 2013
os.system("patch -p3 < bug1137614.patch")
def update_readme(commit):
with open('README_MOZILLA') as f:
readme = f.read()
if 'The git commit ID used was' in readme: