summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2017-07-24 13:20:46 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-02-03 09:58:46 +0100
commitb094b135956829a293dd409eefa39f2912434fd9 (patch)
treec45e685a896948fd5bff5fee0d5adbf1d85bc516
parent2c1f833a092ef7af17f072749940bcb47da19aa6 (diff)
downloadUXP-b094b135956829a293dd409eefa39f2912434fd9.tar
UXP-b094b135956829a293dd409eefa39f2912434fd9.tar.gz
UXP-b094b135956829a293dd409eefa39f2912434fd9.tar.lz
UXP-b094b135956829a293dd409eefa39f2912434fd9.tar.xz
UXP-b094b135956829a293dd409eefa39f2912434fd9.zip
Add build files to support libwebp decoding.
-rw-r--r--config/external/moz.build2
-rw-r--r--media/libwebp/MOZCHANGES3
-rw-r--r--media/libwebp/dec/moz.build26
-rw-r--r--media/libwebp/demux/moz.build17
-rw-r--r--media/libwebp/dsp/moz.build53
-rw-r--r--media/libwebp/moz.build28
-rw-r--r--media/libwebp/moz/cpu.cpp44
-rw-r--r--media/libwebp/moz/moz.build17
-rw-r--r--media/libwebp/update.sh76
-rw-r--r--media/libwebp/utils/moz.build26
10 files changed, 292 insertions, 0 deletions
diff --git a/config/external/moz.build b/config/external/moz.build
index 029ff8504..c52933db8 100644
--- a/config/external/moz.build
+++ b/config/external/moz.build
@@ -36,6 +36,8 @@ if not CONFIG['MOZ_SYSTEM_LIBVPX']:
if not CONFIG['MOZ_SYSTEM_PNG']:
external_dirs += ['media/libpng']
+external_dirs += ['media/libwebp']
+
if CONFIG['CPU_ARCH'] == 'arm':
external_dirs += ['media/openmax_dl']
diff --git a/media/libwebp/MOZCHANGES b/media/libwebp/MOZCHANGES
new file mode 100644
index 000000000..68937eea6
--- /dev/null
+++ b/media/libwebp/MOZCHANGES
@@ -0,0 +1,3 @@
+Changes made to pristine libwebp source by mozilla.org developers.
+
+2017/01/27 -- Synced with libwebp-0.6.0 (bug #1294490).
diff --git a/media/libwebp/dec/moz.build b/media/libwebp/dec/moz.build
new file mode 100644
index 000000000..d988ae658
--- /dev/null
+++ b/media/libwebp/dec/moz.build
@@ -0,0 +1,26 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files('**'):
+ BUG_COMPONENT = ('Core', 'ImageLib')
+
+SOURCES += [
+ 'alpha_dec.c',
+ 'buffer_dec.c',
+ 'frame_dec.c',
+ 'idec_dec.c',
+ 'io_dec.c',
+ 'quant_dec.c',
+ 'tree_dec.c',
+ 'vp8_dec.c',
+ 'vp8l_dec.c',
+ 'webp_dec.c',
+]
+
+FINAL_LIBRARY = 'gkmedias'
+
+# We allow warnings for third-party code that can be updated from upstream.
+ALLOW_COMPILER_WARNINGS = True
diff --git a/media/libwebp/demux/moz.build b/media/libwebp/demux/moz.build
new file mode 100644
index 000000000..3024a71c3
--- /dev/null
+++ b/media/libwebp/demux/moz.build
@@ -0,0 +1,17 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files('**'):
+ BUG_COMPONENT = ('Core', 'ImageLib')
+
+SOURCES += [
+ 'demux.c',
+]
+
+FINAL_LIBRARY = 'gkmedias'
+
+# We allow warnings for third-party code that can be updated from upstream.
+ALLOW_COMPILER_WARNINGS = True
diff --git a/media/libwebp/dsp/moz.build b/media/libwebp/dsp/moz.build
new file mode 100644
index 000000000..006a691a0
--- /dev/null
+++ b/media/libwebp/dsp/moz.build
@@ -0,0 +1,53 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files('**'):
+ BUG_COMPONENT = ('Core', 'ImageLib')
+
+SOURCES += [
+ 'alpha_processing.c',
+ 'alpha_processing_sse2.c',
+ 'alpha_processing_sse41.c',
+ 'dec.c',
+ 'dec_clip_tables.c',
+ 'dec_neon.c',
+ 'dec_sse2.c',
+ 'dec_sse41.c',
+ 'filters.c',
+ 'filters_sse2.c',
+ 'lossless.c',
+ 'lossless_neon.c',
+ 'lossless_sse2.c',
+ 'rescaler.c',
+ 'rescaler_neon.c',
+ 'rescaler_sse2.c',
+ 'upsampling.c',
+ 'upsampling_neon.c',
+ 'upsampling_sse2.c',
+ 'yuv.c',
+ 'yuv_sse2.c',
+]
+
+if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
+ SOURCES['dec_neon.c'].flags += CONFIG['NEON_FLAGS']
+ SOURCES['lossless_neon.c'].flags += CONFIG['NEON_FLAGS']
+ SOURCES['rescaler_neon.c'].flags += CONFIG['NEON_FLAGS']
+ SOURCES['upsampling_neon.c'].flags += CONFIG['NEON_FLAGS']
+elif CONFIG['INTEL_ARCHITECTURE']:
+ SOURCES['alpha_processing_sse2.c'].flags += CONFIG['SSE2_FLAGS']
+ SOURCES['alpha_processing_sse41.c'].flags += CONFIG['SSE2_FLAGS']
+ SOURCES['dec_sse2.c'].flags += CONFIG['SSE2_FLAGS']
+ SOURCES['dec_sse41.c'].flags += CONFIG['SSE2_FLAGS']
+ SOURCES['filters_sse2.c'].flags += CONFIG['SSE2_FLAGS']
+ SOURCES['lossless_sse2.c'].flags += CONFIG['SSE2_FLAGS']
+ SOURCES['rescaler_sse2.c'].flags += CONFIG['SSE2_FLAGS']
+ SOURCES['upsampling_sse2.c'].flags += CONFIG['SSE2_FLAGS']
+ SOURCES['yuv_sse2.c'].flags += CONFIG['SSE2_FLAGS']
+
+FINAL_LIBRARY = 'gkmedias'
+
+# We allow warnings for third-party code that can be updated from upstream.
+ALLOW_COMPILER_WARNINGS = True
diff --git a/media/libwebp/moz.build b/media/libwebp/moz.build
new file mode 100644
index 000000000..7d3aa9d0f
--- /dev/null
+++ b/media/libwebp/moz.build
@@ -0,0 +1,28 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files('**'):
+ BUG_COMPONENT = ('Core', 'ImageLib')
+
+EXPORTS.webp += [
+ 'webp/decode.h',
+ 'webp/demux.h',
+ 'webp/mux_types.h',
+ 'webp/types.h',
+]
+
+DIRS += [
+ 'dec',
+ 'demux',
+ 'dsp',
+ 'moz',
+ 'utils',
+]
+
+FINAL_LIBRARY = 'gkmedias'
+
+# We allow warnings for third-party code that can be updated from upstream.
+ALLOW_COMPILER_WARNINGS = True
diff --git a/media/libwebp/moz/cpu.cpp b/media/libwebp/moz/cpu.cpp
new file mode 100644
index 000000000..39b9f3500
--- /dev/null
+++ b/media/libwebp/moz/cpu.cpp
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/* This file replaces the CPU info methods originally implemented in
+ * src/dsp/cpu.c, due to missing dependencies for Andriod builds. It
+ * controls if NEON/SSE/etc is used. */
+
+#include "../dsp/dsp.h"
+#include "mozilla/arm.h"
+#include "mozilla/SSE.h"
+
+static int MozCPUInfo(CPUFeature feature)
+{
+ switch (feature) {
+#if defined(__i386__) || defined(__x86_64__) || defined(WEBP_MSC_SSE2)
+ case kSSE2:
+ return mozilla::supports_sse2();
+ case kSSE3:
+ return mozilla::supports_sse3();
+ case kSSE4_1:
+ return mozilla::supports_sse4_1();
+ case kAVX:
+ return mozilla::supports_avx();
+ case kAVX2:
+ return mozilla::supports_avx2();
+#endif
+#if defined(WEBP_USE_NEON) || defined(WEBP_ANDROID_NEON)
+ case kNEON:
+ return mozilla::supports_neon();
+#endif
+#if defined(WEBP_USE_MIPS32) || defined(WEBP_USE_MIPS_DSP_R2) || defined(WEBP_USE_MSA)
+ case kMIPS32:
+ case kMIPSdspR2:
+ case kMSA:
+ return 1;
+#endif
+ default:
+ return 0;
+ }
+}
+
+VP8CPUInfo VP8GetCPUInfo = MozCPUInfo;
diff --git a/media/libwebp/moz/moz.build b/media/libwebp/moz/moz.build
new file mode 100644
index 000000000..c60474f45
--- /dev/null
+++ b/media/libwebp/moz/moz.build
@@ -0,0 +1,17 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files('**'):
+ BUG_COMPONENT = ('Core', 'ImageLib')
+
+SOURCES += [
+ 'cpu.cpp',
+]
+
+FINAL_LIBRARY = 'gkmedias'
+
+# We allow warnings for third-party code that can be updated from upstream.
+ALLOW_COMPILER_WARNINGS = True
diff --git a/media/libwebp/update.sh b/media/libwebp/update.sh
new file mode 100644
index 000000000..57cd45996
--- /dev/null
+++ b/media/libwebp/update.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#
+# Usage: ./update.sh <libwebp_directory>
+#
+# Copies the needed files from a directory containing the original
+# libwebp source.
+
+cp $1/AUTHORS .
+cp $1/COPYING .
+cp $1/NEWS .
+cp $1/PATENTS .
+cp $1/README .
+cp $1/README.mux .
+
+mkdir -p webp
+cp $1/src/webp/*.h webp
+
+mkdir -p dec
+cp $1/src/dec/*.h dec
+cp $1/src/dec/alpha_dec.c dec
+cp $1/src/dec/buffer_dec.c dec
+cp $1/src/dec/frame_dec.c dec
+cp $1/src/dec/idec_dec.c dec
+cp $1/src/dec/io_dec.c dec
+cp $1/src/dec/quant_dec.c dec
+cp $1/src/dec/tree_dec.c dec
+cp $1/src/dec/vp8_dec.c dec
+cp $1/src/dec/vp8l_dec.c dec
+cp $1/src/dec/webp_dec.c dec
+
+mkdir -p demux
+cp $1/src/demux/demux.c demux
+
+mkdir -p dsp
+cp $1/src/dsp/*.h dsp
+cp $1/src/dsp/alpha_processing.c dsp
+cp $1/src/dsp/alpha_processing_sse2.c dsp
+cp $1/src/dsp/alpha_processing_sse41.c dsp
+cp $1/src/dsp/dec.c dsp
+cp $1/src/dsp/dec_clip_tables.c dsp
+cp $1/src/dsp/dec_neon.c dsp
+cp $1/src/dsp/dec_sse2.c dsp
+cp $1/src/dsp/dec_sse41.c dsp
+cp $1/src/dsp/filters.c dsp
+cp $1/src/dsp/filters_sse2.c dsp
+cp $1/src/dsp/lossless.c dsp
+cp $1/src/dsp/lossless_neon.c dsp
+cp $1/src/dsp/lossless_sse2.c dsp
+cp $1/src/dsp/rescaler.c dsp
+cp $1/src/dsp/rescaler_neon.c dsp
+cp $1/src/dsp/rescaler_sse2.c dsp
+cp $1/src/dsp/upsampling.c dsp
+cp $1/src/dsp/upsampling_neon.c dsp
+cp $1/src/dsp/upsampling_sse2.c dsp
+cp $1/src/dsp/yuv.c dsp
+cp $1/src/dsp/yuv_sse2.c dsp
+
+mkdir -p enc
+cp $1/src/enc/*.h enc
+
+mkdir -p utils
+cp $1/src/utils/*.h utils
+cp $1/src/utils/bit_reader_utils.c utils
+cp $1/src/utils/color_cache_utils.c utils
+cp $1/src/utils/filters_utils.c utils
+cp $1/src/utils/huffman_utils.c utils
+cp $1/src/utils/quant_levels_dec_utils.c utils
+cp $1/src/utils/quant_levels_utils.c utils
+cp $1/src/utils/random_utils.c utils
+cp $1/src/utils/rescaler_utils.c utils
+cp $1/src/utils/thread_utils.c utils
+cp $1/src/utils/utils.c utils
diff --git a/media/libwebp/utils/moz.build b/media/libwebp/utils/moz.build
new file mode 100644
index 000000000..9fb274e9a
--- /dev/null
+++ b/media/libwebp/utils/moz.build
@@ -0,0 +1,26 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files('**'):
+ BUG_COMPONENT = ('Core', 'ImageLib')
+
+SOURCES += [
+ 'bit_reader_utils.c',
+ 'color_cache_utils.c',
+ 'filters_utils.c',
+ 'huffman_utils.c',
+ 'quant_levels_dec_utils.c',
+ 'quant_levels_utils.c',
+ 'random_utils.c',
+ 'rescaler_utils.c',
+ 'thread_utils.c',
+ 'utils.c',
+]
+
+FINAL_LIBRARY = 'gkmedias'
+
+# We allow warnings for third-party code that can be updated from upstream.
+ALLOW_COMPILER_WARNINGS = True