summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJob Bautista <jobbautista9@protonmail.com>2022-06-26 12:51:41 +0800
committerJob Bautista <jobbautista9@protonmail.com>2022-06-26 12:51:41 +0800
commit3c7fcec8a01d2217128187c138c4c734a1df3a3e (patch)
tree74647e0ec0d41dc29f3f147be74f129a07afefe4
parent785a7c8198ccb33003836dc25b4e2e3845adc1f8 (diff)
downloaduxp-3c7fcec8a01d2217128187c138c4c734a1df3a3e.tar.gz
Issue #1939 - Part 1: Update build system for libwebp.
-rw-r--r--media/libwebp/AUTHORS10
-rw-r--r--media/libwebp/NEWS55
-rw-r--r--media/libwebp/README32
-rw-r--r--media/libwebp/README.mux16
-rw-r--r--media/libwebp/UXPCHANGES1
-rw-r--r--media/libwebp/dsp/moz.build123
-rw-r--r--media/libwebp/enc/moz.build39
-rw-r--r--media/libwebp/moz.build3
-rwxr-xr-x[-rw-r--r--]media/libwebp/update.sh50
-rw-r--r--media/libwebp/utils/moz.build2
-rw-r--r--media/libwebp/webp/config.h37
11 files changed, 250 insertions, 118 deletions
diff --git a/media/libwebp/AUTHORS b/media/libwebp/AUTHORS
index 0d70b7fb2a..8307c2099d 100644
--- a/media/libwebp/AUTHORS
+++ b/media/libwebp/AUTHORS
@@ -1,9 +1,15 @@
Contributors:
+- Aidan O'Loan (aidanol at gmail dot com)
- Alan Browning (browning at google dot com)
- Charles Munger (clm at google dot com)
+- Cheng Yi (cyi at google dot com)
- Christian Duvivier (cduvivier at google dot com)
+- Christopher Degawa (ccom at randomderp dot com)
+- Clement Courbet (courbet at google dot com)
- Djordje Pesut (djordje dot pesut at imgtec dot com)
- Hui Su (huisu at google dot com)
+- Ilya Kurdyukov (jpegqs at gmail dot com)
+- Ingvar Stepanyan (rreverser at google dot com)
- James Zern (jzern at google dot com)
- Jan Engelhardt (jengelh at medozas dot de)
- Jehan (jehan at girinstud dot io)
@@ -20,11 +26,13 @@ Contributors:
- Mislav Bradac (mislavm at google dot com)
- Nico Weber (thakis at chromium dot org)
- Noel Chromium (noel at chromium dot org)
+- Oliver Wolff (oliver dot wolff at qt dot io)
- Owen Rodley (orodley at google dot com)
- Parag Salasakar (img dot mips1 at gmail dot com)
- Pascal Massimino (pascal dot massimino at gmail dot com)
- Paweł Hajdan, Jr (phajdan dot jr at chromium dot org)
- Pierre Joye (pierre dot php at gmail dot com)
+- Roberto Alanis (alanisbaez at google dot com)
- Sam Clegg (sbc at chromium dot org)
- Scott Hancher (seh at google dot com)
- Scott LaVarnway (slavarnway at google dot com)
@@ -38,5 +46,7 @@ Contributors:
- Vikas Arora (vikasa at google dot com)
- Vincent Rabaud (vrabaud at google dot com)
- Vlad Tsyrklevich (vtsyrklevich at chromium dot org)
+- Wan-Teh Chang (wtc at google dot com)
- Yang Zhang (yang dot zhang at arm dot com)
- Yannis Guyon (yguyon at google dot com)
+- Zhi An Ng (zhin at chromium dot org)
diff --git a/media/libwebp/NEWS b/media/libwebp/NEWS
index aa393c819f..5b36c5cf30 100644
--- a/media/libwebp/NEWS
+++ b/media/libwebp/NEWS
@@ -1,3 +1,58 @@
+- 1/11/2022: version 1.2.2
+ This is a binary compatible release.
+ * webpmux: add "-set bgcolor A,R,G,B"
+ * add ARM64 NEON support for MSVC builds (#539)
+ * fix duplicate include error in Xcode when using multiple XCFrameworks in a
+ project (#542)
+ * doc updates and bug fixes (#538, #544, #548, #550)
+
+- 7/20/2021: version 1.2.1
+ This is a binary compatible release.
+ * minor lossless encoder improvements and x86 color conversion speed up
+ * add ARM64 simulator support to xcframeworkbuild.sh (#510)
+ * further security related hardening in libwebp & examples
+ (issues: #497, #508, #518)
+ (chromium: #1196480, #1196773, #1196775, #1196777, #1196778, #1196850)
+ (oss-fuzz: #28658, #28978)
+ * toolchain updates and bug fixes (#498, #501, #502, #504, #505, #506, #509,
+ #533)
+ * use more inclusive language within the source (#507)
+
+- 12/23/2020: version 1.2.0
+ * API changes:
+ - libwebp:
+ encode.h: add a qmin / qmax range for quality factor (cwebp adds -qrange)
+ * lossless encoder improvements
+ * SIMD support for Wasm builds
+ * add xcframeworkbuild.sh, supports Mac Catalyst builds
+ * import fuzzers from oss-fuzz & chromium (#409)
+ * webpmux: add an '-set loop <value>' option (#494)
+ * toolchain updates and bug fixes (#449, #463, #470, #475, #477, #478, #479,
+ #488, #491)
+
+- 12/18/2019: version 1.1.0
+ * API changes:
+ - libwebp:
+ WebPMalloc (issue #442)
+ - extras:
+ WebPUnmultiplyARGB
+ * alpha decode fix (issue #439)
+ * toolchain updates and bug fixes
+ (chromium: #1026858, #1027136, #1027409, #1028620, #1028716, #995200)
+ (oss-fuzz: #19430, #19447)
+
+- 7/4/2019: version 1.0.3
+ This is a binary compatible release.
+ * resize fixes for Nx1 sizes and the addition of non-opaque alpha values for
+ odd sizes (issues #418, #434)
+ * lossless encode/decode performance improvements
+ * lossy compression performance improvement at low quality levels with flat
+ content (issue #432)
+ * python swig files updated to support python 3
+ Tool updates:
+ vwebp will now preserve the aspect ratio of images that exceed monitor
+ resolution by scaling the image to fit (issue #433)
+
- 1/14/2019: version 1.0.2
This is a binary compatible release.
* (Windows) unicode file support in the tools (linux and mac already had
diff --git a/media/libwebp/README b/media/libwebp/README
index 502a4c1c20..f6eaf2c049 100644
--- a/media/libwebp/README
+++ b/media/libwebp/README
@@ -4,7 +4,7 @@
\__\__/\____/\_____/__/ ____ ___
/ _/ / \ \ / _ \/ _/
/ \_/ / / \ \ __/ \__
- \____/____/\_____/_____/____/v1.0.2
+ \____/____/\_____/_____/____/v1.2.2
Description:
============
@@ -13,13 +13,13 @@ WebP codec: library to encode and decode images in WebP format. This package
contains the library that can be used in other programs to add WebP support,
as well as the command line tools 'cwebp' and 'dwebp'.
-See http://developers.google.com/speed/webp
+See https://developers.google.com/speed/webp
The latest source tree is available at
https://chromium.googlesource.com/webm/libwebp
It is released under the same license as the WebM project.
-See http://www.webmproject.org/license/software/ or the
+See https://www.webmproject.org/license/software/ or the
"COPYING" file for details. An additional intellectual
property rights grant can be found in the file PATENTS.
@@ -113,7 +113,7 @@ make install
CMake:
------
-With CMake, you can compile libwebp, cwebp, dwebp, gif2web, img2webp, webpinfo
+With CMake, you can compile libwebp, cwebp, dwebp, gif2webp, img2webp, webpinfo
and the JS bindings.
Prerequisites:
@@ -225,6 +225,7 @@ Usage:
If input size (-s) for an image is not specified, it is
assumed to be a PNG, JPEG, TIFF or WebP file.
+Note: Animated PNG and WebP files are not supported.
Options:
-h / -help ............. short help
@@ -254,6 +255,8 @@ Options:
-partition_limit <int> . limit quality to fit the 512k limit on
the first partition (0=no degradation ... 100=full)
-pass <int> ............ analysis pass number (1..10)
+ -qrange <min> <max> .... specifies the permissible quality range
+ (default: 0 100)
-crop <x> <y> <w> <h> .. crop picture with the given rectangle
-resize <w> <h> ........ resize picture (after any cropping)
-mt .................... use multi-threading if available
@@ -294,6 +297,7 @@ Experimental Options:
-af .................... auto-adjust filter strength
-pre <int> ............. pre-processing filter
+
The main options you might want to try in order to further tune the
visual quality are:
-preset
@@ -341,7 +345,9 @@ The full list of options is available using -h:
> dwebp -h
Usage: dwebp in_file [options] [-o out_file]
-Decodes the WebP image file to PNG format [Default]
+Decodes the WebP image file to PNG format [Default].
+Note: Animated WebP files are not supported.
+
Use following options to convert into alternate image formats:
-pam ......... save the raw RGBA samples as a color PAM
-ppm ......... save the raw RGB samples as a color PPM
@@ -423,15 +429,15 @@ Prerequisites:
1) OpenGL & OpenGL Utility Toolkit (GLUT)
Linux:
$ sudo apt-get install freeglut3-dev mesa-common-dev
- Mac + XCode:
+ Mac + Xcode:
- These libraries should be available in the OpenGL / GLUT frameworks.
Windows:
http://freeglut.sourceforge.net/index.php#download
2) (Optional) qcms (Quick Color Management System)
i. Download qcms from Mozilla / Chromium:
- http://hg.mozilla.org/mozilla-central/file/0e7639e3bdfb/gfx/qcms
- http://src.chromium.org/viewvc/chrome/trunk/src/third_party/qcms
+ https://hg.mozilla.org/mozilla-central/file/0e7639e3bdfb/gfx/qcms
+ https://source.chromium.org/chromium/chromium/src/+/main:third_party/qcms/;drc=d4a2f8e1ed461d8fc05ed88d1ae2dc94c9773825
ii. Build and archive the source files as libqcms.a / qcms.lib
iii. Update makefile.unix / Makefile.vc
a) Define WEBP_HAVE_QCMS
@@ -450,7 +456,7 @@ modes, etc.
Usage:
- img2webp [file-level options] [image files...] [per-frame options...]
+ img2webp [file_options] [[frame_options] frame_file]...
File-level options (only used at the start of compression):
-min_size ............ minimize size
@@ -597,7 +603,7 @@ The encoding flow looks like:
// Setup a config, starting form a preset and tuning some additional
// parameters
WebPConfig config;
- if (!WebPConfigPreset(&config, WEBP_PRESET_PHOTO, quality_factor))
+ if (!WebPConfigPreset(&config, WEBP_PRESET_PHOTO, quality_factor)) {
return 0; // version error
}
// ... additional tuning
@@ -613,7 +619,7 @@ The encoding flow looks like:
pic.width = width;
pic.height = height;
// allocated picture of dimension width x height
- if (!WebPPictureAllocate(&pic)) {
+ if (!WebPPictureAlloc(&pic)) {
return 0; // memory error
}
// at this point, 'pic' has been initialized as a container,
@@ -780,10 +786,10 @@ Bugs:
Please report all bugs to the issue tracker:
https://bugs.chromium.org/p/webp
Patches welcome! See this page to get started:
- http://www.webmproject.org/code/contribute/submitting-patches/
+ https://www.webmproject.org/code/contribute/submitting-patches/
Discuss:
========
Email: webp-discuss@webmproject.org
-Web: http://groups.google.com/a/webmproject.org/group/webp-discuss
+Web: https://groups.google.com/a/webmproject.org/group/webp-discuss
diff --git a/media/libwebp/README.mux b/media/libwebp/README.mux
index 7e9c3c903b..099d8e061d 100644
--- a/media/libwebp/README.mux
+++ b/media/libwebp/README.mux
@@ -1,7 +1,7 @@
 __ __ ____ ____ ____ __ __ _ __ __
/ \\/ \/ _ \/ _ \/ _ \/ \ \/ \___/_ / _\
\ / __/ _ \ __/ / / (_/ /__
- \__\__/\_____/_____/__/ \__//_/\_____/__/___/v1.0.2
+ \__\__/\_____/_____/__/ \__//_/\_____/__/___/v1.2.2
Description:
@@ -43,10 +43,12 @@ GET_OPTIONS:
frame n get nth frame
SET_OPTIONS:
- Set color profile/metadata:
- icc file.icc set ICC profile
- exif file.exif set EXIF metadata
- xmp file.xmp set XMP metadata
+ Set color profile/metadata/parameters:
+ loop LOOP_COUNT set the loop count
+ bgcolor BACKGROUND_COLOR set the animation background color
+ icc file.icc set ICC profile
+ exif file.exif set EXIF metadata
+ xmp file.xmp set XMP metadata
where: 'file.icc' contains the ICC profile to be set,
'file.exif' contains the EXIF metadata to be set
'file.xmp' contains the XMP metadata to be set
@@ -247,10 +249,10 @@ Bugs:
Please report all bugs to the issue tracker:
https://bugs.chromium.org/p/webp
Patches welcome! See this page to get started:
- http://www.webmproject.org/code/contribute/submitting-patches/
+ https://www.webmproject.org/code/contribute/submitting-patches/
Discuss:
========
Email: webp-discuss@webmproject.org
-Web: http://groups.google.com/a/webmproject.org/group/webp-discuss
+Web: https://groups.google.com/a/webmproject.org/group/webp-discuss
diff --git a/media/libwebp/UXPCHANGES b/media/libwebp/UXPCHANGES
index 78b7823c8d..bf1fe22d6e 100644
--- a/media/libwebp/UXPCHANGES
+++ b/media/libwebp/UXPCHANGES
@@ -3,3 +3,4 @@ Changes made to pristine libwebp source by Moonchild Productions and mozilla.org
2017/01/27 -- Synced with libwebp-0.6.0 (BZ #1294490).
2018/06/29 -- Synced with libwebp-1.0.0 + BUG=webp:381,383,384.
2019/01/21 -- Synced with libwebp-1.0.2
+2022/06/26 -- Synced with libwebp-1.2.2
diff --git a/media/libwebp/dsp/moz.build b/media/libwebp/dsp/moz.build
index c00d5e1401..6e2c9deb2c 100644
--- a/media/libwebp/dsp/moz.build
+++ b/media/libwebp/dsp/moz.build
@@ -1,4 +1,5 @@
# -*- 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/.
@@ -8,53 +9,103 @@ with Files('**'):
SOURCES += [
'alpha_processing.c',
- 'alpha_processing_neon.c',
- 'alpha_processing_sse2.c',
- 'alpha_processing_sse41.c',
+ 'cost.c',
'dec.c',
'dec_clip_tables.c',
- 'dec_neon.c',
- 'dec_sse2.c',
- 'dec_sse41.c',
+ 'enc.c',
'filters.c',
- 'filters_neon.c',
- 'filters_sse2.c',
'lossless.c',
- 'lossless_neon.c',
- 'lossless_sse2.c',
+ 'lossless_enc.c',
'rescaler.c',
- 'rescaler_neon.c',
- 'rescaler_sse2.c',
+ 'ssim.c',
'upsampling.c',
- 'upsampling_neon.c',
- 'upsampling_sse2.c',
- 'upsampling_sse41.c',
'yuv.c',
- 'yuv_neon.c',
- 'yuv_sse2.c',
- 'yuv_sse41.c',
]
if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
- SOURCES['alpha_processing_neon.c'].flags += CONFIG['NEON_FLAGS']
- SOURCES['dec_neon.c'].flags += CONFIG['NEON_FLAGS']
- SOURCES['filters_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']
- SOURCES['yuv_neon.c'].flags += CONFIG['NEON_FLAGS']
+ SOURCES += [
+ 'alpha_processing_neon.c',
+ 'cost_neon.c',
+ 'dec_neon.c',
+ 'enc_neon.c',
+ 'filters_neon.c',
+ 'lossless_enc_neon.c',
+ 'lossless_neon.c',
+ 'rescaler_neon.c',
+ 'upsampling_neon.c',
+ 'yuv_neon.c',
+ ]
+ DEFINES['WEBP_HAVE_NEON'] = 1;
+ for f in SOURCES:
+ if f.endswith('neon.c'):
+ SOURCES[f].flags += CONFIG['NEON_FLAGS']
+elif CONFIG['CPU_ARCH'] == 'aarch64':
+ SOURCES += [
+ 'alpha_processing_neon.c',
+ 'cost_neon.c',
+ 'dec_neon.c',
+ 'enc_neon.c',
+ 'filters_neon.c',
+ 'lossless_enc_neon.c',
+ 'lossless_neon.c',
+ 'rescaler_neon.c',
+ 'upsampling_neon.c',
+ 'yuv_neon.c',
+ ]
+ DEFINES['WEBP_HAVE_NEON'] = 1;
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['upsampling_sse41.c'].flags += CONFIG['SSE2_FLAGS']
- SOURCES['yuv_sse2.c'].flags += CONFIG['SSE2_FLAGS']
- SOURCES['yuv_sse41.c'].flags += CONFIG['SSE2_FLAGS']
+ SOURCES += [
+ 'alpha_processing_sse2.c',
+ 'alpha_processing_sse41.c',
+ 'cost_sse2.c',
+ 'dec_sse2.c',
+ 'dec_sse41.c',
+ 'enc_sse2.c',
+ 'enc_sse41.c',
+ 'filters_sse2.c',
+ 'lossless_enc_sse2.c',
+ 'lossless_enc_sse41.c',
+ 'lossless_sse2.c',
+ 'lossless_sse41.c',
+ 'rescaler_sse2.c',
+ 'ssim_sse2.c',
+ 'upsampling_sse2.c',
+ 'upsampling_sse41.c',
+ 'yuv_sse2.c',
+ 'yuv_sse41.c',
+ ]
+ DEFINES['WEBP_HAVE_SSE2'] = 1;
+ DEFINES['WEBP_HAVE_SSE41'] = 1;
+ for f in SOURCES:
+ if f.endswith('sse2.c'):
+ SOURCES[f].flags += CONFIG['SSE2_FLAGS']
+ elif f.endswith('sse41.c'):
+ SOURCES[f].flags += ['-msse4.1']
+elif CONFIG['CPU_ARCH'].startswith('mips'):
+ SOURCES += [
+ 'alpha_processing_mips_dsp_r2.c',
+ 'cost_mips32.c',
+ 'cost_mips_dsp_r2.c',
+ 'dec_mips32.c',
+ 'dec_mips_dsp_r2.c',
+ 'enc_mips32.c',
+ 'enc_mips_dsp_r2.c',
+ 'filters_mips_dsp_r2.c',
+ 'lossless_enc_mips32.c',
+ 'lossless_enc_mips_dsp_r2.c',
+ 'lossless_mips_dsp_r2.c',
+ 'lossless_msa.c',
+ 'rescaler_mips32.c',
+ 'rescaler_mips_dsp_r2.c',
+ 'rescaler_msa.c',
+ 'upsampling_mips_dsp_r2.c',
+ 'upsampling_msa.c',
+ 'yuv_mips32.c',
+ 'yuv_mips_dsp_r2.c',
+ ]
+
+if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+ CFLAGS += ['-Wno-unreachable-code']
FINAL_LIBRARY = 'gkmedias'
diff --git a/media/libwebp/enc/moz.build b/media/libwebp/enc/moz.build
new file mode 100644
index 0000000000..12eaf5a5ed
--- /dev/null
+++ b/media/libwebp/enc/moz.build
@@ -0,0 +1,39 @@
+# -*- 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_enc.c',
+ 'analysis_enc.c',
+ 'backward_references_cost_enc.c',
+ 'backward_references_enc.c',
+ 'config_enc.c',
+ 'cost_enc.c',
+ 'filter_enc.c',
+ 'frame_enc.c',
+ 'histogram_enc.c',
+ 'iterator_enc.c',
+ 'near_lossless_enc.c',
+ 'picture_csp_enc.c',
+ 'picture_enc.c',
+ 'picture_psnr_enc.c',
+ 'picture_rescale_enc.c',
+ 'picture_tools_enc.c',
+ 'predictor_enc.c',
+ 'quant_enc.c',
+ 'syntax_enc.c',
+ 'token_enc.c',
+ 'tree_enc.c',
+ 'vp8l_enc.c',
+ 'webp_enc.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/moz.build b/media/libwebp/moz.build
index 5450e2b47c..5580b9a3dc 100644
--- a/media/libwebp/moz.build
+++ b/media/libwebp/moz.build
@@ -9,6 +9,8 @@ with Files('**'):
EXPORTS.webp += [
'webp/decode.h',
'webp/demux.h',
+ 'webp/encode.h',
+ 'webp/format_constants.h',
'webp/mux_types.h',
'webp/types.h',
]
@@ -17,6 +19,7 @@ DIRS += [
'dec',
'demux',
'dsp',
+ 'enc',
'moz',
'utils',
]
diff --git a/media/libwebp/update.sh b/media/libwebp/update.sh
index 4fff43d694..9201add982 100644..100755
--- a/media/libwebp/update.sh
+++ b/media/libwebp/update.sh
@@ -21,63 +21,21 @@ 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
+cp $1/src/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_neon.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_neon.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/upsampling_sse41.c dsp
-cp $1/src/dsp/yuv.c dsp
-cp $1/src/dsp/yuv_neon.c dsp
-cp $1/src/dsp/yuv_sse2.c dsp
-cp $1/src/dsp/yuv_sse41.c dsp
+cp $1/src/dsp/*.c dsp
mkdir -p enc
cp $1/src/enc/*.h enc
+cp $1/src/enc/*.c 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
+cp $1/src/utils/*.c utils
find . \( -name "*.c" -o -name "*.h" \) -exec sed -i 's/#include "src\//#include "..\//g' {} \;
diff --git a/media/libwebp/utils/moz.build b/media/libwebp/utils/moz.build
index 619eaee6df..32431a9f3b 100644
--- a/media/libwebp/utils/moz.build
+++ b/media/libwebp/utils/moz.build
@@ -8,8 +8,10 @@ with Files('**'):
SOURCES += [
'bit_reader_utils.c',
+ 'bit_writer_utils.c',
'color_cache_utils.c',
'filters_utils.c',
+ 'huffman_encode_utils.c',
'huffman_utils.c',
'quant_levels_dec_utils.c',
'quant_levels_utils.c',
diff --git a/media/libwebp/webp/config.h b/media/libwebp/webp/config.h
index dd31c3cfaa..3496bc2c49 100644
--- a/media/libwebp/webp/config.h
+++ b/media/libwebp/webp/config.h
@@ -13,6 +13,9 @@
/* Set to 1 if __builtin_bswap64 is available */
#define HAVE_BUILTIN_BSWAP64 1
+/* Define to 1 if you have the <cpu-features.h> header file. */
+/* #undef HAVE_CPU_FEATURES_H */
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
@@ -20,14 +23,11 @@
/* #undef HAVE_GLUT_GLUT_H */
/* Define to 1 if you have the <GL/glut.h> header file. */
-/* #undef HAVE_GL_GLUT_H */
+#define HAVE_GL_GLUT_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
/* Define to 1 if you have the <OpenGL/glut.h> header file. */
/* #undef HAVE_OPENGL_GLUT_H */
@@ -40,6 +40,9 @@
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
+/* Define to 1 if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
@@ -77,38 +80,34 @@
#define PACKAGE_NAME "libwebp"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libwebp 0.5.1"
+#define PACKAGE_STRING "libwebp 1.2.2"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libwebp"
/* Define to the home page for this package. */
-#define PACKAGE_URL "http://developers.google.com/speed/webp"
+#define PACKAGE_URL "https://developers.google.com/speed/webp"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.5.1"
+#define PACKAGE_VERSION "1.2.2"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "0.5.1"
-
-/* Enable experimental code */
-/* #undef WEBP_EXPERIMENTAL_FEATURES */
-
-/* Set to 1 if AVX2 is supported */
-#define WEBP_HAVE_AVX2 1
+#define VERSION "1.2.2"
/* Set to 1 if GIF library is installed */
#define WEBP_HAVE_GIF 1
/* Set to 1 if OpenGL is supported */
-/* #undef WEBP_HAVE_GL */
+#define WEBP_HAVE_GL 1
/* Set to 1 if JPEG library is installed */
#define WEBP_HAVE_JPEG 1
@@ -122,6 +121,9 @@
/* Set to 1 if PNG library is installed */
#define WEBP_HAVE_PNG 1
+/* Set to 1 if SDL library is installed */
+#define WEBP_HAVE_SDL 1
+
/* Set to 1 if SSE2 is supported */
#define WEBP_HAVE_SSE2 1
@@ -131,6 +133,9 @@
/* Set to 1 if TIFF library is installed */
#define WEBP_HAVE_TIFF 1
+/* Enable near lossless encoding */
+#define WEBP_NEAR_LOSSLESS 1
+
/* Undefine this to disable thread support. */
#define WEBP_USE_THREAD 1