From c0bb7178be39fc5424c9f48e9c9f2d10d39b142b Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 23 Nov 2016 00:14:29 -0500 Subject: gnu: libtiff: Update to 4.0.7. * gnu/packages/image.scm (libtiff): Update to 4.0.7. [source]: Update URL and remove obsolete patches. [home-page]: Update URL. (libtiff-4.0.7): Delete variable. * gnu/packages/patches/libtiff-CVE-2015-8665+CVE-2015-8683.patch, gnu/packages/patches/libtiff-CVE-2016-3623.patch, gnu/packages/patches/libtiff-CVE-2016-3945.patch, gnu/packages/patches/libtiff-CVE-2016-3990.patch, gnu/packages/patches/libtiff-CVE-2016-3991.patch, gnu/packages/patches/libtiff-CVE-2016-5314.patch, gnu/packages/patches/libtiff-CVE-2016-5321.patch, gnu/packages/patches/libtiff-CVE-2016-5323.patch, gnu/packages/patches/libtiff-oob-accesses-in-decode.patch, gnu/packages/patches/libtiff-oob-write-in-nextdecode.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. --- gnu/packages/image.scm | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) (limited to 'gnu/packages/image.scm') diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 526c87cf86..0003ca0c67 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -243,25 +243,14 @@ extracting icontainer icon files.") (define-public libtiff (package (name "libtiff") - (replacement libtiff-4.0.7) - (version "4.0.6") + (version "4.0.7") (source (origin (method url-fetch) - (uri (string-append "ftp://ftp.remotesensing.org/pub/libtiff/tiff-" - version ".tar.gz")) - (sha256 (base32 - "136nf1rj9dp5jgv1p7z4dk0xy3wki1w0vfjbk82f645m0w4samsd")) - (patches (search-patches - "libtiff-oob-accesses-in-decode.patch" - "libtiff-oob-write-in-nextdecode.patch" - "libtiff-CVE-2015-8665+CVE-2015-8683.patch" - "libtiff-CVE-2016-3623.patch" - "libtiff-CVE-2016-3945.patch" - "libtiff-CVE-2016-3990.patch" - "libtiff-CVE-2016-3991.patch" - "libtiff-CVE-2016-5314.patch" - "libtiff-CVE-2016-5321.patch" - "libtiff-CVE-2016-5323.patch")))) + (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-" + version ".tar.gz")) + (sha256 + (base32 + "06ghqhr4db1ssq0acyyz49gr8k41gzw6pqb6mbn5r7jqp77s4hwz")))) (build-system gnu-build-system) (outputs '("out" "doc")) ;1.3 MiB of HTML documentation @@ -281,20 +270,7 @@ Included are a library, libtiff, for reading and writing TIFF and a small collection of tools for doing simple manipulations of TIFF images.") (license (license:non-copyleft "file://COPYRIGHT" "See COPYRIGHT in the distribution.")) - (home-page "http://www.remotesensing.org/libtiff/"))) - -(define libtiff-4.0.7 - (package - (inherit libtiff) - (version "4.0.7") - (source (origin - (method url-fetch) - (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-" - version ".tar.gz")) - (sha256 - (base32 - "06ghqhr4db1ssq0acyyz49gr8k41gzw6pqb6mbn5r7jqp77s4hwz")))) - (home-page "http://www.simplesystems.org/libtiff/"))) + (home-page "http://www.simplesystems.org/libtiff/"))) (define-public libwmf (package -- cgit v1.2.3 From 9b1bb709047f814b89dcba9452e1b21da65e7da3 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 25 Jan 2017 12:51:50 -0500 Subject: gnu: libpng: Incorporate grafted patch. * gnu/packages/image.scm (libpng)[replacement]: Remove field. [source]: Add patch 'libpng-CVE-2016-10087.patch'. (libpng-1.2)[replacement]: Remove field. (libpng/fixed): Remove variable. --- gnu/packages/image.scm | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'gnu/packages/image.scm') diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 54b7dd6e22..c545f026ad 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -65,7 +65,6 @@ (define-public libpng (package (name "libpng") - (replacement libpng/fixed) (version "1.6.25") (source (origin (method url-fetch) @@ -76,6 +75,7 @@ (string-append "ftp://ftp.simplesystems.org/pub/libpng/png/src" "/libpng15/libpng-" version ".tar.xz"))) + (patches (search-patches "libpng-CVE-2016-10087.patch")) (sha256 (base32 "04c8inn745hw25wz2dc5vll5n5d2gsndj01i4srwzgz8861qvzh9")))) (build-system gnu-build-system) @@ -90,18 +90,9 @@ library. It supports almost all PNG features and is extensible.") (license license:zlib) (home-page "http://www.libpng.org/pub/png/libpng.html"))) -(define libpng/fixed - (package - (inherit libpng) - (source - (origin - (inherit (package-source libpng)) - (patches (search-patches "libpng-CVE-2016-10087.patch")))))) - (define-public libpng-1.2 (package (inherit libpng) - (replacement #f) (version "1.2.57") (source (origin -- cgit v1.2.3 From 29705bc29f891919edf67af4c8368af4c84bf9e0 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 25 Jan 2017 12:53:31 -0500 Subject: gnu: libtiff: Incorporate grafted patches. * gnu/packages/image.scm (libtiff)[replacement]: Remove field. [source]: Add patches from libtiff/fixed. (libtiff/fixed): Remove variable. --- gnu/packages/image.scm | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) (limited to 'gnu/packages/image.scm') diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index c545f026ad..613d344b97 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -250,12 +250,27 @@ extracting icontainer icon files.") (define-public libtiff (package (name "libtiff") - (replacement libtiff/fixed) (version "4.0.7") (source (origin (method url-fetch) (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-" version ".tar.gz")) + (patches (search-patches "libtiff-heap-overflow-tiffcp.patch" + "libtiff-null-dereference.patch" + "libtiff-heap-overflow-tif-dirread.patch" + "libtiff-heap-overflow-pixarlog-luv.patch" + "libtiff-divide-by-zero.patch" + "libtiff-divide-by-zero-ojpeg.patch" + "libtiff-tiffcp-underflow.patch" + "libtiff-invalid-read.patch" + "libtiff-CVE-2016-10092.patch" + "libtiff-heap-overflow-tiffcrop.patch" + "libtiff-divide-by-zero-tiffcrop.patch" + "libtiff-CVE-2016-10093.patch" + "libtiff-divide-by-zero-tiffcp.patch" + "libtiff-assertion-failure.patch" + "libtiff-CVE-2016-10094.patch" + "libtiff-CVE-2017-5225.patch")) (sha256 (base32 "06ghqhr4db1ssq0acyyz49gr8k41gzw6pqb6mbn5r7jqp77s4hwz")))) @@ -283,29 +298,6 @@ collection of tools for doing simple manipulations of TIFF images.") "See COPYRIGHT in the distribution.")) (home-page "http://www.simplesystems.org/libtiff/"))) -(define libtiff/fixed - (package - (inherit libtiff) - (source - (origin - (inherit (package-source libtiff)) - (patches (search-patches "libtiff-heap-overflow-tiffcp.patch" - "libtiff-null-dereference.patch" - "libtiff-heap-overflow-tif-dirread.patch" - "libtiff-heap-overflow-pixarlog-luv.patch" - "libtiff-divide-by-zero.patch" - "libtiff-divide-by-zero-ojpeg.patch" - "libtiff-tiffcp-underflow.patch" - "libtiff-invalid-read.patch" - "libtiff-CVE-2016-10092.patch" - "libtiff-heap-overflow-tiffcrop.patch" - "libtiff-divide-by-zero-tiffcrop.patch" - "libtiff-CVE-2016-10093.patch" - "libtiff-divide-by-zero-tiffcp.patch" - "libtiff-assertion-failure.patch" - "libtiff-CVE-2016-10094.patch" - "libtiff-CVE-2017-5225.patch")))))) - (define-public libwmf (package (name "libwmf") -- cgit v1.2.3 From 66707558b61c69edb3b3ee7dbec28a75acf75cd3 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 25 Jan 2017 12:55:26 -0500 Subject: gnu: openjpeg: Incorporate grafted changes. * gnu/packages/image.scm (openjpeg)[replacement]: Remove field. [source]: Update to 2.1.2. Add patches 'openjpeg-CVE-2016-9850-CVE-2016-9851.patch' and 'openjpeg-CVE-2016-9572-CVE-2016-9573.patch'. (openjpeg-1)[replacement]: Remove field. (openjpeg-2.1.2): Remove variable. --- gnu/packages/image.scm | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'gnu/packages/image.scm') diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 613d344b97..59113e3066 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -429,8 +429,7 @@ work.") (define-public openjpeg (package (name "openjpeg") - (replacement openjpeg-2.1.2) - (version "2.1.1") + (version "2.1.2") (source (origin (method url-fetch) @@ -440,9 +439,11 @@ work.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "1anv0rjkbxw9kx91wvlfpb3dhppibda6kb1papny46bjzi3pzhl2")) + "19yz4g0c45sm8y1z01j9djsrl1mkz3pmw7fykc6hkvrqymp7prsc")) (patches (search-patches "openjpeg-CVE-2016-5157.patch" - "openjpeg-CVE-2016-7163.patch")))) + "openjpeg-CVE-2016-7163.patch" + "openjpeg-CVE-2016-9850-CVE-2016-9851.patch" + "openjpeg-CVE-2016-9572-CVE-2016-9573.patch")))) (build-system cmake-build-system) (arguments ;; Trying to run `$ make check' results in a no rule fault. @@ -466,28 +467,9 @@ error-resilience, a Java-viewer for j2k-images, ...") (home-page "https://github.com/uclouvain/openjpeg") (license license:bsd-2))) -(define openjpeg-2.1.2 - (package - (inherit openjpeg) - (name "openjpeg") - (version "2.1.2") - (source - (origin - (method url-fetch) - (uri (string-append "https://github.com/uclouvain/openjpeg/archive/v" - version ".tar.gz")) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 - "19yz4g0c45sm8y1z01j9djsrl1mkz3pmw7fykc6hkvrqymp7prsc")) - (patches - (search-patches "openjpeg-CVE-2016-9850-CVE-2016-9851.patch" - "openjpeg-CVE-2016-9572-CVE-2016-9573.patch")))))) - (define-public openjpeg-1 (package (inherit openjpeg) (name "openjpeg") - (replacement #f) (version "1.5.2") (source (origin -- cgit v1.2.3 From 913059a12034a11e7f16374ae6e3291da5860d1b Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 20 Feb 2017 09:03:04 +0200 Subject: gnu: libpng: Update source urls. * gnu/packages/image.scm (libpng)[source]: Add 'history' location for older versions. --- gnu/packages/image.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gnu/packages/image.scm') diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 59113e3066..82d9091188 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -68,13 +68,14 @@ (version "1.6.25") (source (origin (method url-fetch) - - ;; Note: upstream removes older tarballs. (uri (list (string-append "mirror://sourceforge/libpng/libpng16/" version "/libpng-" version ".tar.xz") (string-append "ftp://ftp.simplesystems.org/pub/libpng/png/src" - "/libpng15/libpng-" version ".tar.xz"))) + "/libpng16/libpng-" version ".tar.xz") + (string-append + "ftp://ftp.simplesystems.org/pub/libpng/png/src/history" + "/libpng16/libpng-" version ".tar.xz"))) (patches (search-patches "libpng-CVE-2016-10087.patch")) (sha256 (base32 "04c8inn745hw25wz2dc5vll5n5d2gsndj01i4srwzgz8861qvzh9")))) @@ -97,11 +98,13 @@ library. It supports almost all PNG features and is extensible.") (source (origin (method url-fetch) - ;; Note: upstream removes older tarballs. (uri (list (string-append "mirror://sourceforge/libpng/libpng12/" version "/libpng-" version ".tar.xz") (string-append "ftp://ftp.simplesystems.org/pub/libpng/png/src" + "/libpng12/libpng-" version ".tar.xz") + (string-append + "ftp://ftp.simplesystems.org/pub/libpng/png/src/history" "/libpng12/libpng-" version ".tar.xz"))) (sha256 (base32 "1n2lrzjkm5jhfg2bs10q398lkwbbx742fi27zgdgx0x23zhj0ihg")))))) -- cgit v1.2.3 From 864738baaa7bb75c08647ccfc684736479e67f7f Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 20 Feb 2017 09:48:09 +0200 Subject: gnu: libpng: Update to 1.6.28. * gnu/packages/image.scm (libpng): Update to 1.6.28. [source]: Remove patch. * gnu/packages/patches/libpng-CVE-2016-10087.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/image.scm | 5 ++-- gnu/packages/patches/libpng-CVE-2016-10087.patch | 37 ------------------------ 3 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 gnu/packages/patches/libpng-CVE-2016-10087.patch (limited to 'gnu/packages/image.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 2c513dee5c..db15273eb6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -685,7 +685,6 @@ dist_patch_DATA = \ %D%/packages/patches/libmad-armv7-thumb-pt2.patch \ %D%/packages/patches/libmad-frame-length.patch \ %D%/packages/patches/libmad-mips-newgcc.patch \ - %D%/packages/patches/libpng-CVE-2016-10087.patch \ %D%/packages/patches/libssh-0.6.5-CVE-2016-0739.patch \ %D%/packages/patches/libtar-CVE-2013-4420.patch \ %D%/packages/patches/libtheora-config-guess.patch \ diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 82d9091188..cbdc1b39dc 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -65,7 +65,7 @@ (define-public libpng (package (name "libpng") - (version "1.6.25") + (version "1.6.28") (source (origin (method url-fetch) (uri (list (string-append "mirror://sourceforge/libpng/libpng16/" @@ -76,9 +76,8 @@ (string-append "ftp://ftp.simplesystems.org/pub/libpng/png/src/history" "/libpng16/libpng-" version ".tar.xz"))) - (patches (search-patches "libpng-CVE-2016-10087.patch")) (sha256 - (base32 "04c8inn745hw25wz2dc5vll5n5d2gsndj01i4srwzgz8861qvzh9")))) + (base32 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq")))) (build-system gnu-build-system) ;; libpng.la says "-lz", so propagate it. diff --git a/gnu/packages/patches/libpng-CVE-2016-10087.patch b/gnu/packages/patches/libpng-CVE-2016-10087.patch deleted file mode 100644 index 8093b3e448..0000000000 --- a/gnu/packages/patches/libpng-CVE-2016-10087.patch +++ /dev/null @@ -1,37 +0,0 @@ -Fix CVE-2016-10087, a null pointer dereference in png_set_text_2(): - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10087 -http://seclists.org/oss-sec/2016/q4/777 - -Patch adapted from upstream source repository: - -https://sourceforge.net/p/libpng/code/ci/812768d7a9c973452222d454634496b25ed415eb/ - -From 812768d7a9c973452222d454634496b25ed415eb Mon Sep 17 00:00:00 2001 -From: Glenn Randers-Pehrson -Date: Thu, 29 Dec 2016 07:51:33 -0600 -Subject: [PATCH] [libpng16] Fixed a potential null pointer dereference in - png_set_text_2() - -(bug report and patch by Patrick Keshishian). ---- - ANNOUNCE | 2 ++ - CHANGES | 2 ++ - png.c | 1 + - 3 files changed, 5 insertions(+) - -diff --git a/png.c b/png.c -index 8afc28fc2..2e05de159 100644 ---- a/png.c -+++ b/png.c -@@ -477,6 +477,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, - png_free(png_ptr, info_ptr->text); - info_ptr->text = NULL; - info_ptr->num_text = 0; -+ info_ptr->max_text = 0; - } - } - #endif --- -2.11.0 - -- cgit v1.2.3 From 957699ee92a86367d4ba60d1e3a02431b2852963 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Mon, 20 Mar 2017 18:16:20 -0400 Subject: gnu: openjpeg: Remove obsolete patches. * gnu/packages/patches/openjpeg-CVE-2016-5157.patch, gnu/packages/patches/openjpeg-CVE-2016-7163.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. * gnu/packages/image.scm (openjpeg)[source]: Remove them. --- gnu/local.mk | 2 - gnu/packages/image.scm | 4 +- gnu/packages/patches/openjpeg-CVE-2016-5157.patch | 96 ----------------------- gnu/packages/patches/openjpeg-CVE-2016-7163.patch | 71 ----------------- 4 files changed, 1 insertion(+), 172 deletions(-) delete mode 100644 gnu/packages/patches/openjpeg-CVE-2016-5157.patch delete mode 100644 gnu/packages/patches/openjpeg-CVE-2016-7163.patch (limited to 'gnu/packages/image.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 40d2e74023..a194469c4e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -796,8 +796,6 @@ dist_patch_DATA = \ %D%/packages/patches/omake-fix-non-determinism.patch \ %D%/packages/patches/ola-readdir-r.patch \ %D%/packages/patches/openexr-missing-samples.patch \ - %D%/packages/patches/openjpeg-CVE-2016-5157.patch \ - %D%/packages/patches/openjpeg-CVE-2016-7163.patch \ %D%/packages/patches/openjpeg-CVE-2016-9850-CVE-2016-9851.patch \ %D%/packages/patches/openjpeg-CVE-2016-9572-CVE-2016-9573.patch \ %D%/packages/patches/openjpeg-use-after-free-fix.patch \ diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 2989ea006f..9c0e695f9a 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -489,9 +489,7 @@ work.") (sha256 (base32 "19yz4g0c45sm8y1z01j9djsrl1mkz3pmw7fykc6hkvrqymp7prsc")) - (patches (search-patches "openjpeg-CVE-2016-5157.patch" - "openjpeg-CVE-2016-7163.patch" - "openjpeg-CVE-2016-9850-CVE-2016-9851.patch" + (patches (search-patches "openjpeg-CVE-2016-9850-CVE-2016-9851.patch" "openjpeg-CVE-2016-9572-CVE-2016-9573.patch")))) (build-system cmake-build-system) (arguments diff --git a/gnu/packages/patches/openjpeg-CVE-2016-5157.patch b/gnu/packages/patches/openjpeg-CVE-2016-5157.patch deleted file mode 100644 index f83bd9b511..0000000000 --- a/gnu/packages/patches/openjpeg-CVE-2016-5157.patch +++ /dev/null @@ -1,96 +0,0 @@ -Fix CVE-2016-5157 (heap overflow in opj_dwt_interleave_v() allowing execution of -arbitrary code): - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5157 -https://pdfium.googlesource.com/pdfium/+/b6befb2ed2485a3805cddea86dc7574510178ea9 -http://seclists.org/oss-sec/2016/q3/441 - -Adapted from upstream source repository: - -https://github.com/uclouvain/openjpeg/commit/e078172b1c3f98d2219c37076b238fb759c751ea - -The final hunk of the patch, affecting -'tests/nonregression/test_suite.ctest.in', had to be adjusted, since it referred -to some context that is not yet provided by a tagged release. - -From c80286a4d573ad07ccc3c8b53289c38bb8256b30 Mon Sep 17 00:00:00 2001 -From: Leo Famulari -Date: Fri, 9 Sep 2016 04:37:40 -0400 -Subject: [PATCH] CVE-2016-5157 adjusted to apply to 2.1.0. - ---- - src/lib/openjp2/tcd.c | 11 +++++++++++ - tests/compare_dump_files.c | 14 +++++++------- - tests/nonregression/test_suite.ctest.in | 2 ++ - 3 files changed, 20 insertions(+), 7 deletions(-) - -diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c -index 12da05c..7a29c49 100644 ---- a/src/lib/openjp2/tcd.c -+++ b/src/lib/openjp2/tcd.c -@@ -696,9 +696,20 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, - l_tx0 = l_cp->tx0 + p * l_cp->tdx; /* can't be greater than l_image->x1 so won't overflow */ - l_tile->x0 = (OPJ_INT32)opj_uint_max(l_tx0, l_image->x0); - l_tile->x1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_tx0, l_cp->tdx), l_image->x1); -+ /* all those OPJ_UINT32 are casted to OPJ_INT32, let's do some sanity check */ -+ if ((l_tile->x0 < 0) || (l_tile->x1 <= l_tile->x0)) { -+ opj_event_msg(manager, EVT_ERROR, "Tile X coordinates are not supported\n"); -+ return OPJ_FALSE; -+ } - l_ty0 = l_cp->ty0 + q * l_cp->tdy; /* can't be greater than l_image->y1 so won't overflow */ - l_tile->y0 = (OPJ_INT32)opj_uint_max(l_ty0, l_image->y0); - l_tile->y1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_ty0, l_cp->tdy), l_image->y1); -+ /* all those OPJ_UINT32 are casted to OPJ_INT32, let's do some sanity check */ -+ if ((l_tile->y0 < 0) || (l_tile->y1 <= l_tile->y0)) { -+ opj_event_msg(manager, EVT_ERROR, "Tile Y coordinates are not supported\n"); -+ return OPJ_FALSE; -+ } -+ - - /* testcase 1888.pdf.asan.35.988 */ - if (l_tccp->numresolutions == 0) { -diff --git a/tests/compare_dump_files.c b/tests/compare_dump_files.c -index 946c92a..7d22270 100644 ---- a/tests/compare_dump_files.c -+++ b/tests/compare_dump_files.c -@@ -118,10 +118,10 @@ int main(int argc, char **argv) - test_cmp_parameters inParam; - FILE *fbase=NULL, *ftest=NULL; - int same = 0; -- char lbase[256]; -- char strbase[256]; -- char ltest[256]; -- char strtest[256]; -+ char lbase[512]; -+ char strbase[512]; -+ char ltest[512]; -+ char strtest[512]; - - if( parse_cmdline_cmp(argc, argv, &inParam) == 1 ) - { -@@ -154,9 +154,9 @@ int main(int argc, char **argv) - - while (fgets(lbase, sizeof(lbase), fbase) && fgets(ltest,sizeof(ltest),ftest)) - { -- int nbase = sscanf(lbase, "%255[^\r\n]", strbase); -- int ntest = sscanf(ltest, "%255[^\r\n]", strtest); -- assert( nbase != 255 && ntest != 255 ); -+ int nbase = sscanf(lbase, "%511[^\r\n]", strbase); -+ int ntest = sscanf(ltest, "%511[^\r\n]", strtest); -+ assert( nbase != 511 && ntest != 511 ); - if( nbase != 1 || ntest != 1 ) - { - fprintf(stderr, "could not parse line from files\n" ); -diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in -index d393e6c..90cfa43 100644 ---- a/tests/nonregression/test_suite.ctest.in -+++ b/tests/nonregression/test_suite.ctest.in -@@ -564,3 +564,5 @@ opj_decompress -i @INPUT_NR_PATH@/issue726.j2k -o @TEMP_PATH@/issue726.png - # issue 775 - !opj_decompress -i @INPUT_NR_PATH@/issue775.j2k -o @TEMP_PATH@/issue775.png - !opj_decompress -i @INPUT_NR_PATH@/issue775-2.j2k -o @TEMP_PATH@/issue775-2.png -+# issue 823 (yes, not a typo, test image is issue822) -+!opj_decompress -i @INPUT_NR_PATH@/issue822.jp2 -o @TEMP_PATH@/issue822.png --- -2.10.0 - diff --git a/gnu/packages/patches/openjpeg-CVE-2016-7163.patch b/gnu/packages/patches/openjpeg-CVE-2016-7163.patch deleted file mode 100644 index a4a24e4ff5..0000000000 --- a/gnu/packages/patches/openjpeg-CVE-2016-7163.patch +++ /dev/null @@ -1,71 +0,0 @@ -Fix CVE-2016-7613 (Integer overflow in opj_pi_create_decode allowing execution -of arbitrary code): - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-7163 -https://github.com/uclouvain/openjpeg/issues/826 -http://seclists.org/oss-sec/2016/q3/442 - -Copied from upstream repository: - -https://github.com/uclouvain/openjpeg/commit/c16bc057ba3f125051c9966cf1f5b68a05681de4 -https://github.com/uclouvain/openjpeg/commit/ef01f18dfc6780b776d0674ed3e7415c6ef54d24 - -From c16bc057ba3f125051c9966cf1f5b68a05681de4 Mon Sep 17 00:00:00 2001 -From: trylab -Date: Tue, 6 Sep 2016 13:55:49 +0800 -Subject: [PATCH] Fix an integer overflow issue (#809) - -Prevent an integer overflow issue in function opj_pi_create_decode of -pi.c. ---- - src/lib/openjp2/pi.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/src/lib/openjp2/pi.c b/src/lib/openjp2/pi.c -index cffad66..36e2ff0 100644 ---- a/src/lib/openjp2/pi.c -+++ b/src/lib/openjp2/pi.c -@@ -1237,7 +1237,13 @@ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image, - l_current_pi = l_pi; - - /* memory allocation for include */ -- l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16)); -+ /* prevent an integer overflow issue */ -+ l_current_pi->include = 00; -+ if (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U))) -+ { -+ l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16)); -+ } -+ - if - (!l_current_pi->include) - { --- -2.10.0 - -From ef01f18dfc6780b776d0674ed3e7415c6ef54d24 Mon Sep 17 00:00:00 2001 -From: Matthieu Darbois -Date: Thu, 8 Sep 2016 07:34:46 +0200 -Subject: [PATCH] Cast to size_t before multiplication - -Need to cast to size_t before multiplication otherwise overflow check is useless. ---- - src/lib/openjp2/pi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/lib/openjp2/pi.c b/src/lib/openjp2/pi.c -index 36e2ff0..809b33d 100644 ---- a/src/lib/openjp2/pi.c -+++ b/src/lib/openjp2/pi.c -@@ -1241,7 +1241,7 @@ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image, - l_current_pi->include = 00; - if (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U))) - { -- l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16)); -+ l_current_pi->include = (OPJ_INT16*) opj_calloc((size_t)(l_tcp->numlayers + 1U) * l_step_l, sizeof(OPJ_INT16)); - } - - if --- -2.10.0 - -- cgit v1.2.3 From dc8a34ed46f58397b5a53c99ec5f718c6d0e4fef Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 22 Mar 2017 14:45:44 +0100 Subject: gnu: freeimage: Fix build with GCC 5. * gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/image.scm (freeimage)[source]: Add patch. --- gnu/local.mk | 1 + gnu/packages/image.scm | 3 +- .../patches/freeimage-fix-build-with-gcc-5.patch | 1453 ++++++++++++++++++++ 3 files changed, 1456 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch (limited to 'gnu/packages/image.scm') diff --git a/gnu/local.mk b/gnu/local.mk index b8db8712d9..4d85f15a06 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -563,6 +563,7 @@ dist_patch_DATA = \ %D%/packages/patches/fontforge-svg-modtime.patch \ %D%/packages/patches/freeimage-CVE-2015-0852.patch \ %D%/packages/patches/freeimage-CVE-2016-5684.patch \ + %D%/packages/patches/freeimage-fix-build-with-gcc-5.patch \ %D%/packages/patches/gawk-shell.patch \ %D%/packages/patches/gcc-arm-bug-71399.patch \ %D%/packages/patches/gcc-arm-link-spec-fix.patch \ diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index fb6536b8c0..51c465a0cc 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -679,7 +679,8 @@ supplies a generic doubly-linked list and some string functions.") (base32 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v")) (patches (search-patches "freeimage-CVE-2015-0852.patch" - "freeimage-CVE-2016-5684.patch")))) + "freeimage-CVE-2016-5684.patch" + "freeimage-fix-build-with-gcc-5.patch")))) (build-system gnu-build-system) (arguments '(#:phases diff --git a/gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch b/gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch new file mode 100644 index 0000000000..2c9f2c3357 --- /dev/null +++ b/gnu/packages/patches/freeimage-fix-build-with-gcc-5.patch @@ -0,0 +1,1453 @@ +The original patch was downloaded from here: +https://chromium-review.googlesource.com/c/297211 + +The paths, file names, and line endings have been adapted. + +From eebaf97f5a1cb713d81d311308d8a48c124e5aef Mon Sep 17 00:00:00 2001 +From: James Zern +Date: Wed, 02 Sep 2015 23:21:13 -0700 +Subject: [PATCH] dsp/mips: add whitespace around stringizing operator + +fixes compile with gcc 5.1 +BUG=259 + +Change-Id: Ideb39c6290ab8569b1b6cc835bea11c822d0286c +--- + +diff --git a/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c +index 6590f43..40e4d82 100644 +--- a/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c ++++ b/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c +@@ -548,10 +548,10 @@ + // TEMP3 = SRC[D + D1 * BPS] + #define LOAD_4_BYTES(TEMP0, TEMP1, TEMP2, TEMP3, \ + A, A1, B, B1, C, C1, D, D1, SRC) \ +- "lbu %["#TEMP0"], "#A"+"#A1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ +- "lbu %["#TEMP1"], "#B"+"#B1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ +- "lbu %["#TEMP2"], "#C"+"#C1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ +- "lbu %["#TEMP3"], "#D"+"#D1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ ++ "lbu %[" #TEMP0 "], " #A "+" #A1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ ++ "lbu %[" #TEMP1 "], " #B "+" #B1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ ++ "lbu %[" #TEMP2 "], " #C "+" #C1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ ++ "lbu %[" #TEMP3 "], " #D "+" #D1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ + + static void SimpleHFilter16(uint8_t* p, int stride, int thresh) { + int i; +@@ -623,8 +623,8 @@ + // DST[A * BPS] = TEMP0 + // DST[B + C * BPS] = TEMP1 + #define STORE_8_BYTES(TEMP0, TEMP1, A, B, C, DST) \ +- "usw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#DST"]) \n\t" \ +- "usw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#DST"]) \n\t" ++ "usw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #DST "]) \n\t" \ ++ "usw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #DST "]) \n\t" + + static void VE4(uint8_t* dst) { // vertical + const uint8_t* top = dst - BPS; +@@ -725,8 +725,8 @@ + // TEMP0 = SRC[A * BPS] + // TEMP1 = SRC[B + C * BPS] + #define LOAD_8_BYTES(TEMP0, TEMP1, A, B, C, SRC) \ +- "ulw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ +- "ulw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#SRC"]) \n\t" ++ "ulw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ ++ "ulw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #SRC "]) \n\t" + + static void LD4(uint8_t* dst) { // Down-Left + int temp0, temp1, temp2, temp3, temp4; +@@ -873,24 +873,24 @@ + #define CLIPPING(SIZE) \ + "preceu.ph.qbl %[temp2], %[temp0] \n\t" \ + "preceu.ph.qbr %[temp0], %[temp0] \n\t" \ +-".if "#SIZE" == 8 \n\t" \ ++".if " #SIZE " == 8 \n\t" \ + "preceu.ph.qbl %[temp3], %[temp1] \n\t" \ + "preceu.ph.qbr %[temp1], %[temp1] \n\t" \ + ".endif \n\t" \ + "addu.ph %[temp2], %[temp2], %[dst_1] \n\t" \ + "addu.ph %[temp0], %[temp0], %[dst_1] \n\t" \ +-".if "#SIZE" == 8 \n\t" \ ++".if " #SIZE " == 8 \n\t" \ + "addu.ph %[temp3], %[temp3], %[dst_1] \n\t" \ + "addu.ph %[temp1], %[temp1], %[dst_1] \n\t" \ + ".endif \n\t" \ + "shll_s.ph %[temp2], %[temp2], 7 \n\t" \ + "shll_s.ph %[temp0], %[temp0], 7 \n\t" \ +-".if "#SIZE" == 8 \n\t" \ ++".if " #SIZE " == 8 \n\t" \ + "shll_s.ph %[temp3], %[temp3], 7 \n\t" \ + "shll_s.ph %[temp1], %[temp1], 7 \n\t" \ + ".endif \n\t" \ + "precrqu_s.qb.ph %[temp0], %[temp2], %[temp0] \n\t" \ +-".if "#SIZE" == 8 \n\t" \ ++".if " #SIZE " == 8 \n\t" \ + "precrqu_s.qb.ph %[temp1], %[temp3], %[temp1] \n\t" \ + ".endif \n\t" + +@@ -899,7 +899,7 @@ + int dst_1 = ((int)(DST)[-1] << 16) + (DST)[-1]; \ + int temp0, temp1, temp2, temp3; \ + __asm__ volatile ( \ +- ".if "#SIZE" < 8 \n\t" \ ++ ".if " #SIZE " < 8 \n\t" \ + "ulw %[temp0], 0(%[top]) \n\t" \ + "subu.ph %[dst_1], %[dst_1], %[top_1] \n\t" \ + CLIPPING(4) \ +@@ -911,7 +911,7 @@ + CLIPPING(8) \ + "usw %[temp0], 0(%[dst]) \n\t" \ + "usw %[temp1], 4(%[dst]) \n\t" \ +- ".if "#SIZE" == 16 \n\t" \ ++ ".if " #SIZE " == 16 \n\t" \ + "ulw %[temp0], 8(%[top]) \n\t" \ + "ulw %[temp1], 12(%[top]) \n\t" \ + CLIPPING(8) \ +diff --git a/Source/LibWebP/src/dsp/dsp.enc_mips32.c b/Source/LibWebP/src/dsp/dsp.enc_mips32.c +index c5837f1..b50e08b 100644 +--- a/Source/LibWebP/src/dsp/dsp.enc_mips32.c ++++ b/Source/LibWebP/src/dsp/dsp.enc_mips32.c +@@ -31,26 +31,26 @@ + // TEMP0..TEMP3 - registers for corresponding tmp elements + // TEMP4..TEMP5 - temporary registers + #define VERTICAL_PASS(A, B, C, D, TEMP4, TEMP0, TEMP1, TEMP2, TEMP3) \ +- "lh %[temp16], "#A"(%[temp20]) \n\t" \ +- "lh %[temp18], "#B"(%[temp20]) \n\t" \ +- "lh %[temp17], "#C"(%[temp20]) \n\t" \ +- "lh %[temp19], "#D"(%[temp20]) \n\t" \ +- "addu %["#TEMP4"], %[temp16], %[temp18] \n\t" \ +- "subu %[temp16], %[temp16], %[temp18] \n\t" \ +- "mul %["#TEMP0"], %[temp17], %[kC2] \n\t" \ +- "mul %[temp18], %[temp19], %[kC1] \n\t" \ +- "mul %[temp17], %[temp17], %[kC1] \n\t" \ +- "mul %[temp19], %[temp19], %[kC2] \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 16 \n\n" \ +- "sra %[temp18], %[temp18], 16 \n\n" \ +- "sra %[temp17], %[temp17], 16 \n\n" \ +- "sra %[temp19], %[temp19], 16 \n\n" \ +- "subu %["#TEMP2"], %["#TEMP0"], %[temp18] \n\t" \ +- "addu %["#TEMP3"], %[temp17], %[temp19] \n\t" \ +- "addu %["#TEMP0"], %["#TEMP4"], %["#TEMP3"] \n\t" \ +- "addu %["#TEMP1"], %[temp16], %["#TEMP2"] \n\t" \ +- "subu %["#TEMP2"], %[temp16], %["#TEMP2"] \n\t" \ +- "subu %["#TEMP3"], %["#TEMP4"], %["#TEMP3"] \n\t" ++ "lh %[temp16], " #A "(%[temp20]) \n\t" \ ++ "lh %[temp18], " #B "(%[temp20]) \n\t" \ ++ "lh %[temp17], " #C "(%[temp20]) \n\t" \ ++ "lh %[temp19], " #D "(%[temp20]) \n\t" \ ++ "addu %[" #TEMP4 "], %[temp16], %[temp18] \n\t" \ ++ "subu %[temp16], %[temp16], %[temp18] \n\t" \ ++ "mul %[" #TEMP0 "], %[temp17], %[kC2] \n\t" \ ++ "mul %[temp18], %[temp19], %[kC1] \n\t" \ ++ "mul %[temp17], %[temp17], %[kC1] \n\t" \ ++ "mul %[temp19], %[temp19], %[kC2] \n\t" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\n" \ ++ "sra %[temp18], %[temp18], 16 \n\n" \ ++ "sra %[temp17], %[temp17], 16 \n\n" \ ++ "sra %[temp19], %[temp19], 16 \n\n" \ ++ "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp18] \n\t" \ ++ "addu %[" #TEMP3 "], %[temp17], %[temp19] \n\t" \ ++ "addu %[" #TEMP0 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t" \ ++ "addu %[" #TEMP1 "], %[temp16], %[" #TEMP2 "] \n\t" \ ++ "subu %[" #TEMP2 "], %[temp16], %[" #TEMP2 "] \n\t" \ ++ "subu %[" #TEMP3 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t" + + // macro for one horizontal pass in ITransformOne + // MUL and STORE macros inlined +@@ -58,59 +58,59 @@ + // temp0..temp15 holds tmp[0]..tmp[15] + // A - offset in bytes to load from ref and store to dst buffer + // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements +-#define HORIZONTAL_PASS(A, TEMP0, TEMP4, TEMP8, TEMP12) \ +- "addiu %["#TEMP0"], %["#TEMP0"], 4 \n\t" \ +- "addu %[temp16], %["#TEMP0"], %["#TEMP8"] \n\t" \ +- "subu %[temp17], %["#TEMP0"], %["#TEMP8"] \n\t" \ +- "mul %["#TEMP0"], %["#TEMP4"], %[kC2] \n\t" \ +- "mul %["#TEMP8"], %["#TEMP12"], %[kC1] \n\t" \ +- "mul %["#TEMP4"], %["#TEMP4"], %[kC1] \n\t" \ +- "mul %["#TEMP12"], %["#TEMP12"], %[kC2] \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 16 \n\t" \ +- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \ +- "sra %["#TEMP4"], %["#TEMP4"], 16 \n\t" \ +- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \ +- "subu %[temp18], %["#TEMP0"], %["#TEMP8"] \n\t" \ +- "addu %[temp19], %["#TEMP4"], %["#TEMP12"] \n\t" \ +- "addu %["#TEMP0"], %[temp16], %[temp19] \n\t" \ +- "addu %["#TEMP4"], %[temp17], %[temp18] \n\t" \ +- "subu %["#TEMP8"], %[temp17], %[temp18] \n\t" \ +- "subu %["#TEMP12"], %[temp16], %[temp19] \n\t" \ +- "lw %[temp20], 0(%[args]) \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 3 \n\t" \ +- "sra %["#TEMP4"], %["#TEMP4"], 3 \n\t" \ +- "sra %["#TEMP8"], %["#TEMP8"], 3 \n\t" \ +- "sra %["#TEMP12"], %["#TEMP12"], 3 \n\t" \ +- "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ +- "lbu %[temp17], 1+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ +- "lbu %[temp18], 2+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ +- "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ +- "addu %["#TEMP0"], %[temp16], %["#TEMP0"] \n\t" \ +- "addu %["#TEMP4"], %[temp17], %["#TEMP4"] \n\t" \ +- "addu %["#TEMP8"], %[temp18], %["#TEMP8"] \n\t" \ +- "addu %["#TEMP12"], %[temp19], %["#TEMP12"] \n\t" \ +- "slt %[temp16], %["#TEMP0"], $zero \n\t" \ +- "slt %[temp17], %["#TEMP4"], $zero \n\t" \ +- "slt %[temp18], %["#TEMP8"], $zero \n\t" \ +- "slt %[temp19], %["#TEMP12"], $zero \n\t" \ +- "movn %["#TEMP0"], $zero, %[temp16] \n\t" \ +- "movn %["#TEMP4"], $zero, %[temp17] \n\t" \ +- "movn %["#TEMP8"], $zero, %[temp18] \n\t" \ +- "movn %["#TEMP12"], $zero, %[temp19] \n\t" \ +- "addiu %[temp20], $zero, 255 \n\t" \ +- "slt %[temp16], %["#TEMP0"], %[temp20] \n\t" \ +- "slt %[temp17], %["#TEMP4"], %[temp20] \n\t" \ +- "slt %[temp18], %["#TEMP8"], %[temp20] \n\t" \ +- "slt %[temp19], %["#TEMP12"], %[temp20] \n\t" \ +- "movz %["#TEMP0"], %[temp20], %[temp16] \n\t" \ +- "movz %["#TEMP4"], %[temp20], %[temp17] \n\t" \ +- "lw %[temp16], 8(%[args]) \n\t" \ +- "movz %["#TEMP8"], %[temp20], %[temp18] \n\t" \ +- "movz %["#TEMP12"], %[temp20], %[temp19] \n\t" \ +- "sb %["#TEMP0"], 0+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \ +- "sb %["#TEMP4"], 1+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \ +- "sb %["#TEMP8"], 2+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \ +- "sb %["#TEMP12"], 3+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" ++#define HORIZONTAL_PASS(A, TEMP0, TEMP4, TEMP8, TEMP12) \ ++ "addiu %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \ ++ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \ ++ "subu %[temp17], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \ ++ "mul %[" #TEMP0 "], %[" #TEMP4 "], %[kC2] \n\t" \ ++ "mul %[" #TEMP8 "], %[" #TEMP12 "], %[kC1] \n\t" \ ++ "mul %[" #TEMP4 "], %[" #TEMP4 "], %[kC1] \n\t" \ ++ "mul %[" #TEMP12 "], %[" #TEMP12 "], %[kC2] \n\t" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \ ++ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \ ++ "sra %[" #TEMP4 "], %[" #TEMP4 "], 16 \n\t" \ ++ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \ ++ "subu %[temp18], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \ ++ "addu %[temp19], %[" #TEMP4 "], %[" #TEMP12 "] \n\t" \ ++ "addu %[" #TEMP0 "], %[temp16], %[temp19] \n\t" \ ++ "addu %[" #TEMP4 "], %[temp17], %[temp18] \n\t" \ ++ "subu %[" #TEMP8 "], %[temp17], %[temp18] \n\t" \ ++ "subu %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \ ++ "lw %[temp20], 0(%[args]) \n\t" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \ ++ "sra %[" #TEMP4 "], %[" #TEMP4 "], 3 \n\t" \ ++ "sra %[" #TEMP8 "], %[" #TEMP8 "], 3 \n\t" \ ++ "sra %[" #TEMP12 "], %[" #TEMP12 "], 3 \n\t" \ ++ "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ ++ "lbu %[temp17], 1+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ ++ "lbu %[temp18], 2+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ ++ "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ ++ "addu %[" #TEMP0 "], %[temp16], %[" #TEMP0 "] \n\t" \ ++ "addu %[" #TEMP4 "], %[temp17], %[" #TEMP4 "] \n\t" \ ++ "addu %[" #TEMP8 "], %[temp18], %[" #TEMP8 "] \n\t" \ ++ "addu %[" #TEMP12 "], %[temp19], %[" #TEMP12 "] \n\t" \ ++ "slt %[temp16], %[" #TEMP0 "], $zero \n\t" \ ++ "slt %[temp17], %[" #TEMP4 "], $zero \n\t" \ ++ "slt %[temp18], %[" #TEMP8 "], $zero \n\t" \ ++ "slt %[temp19], %[" #TEMP12 "], $zero \n\t" \ ++ "movn %[" #TEMP0 "], $zero, %[temp16] \n\t" \ ++ "movn %[" #TEMP4 "], $zero, %[temp17] \n\t" \ ++ "movn %[" #TEMP8 "], $zero, %[temp18] \n\t" \ ++ "movn %[" #TEMP12 "], $zero, %[temp19] \n\t" \ ++ "addiu %[temp20], $zero, 255 \n\t" \ ++ "slt %[temp16], %[" #TEMP0 "], %[temp20] \n\t" \ ++ "slt %[temp17], %[" #TEMP4 "], %[temp20] \n\t" \ ++ "slt %[temp18], %[" #TEMP8 "], %[temp20] \n\t" \ ++ "slt %[temp19], %[" #TEMP12 "], %[temp20] \n\t" \ ++ "movz %[" #TEMP0 "], %[temp20], %[temp16] \n\t" \ ++ "movz %[" #TEMP4 "], %[temp20], %[temp17] \n\t" \ ++ "lw %[temp16], 8(%[args]) \n\t" \ ++ "movz %[" #TEMP8 "], %[temp20], %[temp18] \n\t" \ ++ "movz %[" #TEMP12 "], %[temp20], %[temp19] \n\t" \ ++ "sb %[" #TEMP0 "], 0+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \ ++ "sb %[" #TEMP4 "], 1+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \ ++ "sb %[" #TEMP8 "], 2+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \ ++ "sb %[" #TEMP12 "], 3+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" + + // Does one or two inverse transforms. + static WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in, +@@ -161,9 +161,9 @@ + // K - offset in bytes (kZigzag[n] * 4) + // N - offset in bytes (n * 2) + #define QUANTIZE_ONE(J, K, N) \ +- "lh %[temp0], "#J"(%[ppin]) \n\t" \ +- "lhu %[temp1], "#J"(%[ppsharpen]) \n\t" \ +- "lw %[temp2], "#K"(%[ppzthresh]) \n\t" \ ++ "lh %[temp0], " #J "(%[ppin]) \n\t" \ ++ "lhu %[temp1], " #J "(%[ppsharpen]) \n\t" \ ++ "lw %[temp2], " #K "(%[ppzthresh]) \n\t" \ + "sra %[sign], %[temp0], 15 \n\t" \ + "xor %[coeff], %[temp0], %[sign] \n\t" \ + "subu %[coeff], %[coeff], %[sign] \n\t" \ +@@ -172,9 +172,9 @@ + "addiu %[temp5], $zero, 0 \n\t" \ + "addiu %[level], $zero, 0 \n\t" \ + "beqz %[temp4], 2f \n\t" \ +- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \ +- "lw %[temp2], "#K"(%[ppbias]) \n\t" \ +- "lhu %[temp3], "#J"(%[ppq]) \n\t" \ ++ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \ ++ "lw %[temp2], " #K "(%[ppbias]) \n\t" \ ++ "lhu %[temp3], " #J "(%[ppq]) \n\t" \ + "mul %[level], %[coeff], %[temp1] \n\t" \ + "addu %[level], %[level], %[temp2] \n\t" \ + "sra %[level], %[level], 17 \n\t" \ +@@ -184,8 +184,8 @@ + "subu %[level], %[level], %[sign] \n\t" \ + "mul %[temp5], %[level], %[temp3] \n\t" \ + "2: \n\t" \ +- "sh %[temp5], "#J"(%[ppin]) \n\t" \ +- "sh %[level], "#N"(%[pout]) \n\t" ++ "sh %[temp5], " #J "(%[ppin]) \n\t" \ ++ "sh %[level], " #N "(%[pout]) \n\t" + + static int QuantizeBlock(int16_t in[16], int16_t out[16], + const VP8Matrix* const mtx) { +@@ -253,39 +253,39 @@ + // A - offset in bytes to load from a and b buffers + // E..H - offsets in bytes to store first results to tmp buffer + // E1..H1 - offsets in bytes to store second results to tmp buffer +-#define HORIZONTAL_PASS(A, E, F, G, H, E1, F1, G1, H1) \ +- "lbu %[temp0], 0+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ +- "lbu %[temp1], 1+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ +- "lbu %[temp2], 2+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ +- "lbu %[temp3], 3+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ +- "lbu %[temp4], 0+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ +- "lbu %[temp5], 1+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ +- "lbu %[temp6], 2+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ +- "lbu %[temp7], 3+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ +- "addu %[temp8], %[temp0], %[temp2] \n\t" \ +- "subu %[temp0], %[temp0], %[temp2] \n\t" \ +- "addu %[temp2], %[temp1], %[temp3] \n\t" \ +- "subu %[temp1], %[temp1], %[temp3] \n\t" \ +- "addu %[temp3], %[temp4], %[temp6] \n\t" \ +- "subu %[temp4], %[temp4], %[temp6] \n\t" \ +- "addu %[temp6], %[temp5], %[temp7] \n\t" \ +- "subu %[temp5], %[temp5], %[temp7] \n\t" \ +- "addu %[temp7], %[temp8], %[temp2] \n\t" \ +- "subu %[temp2], %[temp8], %[temp2] \n\t" \ +- "addu %[temp8], %[temp0], %[temp1] \n\t" \ +- "subu %[temp0], %[temp0], %[temp1] \n\t" \ +- "addu %[temp1], %[temp3], %[temp6] \n\t" \ +- "subu %[temp3], %[temp3], %[temp6] \n\t" \ +- "addu %[temp6], %[temp4], %[temp5] \n\t" \ +- "subu %[temp4], %[temp4], %[temp5] \n\t" \ +- "sw %[temp7], "#E"(%[tmp]) \n\t" \ +- "sw %[temp2], "#H"(%[tmp]) \n\t" \ +- "sw %[temp8], "#F"(%[tmp]) \n\t" \ +- "sw %[temp0], "#G"(%[tmp]) \n\t" \ +- "sw %[temp1], "#E1"(%[tmp]) \n\t" \ +- "sw %[temp3], "#H1"(%[tmp]) \n\t" \ +- "sw %[temp6], "#F1"(%[tmp]) \n\t" \ +- "sw %[temp4], "#G1"(%[tmp]) \n\t" ++#define HORIZONTAL_PASS(A, E, F, G, H, E1, F1, G1, H1) \ ++ "lbu %[temp0], 0+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ ++ "lbu %[temp1], 1+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ ++ "lbu %[temp2], 2+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ ++ "lbu %[temp3], 3+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ ++ "lbu %[temp4], 0+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ ++ "lbu %[temp5], 1+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ ++ "lbu %[temp6], 2+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ ++ "lbu %[temp7], 3+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ ++ "addu %[temp8], %[temp0], %[temp2] \n\t" \ ++ "subu %[temp0], %[temp0], %[temp2] \n\t" \ ++ "addu %[temp2], %[temp1], %[temp3] \n\t" \ ++ "subu %[temp1], %[temp1], %[temp3] \n\t" \ ++ "addu %[temp3], %[temp4], %[temp6] \n\t" \ ++ "subu %[temp4], %[temp4], %[temp6] \n\t" \ ++ "addu %[temp6], %[temp5], %[temp7] \n\t" \ ++ "subu %[temp5], %[temp5], %[temp7] \n\t" \ ++ "addu %[temp7], %[temp8], %[temp2] \n\t" \ ++ "subu %[temp2], %[temp8], %[temp2] \n\t" \ ++ "addu %[temp8], %[temp0], %[temp1] \n\t" \ ++ "subu %[temp0], %[temp0], %[temp1] \n\t" \ ++ "addu %[temp1], %[temp3], %[temp6] \n\t" \ ++ "subu %[temp3], %[temp3], %[temp6] \n\t" \ ++ "addu %[temp6], %[temp4], %[temp5] \n\t" \ ++ "subu %[temp4], %[temp4], %[temp5] \n\t" \ ++ "sw %[temp7], " #E "(%[tmp]) \n\t" \ ++ "sw %[temp2], " #H "(%[tmp]) \n\t" \ ++ "sw %[temp8], " #F "(%[tmp]) \n\t" \ ++ "sw %[temp0], " #G "(%[tmp]) \n\t" \ ++ "sw %[temp1], " #E1 "(%[tmp]) \n\t" \ ++ "sw %[temp3], " #H1 "(%[tmp]) \n\t" \ ++ "sw %[temp6], " #F1 "(%[tmp]) \n\t" \ ++ "sw %[temp4], " #G1 "(%[tmp]) \n\t" + + // macro for one vertical pass in Disto4x4 (TTransform) + // two calls of function TTransform are merged into single one +@@ -300,10 +300,10 @@ + // A1..D1 - offsets in bytes to load second results from tmp buffer + // E..H - offsets in bytes to load from w buffer + #define VERTICAL_PASS(A, B, C, D, A1, B1, C1, D1, E, F, G, H) \ +- "lw %[temp0], "#A1"(%[tmp]) \n\t" \ +- "lw %[temp1], "#C1"(%[tmp]) \n\t" \ +- "lw %[temp2], "#B1"(%[tmp]) \n\t" \ +- "lw %[temp3], "#D1"(%[tmp]) \n\t" \ ++ "lw %[temp0], " #A1 "(%[tmp]) \n\t" \ ++ "lw %[temp1], " #C1 "(%[tmp]) \n\t" \ ++ "lw %[temp2], " #B1 "(%[tmp]) \n\t" \ ++ "lw %[temp3], " #D1 "(%[tmp]) \n\t" \ + "addu %[temp8], %[temp0], %[temp1] \n\t" \ + "subu %[temp0], %[temp0], %[temp1] \n\t" \ + "addu %[temp1], %[temp2], %[temp3] \n\t" \ +@@ -324,18 +324,18 @@ + "subu %[temp1], %[temp1], %[temp5] \n\t" \ + "subu %[temp0], %[temp0], %[temp6] \n\t" \ + "subu %[temp8], %[temp8], %[temp7] \n\t" \ +- "lhu %[temp4], "#E"(%[w]) \n\t" \ +- "lhu %[temp5], "#F"(%[w]) \n\t" \ +- "lhu %[temp6], "#G"(%[w]) \n\t" \ +- "lhu %[temp7], "#H"(%[w]) \n\t" \ ++ "lhu %[temp4], " #E "(%[w]) \n\t" \ ++ "lhu %[temp5], " #F "(%[w]) \n\t" \ ++ "lhu %[temp6], " #G "(%[w]) \n\t" \ ++ "lhu %[temp7], " #H "(%[w]) \n\t" \ + "madd %[temp4], %[temp3] \n\t" \ + "madd %[temp5], %[temp1] \n\t" \ + "madd %[temp6], %[temp0] \n\t" \ + "madd %[temp7], %[temp8] \n\t" \ +- "lw %[temp0], "#A"(%[tmp]) \n\t" \ +- "lw %[temp1], "#C"(%[tmp]) \n\t" \ +- "lw %[temp2], "#B"(%[tmp]) \n\t" \ +- "lw %[temp3], "#D"(%[tmp]) \n\t" \ ++ "lw %[temp0], " #A "(%[tmp]) \n\t" \ ++ "lw %[temp1], " #C "(%[tmp]) \n\t" \ ++ "lw %[temp2], " #B "(%[tmp]) \n\t" \ ++ "lw %[temp3], " #D "(%[tmp]) \n\t" \ + "addu %[temp8], %[temp0], %[temp1] \n\t" \ + "subu %[temp0], %[temp0], %[temp1] \n\t" \ + "addu %[temp1], %[temp2], %[temp3] \n\t" \ +@@ -412,71 +412,71 @@ + // temp0..temp15 holds tmp[0]..tmp[15] + // A - offset in bytes to load from src and ref buffers + // TEMP0..TEMP3 - registers for corresponding tmp elements +-#define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \ +- "lw %["#TEMP1"], 0(%[args]) \n\t" \ +- "lw %["#TEMP2"], 4(%[args]) \n\t" \ +- "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "lbu %[temp17], 0+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ +- "lbu %[temp18], 1+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "lbu %[temp19], 1+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ +- "subu %[temp20], %[temp16], %[temp17] \n\t" \ +- "lbu %[temp16], 2+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "lbu %[temp17], 2+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ +- "subu %["#TEMP0"], %[temp18], %[temp19] \n\t" \ +- "lbu %[temp18], 3+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ +- "subu %["#TEMP1"], %[temp16], %[temp17] \n\t" \ +- "subu %["#TEMP2"], %[temp18], %[temp19] \n\t" \ +- "addu %["#TEMP3"], %[temp20], %["#TEMP2"] \n\t" \ +- "subu %["#TEMP2"], %[temp20], %["#TEMP2"] \n\t" \ +- "addu %[temp20], %["#TEMP0"], %["#TEMP1"] \n\t" \ +- "subu %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \ +- "mul %[temp16], %["#TEMP2"], %[c5352] \n\t" \ +- "mul %[temp17], %["#TEMP2"], %[c2217] \n\t" \ +- "mul %[temp18], %["#TEMP0"], %[c5352] \n\t" \ +- "mul %[temp19], %["#TEMP0"], %[c2217] \n\t" \ +- "addu %["#TEMP1"], %["#TEMP3"], %[temp20] \n\t" \ +- "subu %[temp20], %["#TEMP3"], %[temp20] \n\t" \ +- "sll %["#TEMP0"], %["#TEMP1"], 3 \n\t" \ +- "sll %["#TEMP2"], %[temp20], 3 \n\t" \ +- "addiu %[temp16], %[temp16], 1812 \n\t" \ +- "addiu %[temp17], %[temp17], 937 \n\t" \ +- "addu %[temp16], %[temp16], %[temp19] \n\t" \ +- "subu %[temp17], %[temp17], %[temp18] \n\t" \ +- "sra %["#TEMP1"], %[temp16], 9 \n\t" \ +- "sra %["#TEMP3"], %[temp17], 9 \n\t" ++#define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \ ++ "lw %[" #TEMP1 "], 0(%[args]) \n\t" \ ++ "lw %[" #TEMP2 "], 4(%[args]) \n\t" \ ++ "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "lbu %[temp17], 0+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ ++ "lbu %[temp18], 1+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "lbu %[temp19], 1+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ ++ "subu %[temp20], %[temp16], %[temp17] \n\t" \ ++ "lbu %[temp16], 2+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "lbu %[temp17], 2+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ ++ "subu %[" #TEMP0 "], %[temp18], %[temp19] \n\t" \ ++ "lbu %[temp18], 3+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ ++ "subu %[" #TEMP1 "], %[temp16], %[temp17] \n\t" \ ++ "subu %[" #TEMP2 "], %[temp18], %[temp19] \n\t" \ ++ "addu %[" #TEMP3 "], %[temp20], %[" #TEMP2 "] \n\t" \ ++ "subu %[" #TEMP2 "], %[temp20], %[" #TEMP2 "] \n\t" \ ++ "addu %[temp20], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ ++ "subu %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ ++ "mul %[temp16], %[" #TEMP2 "], %[c5352] \n\t" \ ++ "mul %[temp17], %[" #TEMP2 "], %[c2217] \n\t" \ ++ "mul %[temp18], %[" #TEMP0 "], %[c5352] \n\t" \ ++ "mul %[temp19], %[" #TEMP0 "], %[c2217] \n\t" \ ++ "addu %[" #TEMP1 "], %[" #TEMP3 "], %[temp20] \n\t" \ ++ "subu %[temp20], %[" #TEMP3 "], %[temp20] \n\t" \ ++ "sll %[" #TEMP0 "], %[" #TEMP1 "], 3 \n\t" \ ++ "sll %[" #TEMP2 "], %[temp20], 3 \n\t" \ ++ "addiu %[temp16], %[temp16], 1812 \n\t" \ ++ "addiu %[temp17], %[temp17], 937 \n\t" \ ++ "addu %[temp16], %[temp16], %[temp19] \n\t" \ ++ "subu %[temp17], %[temp17], %[temp18] \n\t" \ ++ "sra %[" #TEMP1 "], %[temp16], 9 \n\t" \ ++ "sra %[" #TEMP3 "], %[temp17], 9 \n\t" + + // macro for one vertical pass in FTransform + // temp0..temp15 holds tmp[0]..tmp[15] + // A..D - offsets in bytes to store to out buffer + // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements +-#define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \ +- "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \ +- "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \ +- "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \ +- "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \ +- "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \ +- "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \ +- "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \ +- "mul %[temp18], %[temp18], %[c5352] \n\t" \ +- "addiu %[temp16], %[temp16], 7 \n\t" \ +- "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \ +- "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \ +- "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \ +- "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \ +- "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \ +- "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \ +- "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \ +- "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \ +- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \ +- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \ +- "addiu %[temp16], %["#TEMP12"], 1 \n\t" \ +- "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \ +- "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \ +- "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \ +- "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \ +- "sh %["#TEMP12"], "#B"(%[temp20]) \n\t" ++#define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \ ++ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ ++ "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ ++ "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ ++ "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ ++ "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \ ++ "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \ ++ "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \ ++ "mul %[temp18], %[temp18], %[c5352] \n\t" \ ++ "addiu %[temp16], %[temp16], 7 \n\t" \ ++ "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \ ++ "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \ ++ "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \ ++ "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \ ++ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \ ++ "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \ ++ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \ ++ "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \ ++ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \ ++ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \ ++ "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \ ++ "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \ ++ "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t" + + static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) { + int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8; +@@ -516,14 +516,14 @@ + #if !defined(WORK_AROUND_GCC) + + #define GET_SSE_INNER(A, B, C, D) \ +- "lbu %[temp0], "#A"(%[a]) \n\t" \ +- "lbu %[temp1], "#A"(%[b]) \n\t" \ +- "lbu %[temp2], "#B"(%[a]) \n\t" \ +- "lbu %[temp3], "#B"(%[b]) \n\t" \ +- "lbu %[temp4], "#C"(%[a]) \n\t" \ +- "lbu %[temp5], "#C"(%[b]) \n\t" \ +- "lbu %[temp6], "#D"(%[a]) \n\t" \ +- "lbu %[temp7], "#D"(%[b]) \n\t" \ ++ "lbu %[temp0], " #A "(%[a]) \n\t" \ ++ "lbu %[temp1], " #A "(%[b]) \n\t" \ ++ "lbu %[temp2], " #B "(%[a]) \n\t" \ ++ "lbu %[temp3], " #B "(%[b]) \n\t" \ ++ "lbu %[temp4], " #C "(%[a]) \n\t" \ ++ "lbu %[temp5], " #C "(%[b]) \n\t" \ ++ "lbu %[temp6], " #D "(%[a]) \n\t" \ ++ "lbu %[temp7], " #D "(%[b]) \n\t" \ + "subu %[temp0], %[temp0], %[temp1] \n\t" \ + "subu %[temp2], %[temp2], %[temp3] \n\t" \ + "subu %[temp4], %[temp4], %[temp5] \n\t" \ +diff --git a/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c +index 56db07c..44f6fd2 100644 +--- a/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c ++++ b/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c +@@ -27,25 +27,25 @@ + // I - input (macro doesn't change it) + #define ADD_SUB_HALVES_X4(O0, O1, O2, O3, O4, O5, O6, O7, \ + I0, I1, I2, I3, I4, I5, I6, I7) \ +- "addq.ph %["#O0"], %["#I0"], %["#I1"] \n\t" \ +- "subq.ph %["#O1"], %["#I0"], %["#I1"] \n\t" \ +- "addq.ph %["#O2"], %["#I2"], %["#I3"] \n\t" \ +- "subq.ph %["#O3"], %["#I2"], %["#I3"] \n\t" \ +- "addq.ph %["#O4"], %["#I4"], %["#I5"] \n\t" \ +- "subq.ph %["#O5"], %["#I4"], %["#I5"] \n\t" \ +- "addq.ph %["#O6"], %["#I6"], %["#I7"] \n\t" \ +- "subq.ph %["#O7"], %["#I6"], %["#I7"] \n\t" ++ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \ ++ "subq.ph %[" #O1 "], %[" #I0 "], %[" #I1 "] \n\t" \ ++ "addq.ph %[" #O2 "], %[" #I2 "], %[" #I3 "] \n\t" \ ++ "subq.ph %[" #O3 "], %[" #I2 "], %[" #I3 "] \n\t" \ ++ "addq.ph %[" #O4 "], %[" #I4 "], %[" #I5 "] \n\t" \ ++ "subq.ph %[" #O5 "], %[" #I4 "], %[" #I5 "] \n\t" \ ++ "addq.ph %[" #O6 "], %[" #I6 "], %[" #I7 "] \n\t" \ ++ "subq.ph %[" #O7 "], %[" #I6 "], %[" #I7 "] \n\t" + + // IO - input/output + #define ABS_X8(IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7) \ +- "absq_s.ph %["#IO0"], %["#IO0"] \n\t" \ +- "absq_s.ph %["#IO1"], %["#IO1"] \n\t" \ +- "absq_s.ph %["#IO2"], %["#IO2"] \n\t" \ +- "absq_s.ph %["#IO3"], %["#IO3"] \n\t" \ +- "absq_s.ph %["#IO4"], %["#IO4"] \n\t" \ +- "absq_s.ph %["#IO5"], %["#IO5"] \n\t" \ +- "absq_s.ph %["#IO6"], %["#IO6"] \n\t" \ +- "absq_s.ph %["#IO7"], %["#IO7"] \n\t" ++ "absq_s.ph %[" #IO0 "], %[" #IO0 "] \n\t" \ ++ "absq_s.ph %[" #IO1 "], %[" #IO1 "] \n\t" \ ++ "absq_s.ph %[" #IO2 "], %[" #IO2 "] \n\t" \ ++ "absq_s.ph %[" #IO3 "], %[" #IO3 "] \n\t" \ ++ "absq_s.ph %[" #IO4 "], %[" #IO4 "] \n\t" \ ++ "absq_s.ph %[" #IO5 "], %[" #IO5 "] \n\t" \ ++ "absq_s.ph %[" #IO6 "], %[" #IO6 "] \n\t" \ ++ "absq_s.ph %[" #IO7 "], %[" #IO7 "] \n\t" + + // dpa.w.ph $ac0 temp0 ,temp1 + // $ac += temp0[31..16] * temp1[31..16] + temp0[15..0] * temp1[15..0] +@@ -56,15 +56,15 @@ + #define MUL_HALF(O0, I0, I1, I2, I3, I4, I5, I6, I7, \ + I8, I9, I10, I11, I12, I13, I14, I15) \ + "mult $ac0, $zero, $zero \n\t" \ +- "dpa.w.ph $ac0, %["#I2"], %["#I0"] \n\t" \ +- "dpax.w.ph $ac0, %["#I5"], %["#I6"] \n\t" \ +- "dpa.w.ph $ac0, %["#I8"], %["#I9"] \n\t" \ +- "dpax.w.ph $ac0, %["#I11"], %["#I4"] \n\t" \ +- "dpa.w.ph $ac0, %["#I12"], %["#I7"] \n\t" \ +- "dpax.w.ph $ac0, %["#I13"], %["#I1"] \n\t" \ +- "dpa.w.ph $ac0, %["#I14"], %["#I3"] \n\t" \ +- "dpax.w.ph $ac0, %["#I15"], %["#I10"] \n\t" \ +- "mflo %["#O0"], $ac0 \n\t" ++ "dpa.w.ph $ac0, %[" #I2 "], %[" #I0 "] \n\t" \ ++ "dpax.w.ph $ac0, %[" #I5 "], %[" #I6 "] \n\t" \ ++ "dpa.w.ph $ac0, %[" #I8 "], %[" #I9 "] \n\t" \ ++ "dpax.w.ph $ac0, %[" #I11 "], %[" #I4 "] \n\t" \ ++ "dpa.w.ph $ac0, %[" #I12 "], %[" #I7 "] \n\t" \ ++ "dpax.w.ph $ac0, %[" #I13 "], %[" #I1 "] \n\t" \ ++ "dpa.w.ph $ac0, %[" #I14 "], %[" #I3 "] \n\t" \ ++ "dpax.w.ph $ac0, %[" #I15 "], %[" #I10 "] \n\t" \ ++ "mflo %[" #O0 "], $ac0 \n\t" + + #define OUTPUT_EARLY_CLOBBER_REGS_17() \ + OUTPUT_EARLY_CLOBBER_REGS_10(), \ +@@ -77,69 +77,69 @@ + // A - offset in bytes to load from src and ref buffers + // TEMP0..TEMP3 - registers for corresponding tmp elements + #define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \ +- "lw %["#TEMP0"], 0(%[args]) \n\t" \ +- "lw %["#TEMP1"], 4(%[args]) \n\t" \ +- "lw %["#TEMP2"], "XSTR(BPS)"*"#A"(%["#TEMP0"]) \n\t" \ +- "lw %["#TEMP3"], "XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "preceu.ph.qbl %["#TEMP0"], %["#TEMP2"] \n\t" \ +- "preceu.ph.qbl %["#TEMP1"], %["#TEMP3"] \n\t" \ +- "preceu.ph.qbr %["#TEMP2"], %["#TEMP2"] \n\t" \ +- "preceu.ph.qbr %["#TEMP3"], %["#TEMP3"] \n\t" \ +- "subq.ph %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \ +- "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP3"] \n\t" \ +- "rotr %["#TEMP0"], %["#TEMP0"], 16 \n\t" \ +- "addq.ph %["#TEMP1"], %["#TEMP2"], %["#TEMP0"] \n\t" \ +- "subq.ph %["#TEMP3"], %["#TEMP2"], %["#TEMP0"] \n\t" \ +- "seh %["#TEMP0"], %["#TEMP1"] \n\t" \ +- "sra %[temp16], %["#TEMP1"], 16 \n\t" \ +- "seh %[temp19], %["#TEMP3"] \n\t" \ +- "sra %["#TEMP3"], %["#TEMP3"], 16 \n\t" \ +- "subu %["#TEMP2"], %["#TEMP0"], %[temp16] \n\t" \ +- "addu %["#TEMP0"], %["#TEMP0"], %[temp16] \n\t" \ +- "mul %[temp17], %[temp19], %[c2217] \n\t" \ +- "mul %[temp18], %["#TEMP3"], %[c5352] \n\t" \ +- "mul %["#TEMP1"], %[temp19], %[c5352] \n\t" \ +- "mul %[temp16], %["#TEMP3"], %[c2217] \n\t" \ +- "sll %["#TEMP2"], %["#TEMP2"], 3 \n\t" \ +- "sll %["#TEMP0"], %["#TEMP0"], 3 \n\t" \ +- "subu %["#TEMP3"], %[temp17], %[temp18] \n\t" \ +- "addu %["#TEMP1"], %[temp16], %["#TEMP1"] \n\t" \ +- "addiu %["#TEMP3"], %["#TEMP3"], 937 \n\t" \ +- "addiu %["#TEMP1"], %["#TEMP1"], 1812 \n\t" \ +- "sra %["#TEMP3"], %["#TEMP3"], 9 \n\t" \ +- "sra %["#TEMP1"], %["#TEMP1"], 9 \n\t" ++ "lw %[" #TEMP0 "], 0(%[args]) \n\t" \ ++ "lw %[" #TEMP1 "], 4(%[args]) \n\t" \ ++ "lw %[" #TEMP2 "], "XSTR(BPS)"*" #A "(%[" #TEMP0 "]) \n\t" \ ++ "lw %[" #TEMP3 "], "XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "preceu.ph.qbl %[" #TEMP0 "], %[" #TEMP2 "] \n\t" \ ++ "preceu.ph.qbl %[" #TEMP1 "], %[" #TEMP3 "] \n\t" \ ++ "preceu.ph.qbr %[" #TEMP2 "], %[" #TEMP2 "] \n\t" \ ++ "preceu.ph.qbr %[" #TEMP3 "], %[" #TEMP3 "] \n\t" \ ++ "subq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ ++ "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP3 "] \n\t" \ ++ "rotr %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \ ++ "addq.ph %[" #TEMP1 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \ ++ "subq.ph %[" #TEMP3 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \ ++ "seh %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ ++ "sra %[temp16], %[" #TEMP1 "], 16 \n\t" \ ++ "seh %[temp19], %[" #TEMP3 "] \n\t" \ ++ "sra %[" #TEMP3 "], %[" #TEMP3 "], 16 \n\t" \ ++ "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp16] \n\t" \ ++ "addu %[" #TEMP0 "], %[" #TEMP0 "], %[temp16] \n\t" \ ++ "mul %[temp17], %[temp19], %[c2217] \n\t" \ ++ "mul %[temp18], %[" #TEMP3 "], %[c5352] \n\t" \ ++ "mul %[" #TEMP1 "], %[temp19], %[c5352] \n\t" \ ++ "mul %[temp16], %[" #TEMP3 "], %[c2217] \n\t" \ ++ "sll %[" #TEMP2 "], %[" #TEMP2 "], 3 \n\t" \ ++ "sll %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \ ++ "subu %[" #TEMP3 "], %[temp17], %[temp18] \n\t" \ ++ "addu %[" #TEMP1 "], %[temp16], %[" #TEMP1 "] \n\t" \ ++ "addiu %[" #TEMP3 "], %[" #TEMP3 "], 937 \n\t" \ ++ "addiu %[" #TEMP1 "], %[" #TEMP1 "], 1812 \n\t" \ ++ "sra %[" #TEMP3 "], %[" #TEMP3 "], 9 \n\t" \ ++ "sra %[" #TEMP1 "], %[" #TEMP1 "], 9 \n\t" + + // macro for one vertical pass in FTransform + // temp0..temp15 holds tmp[0]..tmp[15] + // A..D - offsets in bytes to store to out buffer + // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements + #define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \ +- "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \ +- "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \ +- "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \ +- "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \ +- "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \ +- "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \ +- "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \ +- "mul %[temp18], %[temp18], %[c5352] \n\t" \ +- "addiu %[temp16], %[temp16], 7 \n\t" \ +- "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \ +- "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \ +- "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \ +- "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \ +- "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \ +- "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \ +- "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \ +- "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \ +- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \ +- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \ +- "addiu %[temp16], %["#TEMP12"], 1 \n\t" \ +- "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \ +- "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \ +- "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \ +- "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \ +- "sh %["#TEMP12"], "#B"(%[temp20]) \n\t" ++ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ ++ "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ ++ "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ ++ "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ ++ "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \ ++ "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \ ++ "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \ ++ "mul %[temp18], %[temp18], %[c5352] \n\t" \ ++ "addiu %[temp16], %[temp16], 7 \n\t" \ ++ "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \ ++ "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \ ++ "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \ ++ "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \ ++ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \ ++ "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \ ++ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \ ++ "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \ ++ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \ ++ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \ ++ "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \ ++ "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \ ++ "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t" + + static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) { + const int c2217 = 2217; +@@ -329,11 +329,11 @@ + // Intra predictions + + #define FILL_PART(J, SIZE) \ +- "usw %[value], 0+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ +- "usw %[value], 4+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ +- ".if "#SIZE" == 16 \n\t" \ +- "usw %[value], 8+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ +- "usw %[value], 12+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ ++ "usw %[value], 0+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ ++ "usw %[value], 4+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ ++ ".if " #SIZE " == 16 \n\t" \ ++ "usw %[value], 8+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ ++ "usw %[value], 12+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ + ".endif \n\t" + + #define FILL_8_OR_16(DST, VALUE, SIZE) do { \ +@@ -348,7 +348,7 @@ + FILL_PART( 5, SIZE) \ + FILL_PART( 6, SIZE) \ + FILL_PART( 7, SIZE) \ +- ".if "#SIZE" == 16 \n\t" \ ++ ".if " #SIZE " == 16 \n\t" \ + FILL_PART( 8, 16) \ + FILL_PART( 9, 16) \ + FILL_PART(10, 16) \ +@@ -425,7 +425,7 @@ + CLIPPING() \ + "usw %[temp0], 0(%[dst]) \n\t" \ + "usw %[temp1], 4(%[dst]) \n\t" \ +- ".if "#SIZE" == 16 \n\t" \ ++ ".if " #SIZE " == 16 \n\t" \ + "ulw %[temp0], 8(%[top]) \n\t" \ + "ulw %[temp1], 12(%[top]) \n\t" \ + CLIPPING() \ +@@ -1060,8 +1060,8 @@ + #if !defined(WORK_AROUND_GCC) + + #define GET_SSE_INNER(A) \ +- "lw %[temp0], "#A"(%[a]) \n\t" \ +- "lw %[temp1], "#A"(%[b]) \n\t" \ ++ "lw %[temp0], " #A "(%[a]) \n\t" \ ++ "lw %[temp1], " #A "(%[b]) \n\t" \ + "preceu.ph.qbr %[temp2], %[temp0] \n\t" \ + "preceu.ph.qbl %[temp0], %[temp0] \n\t" \ + "preceu.ph.qbr %[temp3], %[temp1] \n\t" \ +@@ -1185,28 +1185,28 @@ + // N - offset in bytes (n * 2) + // N1 - offset in bytes ((n + 1) * 2) + #define QUANTIZE_ONE(J, K, N, N1) \ +- "ulw %[temp1], "#J"(%[ppin]) \n\t" \ +- "ulw %[temp2], "#J"(%[ppsharpen]) \n\t" \ +- "lhu %[temp3], "#K"(%[ppzthresh]) \n\t" \ +- "lhu %[temp6], "#K"+4(%[ppzthresh]) \n\t" \ ++ "ulw %[temp1], " #J "(%[ppin]) \n\t" \ ++ "ulw %[temp2], " #J "(%[ppsharpen]) \n\t" \ ++ "lhu %[temp3], " #K "(%[ppzthresh]) \n\t" \ ++ "lhu %[temp6], " #K "+4(%[ppzthresh]) \n\t" \ + "absq_s.ph %[temp4], %[temp1] \n\t" \ + "ins %[temp3], %[temp6], 16, 16 \n\t" \ + "addu.ph %[coeff], %[temp4], %[temp2] \n\t" \ + "shra.ph %[sign], %[temp1], 15 \n\t" \ + "li %[level], 0x10001 \n\t" \ + "cmp.lt.ph %[temp3], %[coeff] \n\t" \ +- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \ ++ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \ + "pick.ph %[temp5], %[level], $0 \n\t" \ +- "lw %[temp2], "#K"(%[ppbias]) \n\t" \ ++ "lw %[temp2], " #K "(%[ppbias]) \n\t" \ + "beqz %[temp5], 0f \n\t" \ +- "lhu %[temp3], "#J"(%[ppq]) \n\t" \ ++ "lhu %[temp3], " #J "(%[ppq]) \n\t" \ + "beq %[temp5], %[level], 1f \n\t" \ + "andi %[temp5], %[temp5], 0x1 \n\t" \ + "andi %[temp4], %[coeff], 0xffff \n\t" \ + "beqz %[temp5], 2f \n\t" \ + "mul %[level], %[temp4], %[temp1] \n\t" \ +- "sh $0, "#J"+2(%[ppin]) \n\t" \ +- "sh $0, "#N1"(%[pout]) \n\t" \ ++ "sh $0, " #J "+2(%[ppin]) \n\t" \ ++ "sh $0, " #N1 "(%[pout]) \n\t" \ + "addu %[level], %[level], %[temp2] \n\t" \ + "sra %[level], %[level], 17 \n\t" \ + "slt %[temp4], %[max_level], %[level] \n\t" \ +@@ -1216,15 +1216,15 @@ + "subu %[level], %[level], %[temp6] \n\t" \ + "mul %[temp5], %[level], %[temp3] \n\t" \ + "or %[ret], %[ret], %[level] \n\t" \ +- "sh %[level], "#N"(%[pout]) \n\t" \ +- "sh %[temp5], "#J"(%[ppin]) \n\t" \ ++ "sh %[level], " #N "(%[pout]) \n\t" \ ++ "sh %[temp5], " #J "(%[ppin]) \n\t" \ + "j 3f \n\t" \ + "2: \n\t" \ +- "lhu %[temp1], "#J"+2(%[ppiq]) \n\t" \ ++ "lhu %[temp1], " #J "+2(%[ppiq]) \n\t" \ + "srl %[temp5], %[coeff], 16 \n\t" \ + "mul %[level], %[temp5], %[temp1] \n\t" \ +- "lw %[temp2], "#K"+4(%[ppbias]) \n\t" \ +- "lhu %[temp3], "#J"+2(%[ppq]) \n\t" \ ++ "lw %[temp2], " #K "+4(%[ppbias]) \n\t" \ ++ "lhu %[temp3], " #J "+2(%[ppq]) \n\t" \ + "addu %[level], %[level], %[temp2] \n\t" \ + "sra %[level], %[level], 17 \n\t" \ + "srl %[temp6], %[sign], 16 \n\t" \ +@@ -1233,20 +1233,20 @@ + "xor %[level], %[level], %[temp6] \n\t" \ + "subu %[level], %[level], %[temp6] \n\t" \ + "mul %[temp5], %[level], %[temp3] \n\t" \ +- "sh $0, "#J"(%[ppin]) \n\t" \ +- "sh $0, "#N"(%[pout]) \n\t" \ ++ "sh $0, " #J "(%[ppin]) \n\t" \ ++ "sh $0, " #N "(%[pout]) \n\t" \ + "or %[ret], %[ret], %[level] \n\t" \ +- "sh %[temp5], "#J"+2(%[ppin]) \n\t" \ +- "sh %[level], "#N1"(%[pout]) \n\t" \ ++ "sh %[temp5], " #J "+2(%[ppin]) \n\t" \ ++ "sh %[level], " #N1 "(%[pout]) \n\t" \ + "j 3f \n\t" \ + "1: \n\t" \ +- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \ +- "lw %[temp2], "#K"(%[ppbias]) \n\t" \ +- "ulw %[temp3], "#J"(%[ppq]) \n\t" \ ++ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \ ++ "lw %[temp2], " #K "(%[ppbias]) \n\t" \ ++ "ulw %[temp3], " #J "(%[ppq]) \n\t" \ + "andi %[temp5], %[coeff], 0xffff \n\t" \ + "srl %[temp0], %[coeff], 16 \n\t" \ +- "lhu %[temp6], "#J"+2(%[ppiq]) \n\t" \ +- "lw %[coeff], "#K"+4(%[ppbias]) \n\t" \ ++ "lhu %[temp6], " #J "+2(%[ppiq]) \n\t" \ ++ "lw %[coeff], " #K "+4(%[ppbias]) \n\t" \ + "mul %[level], %[temp5], %[temp1] \n\t" \ + "mul %[temp4], %[temp0], %[temp6] \n\t" \ + "addu %[level], %[level], %[temp2] \n\t" \ +@@ -1259,15 +1259,15 @@ + "subu.ph %[level], %[level], %[sign] \n\t" \ + "mul.ph %[temp3], %[level], %[temp3] \n\t" \ + "or %[ret], %[ret], %[level] \n\t" \ +- "sh %[level], "#N"(%[pout]) \n\t" \ ++ "sh %[level], " #N "(%[pout]) \n\t" \ + "srl %[level], %[level], 16 \n\t" \ +- "sh %[level], "#N1"(%[pout]) \n\t" \ +- "usw %[temp3], "#J"(%[ppin]) \n\t" \ ++ "sh %[level], " #N1 "(%[pout]) \n\t" \ ++ "usw %[temp3], " #J "(%[ppin]) \n\t" \ + "j 3f \n\t" \ + "0: \n\t" \ +- "sh $0, "#N"(%[pout]) \n\t" \ +- "sh $0, "#N1"(%[pout]) \n\t" \ +- "usw $0, "#J"(%[ppin]) \n\t" \ ++ "sh $0, " #N "(%[pout]) \n\t" \ ++ "sh $0, " #N1 "(%[pout]) \n\t" \ ++ "usw $0, " #J "(%[ppin]) \n\t" \ + "3: \n\t" + + static int QuantizeBlock(int16_t in[16], int16_t out[16], +@@ -1326,37 +1326,37 @@ + // A, B, C, D - offset in bytes to load from in buffer + // TEMP0, TEMP1 - registers for corresponding tmp elements + #define HORIZONTAL_PASS_WHT(A, B, C, D, TEMP0, TEMP1) \ +- "lh %["#TEMP0"], "#A"(%[in]) \n\t" \ +- "lh %["#TEMP1"], "#B"(%[in]) \n\t" \ +- "lh %[temp8], "#C"(%[in]) \n\t" \ +- "lh %[temp9], "#D"(%[in]) \n\t" \ +- "ins %["#TEMP1"], %["#TEMP0"], 16, 16 \n\t" \ ++ "lh %[" #TEMP0 "], " #A "(%[in]) \n\t" \ ++ "lh %[" #TEMP1 "], " #B "(%[in]) \n\t" \ ++ "lh %[temp8], " #C "(%[in]) \n\t" \ ++ "lh %[temp9], " #D "(%[in]) \n\t" \ ++ "ins %[" #TEMP1 "], %[" #TEMP0 "], 16, 16 \n\t" \ + "ins %[temp9], %[temp8], 16, 16 \n\t" \ +- "subq.ph %[temp8], %["#TEMP1"], %[temp9] \n\t" \ +- "addq.ph %[temp9], %["#TEMP1"], %[temp9] \n\t" \ +- "precrq.ph.w %["#TEMP0"], %[temp8], %[temp9] \n\t" \ ++ "subq.ph %[temp8], %[" #TEMP1 "], %[temp9] \n\t" \ ++ "addq.ph %[temp9], %[" #TEMP1 "], %[temp9] \n\t" \ ++ "precrq.ph.w %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \ + "append %[temp8], %[temp9], 16 \n\t" \ +- "subq.ph %["#TEMP1"], %["#TEMP0"], %[temp8] \n\t" \ +- "addq.ph %["#TEMP0"], %["#TEMP0"], %[temp8] \n\t" \ +- "rotr %["#TEMP1"], %["#TEMP1"], 16 \n\t" ++ "subq.ph %[" #TEMP1 "], %[" #TEMP0 "], %[temp8] \n\t" \ ++ "addq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[temp8] \n\t" \ ++ "rotr %[" #TEMP1 "], %[" #TEMP1 "], 16 \n\t" + + // macro for one vertical pass in FTransformWHT + // temp0..temp7 holds tmp[0]..tmp[15] + // A, B, C, D - offsets in bytes to store to out buffer + // TEMP0, TEMP2, TEMP4 and TEMP6 - registers for corresponding tmp elements + #define VERTICAL_PASS_WHT(A, B, C, D, TEMP0, TEMP2, TEMP4, TEMP6) \ +- "addq.ph %[temp8], %["#TEMP0"], %["#TEMP4"] \n\t" \ +- "addq.ph %[temp9], %["#TEMP2"], %["#TEMP6"] \n\t" \ +- "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \ +- "subq.ph %["#TEMP6"], %["#TEMP0"], %["#TEMP4"] \n\t" \ +- "addqh.ph %["#TEMP0"], %[temp8], %[temp9] \n\t" \ +- "subqh.ph %["#TEMP4"], %["#TEMP6"], %["#TEMP2"] \n\t" \ +- "addqh.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \ +- "subqh.ph %["#TEMP6"], %[temp8], %[temp9] \n\t" \ +- "usw %["#TEMP0"], "#A"(%[out]) \n\t" \ +- "usw %["#TEMP2"], "#B"(%[out]) \n\t" \ +- "usw %["#TEMP4"], "#C"(%[out]) \n\t" \ +- "usw %["#TEMP6"], "#D"(%[out]) \n\t" ++ "addq.ph %[temp8], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \ ++ "addq.ph %[temp9], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \ ++ "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \ ++ "subq.ph %[" #TEMP6 "], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \ ++ "addqh.ph %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \ ++ "subqh.ph %[" #TEMP4 "], %[" #TEMP6 "], %[" #TEMP2 "] \n\t" \ ++ "addqh.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \ ++ "subqh.ph %[" #TEMP6 "], %[temp8], %[temp9] \n\t" \ ++ "usw %[" #TEMP0 "], " #A "(%[out]) \n\t" \ ++ "usw %[" #TEMP2 "], " #B "(%[out]) \n\t" \ ++ "usw %[" #TEMP4 "], " #C "(%[out]) \n\t" \ ++ "usw %[" #TEMP6 "], " #D "(%[out]) \n\t" + + static void FTransformWHT(const int16_t* in, int16_t* out) { + int temp0, temp1, temp2, temp3, temp4; +@@ -1385,10 +1385,10 @@ + // convert 8 coeffs at time + // A, B, C, D - offsets in bytes to load from out buffer + #define CONVERT_COEFFS_TO_BIN(A, B, C, D) \ +- "ulw %[temp0], "#A"(%[out]) \n\t" \ +- "ulw %[temp1], "#B"(%[out]) \n\t" \ +- "ulw %[temp2], "#C"(%[out]) \n\t" \ +- "ulw %[temp3], "#D"(%[out]) \n\t" \ ++ "ulw %[temp0], " #A "(%[out]) \n\t" \ ++ "ulw %[temp1], " #B "(%[out]) \n\t" \ ++ "ulw %[temp2], " #C "(%[out]) \n\t" \ ++ "ulw %[temp3], " #D "(%[out]) \n\t" \ + "absq_s.ph %[temp0], %[temp0] \n\t" \ + "absq_s.ph %[temp1], %[temp1] \n\t" \ + "absq_s.ph %[temp2], %[temp2] \n\t" \ +diff --git a/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c +index 66f807d..8134af5 100644 +--- a/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c ++++ b/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c +@@ -48,7 +48,7 @@ + "srl %[temp0], %[length], 0x2 \n\t" \ + "beqz %[temp0], 4f \n\t" \ + " andi %[temp6], %[length], 0x3 \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "lbu %[temp1], -1(%[src]) \n\t" \ + "1: \n\t" \ + "lbu %[temp2], 0(%[src]) \n\t" \ +@@ -84,7 +84,7 @@ + "lbu %[temp1], -1(%[src]) \n\t" \ + "lbu %[temp2], 0(%[src]) \n\t" \ + "addiu %[src], %[src], 1 \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "addu %[temp3], %[temp1], %[temp2] \n\t" \ + "sb %[temp3], -1(%[src]) \n\t" \ + ".else \n\t" \ +@@ -131,7 +131,7 @@ + "ulw %[temp3], 4(%[src]) \n\t" \ + "ulw %[temp4], 4(%[pred]) \n\t" \ + "addiu %[src], %[src], 8 \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "addu.qb %[temp5], %[temp1], %[temp2] \n\t" \ + "addu.qb %[temp6], %[temp3], %[temp4] \n\t" \ + ".else \n\t" \ +@@ -152,7 +152,7 @@ + "lbu %[temp2], 0(%[pred]) \n\t" \ + "addiu %[src], %[src], 1 \n\t" \ + "addiu %[pred], %[pred], 1 \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "addu %[temp3], %[temp1], %[temp2] \n\t" \ + ".else \n\t" \ + "subu %[temp3], %[temp1], %[temp2] \n\t" \ +@@ -177,7 +177,7 @@ + __asm__ volatile ( \ + "lbu %[temp1], 0(%[src]) \n\t" \ + "lbu %[temp2], 0(%[pred]) \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "addu %[temp3], %[temp1], %[temp2] \n\t" \ + ".else \n\t" \ + "subu %[temp3], %[temp1], %[temp2] \n\t" \ +diff --git a/Source/LibWebP/src/dsp/dsp.lossless_mips32.c b/Source/LibWebP/src/dsp/dsp.lossless_mips32.c +index 8ae5958..cdf0e26 100644 +--- a/Source/LibWebP/src/dsp/dsp.lossless_mips32.c ++++ b/Source/LibWebP/src/dsp/dsp.lossless_mips32.c + +@@ -278,28 +278,28 @@ + // literal_ and successive histograms could be unaligned + // so we must use ulw and usw + #define ADD_TO_OUT(A, B, C, D, E, P0, P1, P2) \ +- "ulw %[temp0], "#A"(%["#P0"]) \n\t" \ +- "ulw %[temp1], "#B"(%["#P0"]) \n\t" \ +- "ulw %[temp2], "#C"(%["#P0"]) \n\t" \ +- "ulw %[temp3], "#D"(%["#P0"]) \n\t" \ +- "ulw %[temp4], "#A"(%["#P1"]) \n\t" \ +- "ulw %[temp5], "#B"(%["#P1"]) \n\t" \ +- "ulw %[temp6], "#C"(%["#P1"]) \n\t" \ +- "ulw %[temp7], "#D"(%["#P1"]) \n\t" \ ++ "ulw %[temp0], " #A "(%[" #P0 "]) \n\t" \ ++ "ulw %[temp1], " #B "(%[" #P0 "]) \n\t" \ ++ "ulw %[temp2], " #C "(%[" #P0 "]) \n\t" \ ++ "ulw %[temp3], " #D "(%[" #P0 "]) \n\t" \ ++ "ulw %[temp4], " #A "(%[" #P1 "]) \n\t" \ ++ "ulw %[temp5], " #B "(%[" #P1 "]) \n\t" \ ++ "ulw %[temp6], " #C "(%[" #P1 "]) \n\t" \ ++ "ulw %[temp7], " #D "(%[" #P1 "]) \n\t" \ + "addu %[temp4], %[temp4], %[temp0] \n\t" \ + "addu %[temp5], %[temp5], %[temp1] \n\t" \ + "addu %[temp6], %[temp6], %[temp2] \n\t" \ + "addu %[temp7], %[temp7], %[temp3] \n\t" \ +- "addiu %["#P0"], %["#P0"], 16 \n\t" \ +- ".if "#E" == 1 \n\t" \ +- "addiu %["#P1"], %["#P1"], 16 \n\t" \ ++ "addiu %[" #P0 "], %[" #P0 "], 16 \n\t" \ ++ ".if " #E " == 1 \n\t" \ ++ "addiu %[" #P1 "], %[" #P1 "], 16 \n\t" \ + ".endif \n\t" \ +- "usw %[temp4], "#A"(%["#P2"]) \n\t" \ +- "usw %[temp5], "#B"(%["#P2"]) \n\t" \ +- "usw %[temp6], "#C"(%["#P2"]) \n\t" \ +- "usw %[temp7], "#D"(%["#P2"]) \n\t" \ +- "addiu %["#P2"], %["#P2"], 16 \n\t" \ +- "bne %["#P0"], %[LoopEnd], 1b \n\t" \ ++ "usw %[temp4], " #A "(%[" #P2 "]) \n\t" \ ++ "usw %[temp5], " #B "(%[" #P2 "]) \n\t" \ ++ "usw %[temp6], " #C "(%[" #P2 "]) \n\t" \ ++ "usw %[temp7], " #D "(%[" #P2 "]) \n\t" \ ++ "addiu %[" #P2 "], %[" #P2 "], 16 \n\t" \ ++ "bne %[" #P0 "], %[LoopEnd], 1b \n\t" \ + ".set pop \n\t" \ + + #define ASM_END_COMMON_0 \ +diff --git a/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c +index ad55f2c..90aed7f 100644 +--- a/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c ++++ b/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c +@@ -29,14 +29,14 @@ + for (x = 0; x < (width >> 2); ++x) { \ + int tmp1, tmp2, tmp3, tmp4; \ + __asm__ volatile ( \ +- ".ifc "#TYPE", uint8_t \n\t" \ ++ ".ifc " #TYPE ", uint8_t \n\t" \ + "lbu %[tmp1], 0(%[src]) \n\t" \ + "lbu %[tmp2], 1(%[src]) \n\t" \ + "lbu %[tmp3], 2(%[src]) \n\t" \ + "lbu %[tmp4], 3(%[src]) \n\t" \ + "addiu %[src], %[src], 4 \n\t" \ + ".endif \n\t" \ +- ".ifc "#TYPE", uint32_t \n\t" \ ++ ".ifc " #TYPE ", uint32_t \n\t" \ + "lw %[tmp1], 0(%[src]) \n\t" \ + "lw %[tmp2], 4(%[src]) \n\t" \ + "lw %[tmp3], 8(%[src]) \n\t" \ +@@ -55,7 +55,7 @@ + "lwx %[tmp2], %[tmp2](%[color_map]) \n\t" \ + "lwx %[tmp3], %[tmp3](%[color_map]) \n\t" \ + "lwx %[tmp4], %[tmp4](%[color_map]) \n\t" \ +- ".ifc "#TYPE", uint8_t \n\t" \ ++ ".ifc " #TYPE ", uint8_t \n\t" \ + "ext %[tmp1], %[tmp1], 8, 8 \n\t" \ + "ext %[tmp2], %[tmp2], 8, 8 \n\t" \ + "ext %[tmp3], %[tmp3], 8, 8 \n\t" \ +@@ -66,7 +66,7 @@ + "sb %[tmp4], 3(%[dst]) \n\t" \ + "addiu %[dst], %[dst], 4 \n\t" \ + ".endif \n\t" \ +- ".ifc "#TYPE", uint32_t \n\t" \ ++ ".ifc " #TYPE ", uint32_t \n\t" \ + "sw %[tmp1], 0(%[dst]) \n\t" \ + "sw %[tmp2], 4(%[dst]) \n\t" \ + "sw %[tmp3], 8(%[dst]) \n\t" \ +diff --git a/Source/LibWebP/src/dsp/mips_macro.h b/Source/LibWebP/src/dsp/mips_macro.h +index 4cfb23c..e09d2c4 100644 +--- a/Source/LibWebP/src/dsp/mips_macro.h ++++ b/Source/LibWebP/src/dsp/mips_macro.h +@@ -25,25 +25,25 @@ + // I - input (macro doesn't change it) + #define ADD_SUB_HALVES(O0, O1, \ + I0, I1) \ +- "addq.ph %["#O0"], %["#I0"], %["#I1"] \n\t" \ +- "subq.ph %["#O1"], %["#I0"], %["#I1"] \n\t" ++ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \ ++ "subq.ph %[" #O1 "], %[" #I0 "], %[" #I1 "] \n\t" + + // O - output + // I - input (macro doesn't change it) + // I[0/1] - offset in bytes + #define LOAD_IN_X2(O0, O1, \ + I0, I1) \ +- "lh %["#O0"], "#I0"(%[in]) \n\t" \ +- "lh %["#O1"], "#I1"(%[in]) \n\t" ++ "lh %[" #O0 "], " #I0 "(%[in]) \n\t" \ ++ "lh %[" #O1 "], " #I1 "(%[in]) \n\t" + + // I0 - location + // I1..I9 - offsets in bytes + #define LOAD_WITH_OFFSET_X4(O0, O1, O2, O3, \ + I0, I1, I2, I3, I4, I5, I6, I7, I8, I9) \ +- "ulw %["#O0"], "#I1"+"XSTR(I9)"*"#I5"(%["#I0"]) \n\t" \ +- "ulw %["#O1"], "#I2"+"XSTR(I9)"*"#I6"(%["#I0"]) \n\t" \ +- "ulw %["#O2"], "#I3"+"XSTR(I9)"*"#I7"(%["#I0"]) \n\t" \ +- "ulw %["#O3"], "#I4"+"XSTR(I9)"*"#I8"(%["#I0"]) \n\t" ++ "ulw %[" #O0 "], " #I1 "+"XSTR(I9)"*" #I5 "(%[" #I0 "]) \n\t" \ ++ "ulw %[" #O1 "], " #I2 "+"XSTR(I9)"*" #I6 "(%[" #I0 "]) \n\t" \ ++ "ulw %[" #O2 "], " #I3 "+"XSTR(I9)"*" #I7 "(%[" #I0 "]) \n\t" \ ++ "ulw %[" #O3 "], " #I4 "+"XSTR(I9)"*" #I8 "(%[" #I0 "]) \n\t" + + // O - output + // IO - input/output +@@ -51,42 +51,42 @@ + #define MUL_SHIFT_SUM(O0, O1, O2, O3, O4, O5, O6, O7, \ + IO0, IO1, IO2, IO3, \ + I0, I1, I2, I3, I4, I5, I6, I7) \ +- "mul %["#O0"], %["#I0"], %[kC2] \n\t" \ +- "mul %["#O1"], %["#I0"], %[kC1] \n\t" \ +- "mul %["#O2"], %["#I1"], %[kC2] \n\t" \ +- "mul %["#O3"], %["#I1"], %[kC1] \n\t" \ +- "mul %["#O4"], %["#I2"], %[kC2] \n\t" \ +- "mul %["#O5"], %["#I2"], %[kC1] \n\t" \ +- "mul %["#O6"], %["#I3"], %[kC2] \n\t" \ +- "mul %["#O7"], %["#I3"], %[kC1] \n\t" \ +- "sra %["#O0"], %["#O0"], 16 \n\t" \ +- "sra %["#O1"], %["#O1"], 16 \n\t" \ +- "sra %["#O2"], %["#O2"], 16 \n\t" \ +- "sra %["#O3"], %["#O3"], 16 \n\t" \ +- "sra %["#O4"], %["#O4"], 16 \n\t" \ +- "sra %["#O5"], %["#O5"], 16 \n\t" \ +- "sra %["#O6"], %["#O6"], 16 \n\t" \ +- "sra %["#O7"], %["#O7"], 16 \n\t" \ +- "addu %["#IO0"], %["#IO0"], %["#I4"] \n\t" \ +- "addu %["#IO1"], %["#IO1"], %["#I5"] \n\t" \ +- "subu %["#IO2"], %["#IO2"], %["#I6"] \n\t" \ +- "subu %["#IO3"], %["#IO3"], %["#I7"] \n\t" ++ "mul %[" #O0 "], %[" #I0 "], %[kC2] \n\t" \ ++ "mul %[" #O1 "], %[" #I0 "], %[kC1] \n\t" \ ++ "mul %[" #O2 "], %[" #I1 "], %[kC2] \n\t" \ ++ "mul %[" #O3 "], %[" #I1 "], %[kC1] \n\t" \ ++ "mul %[" #O4 "], %[" #I2 "], %[kC2] \n\t" \ ++ "mul %[" #O5 "], %[" #I2 "], %[kC1] \n\t" \ ++ "mul %[" #O6 "], %[" #I3 "], %[kC2] \n\t" \ ++ "mul %[" #O7 "], %[" #I3 "], %[kC1] \n\t" \ ++ "sra %[" #O0 "], %[" #O0 "], 16 \n\t" \ ++ "sra %[" #O1 "], %[" #O1 "], 16 \n\t" \ ++ "sra %[" #O2 "], %[" #O2 "], 16 \n\t" \ ++ "sra %[" #O3 "], %[" #O3 "], 16 \n\t" \ ++ "sra %[" #O4 "], %[" #O4 "], 16 \n\t" \ ++ "sra %[" #O5 "], %[" #O5 "], 16 \n\t" \ ++ "sra %[" #O6 "], %[" #O6 "], 16 \n\t" \ ++ "sra %[" #O7 "], %[" #O7 "], 16 \n\t" \ ++ "addu %[" #IO0 "], %[" #IO0 "], %[" #I4 "] \n\t" \ ++ "addu %[" #IO1 "], %[" #IO1 "], %[" #I5 "] \n\t" \ ++ "subu %[" #IO2 "], %[" #IO2 "], %[" #I6 "] \n\t" \ ++ "subu %[" #IO3 "], %[" #IO3 "], %[" #I7 "] \n\t" + + // O - output + // I - input (macro doesn't change it) + #define INSERT_HALF_X2(O0, O1, \ + I0, I1) \ +- "ins %["#O0"], %["#I0"], 16, 16 \n\t" \ +- "ins %["#O1"], %["#I1"], 16, 16 \n\t" ++ "ins %[" #O0 "], %[" #I0 "], 16, 16 \n\t" \ ++ "ins %[" #O1 "], %[" #I1 "], 16, 16 \n\t" + + // O - output + // I - input (macro doesn't change it) + #define SRA_16(O0, O1, O2, O3, \ + I0, I1, I2, I3) \ +- "sra %["#O0"], %["#I0"], 16 \n\t" \ +- "sra %["#O1"], %["#I1"], 16 \n\t" \ +- "sra %["#O2"], %["#I2"], 16 \n\t" \ +- "sra %["#O3"], %["#I3"], 16 \n\t" ++ "sra %[" #O0 "], %[" #I0 "], 16 \n\t" \ ++ "sra %[" #O1 "], %[" #I1 "], 16 \n\t" \ ++ "sra %[" #O2 "], %[" #I2 "], 16 \n\t" \ ++ "sra %[" #O3 "], %[" #I3 "], 16 \n\t" + + // temp0[31..16 | 15..0] = temp8[31..16 | 15..0] + temp12[31..16 | 15..0] + // temp1[31..16 | 15..0] = temp8[31..16 | 15..0] - temp12[31..16 | 15..0] +@@ -96,22 +96,22 @@ + // I - input (macro doesn't change it) + #define SHIFT_R_SUM_X2(O0, O1, O2, O3, O4, O5, O6, O7, \ + I0, I1, I2, I3, I4, I5, I6, I7) \ +- "addq.ph %["#O0"], %["#I0"], %["#I4"] \n\t" \ +- "subq.ph %["#O1"], %["#I0"], %["#I4"] \n\t" \ +- "addq.ph %["#O2"], %["#I1"], %["#I5"] \n\t" \ +- "subq.ph %["#O3"], %["#I1"], %["#I5"] \n\t" \ +- "addq.ph %["#O4"], %["#I2"], %["#I6"] \n\t" \ +- "subq.ph %["#O5"], %["#I2"], %["#I6"] \n\t" \ +- "addq.ph %["#O6"], %["#I3"], %["#I7"] \n\t" \ +- "subq.ph %["#O7"], %["#I3"], %["#I7"] \n\t" \ +- "shra.ph %["#O0"], %["#O0"], 3 \n\t" \ +- "shra.ph %["#O1"], %["#O1"], 3 \n\t" \ +- "shra.ph %["#O2"], %["#O2"], 3 \n\t" \ +- "shra.ph %["#O3"], %["#O3"], 3 \n\t" \ +- "shra.ph %["#O4"], %["#O4"], 3 \n\t" \ +- "shra.ph %["#O5"], %["#O5"], 3 \n\t" \ +- "shra.ph %["#O6"], %["#O6"], 3 \n\t" \ +- "shra.ph %["#O7"], %["#O7"], 3 \n\t" ++ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I4 "] \n\t" \ ++ "subq.ph %[" #O1 "], %[" #I0 "], %[" #I4 "] \n\t" \ ++ "addq.ph %[" #O2 "], %[" #I1 "], %[" #I5 "] \n\t" \ ++ "subq.ph %[" #O3 "], %[" #I1 "], %[" #I5 "] \n\t" \ ++ "addq.ph %[" #O4 "], %[" #I2 "], %[" #I6 "] \n\t" \ ++ "subq.ph %[" #O5 "], %[" #I2 "], %[" #I6 "] \n\t" \ ++ "addq.ph %[" #O6 "], %[" #I3 "], %[" #I7 "] \n\t" \ ++ "subq.ph %[" #O7 "], %[" #I3 "], %[" #I7 "] \n\t" \ ++ "shra.ph %[" #O0 "], %[" #O0 "], 3 \n\t" \ ++ "shra.ph %[" #O1 "], %[" #O1 "], 3 \n\t" \ ++ "shra.ph %[" #O2 "], %[" #O2 "], 3 \n\t" \ ++ "shra.ph %[" #O3 "], %[" #O3 "], 3 \n\t" \ ++ "shra.ph %[" #O4 "], %[" #O4 "], 3 \n\t" \ ++ "shra.ph %[" #O5 "], %[" #O5 "], 3 \n\t" \ ++ "shra.ph %[" #O6 "], %[" #O6 "], 3 \n\t" \ ++ "shra.ph %[" #O7 "], %[" #O7 "], 3 \n\t" + + // precrq.ph.w temp0, temp8, temp2 + // temp0 = temp8[31..16] | temp2[31..16] +@@ -123,14 +123,14 @@ + #define PACK_2_HALVES_TO_WORD(O0, O1, O2, O3, \ + IO0, IO1, IO2, IO3, \ + I0, I1, I2, I3) \ +- "precrq.ph.w %["#O0"], %["#I0"], %["#IO0"] \n\t" \ +- "precrq.ph.w %["#O1"], %["#I1"], %["#IO1"] \n\t" \ +- "ins %["#IO0"], %["#I0"], 16, 16 \n\t" \ +- "ins %["#IO1"], %["#I1"], 16, 16 \n\t" \ +- "precrq.ph.w %["#O2"], %["#I2"], %["#IO2"] \n\t" \ +- "precrq.ph.w %["#O3"], %["#I3"], %["#IO3"] \n\t" \ +- "ins %["#IO2"], %["#I2"], 16, 16 \n\t" \ +- "ins %["#IO3"], %["#I3"], 16, 16 \n\t" ++ "precrq.ph.w %[" #O0 "], %[" #I0 "], %[" #IO0 "] \n\t" \ ++ "precrq.ph.w %[" #O1 "], %[" #I1 "], %[" #IO1 "] \n\t" \ ++ "ins %[" #IO0 "], %[" #I0 "], 16, 16 \n\t" \ ++ "ins %[" #IO1 "], %[" #I1 "], 16, 16 \n\t" \ ++ "precrq.ph.w %[" #O2 "], %[" #I2 "], %[" #IO2 "] \n\t" \ ++ "precrq.ph.w %[" #O3 "], %[" #I3 "], %[" #IO3 "] \n\t" \ ++ "ins %[" #IO2 "], %[" #I2 "], 16, 16 \n\t" \ ++ "ins %[" #IO3 "], %[" #I3 "], 16, 16 \n\t" + + // preceu.ph.qbr temp0, temp8 + // temp0 = 0 | 0 | temp8[23..16] | temp8[7..0] +@@ -140,14 +140,14 @@ + // I - input (macro doesn't change it) + #define CONVERT_2_BYTES_TO_HALF(O0, O1, O2, O3, O4, O5, O6, O7, \ + I0, I1, I2, I3) \ +- "preceu.ph.qbr %["#O0"], %["#I0"] \n\t" \ +- "preceu.ph.qbl %["#O1"], %["#I0"] \n\t" \ +- "preceu.ph.qbr %["#O2"], %["#I1"] \n\t" \ +- "preceu.ph.qbl %["#O3"], %["#I1"] \n\t" \ +- "preceu.ph.qbr %["#O4"], %["#I2"] \n\t" \ +- "preceu.ph.qbl %["#O5"], %["#I2"] \n\t" \ +- "preceu.ph.qbr %["#O6"], %["#I3"] \n\t" \ +- "preceu.ph.qbl %["#O7"], %["#I3"] \n\t" ++ "preceu.ph.qbr %[" #O0 "], %[" #I0 "] \n\t" \ ++ "preceu.ph.qbl %[" #O1 "], %[" #I0 "] \n\t" \ ++ "preceu.ph.qbr %[" #O2 "], %[" #I1 "] \n\t" \ ++ "preceu.ph.qbl %[" #O3 "], %[" #I1 "] \n\t" \ ++ "preceu.ph.qbr %[" #O4 "], %[" #I2 "] \n\t" \ ++ "preceu.ph.qbl %[" #O5 "], %[" #I2 "] \n\t" \ ++ "preceu.ph.qbr %[" #O6 "], %[" #I3 "] \n\t" \ ++ "preceu.ph.qbl %[" #O7 "], %[" #I3 "] \n\t" + + // temp0[31..16 | 15..0] = temp0[31..16 | 15..0] + temp8[31..16 | 15..0] + // temp0[31..16 | 15..0] = temp0[31..16 <<(s) 7 | 15..0 <<(s) 7] +@@ -160,30 +160,30 @@ + #define STORE_SAT_SUM_X2(IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7, \ + I0, I1, I2, I3, I4, I5, I6, I7, \ + I8, I9, I10, I11, I12, I13) \ +- "addq.ph %["#IO0"], %["#IO0"], %["#I0"] \n\t" \ +- "addq.ph %["#IO1"], %["#IO1"], %["#I1"] \n\t" \ +- "addq.ph %["#IO2"], %["#IO2"], %["#I2"] \n\t" \ +- "addq.ph %["#IO3"], %["#IO3"], %["#I3"] \n\t" \ +- "addq.ph %["#IO4"], %["#IO4"], %["#I4"] \n\t" \ +- "addq.ph %["#IO5"], %["#IO5"], %["#I5"] \n\t" \ +- "addq.ph %["#IO6"], %["#IO6"], %["#I6"] \n\t" \ +- "addq.ph %["#IO7"], %["#IO7"], %["#I7"] \n\t" \ +- "shll_s.ph %["#IO0"], %["#IO0"], 7 \n\t" \ +- "shll_s.ph %["#IO1"], %["#IO1"], 7 \n\t" \ +- "shll_s.ph %["#IO2"], %["#IO2"], 7 \n\t" \ +- "shll_s.ph %["#IO3"], %["#IO3"], 7 \n\t" \ +- "shll_s.ph %["#IO4"], %["#IO4"], 7 \n\t" \ +- "shll_s.ph %["#IO5"], %["#IO5"], 7 \n\t" \ +- "shll_s.ph %["#IO6"], %["#IO6"], 7 \n\t" \ +- "shll_s.ph %["#IO7"], %["#IO7"], 7 \n\t" \ +- "precrqu_s.qb.ph %["#IO0"], %["#IO1"], %["#IO0"] \n\t" \ +- "precrqu_s.qb.ph %["#IO2"], %["#IO3"], %["#IO2"] \n\t" \ +- "precrqu_s.qb.ph %["#IO4"], %["#IO5"], %["#IO4"] \n\t" \ +- "precrqu_s.qb.ph %["#IO6"], %["#IO7"], %["#IO6"] \n\t" \ +- "usw %["#IO0"], "XSTR(I13)"*"#I9"(%["#I8"]) \n\t" \ +- "usw %["#IO2"], "XSTR(I13)"*"#I10"(%["#I8"]) \n\t" \ +- "usw %["#IO4"], "XSTR(I13)"*"#I11"(%["#I8"]) \n\t" \ +- "usw %["#IO6"], "XSTR(I13)"*"#I12"(%["#I8"]) \n\t" ++ "addq.ph %[" #IO0 "], %[" #IO0 "], %[" #I0 "] \n\t" \ ++ "addq.ph %[" #IO1 "], %[" #IO1 "], %[" #I1 "] \n\t" \ ++ "addq.ph %[" #IO2 "], %[" #IO2 "], %[" #I2 "] \n\t" \ ++ "addq.ph %[" #IO3 "], %[" #IO3 "], %[" #I3 "] \n\t" \ ++ "addq.ph %[" #IO4 "], %[" #IO4 "], %[" #I4 "] \n\t" \ ++ "addq.ph %[" #IO5 "], %[" #IO5 "], %[" #I5 "] \n\t" \ ++ "addq.ph %[" #IO6 "], %[" #IO6 "], %[" #I6 "] \n\t" \ ++ "addq.ph %[" #IO7 "], %[" #IO7 "], %[" #I7 "] \n\t" \ ++ "shll_s.ph %[" #IO0 "], %[" #IO0 "], 7 \n\t" \ ++ "shll_s.ph %[" #IO1 "], %[" #IO1 "], 7 \n\t" \ ++ "shll_s.ph %[" #IO2 "], %[" #IO2 "], 7 \n\t" \ ++ "shll_s.ph %[" #IO3 "], %[" #IO3 "], 7 \n\t" \ ++ "shll_s.ph %[" #IO4 "], %[" #IO4 "], 7 \n\t" \ ++ "shll_s.ph %[" #IO5 "], %[" #IO5 "], 7 \n\t" \ ++ "shll_s.ph %[" #IO6 "], %[" #IO6 "], 7 \n\t" \ ++ "shll_s.ph %[" #IO7 "], %[" #IO7 "], 7 \n\t" \ ++ "precrqu_s.qb.ph %[" #IO0 "], %[" #IO1 "], %[" #IO0 "] \n\t" \ ++ "precrqu_s.qb.ph %[" #IO2 "], %[" #IO3 "], %[" #IO2 "] \n\t" \ ++ "precrqu_s.qb.ph %[" #IO4 "], %[" #IO5 "], %[" #IO4 "] \n\t" \ ++ "precrqu_s.qb.ph %[" #IO6 "], %[" #IO7 "], %[" #IO6 "] \n\t" \ ++ "usw %[" #IO0 "], "XSTR(I13)"*" #I9 "(%[" #I8 "]) \n\t" \ ++ "usw %[" #IO2 "], "XSTR(I13)"*" #I10 "(%[" #I8 "]) \n\t" \ ++ "usw %[" #IO4 "], "XSTR(I13)"*" #I11 "(%[" #I8 "]) \n\t" \ ++ "usw %[" #IO6 "], "XSTR(I13)"*" #I12 "(%[" #I8 "]) \n\t" + + #define OUTPUT_EARLY_CLOBBER_REGS_10() \ + : [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), \ +diff --git a/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c +index 9c9665f..46f207b 100644 +--- a/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c ++++ b/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c +@@ -34,15 +34,15 @@ + G = G - t2 + kGCst; \ + B = B + kBCst; \ + __asm__ volatile ( \ +- "shll_s.w %["#R"], %["#R"], 9 \n\t" \ +- "shll_s.w %["#G"], %["#G"], 9 \n\t" \ +- "shll_s.w %["#B"], %["#B"], 9 \n\t" \ +- "precrqu_s.qb.ph %["#R"], %["#R"], $zero \n\t" \ +- "precrqu_s.qb.ph %["#G"], %["#G"], $zero \n\t" \ +- "precrqu_s.qb.ph %["#B"], %["#B"], $zero \n\t" \ +- "srl %["#R"], %["#R"], 24 \n\t" \ +- "srl %["#G"], %["#G"], 24 \n\t" \ +- "srl %["#B"], %["#B"], 24 \n\t" \ ++ "shll_s.w %[" #R "], %[" #R "], 9 \n\t" \ ++ "shll_s.w %[" #G "], %[" #G "], 9 \n\t" \ ++ "shll_s.w %[" #B "], %[" #B "], 9 \n\t" \ ++ "precrqu_s.qb.ph %[" #R "], %[" #R "], $zero \n\t" \ ++ "precrqu_s.qb.ph %[" #G "], %[" #G "], $zero \n\t" \ ++ "precrqu_s.qb.ph %[" #B "], %[" #B "], $zero \n\t" \ ++ "srl %[" #R "], %[" #R "], 24 \n\t" \ ++ "srl %[" #G "], %[" #G "], 24 \n\t" \ ++ "srl %[" #B "], %[" #B "], 24 \n\t" \ + : [R]"+r"(R), [G]"+r"(G), [B]"+r"(B) \ + : \ + ); \ +diff --git a/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c +index 43f02cc..45a2200 100644 +--- a/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c ++++ b/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c +@@ -39,12 +39,12 @@ + "addu %[temp5], %[temp0], %[temp1] \n\t" \ + "subu %[temp6], %[temp0], %[temp2] \n\t" \ + "addu %[temp7], %[temp0], %[temp4] \n\t" \ +-".if "#K" \n\t" \ ++".if " #K " \n\t" \ + "lbu %[temp0], 1(%[y]) \n\t" \ + ".endif \n\t" \ + "shll_s.w %[temp5], %[temp5], 9 \n\t" \ + "shll_s.w %[temp6], %[temp6], 9 \n\t" \ +-".if "#K" \n\t" \ ++".if " #K " \n\t" \ + "mul %[temp0], %[t_con_5], %[temp0] \n\t" \ + ".endif \n\t" \ + "shll_s.w %[temp7], %[temp7], 9 \n\t" \ +@@ -54,9 +54,9 @@ + "srl %[temp5], %[temp5], 24 \n\t" \ + "srl %[temp6], %[temp6], 24 \n\t" \ + "srl %[temp7], %[temp7], 24 \n\t" \ +- "sb %[temp5], "#R"(%[dst]) \n\t" \ +- "sb %[temp6], "#G"(%[dst]) \n\t" \ +- "sb %[temp7], "#B"(%[dst]) \n\t" \ ++ "sb %[temp5], " #R "(%[dst]) \n\t" \ ++ "sb %[temp6], " #G "(%[dst]) \n\t" \ ++ "sb %[temp7], " #B "(%[dst]) \n\t" \ + + #define ASM_CLOBBER_LIST() \ + : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), \ -- cgit v1.2.3 From 77ab6983a19ef307558ab2607920158d6bb94ba8 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 24 Mar 2017 00:12:00 +0100 Subject: gnu: devil: Update to 1.8.0. * gnu/packages/patches/devil-CVE-2009-3994.patch, gnu/packages/patches/devil-fix-libpng.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. * gnu/packages/image.scm (devil): Update to 1.8.0. [source]: Remove patches and snippet. [build-system]: Change to CMAKE-BUILD-SYSTEM. [arguments]: Disable tests. Remove #:configure-flags and add a 'change-directory' phase. Remove 'fix-tests' phase. [inputs]: Change LIBJPEG to LIBJPEG-TURBO. --- gnu/local.mk | 2 -- gnu/packages/image.scm | 34 +++++++----------------- gnu/packages/patches/devil-CVE-2009-3994.patch | 24 ----------------- gnu/packages/patches/devil-fix-libpng.patch | 36 -------------------------- 4 files changed, 9 insertions(+), 87 deletions(-) delete mode 100644 gnu/packages/patches/devil-CVE-2009-3994.patch delete mode 100644 gnu/packages/patches/devil-fix-libpng.patch (limited to 'gnu/packages/image.scm') diff --git a/gnu/local.mk b/gnu/local.mk index c9e3131c08..6df3e58465 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -526,8 +526,6 @@ dist_patch_DATA = \ %D%/packages/patches/cursynth-wave-rand.patch \ %D%/packages/patches/cyrus-sasl-CVE-2013-4122.patch \ %D%/packages/patches/dbus-helper-search-path.patch \ - %D%/packages/patches/devil-CVE-2009-3994.patch \ - %D%/packages/patches/devil-fix-libpng.patch \ %D%/packages/patches/dfu-programmer-fix-libusb.patch \ %D%/packages/patches/diffutils-gets-undeclared.patch \ %D%/packages/patches/doc++-include-directives.patch \ diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 51c465a0cc..51b09680a9 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -860,44 +860,28 @@ and XMP metadata of images in various formats.") (define-public devil (package (name "devil") - (version "1.7.8") + (version "1.8.0") (source (origin (method url-fetch) (uri (string-append "http://downloads.sourceforge.net/openil/" "DevIL-" version ".tar.gz")) (sha256 (base32 - "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8")) - ;; Backported from upstream: - ;; https://github.com/DentonW/DevIL/commit/724194d7a9a91221a564579f64bdd6f0abd64219.patch - (patches (search-patches "devil-fix-libpng.patch" - "devil-CVE-2009-3994.patch")) - (modules '((guix build utils))) - (snippet - ;; Fix old lcms include directives and lib flags. - '(substitute* '("configure" "src-IL/src/il_profiles.c") - (("-llcms") "-llcms2") - (("lcms/lcms\\.h") "lcms2/lcms2.h") - (("lcms\\.h") "lcms2.h"))))) - (build-system gnu-build-system) + "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80")))) + (build-system cmake-build-system) (arguments - '(#:configure-flags '("--enable-ILUT=yes") ; build utility library + '(;; XXX: Not supported in the released CMakeLists.txt. + ;; Enable this for > 1.8.0. + #:tests? #f #:phases (modify-phases %standard-phases - (add-before 'check 'fix-tests - (lambda* (#:key inputs #:allow-other-keys) - ;; Fix hard-coded /bin/bash reference. - (substitute* '("test/Makefile") - (("TESTS_ENVIRONMENT = /bin/bash") - (string-append "TESTS_ENVIRONMENT = " - (assoc-ref inputs "bash") - "/bin/bash"))) - #t))))) + (add-before 'configure 'change-directory + (lambda _ (chdir "DevIL") #t))))) (native-inputs `(("pkg-config" ,pkg-config))) (inputs `(("lcms" ,lcms) - ("libjpeg" ,libjpeg) + ("libjpeg" ,libjpeg-turbo) ("libmng" ,libmng) ("libpng" ,libpng) ("libtiff" ,libtiff) diff --git a/gnu/packages/patches/devil-CVE-2009-3994.patch b/gnu/packages/patches/devil-CVE-2009-3994.patch deleted file mode 100644 index e009a95c44..0000000000 --- a/gnu/packages/patches/devil-CVE-2009-3994.patch +++ /dev/null @@ -1,24 +0,0 @@ -Fix CVE-2009-3994 (buffer overflow in GetUID() allows remote DOS or -arbitrary code execution via crafted DICOM file). - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3994 - -Copied from Fedora -https://pkgs.fedoraproject.org/cgit/rpms/DevIL.git/tree/DevIL-1.7.8-CVE-2009-3994.patch?id=9c656a75393d6c455aef9f4968fbbee9c53f4fdb - -diff -up devil-1.7.8/src-IL/src/il_dicom.c~ devil-1.7.8/src-IL/src/il_dicom.c ---- devil-1.7.8/src-IL/src/il_dicom.c~ 2009-03-08 08:10:09.000000000 +0100 -+++ devil-1.7.8/src-IL/src/il_dicom.c 2009-12-03 12:07:45.000000000 +0100 -@@ -427,9 +427,11 @@ ILboolean GetUID(ILubyte *UID) - return IL_FALSE; - - ValLen = GetLittleUShort(); -+ if (ValLen > 64) -+ return IL_FALSE; - if (iread(UID, ValLen, 1) != 1) - return IL_FALSE; -- UID[64] = 0; // Just to make sure that our string is terminated. -+ UID[ValLen] = 0; // Just to make sure that our string is terminated. - - return IL_TRUE; - } diff --git a/gnu/packages/patches/devil-fix-libpng.patch b/gnu/packages/patches/devil-fix-libpng.patch deleted file mode 100644 index a8e90333a3..0000000000 --- a/gnu/packages/patches/devil-fix-libpng.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 724194d7a9a91221a564579f64bdd6f0abd64219 Mon Sep 17 00:00:00 2001 -From: Noah Mayr -Date: Sun, 1 Mar 2015 10:10:56 +0100 -Subject: [PATCH] Fixed deprecated libpng API usage. - ---- - src-IL/src/il_icon.c | 2 +- - src-IL/src/il_png.c | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src-IL/src/il_icon.c b/src-IL/src/il_icon.c -index 2ccb1a3..fd9475d 100644 ---- a/src-IL/src/il_icon.c -+++ b/src-IL/src/il_icon.c -@@ -525,7 +525,7 @@ ILboolean ico_readpng_get_image(ICOIMAGE *Icon, ILdouble display_exponent) - - // Expand low-bit-depth grayscale images to 8 bits - if (ico_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { -- png_set_gray_1_2_4_to_8(ico_png_ptr); -+ png_set_expand_gray_1_2_4_to_8(ico_png_ptr); - } - - // Expand RGB images with transparency to full alpha channels -diff --git a/src-IL/src/il_png.c b/src-IL/src/il_png.c -index da9517d..2866508 100644 ---- a/src-IL/src/il_png.c -+++ b/src-IL/src/il_png.c -@@ -277,7 +277,7 @@ ILboolean readpng_get_image(ILdouble display_exponent) - - // Expand low-bit-depth grayscale images to 8 bits - if (png_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { -- png_set_gray_1_2_4_to_8(png_ptr); -+ png_set_expand_gray_1_2_4_to_8(png_ptr); - } - - // Expand RGB images with transparency to full alpha channels -- cgit v1.2.3