From f72f1f2e9427cc663d908e33fffd4f62caa81eaa Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 4 Sep 2014 18:51:31 +0000 Subject: [PATCH 001/140] Bump version to 1.5 alpha1 to prepare for new features git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1404 632fc199-4ca6-4c93-a231-07263d6284db --- CMakeLists.txt | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 202b5e76..46c6450e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ if(POLICY CMP0022) endif() project(libjpeg-turbo C) -set(VERSION 1.3.90) +set(VERSION 1.4.80) if(CYGWIN OR NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD) diff --git a/configure.ac b/configure.ac index 832e4cfb..42c61501 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.56]) -AC_INIT([libjpeg-turbo], [1.3.90]) +AC_INIT([libjpeg-turbo], [1.4.80]) BUILD=`date +%Y%m%d` AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2]) From cd2d8e1cc77130216e2a2da7fb6e7507bafc8299 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 5 Sep 2014 06:33:42 +0000 Subject: [PATCH 002/140] AltiVec SIMD implementation of fast forward DCT git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1405 632fc199-4ca6-4c93-a231-07263d6284db --- configure.ac | 5 + simd/Makefile.am | 7 + simd/jsimd.h | 5 +- simd/jsimd_powerpc64.c | 358 +++++++++++++++++++++++++++++++++ simd/jsimd_powerpc64_altivec.c | 191 ++++++++++++++++++ 5 files changed, 565 insertions(+), 1 deletion(-) create mode 100644 simd/jsimd_powerpc64.c create mode 100644 simd/jsimd_powerpc64_altivec.c diff --git a/configure.ac b/configure.ac index 42c61501..6361cd41 100644 --- a/configure.ac +++ b/configure.ac @@ -481,6 +481,10 @@ if test "x${with_simd}" != "xno"; then fi fi ;; + powerpc64) + AC_MSG_RESULT([yes (powerpc64)]) + simd_arch=powerpc64 + ;; *) AC_MSG_RESULT([no ("$host_cpu")]) with_simd=no; @@ -506,6 +510,7 @@ AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"]) AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"]) AM_CONDITIONAL([SIMD_ARM_64], [test "x$simd_arch" = "xaarch64"]) AM_CONDITIONAL([SIMD_MIPS], [test "x$simd_arch" = "xmips"]) +AM_CONDITIONAL([SIMD_POWERPC64], [test "x$simd_arch" = "xpowerpc64"]) AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"]) AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"]) diff --git a/simd/Makefile.am b/simd/Makefile.am index 9605e68d..06dce038 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -70,6 +70,13 @@ libsimd_la_SOURCES = jsimd_mips.c jsimd_mips_dspr2_asm.h jsimd_mips_dspr2.S endif +if SIMD_POWERPC64 + +libsimd_la_SOURCES = jsimd_powerpc64.c jsimd_powerpc64_altivec.c +libsimd_la_CFLAGS = -maltivec + +endif + AM_CPPFLAGS = -I$(top_srcdir) .asm.lo: diff --git a/simd/jsimd.h b/simd/jsimd.h index c5abd458..b0329728 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -2,7 +2,7 @@ * simd/jsimd.h * * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright 2011 D. R. Commander + * Copyright (C) 2011, 2014 D. R. Commander * Copyright (C) 2013-2014, MIPS Technologies, Inc., California * Copyright (C) 2014 Linaro Limited * @@ -21,6 +21,7 @@ #define JSIMD_SSE2 0x08 #define JSIMD_ARM_NEON 0x10 #define JSIMD_MIPS_DSPR2 0x20 +#define JSIMD_ALTIVEC 0x40 /* SIMD Ext: retrieve SIMD/CPU information */ EXTERN(unsigned int) jpeg_simd_cpu_support (void); @@ -554,6 +555,8 @@ EXTERN(void) jsimd_fdct_ifast_neon (DCTELEM * data); EXTERN(void) jsimd_fdct_ifast_mips_dspr2 (DCTELEM * data); +EXTERN(void) jsimd_fdct_ifast_altivec (DCTELEM * data); + /* Floating Point Forward DCT */ EXTERN(void) jsimd_fdct_float_3dnow (FAST_FLOAT * data); diff --git a/simd/jsimd_powerpc64.c b/simd/jsimd_powerpc64.c new file mode 100644 index 00000000..a9a5965d --- /dev/null +++ b/simd/jsimd_powerpc64.c @@ -0,0 +1,358 @@ +/* + * jsimd_powerpc64.c + * + * Copyright 2009 Pierre Ossman for Cendio AB + * Copyright 2009-2011, 2014 D. R. Commander + * + * Based on the x86 SIMD extension for IJG JPEG library, + * Copyright (C) 1999-2006, MIYASAKA Masaru. + * For conditions of distribution and use, see copyright notice in jsimdext.inc + * + * This file contains the interface between the "normal" portions + * of the library and the SIMD implementations when running on a + * 64-bit x86 architecture. + */ + +#define JPEG_INTERNALS +#include "../jinclude.h" +#include "../jpeglib.h" +#include "../jsimd.h" +#include "../jdct.h" +#include "../jsimddct.h" +#include "jsimd.h" + +static unsigned int simd_support = ~0; + +LOCAL(void) +init_simd (void) +{ + char *env = NULL; + + if (simd_support != ~0U) + return; + + simd_support = JSIMD_ALTIVEC; + + /* Force different settings through environment variables */ + env = getenv("JSIMD_FORCENONE"); + if ((env != NULL) && (strcmp(env, "1") == 0)) + simd_support = 0; +} + +GLOBAL(int) +jsimd_can_rgb_ycc (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_rgb_gray (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_ycc_rgb (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_ycc_rgb565 (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_rgb_ycc_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ +} + +GLOBAL(void) +jsimd_rgb_gray_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ +} + +GLOBAL(void) +jsimd_ycc_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ +} + +GLOBAL(void) +jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ +} + +GLOBAL(int) +jsimd_can_h2v2_downsample (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_h2v1_downsample (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ +} + +GLOBAL(void) +jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ +} + +GLOBAL(int) +jsimd_can_h2v2_upsample (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_h2v1_upsample (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_h2v2_upsample (j_decompress_ptr cinfo, + jpeg_component_info * compptr, + JSAMPARRAY input_data, + JSAMPARRAY * output_data_ptr) +{ +} + +GLOBAL(void) +jsimd_h2v1_upsample (j_decompress_ptr cinfo, + jpeg_component_info * compptr, + JSAMPARRAY input_data, + JSAMPARRAY * output_data_ptr) +{ +} + +GLOBAL(int) +jsimd_can_h2v2_fancy_upsample (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_h2v1_fancy_upsample (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, + jpeg_component_info * compptr, + JSAMPARRAY input_data, + JSAMPARRAY * output_data_ptr) +{ +} + +GLOBAL(void) +jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, + jpeg_component_info * compptr, + JSAMPARRAY input_data, + JSAMPARRAY * output_data_ptr) +{ +} + +GLOBAL(int) +jsimd_can_h2v2_merged_upsample (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_h2v1_merged_upsample (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ +} + +GLOBAL(void) +jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ +} + +GLOBAL(int) +jsimd_can_convsamp (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_convsamp_float (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, + DCTELEM * workspace) +{ +} + +GLOBAL(void) +jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, + FAST_FLOAT * workspace) +{ +} + +GLOBAL(int) +jsimd_can_fdct_islow (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_fdct_ifast (void) +{ + init_simd(); + + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + + return 0; +} + +GLOBAL(int) +jsimd_can_fdct_float (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_fdct_islow (DCTELEM * data) +{ +} + +GLOBAL(void) +jsimd_fdct_ifast (DCTELEM * data) +{ + jsimd_fdct_ifast_altivec(data); +} + +GLOBAL(void) +jsimd_fdct_float (FAST_FLOAT * data) +{ +} + +GLOBAL(int) +jsimd_can_quantize (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_quantize_float (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, + DCTELEM * workspace) +{ +} + +GLOBAL(void) +jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, + FAST_FLOAT * workspace) +{ +} + +GLOBAL(int) +jsimd_can_idct_2x2 (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_idct_4x4 (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col) +{ +} + +GLOBAL(void) +jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col) +{ +} + +GLOBAL(int) +jsimd_can_idct_islow (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_idct_ifast (void) +{ + return 0; +} + +GLOBAL(int) +jsimd_can_idct_float (void) +{ + return 0; +} + +GLOBAL(void) +jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col) +{ +} + +GLOBAL(void) +jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col) +{ +} + +GLOBAL(void) +jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col) +{ +} diff --git a/simd/jsimd_powerpc64_altivec.c b/simd/jsimd_powerpc64_altivec.c new file mode 100644 index 00000000..be42e672 --- /dev/null +++ b/simd/jsimd_powerpc64_altivec.c @@ -0,0 +1,191 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +#define JPEG_INTERNALS +#include "../jinclude.h" +#include "../jpeglib.h" +#include "../jsimd.h" +#include "../jdct.h" +#include "../jsimddct.h" +#include "jsimd.h" +#include + +#define TRANSPOSE(row, col) \ +{ \ + __vector short row04l, row04h, row15l, row15h, \ + row26l, row26h, row37l, row37h; \ + __vector short col01e, col01o, col23e, col23o, \ + col45e, col45o, col67e, col67o; \ + \ + /* transpose coefficients (phase 1) */ \ + row04l = vec_mergeh(row##0, row##4); /* row04l=(00 40 01 41 02 42 03 43) */ \ + row04h = vec_mergel(row##0, row##4); /* row04h=(04 44 05 45 06 46 07 47) */ \ + row15l = vec_mergeh(row##1, row##5); /* row15l=(10 50 11 51 12 52 13 53) */ \ + row15h = vec_mergel(row##1, row##5); /* row15h=(14 54 15 55 16 56 17 57) */ \ + row26l = vec_mergeh(row##2, row##6); /* row26l=(20 60 21 61 22 62 23 63) */ \ + row26h = vec_mergel(row##2, row##6); /* row26h=(24 64 25 65 26 66 27 67) */ \ + row37l = vec_mergeh(row##3, row##7); /* row37l=(30 70 31 71 32 72 33 73) */ \ + row37h = vec_mergel(row##3, row##7); /* row37h=(34 74 35 75 36 76 37 77) */ \ + \ + /* transpose coefficients (phase 2) */ \ + col01e = vec_mergeh(row04l, row26l); /* col01e=(00 20 40 60 01 21 41 61} */ \ + col23e = vec_mergel(row04l, row26l); /* col23e=(02 22 42 62 03 23 43 63) */ \ + col45e = vec_mergeh(row04h, row26h); /* col45e=(04 24 44 64 05 25 45 65) */ \ + col67e = vec_mergel(row04h, row26h); /* col67e=(06 26 46 66 07 27 47 67) */ \ + col01o = vec_mergeh(row15l, row37l); /* col01o=(10 30 50 70 11 31 51 71) */ \ + col23o = vec_mergel(row15l, row37l); /* col23o=(12 32 52 72 13 33 53 73) */ \ + col45o = vec_mergeh(row15h, row37h); /* col45o=(14 34 54 74 15 35 55 75) */ \ + col67o = vec_mergel(row15h, row37h); /* col67o=(16 36 56 76 17 37 57 77) */ \ + \ + /* transpose coefficients (phase 3) */ \ + col##0 = vec_mergeh(col01e, col01o); /* col0=(00 10 20 30 40 50 60 70) */ \ + col##1 = vec_mergel(col01e, col01o); /* col1=(01 11 21 31 41 51 61 71} */ \ + col##2 = vec_mergeh(col23e, col23o); /* col2=(02 12 22 32 42 52 62 72) */ \ + col##3 = vec_mergel(col23e, col23o); /* col3=(03 13 23 33 43 53 63 73) */ \ + col##4 = vec_mergeh(col45e, col45o); /* col4=(04 14 24 34 44 54 64 74) */ \ + col##5 = vec_mergel(col45e, col45o); /* col5=(05 15 25 35 45 55 65 75) */ \ + col##6 = vec_mergeh(col67e, col67o); /* col6=(06 16 26 36 46 56 66 76) */ \ + col##7 = vec_mergel(col67e, col67o); /* col7=(07 17 27 37 47 57 67 77) */ \ +} + +#define PRE_MULTIPLY_SCALE_BITS 2 + +static const __vector short constants __attribute__((aligned(16))) = +{ + 98 << 5, /* FIX(0.382683433) */ + 139 << 5, /* FIX(0.541196100) */ + 181 << 5, /* FIX(0.707106781) */ + 334 << 5 /* FIX(1.306562965) */ +}; + +#define DO_DCT() \ +{ \ + /* Even part */ \ + \ + tmp10 = vec_add(tmp0, tmp3); \ + tmp13 = vec_sub(tmp0, tmp3); \ + tmp11 = vec_add(tmp1, tmp2); \ + tmp12 = vec_sub(tmp1, tmp2); \ + \ + out0 = vec_add(tmp10, tmp11); \ + out4 = vec_sub(tmp10, tmp11); \ + \ + z1 = vec_add(tmp12, tmp13); \ + z1 = z1 << PRE_MULTIPLY_SCALE_BITS; \ + z1 = vec_madds(z1, PW_0707, zero); \ + \ + out2 = vec_add(tmp13, z1); \ + out6 = vec_sub(tmp13, z1); \ + \ + /* Odd part */ \ + \ + tmp10 = vec_add(tmp4, tmp5); \ + tmp11 = vec_add(tmp5, tmp6); \ + tmp12 = vec_add(tmp6, tmp7); \ + \ + tmp10 = tmp10 << PRE_MULTIPLY_SCALE_BITS; \ + tmp12 = tmp12 << PRE_MULTIPLY_SCALE_BITS; \ + z5 = vec_sub(tmp10, tmp12); \ + z5 = vec_madds(z5, PW_0382, zero); \ + \ + z2 = vec_madds(tmp10, PW_0541, zero); \ + z2 = vec_add(z2, z5); \ + \ + z4 = vec_madds(tmp12, PW_1306, zero); \ + z4 = vec_add(z4, z5); \ + \ + tmp11 = tmp11 << PRE_MULTIPLY_SCALE_BITS; \ + z3 = vec_madds(tmp11, PW_0707, zero); \ + \ + z11 = vec_add(tmp7, z3); \ + z13 = vec_sub(tmp7, z3); \ + \ + out5 = vec_add(z13, z2); \ + out3 = vec_sub(z13, z2); \ + out1 = vec_add(z11, z4); \ + out7 = vec_sub(z11, z4); \ +} + +void +jsimd_fdct_ifast_altivec (DCTELEM *data) +{ + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + col0, col1, col2, col3, col4, col5, col6, col7, + tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, + z1, z2, z3, z4, z5, z11, z13, + out0, out1, out2, out3, out4, out5, out6, out7; + + /* Constants */ + __vector short zero = vec_splat_s16(0), + PW_0382 = vec_splat(constants, 0), + PW_0541 = vec_splat(constants, 1), + PW_0707 = vec_splat(constants, 2), + PW_1306 = vec_splat(constants, 3); + + /* Pass 1: process rows. */ + + row0 = *(__vector short *)&data[0]; + row1 = *(__vector short *)&data[8]; + row2 = *(__vector short *)&data[16]; + row3 = *(__vector short *)&data[24]; + row4 = *(__vector short *)&data[32]; + row5 = *(__vector short *)&data[40]; + row6 = *(__vector short *)&data[48]; + row7 = *(__vector short *)&data[56]; + + TRANSPOSE(row, col); + + tmp0 = vec_add(col0, col7); + tmp7 = vec_sub(col0, col7); + tmp1 = vec_add(col1, col6); + tmp6 = vec_sub(col1, col6); + tmp2 = vec_add(col2, col5); + tmp5 = vec_sub(col2, col5); + tmp3 = vec_add(col3, col4); + tmp4 = vec_sub(col3, col4); + + DO_DCT(); + + /* Pass 2: process columns. */ + + TRANSPOSE(out, row); + + tmp0 = vec_add(row0, row7); + tmp7 = vec_sub(row0, row7); + tmp1 = vec_add(row1, row6); + tmp6 = vec_sub(row1, row6); + tmp2 = vec_add(row2, row5); + tmp5 = vec_sub(row2, row5); + tmp3 = vec_add(row3, row4); + tmp4 = vec_sub(row3, row4); + + DO_DCT(); + + *(__vector short *)&data[0] = out0; + *(__vector short *)&data[8] = out1; + *(__vector short *)&data[16] = out2; + *(__vector short *)&data[24] = out3; + *(__vector short *)&data[32] = out4; + *(__vector short *)&data[40] = out5; + *(__vector short *)&data[48] = out6; + *(__vector short *)&data[56] = out7; +} From 7affbfc2418bc71f91e30c983c9f6344404f00e2 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 5 Sep 2014 07:23:12 +0000 Subject: [PATCH 003/140] The AltiVec code actually works on 32-bit PowerPC platforms as well, so change the "powerpc64" token to "powerpc". Also clean up the shift code, which wasn't building properly on OS X. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1406 632fc199-4ca6-4c93-a231-07263d6284db --- configure.ac | 8 ++++---- simd/Makefile.am | 4 ++-- simd/{jsimd_powerpc64.c => jsimd_powerpc.c} | 0 ...md_powerpc64_altivec.c => jsimd_powerpc_altivec.c} | 11 +++++------ 4 files changed, 11 insertions(+), 12 deletions(-) rename simd/{jsimd_powerpc64.c => jsimd_powerpc.c} (100%) rename simd/{jsimd_powerpc64_altivec.c => jsimd_powerpc_altivec.c} (95%) diff --git a/configure.ac b/configure.ac index 6361cd41..39a9c2ba 100644 --- a/configure.ac +++ b/configure.ac @@ -481,9 +481,9 @@ if test "x${with_simd}" != "xno"; then fi fi ;; - powerpc64) - AC_MSG_RESULT([yes (powerpc64)]) - simd_arch=powerpc64 + powerpc*) + AC_MSG_RESULT([yes (powerpc)]) + simd_arch=powerpc ;; *) AC_MSG_RESULT([no ("$host_cpu")]) @@ -510,7 +510,7 @@ AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"]) AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"]) AM_CONDITIONAL([SIMD_ARM_64], [test "x$simd_arch" = "xaarch64"]) AM_CONDITIONAL([SIMD_MIPS], [test "x$simd_arch" = "xmips"]) -AM_CONDITIONAL([SIMD_POWERPC64], [test "x$simd_arch" = "xpowerpc64"]) +AM_CONDITIONAL([SIMD_POWERPC], [test "x$simd_arch" = "xpowerpc"]) AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"]) AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"]) diff --git a/simd/Makefile.am b/simd/Makefile.am index 06dce038..c5213b8c 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -70,9 +70,9 @@ libsimd_la_SOURCES = jsimd_mips.c jsimd_mips_dspr2_asm.h jsimd_mips_dspr2.S endif -if SIMD_POWERPC64 +if SIMD_POWERPC -libsimd_la_SOURCES = jsimd_powerpc64.c jsimd_powerpc64_altivec.c +libsimd_la_SOURCES = jsimd_powerpc.c jsimd_powerpc_altivec.c libsimd_la_CFLAGS = -maltivec endif diff --git a/simd/jsimd_powerpc64.c b/simd/jsimd_powerpc.c similarity index 100% rename from simd/jsimd_powerpc64.c rename to simd/jsimd_powerpc.c diff --git a/simd/jsimd_powerpc64_altivec.c b/simd/jsimd_powerpc_altivec.c similarity index 95% rename from simd/jsimd_powerpc64_altivec.c rename to simd/jsimd_powerpc_altivec.c index be42e672..84132d03 100644 --- a/simd/jsimd_powerpc64_altivec.c +++ b/simd/jsimd_powerpc_altivec.c @@ -67,8 +67,6 @@ col##7 = vec_mergel(col67e, col67o); /* col7=(07 17 27 37 47 57 67 77) */ \ } -#define PRE_MULTIPLY_SCALE_BITS 2 - static const __vector short constants __attribute__((aligned(16))) = { 98 << 5, /* FIX(0.382683433) */ @@ -90,7 +88,7 @@ static const __vector short constants __attribute__((aligned(16))) = out4 = vec_sub(tmp10, tmp11); \ \ z1 = vec_add(tmp12, tmp13); \ - z1 = z1 << PRE_MULTIPLY_SCALE_BITS; \ + z1 = vec_sl(z1, PRE_MULTIPLY_SCALE_BITS); \ z1 = vec_madds(z1, PW_0707, zero); \ \ out2 = vec_add(tmp13, z1); \ @@ -102,8 +100,8 @@ static const __vector short constants __attribute__((aligned(16))) = tmp11 = vec_add(tmp5, tmp6); \ tmp12 = vec_add(tmp6, tmp7); \ \ - tmp10 = tmp10 << PRE_MULTIPLY_SCALE_BITS; \ - tmp12 = tmp12 << PRE_MULTIPLY_SCALE_BITS; \ + tmp10 = vec_sl(tmp10, PRE_MULTIPLY_SCALE_BITS); \ + tmp12 = vec_sl(tmp12, PRE_MULTIPLY_SCALE_BITS); \ z5 = vec_sub(tmp10, tmp12); \ z5 = vec_madds(z5, PW_0382, zero); \ \ @@ -113,7 +111,7 @@ static const __vector short constants __attribute__((aligned(16))) = z4 = vec_madds(tmp12, PW_1306, zero); \ z4 = vec_add(z4, z5); \ \ - tmp11 = tmp11 << PRE_MULTIPLY_SCALE_BITS; \ + tmp11 = vec_sl(tmp11, PRE_MULTIPLY_SCALE_BITS); \ z3 = vec_madds(tmp11, PW_0707, zero); \ \ z11 = vec_add(tmp7, z3); \ @@ -140,6 +138,7 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) PW_0541 = vec_splat(constants, 1), PW_0707 = vec_splat(constants, 2), PW_1306 = vec_splat(constants, 3); + __vector unsigned short PRE_MULTIPLY_SCALE_BITS = vec_splat_u16(2); /* Pass 1: process rows. */ From e1ac40104c3f3335b39483e90950e9047e6a557e Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 17 Dec 2014 08:00:29 +0000 Subject: [PATCH 004/140] Fix cosmetic issues in AltiVec comments git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1442 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd_powerpc_altivec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simd/jsimd_powerpc_altivec.c b/simd/jsimd_powerpc_altivec.c index 84132d03..e18eaa8e 100644 --- a/simd/jsimd_powerpc_altivec.c +++ b/simd/jsimd_powerpc_altivec.c @@ -47,7 +47,7 @@ row37h = vec_mergel(row##3, row##7); /* row37h=(34 74 35 75 36 76 37 77) */ \ \ /* transpose coefficients (phase 2) */ \ - col01e = vec_mergeh(row04l, row26l); /* col01e=(00 20 40 60 01 21 41 61} */ \ + col01e = vec_mergeh(row04l, row26l); /* col01e=(00 20 40 60 01 21 41 61) */ \ col23e = vec_mergel(row04l, row26l); /* col23e=(02 22 42 62 03 23 43 63) */ \ col45e = vec_mergeh(row04h, row26h); /* col45e=(04 24 44 64 05 25 45 65) */ \ col67e = vec_mergel(row04h, row26h); /* col67e=(06 26 46 66 07 27 47 67) */ \ @@ -58,7 +58,7 @@ \ /* transpose coefficients (phase 3) */ \ col##0 = vec_mergeh(col01e, col01o); /* col0=(00 10 20 30 40 50 60 70) */ \ - col##1 = vec_mergel(col01e, col01o); /* col1=(01 11 21 31 41 51 61 71} */ \ + col##1 = vec_mergel(col01e, col01o); /* col1=(01 11 21 31 41 51 61 71) */ \ col##2 = vec_mergeh(col23e, col23o); /* col2=(02 12 22 32 42 52 62 72) */ \ col##3 = vec_mergel(col23e, col23o); /* col3=(03 13 23 33 43 53 63 73) */ \ col##4 = vec_mergeh(col45e, col45o); /* col4=(04 14 24 34 44 54 64 74) */ \ From fb0c394037050277c78c0e28eb0ca1590ec58ccd Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 17 Dec 2014 08:04:39 +0000 Subject: [PATCH 005/140] AltiVec SIMD implementation of slow integer forward DCT; Clean up fast integer forward DCT code so that it is easier to see how it derives from the SSE2 code and to make it play more nicely with the slow FDCT code. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1443 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd.h | 2 + simd/jsimd_powerpc.c | 12 ++ simd/jsimd_powerpc_altivec.c | 299 +++++++++++++++++++++++++++++++++-- 3 files changed, 300 insertions(+), 13 deletions(-) diff --git a/simd/jsimd.h b/simd/jsimd.h index b0329728..4dcdfc1a 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -545,6 +545,8 @@ EXTERN(void) jsimd_fdct_islow_sse2 (DCTELEM * data); EXTERN(void) jsimd_fdct_islow_mips_dspr2 (DCTELEM * data); +EXTERN(void) jsimd_fdct_islow_altivec (DCTELEM * data); + /* Fast Integer Forward DCT */ EXTERN(void) jsimd_fdct_ifast_mmx (DCTELEM * data); diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index a9a5965d..ff37c5f0 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -226,6 +226,17 @@ jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, GLOBAL(int) jsimd_can_fdct_islow (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -255,6 +266,7 @@ jsimd_can_fdct_float (void) GLOBAL(void) jsimd_fdct_islow (DCTELEM * data) { + jsimd_fdct_islow_altivec(data); } GLOBAL(void) diff --git a/simd/jsimd_powerpc_altivec.c b/simd/jsimd_powerpc_altivec.c index e18eaa8e..ef32545d 100644 --- a/simd/jsimd_powerpc_altivec.c +++ b/simd/jsimd_powerpc_altivec.c @@ -29,6 +29,9 @@ #include "jsimd.h" #include + +/* Common code */ + #define TRANSPOSE(row, col) \ { \ __vector short row04l, row04h, row15l, row15h, \ @@ -67,15 +70,30 @@ col##7 = vec_mergel(col67e, col67o); /* col7=(07 17 27 37 47 57 67 77) */ \ } -static const __vector short constants __attribute__((aligned(16))) = + +/* FAST INTEGER FORWARD DCT + * + * This is similar to the SSE2 implementation, except that we left-shift the + * constants by 1 less bit (the -1 in IFAST_CONST_SHIFT.) This is because + * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of: + * the elements in arg3 + the most significant 17 bits of + * (the elements in arg1 * the elements in arg2). + */ + +#define IFAST_CONST_BITS 8 +#define IFAST_PRE_MULTIPLY_SCALE_BITS 2 +#define IFAST_CONST_SHIFT \ + (16 - IFAST_PRE_MULTIPLY_SCALE_BITS - IFAST_CONST_BITS - 1) + +static const __vector short jconst_fdct_ifast __attribute__((aligned(16))) = { - 98 << 5, /* FIX(0.382683433) */ - 139 << 5, /* FIX(0.541196100) */ - 181 << 5, /* FIX(0.707106781) */ - 334 << 5 /* FIX(1.306562965) */ + 98 << IFAST_CONST_SHIFT, /* FIX(0.382683433) */ + 139 << IFAST_CONST_SHIFT, /* FIX(0.541196100) */ + 181 << IFAST_CONST_SHIFT, /* FIX(0.707106781) */ + 334 << IFAST_CONST_SHIFT /* FIX(1.306562965) */ }; -#define DO_DCT() \ +#define DO_FDCT_IFAST() \ { \ /* Even part */ \ \ @@ -134,11 +152,12 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) /* Constants */ __vector short zero = vec_splat_s16(0), - PW_0382 = vec_splat(constants, 0), - PW_0541 = vec_splat(constants, 1), - PW_0707 = vec_splat(constants, 2), - PW_1306 = vec_splat(constants, 3); - __vector unsigned short PRE_MULTIPLY_SCALE_BITS = vec_splat_u16(2); + PW_0382 = vec_splat(jconst_fdct_ifast, 0), + PW_0541 = vec_splat(jconst_fdct_ifast, 1), + PW_0707 = vec_splat(jconst_fdct_ifast, 2), + PW_1306 = vec_splat(jconst_fdct_ifast, 3); + __vector unsigned short PRE_MULTIPLY_SCALE_BITS = + vec_splat_u16(IFAST_PRE_MULTIPLY_SCALE_BITS); /* Pass 1: process rows. */ @@ -162,7 +181,7 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) tmp3 = vec_add(col3, col4); tmp4 = vec_sub(col3, col4); - DO_DCT(); + DO_FDCT_IFAST(); /* Pass 2: process columns. */ @@ -177,7 +196,261 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) tmp3 = vec_add(row3, row4); tmp4 = vec_sub(row3, row4); - DO_DCT(); + DO_FDCT_IFAST(); + + *(__vector short *)&data[0] = out0; + *(__vector short *)&data[8] = out1; + *(__vector short *)&data[16] = out2; + *(__vector short *)&data[24] = out3; + *(__vector short *)&data[32] = out4; + *(__vector short *)&data[40] = out5; + *(__vector short *)&data[48] = out6; + *(__vector short *)&data[56] = out7; +} + + +/* SLOW INTEGER FORWARD DCT */ + +#define F_0_298 2446 /* FIX(0.298631336) */ +#define F_0_390 3196 /* FIX(0.390180644) */ +#define F_0_541 4433 /* FIX(0.541196100) */ +#define F_0_765 6270 /* FIX(0.765366865) */ +#define F_0_899 7373 /* FIX(0.899976223) */ +#define F_1_175 9633 /* FIX(1.175875602) */ +#define F_1_501 12299 /* FIX(1.501321110) */ +#define F_1_847 15137 /* FIX(1.847759065) */ +#define F_1_961 16069 /* FIX(1.961570560) */ +#define F_2_053 16819 /* FIX(2.053119869) */ +#define F_2_562 20995 /* FIX(2.562915447) */ +#define F_3_072 25172 /* FIX(3.072711026) */ + +#define ISLOW_CONST_BITS 13 +#define ISLOW_PASS1_BITS 2 +#define ISLOW_DESCALE_P1 (ISLOW_CONST_BITS - ISLOW_PASS1_BITS) +#define ISLOW_DESCALE_P2 (ISLOW_CONST_BITS + ISLOW_PASS1_BITS) + +static const __vector int jconst_fdct_islow __attribute__((aligned(16))) = +{ + 1 << (ISLOW_DESCALE_P1 - 1), + 1 << (ISLOW_DESCALE_P2 - 1) +}; + +static const __vector short jconst_fdct_islow2 __attribute__((aligned(16))) = +{ + 1 << (ISLOW_PASS1_BITS - 1) +}; + +#define DO_FDCT_ISLOW_COMMON(PASS) \ +{ \ + tmp1312l = vec_mergeh(tmp13, tmp12); \ + tmp1312h = vec_mergel(tmp13, tmp12); \ + \ + out2l = vec_msums(tmp1312l, PW_F130_F054, zero); \ + out2h = vec_msums(tmp1312h, PW_F130_F054, zero); \ + out6l = vec_msums(tmp1312l, PW_F054_MF130, zero); \ + out6h = vec_msums(tmp1312h, PW_F054_MF130, zero); \ + \ + out2l = vec_add(out2l, PD_DESCALE_P##PASS); \ + out2h = vec_add(out2h, PD_DESCALE_P##PASS); \ + out2l = vec_sr(out2l, DESCALE_P##PASS); \ + out2h = vec_sr(out2h, DESCALE_P##PASS); \ + \ + out6l = vec_add(out6l, PD_DESCALE_P##PASS); \ + out6h = vec_add(out6h, PD_DESCALE_P##PASS); \ + out6l = vec_sr(out6l, DESCALE_P##PASS); \ + out6h = vec_sr(out6h, DESCALE_P##PASS); \ + \ + out2 = vec_pack(out2l, out2h); \ + out6 = vec_pack(out6l, out6h); \ + \ + /* Odd part */ \ + \ + z3 = vec_add(tmp4, tmp6); \ + z4 = vec_add(tmp5, tmp7); \ + \ + z34l = vec_mergeh(z3, z4); \ + z34h = vec_mergel(z3, z4); \ + \ + z3l = vec_msums(z34l, PW_MF078_F117, zero); \ + z3h = vec_msums(z34h, PW_MF078_F117, zero); \ + z4l = vec_msums(z34l, PW_F117_F078, zero); \ + z4h = vec_msums(z34h, PW_F117_F078, zero); \ + \ + tmp47l = vec_mergeh(tmp4, tmp7); \ + tmp47h = vec_mergel(tmp4, tmp7); \ + \ + tmp4l = vec_msums(tmp47l, PW_MF060_MF089, zero); \ + tmp4h = vec_msums(tmp47h, PW_MF060_MF089, zero); \ + tmp7l = vec_msums(tmp47l, PW_MF089_F060, zero); \ + tmp7h = vec_msums(tmp47h, PW_MF089_F060, zero); \ + \ + out7l = vec_add(z3l, tmp4l); \ + out7h = vec_add(z3h, tmp4h); \ + out1l = vec_add(z4l, tmp7l); \ + out1h = vec_add(z4h, tmp7h); \ + \ + out7l = vec_add(out7l, PD_DESCALE_P##PASS); \ + out7h = vec_add(out7h, PD_DESCALE_P##PASS); \ + out7l = vec_sr(out7l, DESCALE_P##PASS); \ + out7h = vec_sr(out7h, DESCALE_P##PASS); \ + \ + out1l = vec_add(out1l, PD_DESCALE_P##PASS); \ + out1h = vec_add(out1h, PD_DESCALE_P##PASS); \ + out1l = vec_sr(out1l, DESCALE_P##PASS); \ + out1h = vec_sr(out1h, DESCALE_P##PASS); \ + \ + out7 = vec_pack(out7l, out7h); \ + out1 = vec_pack(out1l, out1h); \ + \ + tmp56l = vec_mergeh(tmp5, tmp6); \ + tmp56h = vec_mergel(tmp5, tmp6); \ + \ + tmp5l = vec_msums(tmp56l, PW_MF050_MF256, zero); \ + tmp5h = vec_msums(tmp56h, PW_MF050_MF256, zero); \ + tmp6l = vec_msums(tmp56l, PW_MF256_F050, zero); \ + tmp6h = vec_msums(tmp56h, PW_MF256_F050, zero); \ + \ + out5l = vec_add(tmp5l, z4l); \ + out5h = vec_add(tmp5h, z4h); \ + out3l = vec_add(tmp6l, z3l); \ + out3h = vec_add(tmp6h, z3h); \ + \ + out5l = vec_add(out5l, PD_DESCALE_P##PASS); \ + out5h = vec_add(out5h, PD_DESCALE_P##PASS); \ + out5l = vec_sr(out5l, DESCALE_P##PASS); \ + out5h = vec_sr(out5h, DESCALE_P##PASS); \ + \ + out3l = vec_add(out3l, PD_DESCALE_P##PASS); \ + out3h = vec_add(out3h, PD_DESCALE_P##PASS); \ + out3l = vec_sr(out3l, DESCALE_P##PASS); \ + out3h = vec_sr(out3h, DESCALE_P##PASS); \ + \ + out5 = vec_pack(out5l, out5h); \ + out3 = vec_pack(out3l, out3h); \ +} + +#define DO_FDCT_ISLOW_ROWS() \ +{ \ + /* Even part */ \ + \ + tmp10 = vec_add(tmp0, tmp3); \ + tmp13 = vec_sub(tmp0, tmp3); \ + tmp11 = vec_add(tmp1, tmp2); \ + tmp12 = vec_sub(tmp1, tmp2); \ + \ + out0 = vec_add(tmp10, tmp11); \ + out0 = vec_sl(out0, PASS1_BITS); \ + out4 = vec_sub(tmp10, tmp11); \ + out4 = vec_sl(out4, PASS1_BITS); \ + \ + DO_FDCT_ISLOW_COMMON(1); \ +} + +#define DO_FDCT_ISLOW_COLS() \ +{ \ + /* Even part */ \ + \ + tmp10 = vec_add(tmp0, tmp3); \ + tmp13 = vec_sub(tmp0, tmp3); \ + tmp11 = vec_add(tmp1, tmp2); \ + tmp12 = vec_sub(tmp1, tmp2); \ + \ + out0 = vec_add(tmp10, tmp11); \ + out0 = vec_add(out0, PW_DESCALE_P2X); \ + out0 = vec_sra(out0, PASS1_BITS); \ + out4 = vec_sub(tmp10, tmp11); \ + out4 = vec_add(out4, PW_DESCALE_P2X); \ + out4 = vec_sra(out4, PASS1_BITS); \ + \ + DO_FDCT_ISLOW_COMMON(2); \ +} + +void +jsimd_fdct_islow_altivec (DCTELEM *data) +{ + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + col0, col1, col2, col3, col4, col5, col6, col7, + tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, + tmp47l, tmp47h, tmp56l, tmp56h, tmp1312l, tmp1312h, + z3, z4, z34l, z34h, + out0, out1, out2, out3, out4, out5, out6, out7; + __vector int tmp4l, tmp4h, tmp5l, tmp5h, tmp6l, tmp6h, tmp7l, tmp7h, + z3l, z3h, z4l, z4h, + out1l, out1h, out2l, out2h, out3l, out3h, out5l, out5h, out6l, out6h, + out7l, out7h; + + __vector short PW_F130_F054 = {F_0_541 + F_0_765, F_0_541, + F_0_541 + F_0_765, F_0_541, F_0_541 + F_0_765, F_0_541, + F_0_541 + F_0_765, F_0_541}; + __vector short PW_F054_MF130 = {F_0_541, F_0_541 - F_1_847, + F_0_541, F_0_541 - F_1_847, F_0_541, F_0_541 - F_1_847, + F_0_541, F_0_541 - F_1_847}; + __vector short PW_MF078_F117 = {F_1_175 - F_1_961, F_1_175, + F_1_175 - F_1_961, F_1_175, F_1_175 - F_1_961, F_1_175, + F_1_175 - F_1_961, F_1_175}; + __vector short PW_F117_F078 = {F_1_175, F_1_175 - F_0_390, + F_1_175, F_1_175 - F_0_390, F_1_175, F_1_175 - F_0_390, + F_1_175, F_1_175 - F_0_390}; + __vector short PW_MF060_MF089 = {F_0_298 - F_0_899, -F_0_899, + F_0_298 - F_0_899, -F_0_899, F_0_298 - F_0_899, -F_0_899, + F_0_298 - F_0_899, -F_0_899}; + __vector short PW_MF089_F060 = {-F_0_899, F_1_501 - F_0_899, + -F_0_899, F_1_501 - F_0_899, -F_0_899, F_1_501 - F_0_899, + -F_0_899, F_1_501 - F_0_899}; + __vector short PW_MF050_MF256 = {F_2_053 - F_2_562, -F_2_562, + F_2_053 - F_2_562, -F_2_562, F_2_053 - F_2_562, -F_2_562, + F_2_053 - F_2_562, -F_2_562}; + __vector short PW_MF256_F050 = {-F_2_562, F_3_072 - F_2_562, + -F_2_562, F_3_072 - F_2_562, -F_2_562, F_3_072 - F_2_562, + -F_2_562, F_3_072 - F_2_562}; + __vector short PW_DESCALE_P2X = vec_splat(jconst_fdct_islow2, 0); + + /* Constants */ + __vector unsigned short PASS1_BITS = vec_splat_u16(ISLOW_PASS1_BITS); + __vector int zero = vec_splat_s32(0), + PD_DESCALE_P1 = vec_splat(jconst_fdct_islow, 0), + PD_DESCALE_P2 = vec_splat(jconst_fdct_islow, 1); + __vector unsigned int DESCALE_P1 = vec_splat_u32(ISLOW_DESCALE_P1), + DESCALE_P2 = vec_splat_u32(ISLOW_DESCALE_P2); + + /* Pass 1: process rows. */ + + row0 = *(__vector short *)&data[0]; + row1 = *(__vector short *)&data[8]; + row2 = *(__vector short *)&data[16]; + row3 = *(__vector short *)&data[24]; + row4 = *(__vector short *)&data[32]; + row5 = *(__vector short *)&data[40]; + row6 = *(__vector short *)&data[48]; + row7 = *(__vector short *)&data[56]; + + TRANSPOSE(row, col); + + tmp0 = vec_add(col0, col7); + tmp7 = vec_sub(col0, col7); + tmp1 = vec_add(col1, col6); + tmp6 = vec_sub(col1, col6); + tmp2 = vec_add(col2, col5); + tmp5 = vec_sub(col2, col5); + tmp3 = vec_add(col3, col4); + tmp4 = vec_sub(col3, col4); + + DO_FDCT_ISLOW_ROWS(); + + /* Pass 2: process columns. */ + + TRANSPOSE(out, row); + + tmp0 = vec_add(row0, row7); + tmp7 = vec_sub(row0, row7); + tmp1 = vec_add(row1, row6); + tmp6 = vec_sub(row1, row6); + tmp2 = vec_add(row2, row5); + tmp5 = vec_sub(row2, row5); + tmp3 = vec_add(row3, row4); + tmp4 = vec_sub(row3, row4); + + DO_FDCT_ISLOW_COLS(); *(__vector short *)&data[0] = out0; *(__vector short *)&data[8] = out1; From 040435afb9d6a82e547c7b0bc5ac04bfcc1741af Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 18 Dec 2014 09:49:39 +0000 Subject: [PATCH 006/140] Further cleanup of the AltiVec forward DCT code: -- Use macros to represent the fast FDCT constants, to facilitate comparing the AltiVec implementation of the algorithm with the SSE2 implementation. -- Rename slow FDCT constants for consistency. -- Use vec_sra() in all cases in the slow FDCT code. The SSE2 implementation uses psraw, which is an arithmetic shift, so we need to do likewise with AltiVec. Using vec_sr() hasn't caused any problems yet, but it is conceivable that it might cause different behavior in certain corner cases. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1444 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd_powerpc_altivec.c | 121 ++++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 52 deletions(-) diff --git a/simd/jsimd_powerpc_altivec.c b/simd/jsimd_powerpc_altivec.c index ef32545d..6f26bd5f 100644 --- a/simd/jsimd_powerpc_altivec.c +++ b/simd/jsimd_powerpc_altivec.c @@ -80,6 +80,11 @@ * (the elements in arg1 * the elements in arg2). */ +#define IFAST_F_0_382 98 /* FIX(0.382683433) */ +#define IFAST_F_0_541 139 /* FIX(0.541196100) */ +#define IFAST_F_0_707 181 /* FIX(0.707106781) */ +#define IFAST_F_1_306 334 /* FIX(1.306562965) */ + #define IFAST_CONST_BITS 8 #define IFAST_PRE_MULTIPLY_SCALE_BITS 2 #define IFAST_CONST_SHIFT \ @@ -87,10 +92,10 @@ static const __vector short jconst_fdct_ifast __attribute__((aligned(16))) = { - 98 << IFAST_CONST_SHIFT, /* FIX(0.382683433) */ - 139 << IFAST_CONST_SHIFT, /* FIX(0.541196100) */ - 181 << IFAST_CONST_SHIFT, /* FIX(0.707106781) */ - 334 << IFAST_CONST_SHIFT /* FIX(1.306562965) */ + IFAST_F_0_382 << IFAST_CONST_SHIFT, + IFAST_F_0_541 << IFAST_CONST_SHIFT, + IFAST_F_0_707 << IFAST_CONST_SHIFT, + IFAST_F_1_306 << IFAST_CONST_SHIFT }; #define DO_FDCT_IFAST() \ @@ -211,18 +216,18 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) /* SLOW INTEGER FORWARD DCT */ -#define F_0_298 2446 /* FIX(0.298631336) */ -#define F_0_390 3196 /* FIX(0.390180644) */ -#define F_0_541 4433 /* FIX(0.541196100) */ -#define F_0_765 6270 /* FIX(0.765366865) */ -#define F_0_899 7373 /* FIX(0.899976223) */ -#define F_1_175 9633 /* FIX(1.175875602) */ -#define F_1_501 12299 /* FIX(1.501321110) */ -#define F_1_847 15137 /* FIX(1.847759065) */ -#define F_1_961 16069 /* FIX(1.961570560) */ -#define F_2_053 16819 /* FIX(2.053119869) */ -#define F_2_562 20995 /* FIX(2.562915447) */ -#define F_3_072 25172 /* FIX(3.072711026) */ +#define ISLOW_F_0_298 2446 /* FIX(0.298631336) */ +#define ISLOW_F_0_390 3196 /* FIX(0.390180644) */ +#define ISLOW_F_0_541 4433 /* FIX(0.541196100) */ +#define ISLOW_F_0_765 6270 /* FIX(0.765366865) */ +#define ISLOW_F_0_899 7373 /* FIX(0.899976223) */ +#define ISLOW_F_1_175 9633 /* FIX(1.175875602) */ +#define ISLOW_F_1_501 12299 /* FIX(1.501321110) */ +#define ISLOW_F_1_847 15137 /* FIX(1.847759065) */ +#define ISLOW_F_1_961 16069 /* FIX(1.961570560) */ +#define ISLOW_F_2_053 16819 /* FIX(2.053119869) */ +#define ISLOW_F_2_562 20995 /* FIX(2.562915447) */ +#define ISLOW_F_3_072 25172 /* FIX(3.072711026) */ #define ISLOW_CONST_BITS 13 #define ISLOW_PASS1_BITS 2 @@ -252,13 +257,13 @@ static const __vector short jconst_fdct_islow2 __attribute__((aligned(16))) = \ out2l = vec_add(out2l, PD_DESCALE_P##PASS); \ out2h = vec_add(out2h, PD_DESCALE_P##PASS); \ - out2l = vec_sr(out2l, DESCALE_P##PASS); \ - out2h = vec_sr(out2h, DESCALE_P##PASS); \ + out2l = vec_sra(out2l, DESCALE_P##PASS); \ + out2h = vec_sra(out2h, DESCALE_P##PASS); \ \ out6l = vec_add(out6l, PD_DESCALE_P##PASS); \ out6h = vec_add(out6h, PD_DESCALE_P##PASS); \ - out6l = vec_sr(out6l, DESCALE_P##PASS); \ - out6h = vec_sr(out6h, DESCALE_P##PASS); \ + out6l = vec_sra(out6l, DESCALE_P##PASS); \ + out6h = vec_sra(out6h, DESCALE_P##PASS); \ \ out2 = vec_pack(out2l, out2h); \ out6 = vec_pack(out6l, out6h); \ @@ -291,13 +296,13 @@ static const __vector short jconst_fdct_islow2 __attribute__((aligned(16))) = \ out7l = vec_add(out7l, PD_DESCALE_P##PASS); \ out7h = vec_add(out7h, PD_DESCALE_P##PASS); \ - out7l = vec_sr(out7l, DESCALE_P##PASS); \ - out7h = vec_sr(out7h, DESCALE_P##PASS); \ + out7l = vec_sra(out7l, DESCALE_P##PASS); \ + out7h = vec_sra(out7h, DESCALE_P##PASS); \ \ out1l = vec_add(out1l, PD_DESCALE_P##PASS); \ out1h = vec_add(out1h, PD_DESCALE_P##PASS); \ - out1l = vec_sr(out1l, DESCALE_P##PASS); \ - out1h = vec_sr(out1h, DESCALE_P##PASS); \ + out1l = vec_sra(out1l, DESCALE_P##PASS); \ + out1h = vec_sra(out1h, DESCALE_P##PASS); \ \ out7 = vec_pack(out7l, out7h); \ out1 = vec_pack(out1l, out1h); \ @@ -317,13 +322,13 @@ static const __vector short jconst_fdct_islow2 __attribute__((aligned(16))) = \ out5l = vec_add(out5l, PD_DESCALE_P##PASS); \ out5h = vec_add(out5h, PD_DESCALE_P##PASS); \ - out5l = vec_sr(out5l, DESCALE_P##PASS); \ - out5h = vec_sr(out5h, DESCALE_P##PASS); \ + out5l = vec_sra(out5l, DESCALE_P##PASS); \ + out5h = vec_sra(out5h, DESCALE_P##PASS); \ \ out3l = vec_add(out3l, PD_DESCALE_P##PASS); \ out3h = vec_add(out3h, PD_DESCALE_P##PASS); \ - out3l = vec_sr(out3l, DESCALE_P##PASS); \ - out3h = vec_sr(out3h, DESCALE_P##PASS); \ + out3l = vec_sra(out3l, DESCALE_P##PASS); \ + out3h = vec_sra(out3h, DESCALE_P##PASS); \ \ out5 = vec_pack(out5l, out5h); \ out3 = vec_pack(out3l, out3h); \ @@ -379,30 +384,42 @@ jsimd_fdct_islow_altivec (DCTELEM *data) out1l, out1h, out2l, out2h, out3l, out3h, out5l, out5h, out6l, out6h, out7l, out7h; - __vector short PW_F130_F054 = {F_0_541 + F_0_765, F_0_541, - F_0_541 + F_0_765, F_0_541, F_0_541 + F_0_765, F_0_541, - F_0_541 + F_0_765, F_0_541}; - __vector short PW_F054_MF130 = {F_0_541, F_0_541 - F_1_847, - F_0_541, F_0_541 - F_1_847, F_0_541, F_0_541 - F_1_847, - F_0_541, F_0_541 - F_1_847}; - __vector short PW_MF078_F117 = {F_1_175 - F_1_961, F_1_175, - F_1_175 - F_1_961, F_1_175, F_1_175 - F_1_961, F_1_175, - F_1_175 - F_1_961, F_1_175}; - __vector short PW_F117_F078 = {F_1_175, F_1_175 - F_0_390, - F_1_175, F_1_175 - F_0_390, F_1_175, F_1_175 - F_0_390, - F_1_175, F_1_175 - F_0_390}; - __vector short PW_MF060_MF089 = {F_0_298 - F_0_899, -F_0_899, - F_0_298 - F_0_899, -F_0_899, F_0_298 - F_0_899, -F_0_899, - F_0_298 - F_0_899, -F_0_899}; - __vector short PW_MF089_F060 = {-F_0_899, F_1_501 - F_0_899, - -F_0_899, F_1_501 - F_0_899, -F_0_899, F_1_501 - F_0_899, - -F_0_899, F_1_501 - F_0_899}; - __vector short PW_MF050_MF256 = {F_2_053 - F_2_562, -F_2_562, - F_2_053 - F_2_562, -F_2_562, F_2_053 - F_2_562, -F_2_562, - F_2_053 - F_2_562, -F_2_562}; - __vector short PW_MF256_F050 = {-F_2_562, F_3_072 - F_2_562, - -F_2_562, F_3_072 - F_2_562, -F_2_562, F_3_072 - F_2_562, - -F_2_562, F_3_072 - F_2_562}; + __vector short PW_F130_F054 = {ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541, + ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541, + ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541, + ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541}; + __vector short PW_F054_MF130 = {ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847, + ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847, + ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847, + ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847}; + __vector short PW_MF078_F117 = {ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175, + ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175, + ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175, + ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175}; + __vector short PW_F117_F078 = {ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390, + ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390, + ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390, + ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390}; + __vector short PW_MF060_MF089 = { + ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899, + ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899, + ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899, + ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899}; + __vector short PW_MF089_F060 = { + -ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899, + -ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899, + -ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899, + -ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899}; + __vector short PW_MF050_MF256 = { + ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562, + ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562, + ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562, + ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562}; + __vector short PW_MF256_F050 = { + -ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562, + -ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562, + -ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562, + -ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562}; __vector short PW_DESCALE_P2X = vec_splat(jconst_fdct_islow2, 0); /* Constants */ From 6cb7f40a1814e528b53a0ed35fdcbb7b4d583b99 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 18 Dec 2014 10:12:29 +0000 Subject: [PATCH 007/140] AltiVec SIMD implementation of fast integer inverse DCT git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1445 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd.h | 4 + simd/jsimd_powerpc.c | 13 +++ simd/jsimd_powerpc_altivec.c | 214 +++++++++++++++++++++++++++++++++++ 3 files changed, 231 insertions(+) diff --git a/simd/jsimd.h b/simd/jsimd.h index 4dcdfc1a..f3396110 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -667,6 +667,10 @@ EXTERN(void) jsimd_idct_ifast_rows_mips_dspr2 (DCTELEM * wsptr, JSAMPARRAY output_buf, JDIMENSION output_col, const int * idct_coefs); +EXTERN(void) jsimd_idct_ifast_altivec + (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col); + /* Floating Point Inverse DCT */ EXTERN(void) jsimd_idct_float_3dnow (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index ff37c5f0..eb977d73 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -339,6 +339,17 @@ jsimd_can_idct_islow (void) GLOBAL(int) jsimd_can_idct_ifast (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -360,6 +371,8 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { + jsimd_idct_ifast_altivec(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(void) diff --git a/simd/jsimd_powerpc_altivec.c b/simd/jsimd_powerpc_altivec.c index 6f26bd5f..b77208ca 100644 --- a/simd/jsimd_powerpc_altivec.c +++ b/simd/jsimd_powerpc_altivec.c @@ -478,3 +478,217 @@ jsimd_fdct_islow_altivec (DCTELEM *data) *(__vector short *)&data[48] = out6; *(__vector short *)&data[56] = out7; } + + +/* FAST INTEGER INVERSE DCT + * + * This is similar to the SSE2 implementation, except that we left-shift the + * constants by 1 less bit (the -1 in IFAST_CONST_SHIFT.) This is because + * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of: + * the elements in arg3 + the most significant 17 bits of + * (the elements in arg1 * the elements in arg2). + */ + +#define F_1_082 277 /* FIX(1.082392200) */ +#define F_1_414 362 /* FIX(1.414213562) */ +#define F_1_847 473 /* FIX(1.847759065) */ +#define F_2_613 669 /* FIX(2.613125930) */ +#define F_1_613 (F_2_613 - 256) /* FIX(2.613125930) - FIX(1) */ + +#define IFAST_PASS1_BITS 2 +#define IFAST_CENTERJSAMPLE 128 + +static const __vector short jconst_idct_ifast __attribute__((aligned(16))) = +{ + F_1_414 << IFAST_CONST_SHIFT, + F_1_847 << IFAST_CONST_SHIFT, + -F_1_613 << IFAST_CONST_SHIFT, + F_1_082 << IFAST_CONST_SHIFT +}; + +static const __vector signed char jconst_idct_ifast2 + __attribute__((aligned(16))) = +{ + IFAST_CENTERJSAMPLE +}; + +#define DO_IDCT_IFAST(in) \ +{ \ + /* Even part */ \ + \ + tmp10 = vec_add(in##0, in##4); \ + tmp11 = vec_sub(in##0, in##4); \ + tmp13 = vec_add(in##2, in##6); \ + \ + tmp12 = vec_sub(in##2, in##6); \ + tmp12 = vec_sl(tmp12, PRE_MULTIPLY_SCALE_BITS); \ + tmp12 = vec_madds(tmp12, PW_F1414, zero); \ + tmp12 = vec_sub(tmp12, tmp13); \ + \ + tmp0 = vec_add(tmp10, tmp13); \ + tmp3 = vec_sub(tmp10, tmp13); \ + tmp1 = vec_add(tmp11, tmp12); \ + tmp2 = vec_sub(tmp11, tmp12); \ + \ + /* Odd part */ \ + \ + z13 = vec_add(in##5, in##3); \ + z10 = vec_sub(in##5, in##3); \ + z10s = vec_sl(z10, PRE_MULTIPLY_SCALE_BITS); \ + z11 = vec_add(in##1, in##7); \ + z12s = vec_sub(in##1, in##7); \ + z12s = vec_sl(z12s, PRE_MULTIPLY_SCALE_BITS); \ + \ + tmp11 = vec_sub(z11, z13); \ + tmp11 = vec_sl(tmp11, PRE_MULTIPLY_SCALE_BITS); \ + tmp11 = vec_madds(tmp11, PW_F1414, zero); \ + \ + tmp7 = vec_add(z11, z13); \ + \ + z5 = vec_add(z10s, z12s); \ + z5 = vec_madds(z5, PW_F1847, zero); \ + \ + tmp10 = vec_madds(z12s, PW_F1082, zero); \ + tmp10 = vec_sub(tmp10, z5); \ + tmp12 = vec_madds(z10s, PW_MF1613, zero); \ + tmp12 = vec_sub(tmp12, z10); \ + tmp12 = vec_add(tmp12, z5); \ + \ + tmp6 = vec_sub(tmp12, tmp7); \ + tmp5 = vec_sub(tmp11, tmp6); \ + tmp4 = vec_add(tmp10, tmp5); \ + \ + out0 = vec_add(tmp0, tmp7); \ + out1 = vec_add(tmp1, tmp6); \ + out2 = vec_add(tmp2, tmp5); \ + out3 = vec_sub(tmp3, tmp4); \ + out4 = vec_add(tmp3, tmp4); \ + out5 = vec_sub(tmp2, tmp5); \ + out6 = vec_sub(tmp1, tmp6); \ + out7 = vec_sub(tmp0, tmp7); \ +} + +void +jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + short *dct_table = (short *)dct_table_; + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + col0, col1, col2, col3, col4, col5, col6, col7, + quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, + tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, + z5, z10, z10s, z11, z12s, z13, + out0, out1, out2, out3, out4, out5, out6, out7; + __vector signed char outb; + long long *outptr, *outbptr = (long long *)(&outb); + + /* Constants */ + __vector short zero = vec_splat_s16(0), + PW_F1414 = vec_splat(jconst_idct_ifast, 0), + PW_F1847 = vec_splat(jconst_idct_ifast, 1), + PW_MF1613 = vec_splat(jconst_idct_ifast, 2), + PW_F1082 = vec_splat(jconst_idct_ifast, 3); + __vector unsigned short + PRE_MULTIPLY_SCALE_BITS = vec_splat_u16(IFAST_PRE_MULTIPLY_SCALE_BITS), + PASS1_BITS3 = vec_splat_u16(IFAST_PASS1_BITS + 3); + __vector signed char PB_CENTERJSAMP = vec_splat(jconst_idct_ifast2, 0); + + /* Pass 1: process columns. */ + + col0 = *(__vector short *)&coef_block[0]; + col1 = *(__vector short *)&coef_block[8]; + col2 = *(__vector short *)&coef_block[16]; + col3 = *(__vector short *)&coef_block[24]; + col4 = *(__vector short *)&coef_block[32]; + col5 = *(__vector short *)&coef_block[40]; + col6 = *(__vector short *)&coef_block[48]; + col7 = *(__vector short *)&coef_block[56]; + + tmp1 = vec_or(col1, col2); + tmp2 = vec_or(col3, col4); + tmp1 = vec_or(tmp1, tmp2); + tmp3 = vec_or(col5, col6); + tmp3 = vec_or(tmp3, col7); + tmp1 = vec_or(tmp1, tmp3); + + quant0 = *(__vector short *)&dct_table[0]; + col0 = vec_mladd(col0, quant0, zero); + + if (vec_all_eq(tmp1, zero)) { + /* AC terms all zero */ + + row0 = vec_splat(col0, 0); + row1 = vec_splat(col0, 1); + row2 = vec_splat(col0, 2); + row3 = vec_splat(col0, 3); + row4 = vec_splat(col0, 4); + row5 = vec_splat(col0, 5); + row6 = vec_splat(col0, 6); + row7 = vec_splat(col0, 7); + + } else { + + quant1 = *(__vector short *)&dct_table[8]; + quant2 = *(__vector short *)&dct_table[16]; + quant3 = *(__vector short *)&dct_table[24]; + quant4 = *(__vector short *)&dct_table[32]; + quant5 = *(__vector short *)&dct_table[40]; + quant6 = *(__vector short *)&dct_table[48]; + quant7 = *(__vector short *)&dct_table[56]; + + col1 = vec_mladd(col1, quant1, zero); + col2 = vec_mladd(col2, quant2, zero); + col3 = vec_mladd(col3, quant3, zero); + col4 = vec_mladd(col4, quant4, zero); + col5 = vec_mladd(col5, quant5, zero); + col6 = vec_mladd(col6, quant6, zero); + col7 = vec_mladd(col7, quant7, zero); + + DO_IDCT_IFAST(col); + + TRANSPOSE(out, row); + } + + /* Pass 2: process rows. */ + + DO_IDCT_IFAST(row); + + out0 = vec_sra(out0, PASS1_BITS3); + out1 = vec_sra(out1, PASS1_BITS3); + out2 = vec_sra(out2, PASS1_BITS3); + out3 = vec_sra(out3, PASS1_BITS3); + out4 = vec_sra(out4, PASS1_BITS3); + out5 = vec_sra(out5, PASS1_BITS3); + out6 = vec_sra(out6, PASS1_BITS3); + out7 = vec_sra(out7, PASS1_BITS3); + + TRANSPOSE(out, col); + + outb = vec_packs(col0, col1); + outb = vec_add(outb, PB_CENTERJSAMP); + outptr = (long long *)(output_buf[0] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[1] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col2, col3); + outb = vec_add(outb, PB_CENTERJSAMP); + outptr = (long long *)(output_buf[2] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[3] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col4, col5); + outb = vec_add(outb, PB_CENTERJSAMP); + outptr = (long long *)(output_buf[4] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[5] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col6, col7); + outb = vec_add(outb, PB_CENTERJSAMP); + outptr = (long long *)(output_buf[6] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[7] + output_col); + *outptr = outbptr[1]; +} From 935d1d63982a728ebb4e678c906fec269effcac3 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 20 Dec 2014 01:14:38 +0000 Subject: [PATCH 008/140] Swap the order of the IFAST and ISLOW FDCT functions so that it matches the order of the prototypes in jsimd.h and the stubs in jsimd_powerpc.c. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1459 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd_powerpc_altivec.c | 286 +++++++++++++++++------------------ 1 file changed, 143 insertions(+), 143 deletions(-) diff --git a/simd/jsimd_powerpc_altivec.c b/simd/jsimd_powerpc_altivec.c index b77208ca..798757cf 100644 --- a/simd/jsimd_powerpc_altivec.c +++ b/simd/jsimd_powerpc_altivec.c @@ -71,149 +71,6 @@ } -/* FAST INTEGER FORWARD DCT - * - * This is similar to the SSE2 implementation, except that we left-shift the - * constants by 1 less bit (the -1 in IFAST_CONST_SHIFT.) This is because - * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of: - * the elements in arg3 + the most significant 17 bits of - * (the elements in arg1 * the elements in arg2). - */ - -#define IFAST_F_0_382 98 /* FIX(0.382683433) */ -#define IFAST_F_0_541 139 /* FIX(0.541196100) */ -#define IFAST_F_0_707 181 /* FIX(0.707106781) */ -#define IFAST_F_1_306 334 /* FIX(1.306562965) */ - -#define IFAST_CONST_BITS 8 -#define IFAST_PRE_MULTIPLY_SCALE_BITS 2 -#define IFAST_CONST_SHIFT \ - (16 - IFAST_PRE_MULTIPLY_SCALE_BITS - IFAST_CONST_BITS - 1) - -static const __vector short jconst_fdct_ifast __attribute__((aligned(16))) = -{ - IFAST_F_0_382 << IFAST_CONST_SHIFT, - IFAST_F_0_541 << IFAST_CONST_SHIFT, - IFAST_F_0_707 << IFAST_CONST_SHIFT, - IFAST_F_1_306 << IFAST_CONST_SHIFT -}; - -#define DO_FDCT_IFAST() \ -{ \ - /* Even part */ \ - \ - tmp10 = vec_add(tmp0, tmp3); \ - tmp13 = vec_sub(tmp0, tmp3); \ - tmp11 = vec_add(tmp1, tmp2); \ - tmp12 = vec_sub(tmp1, tmp2); \ - \ - out0 = vec_add(tmp10, tmp11); \ - out4 = vec_sub(tmp10, tmp11); \ - \ - z1 = vec_add(tmp12, tmp13); \ - z1 = vec_sl(z1, PRE_MULTIPLY_SCALE_BITS); \ - z1 = vec_madds(z1, PW_0707, zero); \ - \ - out2 = vec_add(tmp13, z1); \ - out6 = vec_sub(tmp13, z1); \ - \ - /* Odd part */ \ - \ - tmp10 = vec_add(tmp4, tmp5); \ - tmp11 = vec_add(tmp5, tmp6); \ - tmp12 = vec_add(tmp6, tmp7); \ - \ - tmp10 = vec_sl(tmp10, PRE_MULTIPLY_SCALE_BITS); \ - tmp12 = vec_sl(tmp12, PRE_MULTIPLY_SCALE_BITS); \ - z5 = vec_sub(tmp10, tmp12); \ - z5 = vec_madds(z5, PW_0382, zero); \ - \ - z2 = vec_madds(tmp10, PW_0541, zero); \ - z2 = vec_add(z2, z5); \ - \ - z4 = vec_madds(tmp12, PW_1306, zero); \ - z4 = vec_add(z4, z5); \ - \ - tmp11 = vec_sl(tmp11, PRE_MULTIPLY_SCALE_BITS); \ - z3 = vec_madds(tmp11, PW_0707, zero); \ - \ - z11 = vec_add(tmp7, z3); \ - z13 = vec_sub(tmp7, z3); \ - \ - out5 = vec_add(z13, z2); \ - out3 = vec_sub(z13, z2); \ - out1 = vec_add(z11, z4); \ - out7 = vec_sub(z11, z4); \ -} - -void -jsimd_fdct_ifast_altivec (DCTELEM *data) -{ - __vector short row0, row1, row2, row3, row4, row5, row6, row7, - col0, col1, col2, col3, col4, col5, col6, col7, - tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, - z1, z2, z3, z4, z5, z11, z13, - out0, out1, out2, out3, out4, out5, out6, out7; - - /* Constants */ - __vector short zero = vec_splat_s16(0), - PW_0382 = vec_splat(jconst_fdct_ifast, 0), - PW_0541 = vec_splat(jconst_fdct_ifast, 1), - PW_0707 = vec_splat(jconst_fdct_ifast, 2), - PW_1306 = vec_splat(jconst_fdct_ifast, 3); - __vector unsigned short PRE_MULTIPLY_SCALE_BITS = - vec_splat_u16(IFAST_PRE_MULTIPLY_SCALE_BITS); - - /* Pass 1: process rows. */ - - row0 = *(__vector short *)&data[0]; - row1 = *(__vector short *)&data[8]; - row2 = *(__vector short *)&data[16]; - row3 = *(__vector short *)&data[24]; - row4 = *(__vector short *)&data[32]; - row5 = *(__vector short *)&data[40]; - row6 = *(__vector short *)&data[48]; - row7 = *(__vector short *)&data[56]; - - TRANSPOSE(row, col); - - tmp0 = vec_add(col0, col7); - tmp7 = vec_sub(col0, col7); - tmp1 = vec_add(col1, col6); - tmp6 = vec_sub(col1, col6); - tmp2 = vec_add(col2, col5); - tmp5 = vec_sub(col2, col5); - tmp3 = vec_add(col3, col4); - tmp4 = vec_sub(col3, col4); - - DO_FDCT_IFAST(); - - /* Pass 2: process columns. */ - - TRANSPOSE(out, row); - - tmp0 = vec_add(row0, row7); - tmp7 = vec_sub(row0, row7); - tmp1 = vec_add(row1, row6); - tmp6 = vec_sub(row1, row6); - tmp2 = vec_add(row2, row5); - tmp5 = vec_sub(row2, row5); - tmp3 = vec_add(row3, row4); - tmp4 = vec_sub(row3, row4); - - DO_FDCT_IFAST(); - - *(__vector short *)&data[0] = out0; - *(__vector short *)&data[8] = out1; - *(__vector short *)&data[16] = out2; - *(__vector short *)&data[24] = out3; - *(__vector short *)&data[32] = out4; - *(__vector short *)&data[40] = out5; - *(__vector short *)&data[48] = out6; - *(__vector short *)&data[56] = out7; -} - - /* SLOW INTEGER FORWARD DCT */ #define ISLOW_F_0_298 2446 /* FIX(0.298631336) */ @@ -480,6 +337,149 @@ jsimd_fdct_islow_altivec (DCTELEM *data) } +/* FAST INTEGER FORWARD DCT + * + * This is similar to the SSE2 implementation, except that we left-shift the + * constants by 1 less bit (the -1 in IFAST_CONST_SHIFT.) This is because + * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of: + * the elements in arg3 + the most significant 17 bits of + * (the elements in arg1 * the elements in arg2). + */ + +#define IFAST_F_0_382 98 /* FIX(0.382683433) */ +#define IFAST_F_0_541 139 /* FIX(0.541196100) */ +#define IFAST_F_0_707 181 /* FIX(0.707106781) */ +#define IFAST_F_1_306 334 /* FIX(1.306562965) */ + +#define IFAST_CONST_BITS 8 +#define IFAST_PRE_MULTIPLY_SCALE_BITS 2 +#define IFAST_CONST_SHIFT \ + (16 - IFAST_PRE_MULTIPLY_SCALE_BITS - IFAST_CONST_BITS - 1) + +static const __vector short jconst_fdct_ifast __attribute__((aligned(16))) = +{ + IFAST_F_0_382 << IFAST_CONST_SHIFT, + IFAST_F_0_541 << IFAST_CONST_SHIFT, + IFAST_F_0_707 << IFAST_CONST_SHIFT, + IFAST_F_1_306 << IFAST_CONST_SHIFT +}; + +#define DO_FDCT_IFAST() \ +{ \ + /* Even part */ \ + \ + tmp10 = vec_add(tmp0, tmp3); \ + tmp13 = vec_sub(tmp0, tmp3); \ + tmp11 = vec_add(tmp1, tmp2); \ + tmp12 = vec_sub(tmp1, tmp2); \ + \ + out0 = vec_add(tmp10, tmp11); \ + out4 = vec_sub(tmp10, tmp11); \ + \ + z1 = vec_add(tmp12, tmp13); \ + z1 = vec_sl(z1, PRE_MULTIPLY_SCALE_BITS); \ + z1 = vec_madds(z1, PW_0707, zero); \ + \ + out2 = vec_add(tmp13, z1); \ + out6 = vec_sub(tmp13, z1); \ + \ + /* Odd part */ \ + \ + tmp10 = vec_add(tmp4, tmp5); \ + tmp11 = vec_add(tmp5, tmp6); \ + tmp12 = vec_add(tmp6, tmp7); \ + \ + tmp10 = vec_sl(tmp10, PRE_MULTIPLY_SCALE_BITS); \ + tmp12 = vec_sl(tmp12, PRE_MULTIPLY_SCALE_BITS); \ + z5 = vec_sub(tmp10, tmp12); \ + z5 = vec_madds(z5, PW_0382, zero); \ + \ + z2 = vec_madds(tmp10, PW_0541, zero); \ + z2 = vec_add(z2, z5); \ + \ + z4 = vec_madds(tmp12, PW_1306, zero); \ + z4 = vec_add(z4, z5); \ + \ + tmp11 = vec_sl(tmp11, PRE_MULTIPLY_SCALE_BITS); \ + z3 = vec_madds(tmp11, PW_0707, zero); \ + \ + z11 = vec_add(tmp7, z3); \ + z13 = vec_sub(tmp7, z3); \ + \ + out5 = vec_add(z13, z2); \ + out3 = vec_sub(z13, z2); \ + out1 = vec_add(z11, z4); \ + out7 = vec_sub(z11, z4); \ +} + +void +jsimd_fdct_ifast_altivec (DCTELEM *data) +{ + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + col0, col1, col2, col3, col4, col5, col6, col7, + tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, + z1, z2, z3, z4, z5, z11, z13, + out0, out1, out2, out3, out4, out5, out6, out7; + + /* Constants */ + __vector short zero = vec_splat_s16(0), + PW_0382 = vec_splat(jconst_fdct_ifast, 0), + PW_0541 = vec_splat(jconst_fdct_ifast, 1), + PW_0707 = vec_splat(jconst_fdct_ifast, 2), + PW_1306 = vec_splat(jconst_fdct_ifast, 3); + __vector unsigned short PRE_MULTIPLY_SCALE_BITS = + vec_splat_u16(IFAST_PRE_MULTIPLY_SCALE_BITS); + + /* Pass 1: process rows. */ + + row0 = *(__vector short *)&data[0]; + row1 = *(__vector short *)&data[8]; + row2 = *(__vector short *)&data[16]; + row3 = *(__vector short *)&data[24]; + row4 = *(__vector short *)&data[32]; + row5 = *(__vector short *)&data[40]; + row6 = *(__vector short *)&data[48]; + row7 = *(__vector short *)&data[56]; + + TRANSPOSE(row, col); + + tmp0 = vec_add(col0, col7); + tmp7 = vec_sub(col0, col7); + tmp1 = vec_add(col1, col6); + tmp6 = vec_sub(col1, col6); + tmp2 = vec_add(col2, col5); + tmp5 = vec_sub(col2, col5); + tmp3 = vec_add(col3, col4); + tmp4 = vec_sub(col3, col4); + + DO_FDCT_IFAST(); + + /* Pass 2: process columns. */ + + TRANSPOSE(out, row); + + tmp0 = vec_add(row0, row7); + tmp7 = vec_sub(row0, row7); + tmp1 = vec_add(row1, row6); + tmp6 = vec_sub(row1, row6); + tmp2 = vec_add(row2, row5); + tmp5 = vec_sub(row2, row5); + tmp3 = vec_add(row3, row4); + tmp4 = vec_sub(row3, row4); + + DO_FDCT_IFAST(); + + *(__vector short *)&data[0] = out0; + *(__vector short *)&data[8] = out1; + *(__vector short *)&data[16] = out2; + *(__vector short *)&data[24] = out3; + *(__vector short *)&data[32] = out4; + *(__vector short *)&data[40] = out5; + *(__vector short *)&data[48] = out6; + *(__vector short *)&data[56] = out7; +} + + /* FAST INTEGER INVERSE DCT * * This is similar to the SSE2 implementation, except that we left-shift the From 9cb418d221235bba655689e5605f6cde42a9ddcc Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 20 Dec 2014 01:16:26 +0000 Subject: [PATCH 009/140] Use macros to allocate constants statically, rather than reading them from a table using vec_splat*(). This improves code readability and probably improves performance a bit as well. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1460 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd_powerpc_altivec.c | 135 +++++++++++------------------------ 1 file changed, 40 insertions(+), 95 deletions(-) diff --git a/simd/jsimd_powerpc_altivec.c b/simd/jsimd_powerpc_altivec.c index 798757cf..fd3fcc2d 100644 --- a/simd/jsimd_powerpc_altivec.c +++ b/simd/jsimd_powerpc_altivec.c @@ -32,6 +32,11 @@ /* Common code */ +#define __4X(a) a, a, a, a +#define __4X2(a, b) a, b, a, b, a, b, a, b +#define __8X(a) __4X(a), __4X(a) +#define __16X(a) __8X(a), __8X(a) + #define TRANSPOSE(row, col) \ { \ __vector short row04l, row04h, row15l, row15h, \ @@ -91,17 +96,6 @@ #define ISLOW_DESCALE_P1 (ISLOW_CONST_BITS - ISLOW_PASS1_BITS) #define ISLOW_DESCALE_P2 (ISLOW_CONST_BITS + ISLOW_PASS1_BITS) -static const __vector int jconst_fdct_islow __attribute__((aligned(16))) = -{ - 1 << (ISLOW_DESCALE_P1 - 1), - 1 << (ISLOW_DESCALE_P2 - 1) -}; - -static const __vector short jconst_fdct_islow2 __attribute__((aligned(16))) = -{ - 1 << (ISLOW_PASS1_BITS - 1) -}; - #define DO_FDCT_ISLOW_COMMON(PASS) \ { \ tmp1312l = vec_mergeh(tmp13, tmp12); \ @@ -241,51 +235,24 @@ jsimd_fdct_islow_altivec (DCTELEM *data) out1l, out1h, out2l, out2h, out3l, out3h, out5l, out5h, out6l, out6h, out7l, out7h; - __vector short PW_F130_F054 = {ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541, - ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541, - ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541, - ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541}; - __vector short PW_F054_MF130 = {ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847, - ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847, - ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847, - ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847}; - __vector short PW_MF078_F117 = {ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175, - ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175, - ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175, - ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175}; - __vector short PW_F117_F078 = {ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390, - ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390, - ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390, - ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390}; - __vector short PW_MF060_MF089 = { - ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899, - ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899, - ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899, - ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899}; - __vector short PW_MF089_F060 = { - -ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899, - -ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899, - -ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899, - -ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899}; - __vector short PW_MF050_MF256 = { - ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562, - ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562, - ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562, - ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562}; - __vector short PW_MF256_F050 = { - -ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562, - -ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562, - -ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562, - -ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562}; - __vector short PW_DESCALE_P2X = vec_splat(jconst_fdct_islow2, 0); + __vector short + PW_F130_F054 = { __4X2(ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541) }, + PW_F054_MF130 = { __4X2(ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847) }, + PW_MF078_F117 = { __4X2(ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175) }, + PW_F117_F078 = { __4X2(ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390) }, + PW_MF060_MF089 = { __4X2(ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899) }, + PW_MF089_F060 = { __4X2(-ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899) }, + PW_MF050_MF256 = { __4X2(ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562) }, + PW_MF256_F050 = { __4X2(-ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562) }, + PW_DESCALE_P2X = { __8X(1 << (ISLOW_PASS1_BITS - 1)) }; /* Constants */ - __vector unsigned short PASS1_BITS = vec_splat_u16(ISLOW_PASS1_BITS); - __vector int zero = vec_splat_s32(0), - PD_DESCALE_P1 = vec_splat(jconst_fdct_islow, 0), - PD_DESCALE_P2 = vec_splat(jconst_fdct_islow, 1); - __vector unsigned int DESCALE_P1 = vec_splat_u32(ISLOW_DESCALE_P1), - DESCALE_P2 = vec_splat_u32(ISLOW_DESCALE_P2); + __vector unsigned short PASS1_BITS = { __8X(ISLOW_PASS1_BITS) }; + __vector int zero = { __4X(0) }, + PD_DESCALE_P1 = { __4X(1 << (ISLOW_DESCALE_P1 - 1)) }, + PD_DESCALE_P2 = { __4X(1 << (ISLOW_DESCALE_P2 - 1)) }; + __vector unsigned int DESCALE_P1 = { __4X(ISLOW_DESCALE_P1) }, + DESCALE_P2 = { __4X(ISLOW_DESCALE_P2) }; /* Pass 1: process rows. */ @@ -356,14 +323,6 @@ jsimd_fdct_islow_altivec (DCTELEM *data) #define IFAST_CONST_SHIFT \ (16 - IFAST_PRE_MULTIPLY_SCALE_BITS - IFAST_CONST_BITS - 1) -static const __vector short jconst_fdct_ifast __attribute__((aligned(16))) = -{ - IFAST_F_0_382 << IFAST_CONST_SHIFT, - IFAST_F_0_541 << IFAST_CONST_SHIFT, - IFAST_F_0_707 << IFAST_CONST_SHIFT, - IFAST_F_1_306 << IFAST_CONST_SHIFT -}; - #define DO_FDCT_IFAST() \ { \ /* Even part */ \ @@ -423,12 +382,12 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) /* Constants */ __vector short zero = vec_splat_s16(0), - PW_0382 = vec_splat(jconst_fdct_ifast, 0), - PW_0541 = vec_splat(jconst_fdct_ifast, 1), - PW_0707 = vec_splat(jconst_fdct_ifast, 2), - PW_1306 = vec_splat(jconst_fdct_ifast, 3); - __vector unsigned short PRE_MULTIPLY_SCALE_BITS = - vec_splat_u16(IFAST_PRE_MULTIPLY_SCALE_BITS); + PW_0382 = { __8X(IFAST_F_0_382 << IFAST_CONST_SHIFT) }, + PW_0541 = { __8X(IFAST_F_0_541 << IFAST_CONST_SHIFT) }, + PW_0707 = { __8X(IFAST_F_0_707 << IFAST_CONST_SHIFT) }, + PW_1306 = { __8X(IFAST_F_1_306 << IFAST_CONST_SHIFT) }; + __vector unsigned short + PRE_MULTIPLY_SCALE_BITS = { __8X(IFAST_PRE_MULTIPLY_SCALE_BITS) }; /* Pass 1: process rows. */ @@ -489,29 +448,15 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) * (the elements in arg1 * the elements in arg2). */ -#define F_1_082 277 /* FIX(1.082392200) */ -#define F_1_414 362 /* FIX(1.414213562) */ -#define F_1_847 473 /* FIX(1.847759065) */ -#define F_2_613 669 /* FIX(2.613125930) */ -#define F_1_613 (F_2_613 - 256) /* FIX(2.613125930) - FIX(1) */ +#define IFAST_F_1_082 277 /* FIX(1.082392200) */ +#define IFAST_F_1_414 362 /* FIX(1.414213562) */ +#define IFAST_F_1_847 473 /* FIX(1.847759065) */ +#define IFAST_F_2_613 669 /* FIX(2.613125930) */ +#define IFAST_F_1_613 (IFAST_F_2_613 - 256) /* FIX(2.613125930) - FIX(1) */ #define IFAST_PASS1_BITS 2 #define IFAST_CENTERJSAMPLE 128 -static const __vector short jconst_idct_ifast __attribute__((aligned(16))) = -{ - F_1_414 << IFAST_CONST_SHIFT, - F_1_847 << IFAST_CONST_SHIFT, - -F_1_613 << IFAST_CONST_SHIFT, - F_1_082 << IFAST_CONST_SHIFT -}; - -static const __vector signed char jconst_idct_ifast2 - __attribute__((aligned(16))) = -{ - IFAST_CENTERJSAMPLE -}; - #define DO_IDCT_IFAST(in) \ { \ /* Even part */ \ @@ -583,15 +528,15 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, long long *outptr, *outbptr = (long long *)(&outb); /* Constants */ - __vector short zero = vec_splat_s16(0), - PW_F1414 = vec_splat(jconst_idct_ifast, 0), - PW_F1847 = vec_splat(jconst_idct_ifast, 1), - PW_MF1613 = vec_splat(jconst_idct_ifast, 2), - PW_F1082 = vec_splat(jconst_idct_ifast, 3); + __vector short zero = { __8X(0) }, + PW_F1414 = { __8X(IFAST_F_1_414 << IFAST_CONST_SHIFT) }, + PW_F1847 = { __8X(IFAST_F_1_847 << IFAST_CONST_SHIFT) }, + PW_MF1613 = { __8X(-IFAST_F_1_613 << IFAST_CONST_SHIFT) }, + PW_F1082 = { __8X(IFAST_F_1_082 << IFAST_CONST_SHIFT) }; __vector unsigned short - PRE_MULTIPLY_SCALE_BITS = vec_splat_u16(IFAST_PRE_MULTIPLY_SCALE_BITS), - PASS1_BITS3 = vec_splat_u16(IFAST_PASS1_BITS + 3); - __vector signed char PB_CENTERJSAMP = vec_splat(jconst_idct_ifast2, 0); + PRE_MULTIPLY_SCALE_BITS = { __8X(IFAST_PRE_MULTIPLY_SCALE_BITS) }, + PASS1_BITS3 = { __8X(IFAST_PASS1_BITS + 3) }; + __vector signed char PB_CENTERJSAMP = { __16X(IFAST_CENTERJSAMPLE) }; /* Pass 1: process columns. */ From 0691162a8bab2bad84e7f25da99f91a553c3c067 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 20 Dec 2014 01:17:39 +0000 Subject: [PATCH 010/140] AltiVec SIMD implementation of slow integer inverse DCT git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1461 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd.h | 4 + simd/jsimd_powerpc.c | 13 ++ simd/jsimd_powerpc_altivec.c | 278 ++++++++++++++++++++++++++++++++++- 3 files changed, 291 insertions(+), 4 deletions(-) diff --git a/simd/jsimd.h b/simd/jsimd.h index f3396110..9b50610a 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -646,6 +646,10 @@ EXTERN(void) jsimd_idct_islow_mips_dspr2 (void * dct_table, JCOEFPTR coef_block, int * output_buf, JSAMPLE * output_col); +EXTERN(void) jsimd_idct_islow_altivec + (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col); + /* Fast Integer Inverse DCT */ EXTERN(void) jsimd_idct_ifast_mmx (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index eb977d73..f92851c5 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -333,6 +333,17 @@ jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, GLOBAL(int) jsimd_can_idct_islow (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -364,6 +375,8 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { + jsimd_idct_islow_altivec(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(void) diff --git a/simd/jsimd_powerpc_altivec.c b/simd/jsimd_powerpc_altivec.c index fd3fcc2d..0d251dfa 100644 --- a/simd/jsimd_powerpc_altivec.c +++ b/simd/jsimd_powerpc_altivec.c @@ -235,6 +235,7 @@ jsimd_fdct_islow_altivec (DCTELEM *data) out1l, out1h, out2l, out2h, out3l, out3h, out5l, out5h, out6l, out6h, out7l, out7h; + /* Constants */ __vector short PW_F130_F054 = { __4X2(ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541) }, PW_F054_MF130 = { __4X2(ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847) }, @@ -245,8 +246,6 @@ jsimd_fdct_islow_altivec (DCTELEM *data) PW_MF050_MF256 = { __4X2(ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562) }, PW_MF256_F050 = { __4X2(-ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562) }, PW_DESCALE_P2X = { __8X(1 << (ISLOW_PASS1_BITS - 1)) }; - - /* Constants */ __vector unsigned short PASS1_BITS = { __8X(ISLOW_PASS1_BITS) }; __vector int zero = { __4X(0) }, PD_DESCALE_P1 = { __4X(1 << (ISLOW_DESCALE_P1 - 1)) }, @@ -439,6 +438,278 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) } +/* SLOW INTEGER INVERSE DCT */ + +#define DO_IDCT_ISLOW(in, PASS) \ +{ \ + /* Even part */ \ + \ + in##26l = vec_mergeh(in##2, in##6); \ + in##26h = vec_mergel(in##2, in##6); \ + \ + tmp3l = vec_msums(in##26l, PW_F130_F054, zero32); \ + tmp3h = vec_msums(in##26h, PW_F130_F054, zero32); \ + tmp2l = vec_msums(in##26l, PW_F054_MF130, zero32); \ + tmp2h = vec_msums(in##26h, PW_F054_MF130, zero32); \ + \ + tmp0 = vec_add(in##0, in##4); \ + tmp1 = vec_sub(in##0, in##4); \ + \ + tmp0l = vec_unpackh(tmp0); \ + tmp0h = vec_unpackl(tmp0); \ + tmp0l = vec_sl(tmp0l, CONST_BITS); \ + tmp0h = vec_sl(tmp0h, CONST_BITS); \ + \ + tmp10l = vec_add(tmp0l, tmp3l); \ + tmp10h = vec_add(tmp0h, tmp3h); \ + tmp13l = vec_sub(tmp0l, tmp3l); \ + tmp13h = vec_sub(tmp0h, tmp3h); \ + \ + tmp1l = vec_unpackh(tmp1); \ + tmp1h = vec_unpackl(tmp1); \ + tmp1l = vec_sl(tmp1l, CONST_BITS); \ + tmp1h = vec_sl(tmp1h, CONST_BITS); \ + \ + tmp11l = vec_add(tmp1l, tmp2l); \ + tmp11h = vec_add(tmp1h, tmp2h); \ + tmp12l = vec_sub(tmp1l, tmp2l); \ + tmp12h = vec_sub(tmp1h, tmp2h); \ + \ + /* Odd part */ \ + \ + z3 = vec_add(in##3, in##7); \ + z4 = vec_add(in##1, in##5); \ + \ + z34l = vec_mergeh(z3, z4); \ + z34h = vec_mergel(z3, z4); \ + \ + z3l = vec_msums(z34l, PW_MF078_F117, zero32); \ + z3h = vec_msums(z34h, PW_MF078_F117, zero32); \ + z4l = vec_msums(z34l, PW_F117_F078, zero32); \ + z4h = vec_msums(z34h, PW_F117_F078, zero32); \ + \ + in##71l = vec_mergeh(in##7, in##1); \ + in##71h = vec_mergel(in##7, in##1); \ + \ + tmp0l = vec_msums(in##71l, PW_MF060_MF089, z3l); \ + tmp0h = vec_msums(in##71h, PW_MF060_MF089, z3h); \ + tmp3l = vec_msums(in##71l, PW_MF089_F060, z4l); \ + tmp3h = vec_msums(in##71h, PW_MF089_F060, z4h); \ + \ + in##53l = vec_mergeh(in##5, in##3); \ + in##53h = vec_mergel(in##5, in##3); \ + \ + tmp1l = vec_msums(in##53l, PW_MF050_MF256, z4l); \ + tmp1h = vec_msums(in##53h, PW_MF050_MF256, z4h); \ + tmp2l = vec_msums(in##53l, PW_MF256_F050, z3l); \ + tmp2h = vec_msums(in##53h, PW_MF256_F050, z3h); \ + \ + /* Final output stage */ \ + \ + out0l = vec_add(tmp10l, tmp3l); \ + out0h = vec_add(tmp10h, tmp3h); \ + out7l = vec_sub(tmp10l, tmp3l); \ + out7h = vec_sub(tmp10h, tmp3h); \ + \ + out0l = vec_add(out0l, PD_DESCALE_P##PASS); \ + out0h = vec_add(out0h, PD_DESCALE_P##PASS); \ + out0l = vec_sra(out0l, DESCALE_P##PASS); \ + out0h = vec_sra(out0h, DESCALE_P##PASS); \ + \ + out7l = vec_add(out7l, PD_DESCALE_P##PASS); \ + out7h = vec_add(out7h, PD_DESCALE_P##PASS); \ + out7l = vec_sra(out7l, DESCALE_P##PASS); \ + out7h = vec_sra(out7h, DESCALE_P##PASS); \ + \ + out0 = vec_pack(out0l, out0h); \ + out7 = vec_pack(out7l, out7h); \ + \ + out1l = vec_add(tmp11l, tmp2l); \ + out1h = vec_add(tmp11h, tmp2h); \ + out6l = vec_sub(tmp11l, tmp2l); \ + out6h = vec_sub(tmp11h, tmp2h); \ + \ + out1l = vec_add(out1l, PD_DESCALE_P##PASS); \ + out1h = vec_add(out1h, PD_DESCALE_P##PASS); \ + out1l = vec_sra(out1l, DESCALE_P##PASS); \ + out1h = vec_sra(out1h, DESCALE_P##PASS); \ + \ + out6l = vec_add(out6l, PD_DESCALE_P##PASS); \ + out6h = vec_add(out6h, PD_DESCALE_P##PASS); \ + out6l = vec_sra(out6l, DESCALE_P##PASS); \ + out6h = vec_sra(out6h, DESCALE_P##PASS); \ + \ + out1 = vec_pack(out1l, out1h); \ + out6 = vec_pack(out6l, out6h); \ + \ + out2l = vec_add(tmp12l, tmp1l); \ + out2h = vec_add(tmp12h, tmp1h); \ + out5l = vec_sub(tmp12l, tmp1l); \ + out5h = vec_sub(tmp12h, tmp1h); \ + \ + out2l = vec_add(out2l, PD_DESCALE_P##PASS); \ + out2h = vec_add(out2h, PD_DESCALE_P##PASS); \ + out2l = vec_sra(out2l, DESCALE_P##PASS); \ + out2h = vec_sra(out2h, DESCALE_P##PASS); \ + \ + out5l = vec_add(out5l, PD_DESCALE_P##PASS); \ + out5h = vec_add(out5h, PD_DESCALE_P##PASS); \ + out5l = vec_sra(out5l, DESCALE_P##PASS); \ + out5h = vec_sra(out5h, DESCALE_P##PASS); \ + \ + out2 = vec_pack(out2l, out2h); \ + out5 = vec_pack(out5l, out5h); \ + \ + out3l = vec_add(tmp13l, tmp0l); \ + out3h = vec_add(tmp13h, tmp0h); \ + out4l = vec_sub(tmp13l, tmp0l); \ + out4h = vec_sub(tmp13h, tmp0h); \ + \ + out3l = vec_add(out3l, PD_DESCALE_P##PASS); \ + out3h = vec_add(out3h, PD_DESCALE_P##PASS); \ + out3l = vec_sra(out3l, DESCALE_P##PASS); \ + out3h = vec_sra(out3h, DESCALE_P##PASS); \ + \ + out4l = vec_add(out4l, PD_DESCALE_P##PASS); \ + out4h = vec_add(out4h, PD_DESCALE_P##PASS); \ + out4l = vec_sra(out4l, DESCALE_P##PASS); \ + out4h = vec_sra(out4h, DESCALE_P##PASS); \ + \ + out3 = vec_pack(out3l, out3h); \ + out4 = vec_pack(out4l, out4h); \ +} + +void +jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + short *dct_table = (short *)dct_table_; + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + col0, col1, col2, col3, col4, col5, col6, col7, + quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, + tmp0, tmp1, tmp2, tmp3, z3, z4, + z34l, z34h, col71l, col71h, col26l, col26h, col53l, col53h, + row71l, row71h, row26l, row26h, row53l, row53h, + out0, out1, out2, out3, out4, out5, out6, out7; + __vector int tmp0l, tmp0h, tmp1l, tmp1h, tmp2l, tmp2h, tmp3l, tmp3h, + tmp10l, tmp10h, tmp11l, tmp11h, tmp12l, tmp12h, tmp13l, tmp13h, + z3l, z3h, z4l, z4h, + out0l, out0h, out1l, out1h, out2l, out2h, out3l, out3h, out4l, out4h, + out5l, out5h, out6l, out6h, out7l, out7h; + __vector signed char outb; + long long *outptr, *outbptr = (long long *)(&outb); + + /* Constants */ + __vector short zero16 = { __8X(0) }, + PW_F130_F054 = { __4X2(ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541) }, + PW_F054_MF130 = { __4X2(ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847) }, + PW_MF078_F117 = { __4X2(ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175) }, + PW_F117_F078 = { __4X2(ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390) }, + PW_MF060_MF089 = { __4X2(ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899) }, + PW_MF089_F060 = { __4X2(-ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899) }, + PW_MF050_MF256 = { __4X2(ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562) }, + PW_MF256_F050 = { __4X2(-ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562) }; + __vector unsigned short PASS1_BITS = { __8X(ISLOW_PASS1_BITS) }; + __vector int zero32 = { __4X(0) }, + PD_DESCALE_P1 = { __4X(1 << (ISLOW_DESCALE_P1 - 1)) }, + PD_DESCALE_P2 = { __4X(1 << (ISLOW_DESCALE_P2 + 3 - 1)) }; + __vector unsigned int DESCALE_P1 = { __4X(ISLOW_DESCALE_P1) }, + DESCALE_P2 = { __4X(ISLOW_DESCALE_P2 + 3) }, + CONST_BITS = { __4X(ISLOW_CONST_BITS) }; + __vector signed char PB_CENTERJSAMP = { __16X(CENTERJSAMPLE) }; + + /* Pass 1: process columns. */ + + col0 = *(__vector short *)&coef_block[0]; + col1 = *(__vector short *)&coef_block[8]; + col2 = *(__vector short *)&coef_block[16]; + col3 = *(__vector short *)&coef_block[24]; + col4 = *(__vector short *)&coef_block[32]; + col5 = *(__vector short *)&coef_block[40]; + col6 = *(__vector short *)&coef_block[48]; + col7 = *(__vector short *)&coef_block[56]; + + tmp1 = vec_or(col1, col2); + tmp2 = vec_or(col3, col4); + tmp1 = vec_or(tmp1, tmp2); + tmp3 = vec_or(col5, col6); + tmp3 = vec_or(tmp3, col7); + tmp1 = vec_or(tmp1, tmp3); + + quant0 = *(__vector short *)&dct_table[0]; + col0 = vec_mladd(col0, quant0, zero16); + + if (vec_all_eq(tmp1, zero16)) { + /* AC terms all zero */ + + col0 = vec_sl(col0, PASS1_BITS); + + row0 = vec_splat(col0, 0); + row1 = vec_splat(col0, 1); + row2 = vec_splat(col0, 2); + row3 = vec_splat(col0, 3); + row4 = vec_splat(col0, 4); + row5 = vec_splat(col0, 5); + row6 = vec_splat(col0, 6); + row7 = vec_splat(col0, 7); + + } else { + + quant1 = *(__vector short *)&dct_table[8]; + quant2 = *(__vector short *)&dct_table[16]; + quant3 = *(__vector short *)&dct_table[24]; + quant4 = *(__vector short *)&dct_table[32]; + quant5 = *(__vector short *)&dct_table[40]; + quant6 = *(__vector short *)&dct_table[48]; + quant7 = *(__vector short *)&dct_table[56]; + + col1 = vec_mladd(col1, quant1, zero16); + col2 = vec_mladd(col2, quant2, zero16); + col3 = vec_mladd(col3, quant3, zero16); + col4 = vec_mladd(col4, quant4, zero16); + col5 = vec_mladd(col5, quant5, zero16); + col6 = vec_mladd(col6, quant6, zero16); + col7 = vec_mladd(col7, quant7, zero16); + + DO_IDCT_ISLOW(col, 1); + + TRANSPOSE(out, row); + } + + DO_IDCT_ISLOW(row, 2); + + TRANSPOSE(out, col); + + outb = vec_packs(col0, col1); + outb = vec_add(outb, PB_CENTERJSAMP); + outptr = (long long *)(output_buf[0] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[1] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col2, col3); + outb = vec_add(outb, PB_CENTERJSAMP); + outptr = (long long *)(output_buf[2] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[3] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col4, col5); + outb = vec_add(outb, PB_CENTERJSAMP); + outptr = (long long *)(output_buf[4] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[5] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col6, col7); + outb = vec_add(outb, PB_CENTERJSAMP); + outptr = (long long *)(output_buf[6] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[7] + output_col); + *outptr = outbptr[1]; +} + + /* FAST INTEGER INVERSE DCT * * This is similar to the SSE2 implementation, except that we left-shift the @@ -455,7 +726,6 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) #define IFAST_F_1_613 (IFAST_F_2_613 - 256) /* FIX(2.613125930) - FIX(1) */ #define IFAST_PASS1_BITS 2 -#define IFAST_CENTERJSAMPLE 128 #define DO_IDCT_IFAST(in) \ { \ @@ -536,7 +806,7 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, __vector unsigned short PRE_MULTIPLY_SCALE_BITS = { __8X(IFAST_PRE_MULTIPLY_SCALE_BITS) }, PASS1_BITS3 = { __8X(IFAST_PASS1_BITS + 3) }; - __vector signed char PB_CENTERJSAMP = { __16X(IFAST_CENTERJSAMPLE) }; + __vector signed char PB_CENTERJSAMP = { __16X(CENTERJSAMPLE) }; /* Pass 1: process columns. */ From c9da78525bc14f4054616c398b53af8bfa04628d Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 20 Dec 2014 03:32:59 +0000 Subject: [PATCH 011/140] Optimizations to the AltiVec DCT algorithms (pre-compute constants and combine multiply/add operations) git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1462 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd_powerpc_altivec.c | 97 ++++++++++-------------------------- 1 file changed, 25 insertions(+), 72 deletions(-) diff --git a/simd/jsimd_powerpc_altivec.c b/simd/jsimd_powerpc_altivec.c index 0d251dfa..7796b707 100644 --- a/simd/jsimd_powerpc_altivec.c +++ b/simd/jsimd_powerpc_altivec.c @@ -101,18 +101,13 @@ tmp1312l = vec_mergeh(tmp13, tmp12); \ tmp1312h = vec_mergel(tmp13, tmp12); \ \ - out2l = vec_msums(tmp1312l, PW_F130_F054, zero); \ - out2h = vec_msums(tmp1312h, PW_F130_F054, zero); \ - out6l = vec_msums(tmp1312l, PW_F054_MF130, zero); \ - out6h = vec_msums(tmp1312h, PW_F054_MF130, zero); \ + out2l = vec_msums(tmp1312l, PW_F130_F054, PD_DESCALE_P##PASS); \ + out2h = vec_msums(tmp1312h, PW_F130_F054, PD_DESCALE_P##PASS); \ + out6l = vec_msums(tmp1312l, PW_F054_MF130, PD_DESCALE_P##PASS); \ + out6h = vec_msums(tmp1312h, PW_F054_MF130, PD_DESCALE_P##PASS); \ \ - out2l = vec_add(out2l, PD_DESCALE_P##PASS); \ - out2h = vec_add(out2h, PD_DESCALE_P##PASS); \ out2l = vec_sra(out2l, DESCALE_P##PASS); \ out2h = vec_sra(out2h, DESCALE_P##PASS); \ - \ - out6l = vec_add(out6l, PD_DESCALE_P##PASS); \ - out6h = vec_add(out6h, PD_DESCALE_P##PASS); \ out6l = vec_sra(out6l, DESCALE_P##PASS); \ out6h = vec_sra(out6h, DESCALE_P##PASS); \ \ @@ -127,31 +122,21 @@ z34l = vec_mergeh(z3, z4); \ z34h = vec_mergel(z3, z4); \ \ - z3l = vec_msums(z34l, PW_MF078_F117, zero); \ - z3h = vec_msums(z34h, PW_MF078_F117, zero); \ - z4l = vec_msums(z34l, PW_F117_F078, zero); \ - z4h = vec_msums(z34h, PW_F117_F078, zero); \ + z3l = vec_msums(z34l, PW_MF078_F117, PD_DESCALE_P##PASS); \ + z3h = vec_msums(z34h, PW_MF078_F117, PD_DESCALE_P##PASS); \ + z4l = vec_msums(z34l, PW_F117_F078, PD_DESCALE_P##PASS); \ + z4h = vec_msums(z34h, PW_F117_F078, PD_DESCALE_P##PASS); \ \ tmp47l = vec_mergeh(tmp4, tmp7); \ tmp47h = vec_mergel(tmp4, tmp7); \ \ - tmp4l = vec_msums(tmp47l, PW_MF060_MF089, zero); \ - tmp4h = vec_msums(tmp47h, PW_MF060_MF089, zero); \ - tmp7l = vec_msums(tmp47l, PW_MF089_F060, zero); \ - tmp7h = vec_msums(tmp47h, PW_MF089_F060, zero); \ + out7l = vec_msums(tmp47l, PW_MF060_MF089, z3l); \ + out7h = vec_msums(tmp47h, PW_MF060_MF089, z3h); \ + out1l = vec_msums(tmp47l, PW_MF089_F060, z4l); \ + out1h = vec_msums(tmp47h, PW_MF089_F060, z4h); \ \ - out7l = vec_add(z3l, tmp4l); \ - out7h = vec_add(z3h, tmp4h); \ - out1l = vec_add(z4l, tmp7l); \ - out1h = vec_add(z4h, tmp7h); \ - \ - out7l = vec_add(out7l, PD_DESCALE_P##PASS); \ - out7h = vec_add(out7h, PD_DESCALE_P##PASS); \ out7l = vec_sra(out7l, DESCALE_P##PASS); \ out7h = vec_sra(out7h, DESCALE_P##PASS); \ - \ - out1l = vec_add(out1l, PD_DESCALE_P##PASS); \ - out1h = vec_add(out1h, PD_DESCALE_P##PASS); \ out1l = vec_sra(out1l, DESCALE_P##PASS); \ out1h = vec_sra(out1h, DESCALE_P##PASS); \ \ @@ -161,23 +146,13 @@ tmp56l = vec_mergeh(tmp5, tmp6); \ tmp56h = vec_mergel(tmp5, tmp6); \ \ - tmp5l = vec_msums(tmp56l, PW_MF050_MF256, zero); \ - tmp5h = vec_msums(tmp56h, PW_MF050_MF256, zero); \ - tmp6l = vec_msums(tmp56l, PW_MF256_F050, zero); \ - tmp6h = vec_msums(tmp56h, PW_MF256_F050, zero); \ + out5l = vec_msums(tmp56l, PW_MF050_MF256, z4l); \ + out5h = vec_msums(tmp56h, PW_MF050_MF256, z4h); \ + out3l = vec_msums(tmp56l, PW_MF256_F050, z3l); \ + out3h = vec_msums(tmp56h, PW_MF256_F050, z3h); \ \ - out5l = vec_add(tmp5l, z4l); \ - out5h = vec_add(tmp5h, z4h); \ - out3l = vec_add(tmp6l, z3l); \ - out3h = vec_add(tmp6h, z3h); \ - \ - out5l = vec_add(out5l, PD_DESCALE_P##PASS); \ - out5h = vec_add(out5h, PD_DESCALE_P##PASS); \ out5l = vec_sra(out5l, DESCALE_P##PASS); \ out5h = vec_sra(out5h, DESCALE_P##PASS); \ - \ - out3l = vec_add(out3l, PD_DESCALE_P##PASS); \ - out3h = vec_add(out3h, PD_DESCALE_P##PASS); \ out3l = vec_sra(out3l, DESCALE_P##PASS); \ out3h = vec_sra(out3h, DESCALE_P##PASS); \ \ @@ -230,8 +205,7 @@ jsimd_fdct_islow_altivec (DCTELEM *data) tmp47l, tmp47h, tmp56l, tmp56h, tmp1312l, tmp1312h, z3, z4, z34l, z34h, out0, out1, out2, out3, out4, out5, out6, out7; - __vector int tmp4l, tmp4h, tmp5l, tmp5h, tmp6l, tmp6h, tmp7l, tmp7h, - z3l, z3h, z4l, z4h, + __vector int z3l, z3h, z4l, z4h, out1l, out1h, out2l, out2h, out3l, out3h, out5l, out5h, out6l, out6h, out7l, out7h; @@ -247,8 +221,7 @@ jsimd_fdct_islow_altivec (DCTELEM *data) PW_MF256_F050 = { __4X2(-ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562) }, PW_DESCALE_P2X = { __8X(1 << (ISLOW_PASS1_BITS - 1)) }; __vector unsigned short PASS1_BITS = { __8X(ISLOW_PASS1_BITS) }; - __vector int zero = { __4X(0) }, - PD_DESCALE_P1 = { __4X(1 << (ISLOW_DESCALE_P1 - 1)) }, + __vector int PD_DESCALE_P1 = { __4X(1 << (ISLOW_DESCALE_P1 - 1)) }, PD_DESCALE_P2 = { __4X(1 << (ISLOW_DESCALE_P2 - 1)) }; __vector unsigned int DESCALE_P1 = { __4X(ISLOW_DESCALE_P1) }, DESCALE_P2 = { __4X(ISLOW_DESCALE_P2) }; @@ -352,11 +325,8 @@ jsimd_fdct_islow_altivec (DCTELEM *data) z5 = vec_sub(tmp10, tmp12); \ z5 = vec_madds(z5, PW_0382, zero); \ \ - z2 = vec_madds(tmp10, PW_0541, zero); \ - z2 = vec_add(z2, z5); \ - \ - z4 = vec_madds(tmp12, PW_1306, zero); \ - z4 = vec_add(z4, z5); \ + z2 = vec_madds(tmp10, PW_0541, z5); \ + z4 = vec_madds(tmp12, PW_1306, z5); \ \ tmp11 = vec_sl(tmp11, PRE_MULTIPLY_SCALE_BITS); \ z3 = vec_madds(tmp11, PW_0707, zero); \ @@ -459,6 +429,8 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) tmp0h = vec_unpackl(tmp0); \ tmp0l = vec_sl(tmp0l, CONST_BITS); \ tmp0h = vec_sl(tmp0h, CONST_BITS); \ + tmp0l = vec_add(tmp0l, PD_DESCALE_P##PASS); \ + tmp0h = vec_add(tmp0h, PD_DESCALE_P##PASS); \ \ tmp10l = vec_add(tmp0l, tmp3l); \ tmp10h = vec_add(tmp0h, tmp3h); \ @@ -469,6 +441,8 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) tmp1h = vec_unpackl(tmp1); \ tmp1l = vec_sl(tmp1l, CONST_BITS); \ tmp1h = vec_sl(tmp1h, CONST_BITS); \ + tmp1l = vec_add(tmp1l, PD_DESCALE_P##PASS); \ + tmp1h = vec_add(tmp1h, PD_DESCALE_P##PASS); \ \ tmp11l = vec_add(tmp1l, tmp2l); \ tmp11h = vec_add(tmp1h, tmp2h); \ @@ -511,13 +485,8 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) out7l = vec_sub(tmp10l, tmp3l); \ out7h = vec_sub(tmp10h, tmp3h); \ \ - out0l = vec_add(out0l, PD_DESCALE_P##PASS); \ - out0h = vec_add(out0h, PD_DESCALE_P##PASS); \ out0l = vec_sra(out0l, DESCALE_P##PASS); \ out0h = vec_sra(out0h, DESCALE_P##PASS); \ - \ - out7l = vec_add(out7l, PD_DESCALE_P##PASS); \ - out7h = vec_add(out7h, PD_DESCALE_P##PASS); \ out7l = vec_sra(out7l, DESCALE_P##PASS); \ out7h = vec_sra(out7h, DESCALE_P##PASS); \ \ @@ -529,13 +498,8 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) out6l = vec_sub(tmp11l, tmp2l); \ out6h = vec_sub(tmp11h, tmp2h); \ \ - out1l = vec_add(out1l, PD_DESCALE_P##PASS); \ - out1h = vec_add(out1h, PD_DESCALE_P##PASS); \ out1l = vec_sra(out1l, DESCALE_P##PASS); \ out1h = vec_sra(out1h, DESCALE_P##PASS); \ - \ - out6l = vec_add(out6l, PD_DESCALE_P##PASS); \ - out6h = vec_add(out6h, PD_DESCALE_P##PASS); \ out6l = vec_sra(out6l, DESCALE_P##PASS); \ out6h = vec_sra(out6h, DESCALE_P##PASS); \ \ @@ -547,13 +511,8 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) out5l = vec_sub(tmp12l, tmp1l); \ out5h = vec_sub(tmp12h, tmp1h); \ \ - out2l = vec_add(out2l, PD_DESCALE_P##PASS); \ - out2h = vec_add(out2h, PD_DESCALE_P##PASS); \ out2l = vec_sra(out2l, DESCALE_P##PASS); \ out2h = vec_sra(out2h, DESCALE_P##PASS); \ - \ - out5l = vec_add(out5l, PD_DESCALE_P##PASS); \ - out5h = vec_add(out5h, PD_DESCALE_P##PASS); \ out5l = vec_sra(out5l, DESCALE_P##PASS); \ out5h = vec_sra(out5h, DESCALE_P##PASS); \ \ @@ -565,13 +524,8 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) out4l = vec_sub(tmp13l, tmp0l); \ out4h = vec_sub(tmp13h, tmp0h); \ \ - out3l = vec_add(out3l, PD_DESCALE_P##PASS); \ - out3h = vec_add(out3h, PD_DESCALE_P##PASS); \ out3l = vec_sra(out3l, DESCALE_P##PASS); \ out3h = vec_sra(out3h, DESCALE_P##PASS); \ - \ - out4l = vec_add(out4l, PD_DESCALE_P##PASS); \ - out4h = vec_add(out4h, PD_DESCALE_P##PASS); \ out4l = vec_sra(out4l, DESCALE_P##PASS); \ out4h = vec_sra(out4h, DESCALE_P##PASS); \ \ @@ -765,9 +719,8 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, \ tmp10 = vec_madds(z12s, PW_F1082, zero); \ tmp10 = vec_sub(tmp10, z5); \ - tmp12 = vec_madds(z10s, PW_MF1613, zero); \ + tmp12 = vec_madds(z10s, PW_MF1613, z5); \ tmp12 = vec_sub(tmp12, z10); \ - tmp12 = vec_add(tmp12, z5); \ \ tmp6 = vec_sub(tmp12, tmp7); \ tmp5 = vec_sub(tmp11, tmp6); \ From 535674b1b8d2f969e277aee0b0fb1d2a92be4c99 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 01:00:42 +0000 Subject: [PATCH 012/140] Split AltiVec algorithms into separate files for ease of maintenance; Rename constants using lowercase so they are not confused with macros git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1463 632fc199-4ca6-4c93-a231-07263d6284db --- simd/Makefile.am | 6 +- simd/jfdctfst-altivec.c | 156 +++++++ simd/jfdctint-altivec.c | 225 +++++++++ simd/jidctfst-altivec.c | 226 +++++++++ simd/jidctint-altivec.c | 299 ++++++++++++ simd/jsimd_altivec.h | 76 +++ simd/jsimd_powerpc_altivec.c | 862 ----------------------------------- 7 files changed, 986 insertions(+), 864 deletions(-) create mode 100644 simd/jfdctfst-altivec.c create mode 100644 simd/jfdctint-altivec.c create mode 100644 simd/jidctfst-altivec.c create mode 100644 simd/jidctint-altivec.c create mode 100644 simd/jsimd_altivec.h delete mode 100644 simd/jsimd_powerpc_altivec.c diff --git a/simd/Makefile.am b/simd/Makefile.am index c5213b8c..d7b8d02a 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -72,8 +72,10 @@ endif if SIMD_POWERPC -libsimd_la_SOURCES = jsimd_powerpc.c jsimd_powerpc_altivec.c -libsimd_la_CFLAGS = -maltivec +libsimd_la_SOURCES = jsimd_powerpc.c \ + jfdctfst-altivec.c jfdctint-altivec.c \ + jidctfst-altivec.c jidctint-altivec.c +libsimd_la_CFLAGS = -maltivec endif diff --git a/simd/jfdctfst-altivec.c b/simd/jfdctfst-altivec.c new file mode 100644 index 00000000..0c3687f8 --- /dev/null +++ b/simd/jfdctfst-altivec.c @@ -0,0 +1,156 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* FAST INTEGER FORWARD DCT + * + * This is similar to the SSE2 implementation, except that we left-shift the + * constants by 1 less bit (the -1 in CONST_SHIFT.) This is because + * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of: + * the elements in arg3 + the most significant 17 bits of + * (the elements in arg1 * the elements in arg2). + */ + +#include "jsimd_altivec.h" + + +#define F_0_382 98 /* FIX(0.382683433) */ +#define F_0_541 139 /* FIX(0.541196100) */ +#define F_0_707 181 /* FIX(0.707106781) */ +#define F_1_306 334 /* FIX(1.306562965) */ + +#define CONST_BITS 8 +#define PRE_MULTIPLY_SCALE_BITS 2 +#define CONST_SHIFT (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS - 1) + + +#define DO_FDCT() \ +{ \ + /* Even part */ \ + \ + tmp10 = vec_add(tmp0, tmp3); \ + tmp13 = vec_sub(tmp0, tmp3); \ + tmp11 = vec_add(tmp1, tmp2); \ + tmp12 = vec_sub(tmp1, tmp2); \ + \ + out0 = vec_add(tmp10, tmp11); \ + out4 = vec_sub(tmp10, tmp11); \ + \ + z1 = vec_add(tmp12, tmp13); \ + z1 = vec_sl(z1, pre_multiply_scale_bits); \ + z1 = vec_madds(z1, pw_0707, zero); \ + \ + out2 = vec_add(tmp13, z1); \ + out6 = vec_sub(tmp13, z1); \ + \ + /* Odd part */ \ + \ + tmp10 = vec_add(tmp4, tmp5); \ + tmp11 = vec_add(tmp5, tmp6); \ + tmp12 = vec_add(tmp6, tmp7); \ + \ + tmp10 = vec_sl(tmp10, pre_multiply_scale_bits); \ + tmp12 = vec_sl(tmp12, pre_multiply_scale_bits); \ + z5 = vec_sub(tmp10, tmp12); \ + z5 = vec_madds(z5, pw_0382, zero); \ + \ + z2 = vec_madds(tmp10, pw_0541, z5); \ + z4 = vec_madds(tmp12, pw_1306, z5); \ + \ + tmp11 = vec_sl(tmp11, pre_multiply_scale_bits); \ + z3 = vec_madds(tmp11, pw_0707, zero); \ + \ + z11 = vec_add(tmp7, z3); \ + z13 = vec_sub(tmp7, z3); \ + \ + out5 = vec_add(z13, z2); \ + out3 = vec_sub(z13, z2); \ + out1 = vec_add(z11, z4); \ + out7 = vec_sub(z11, z4); \ +} + + +void +jsimd_fdct_ifast_altivec (DCTELEM *data) +{ + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + col0, col1, col2, col3, col4, col5, col6, col7, + tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, + z1, z2, z3, z4, z5, z11, z13, + out0, out1, out2, out3, out4, out5, out6, out7; + + /* Constants */ + __vector short zero = vec_splat_s16(0), + pw_0382 = { __8X(F_0_382 << CONST_SHIFT) }, + pw_0541 = { __8X(F_0_541 << CONST_SHIFT) }, + pw_0707 = { __8X(F_0_707 << CONST_SHIFT) }, + pw_1306 = { __8X(F_1_306 << CONST_SHIFT) }; + __vector unsigned short + pre_multiply_scale_bits = { __8X(PRE_MULTIPLY_SCALE_BITS) }; + + /* Pass 1: process rows. */ + + row0 = *(__vector short *)&data[0]; + row1 = *(__vector short *)&data[8]; + row2 = *(__vector short *)&data[16]; + row3 = *(__vector short *)&data[24]; + row4 = *(__vector short *)&data[32]; + row5 = *(__vector short *)&data[40]; + row6 = *(__vector short *)&data[48]; + row7 = *(__vector short *)&data[56]; + + TRANSPOSE(row, col); + + tmp0 = vec_add(col0, col7); + tmp7 = vec_sub(col0, col7); + tmp1 = vec_add(col1, col6); + tmp6 = vec_sub(col1, col6); + tmp2 = vec_add(col2, col5); + tmp5 = vec_sub(col2, col5); + tmp3 = vec_add(col3, col4); + tmp4 = vec_sub(col3, col4); + + DO_FDCT(); + + /* Pass 2: process columns. */ + + TRANSPOSE(out, row); + + tmp0 = vec_add(row0, row7); + tmp7 = vec_sub(row0, row7); + tmp1 = vec_add(row1, row6); + tmp6 = vec_sub(row1, row6); + tmp2 = vec_add(row2, row5); + tmp5 = vec_sub(row2, row5); + tmp3 = vec_add(row3, row4); + tmp4 = vec_sub(row3, row4); + + DO_FDCT(); + + *(__vector short *)&data[0] = out0; + *(__vector short *)&data[8] = out1; + *(__vector short *)&data[16] = out2; + *(__vector short *)&data[24] = out3; + *(__vector short *)&data[32] = out4; + *(__vector short *)&data[40] = out5; + *(__vector short *)&data[48] = out6; + *(__vector short *)&data[56] = out7; +} diff --git a/simd/jfdctint-altivec.c b/simd/jfdctint-altivec.c new file mode 100644 index 00000000..d1230c7c --- /dev/null +++ b/simd/jfdctint-altivec.c @@ -0,0 +1,225 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* SLOW INTEGER FORWARD DCT */ + +#include "jsimd_altivec.h" + + +#define F_0_298 2446 /* FIX(0.298631336) */ +#define F_0_390 3196 /* FIX(0.390180644) */ +#define F_0_541 4433 /* FIX(0.541196100) */ +#define F_0_765 6270 /* FIX(0.765366865) */ +#define F_0_899 7373 /* FIX(0.899976223) */ +#define F_1_175 9633 /* FIX(1.175875602) */ +#define F_1_501 12299 /* FIX(1.501321110) */ +#define F_1_847 15137 /* FIX(1.847759065) */ +#define F_1_961 16069 /* FIX(1.961570560) */ +#define F_2_053 16819 /* FIX(2.053119869) */ +#define F_2_562 20995 /* FIX(2.562915447) */ +#define F_3_072 25172 /* FIX(3.072711026) */ + +#define CONST_BITS 13 +#define PASS1_BITS 2 +#define DESCALE_P1 (CONST_BITS - PASS1_BITS) +#define DESCALE_P2 (CONST_BITS + PASS1_BITS) + + +#define DO_FDCT_COMMON(PASS) \ +{ \ + tmp1312l = vec_mergeh(tmp13, tmp12); \ + tmp1312h = vec_mergel(tmp13, tmp12); \ + \ + out2l = vec_msums(tmp1312l, pw_f130_f054, pd_descale_p##PASS); \ + out2h = vec_msums(tmp1312h, pw_f130_f054, pd_descale_p##PASS); \ + out6l = vec_msums(tmp1312l, pw_f054_mf130, pd_descale_p##PASS); \ + out6h = vec_msums(tmp1312h, pw_f054_mf130, pd_descale_p##PASS); \ + \ + out2l = vec_sra(out2l, descale_p##PASS); \ + out2h = vec_sra(out2h, descale_p##PASS); \ + out6l = vec_sra(out6l, descale_p##PASS); \ + out6h = vec_sra(out6h, descale_p##PASS); \ + \ + out2 = vec_pack(out2l, out2h); \ + out6 = vec_pack(out6l, out6h); \ + \ + /* Odd part */ \ + \ + z3 = vec_add(tmp4, tmp6); \ + z4 = vec_add(tmp5, tmp7); \ + \ + z34l = vec_mergeh(z3, z4); \ + z34h = vec_mergel(z3, z4); \ + \ + z3l = vec_msums(z34l, pw_mf078_f117, pd_descale_p##PASS); \ + z3h = vec_msums(z34h, pw_mf078_f117, pd_descale_p##PASS); \ + z4l = vec_msums(z34l, pw_f117_f078, pd_descale_p##PASS); \ + z4h = vec_msums(z34h, pw_f117_f078, pd_descale_p##PASS); \ + \ + tmp47l = vec_mergeh(tmp4, tmp7); \ + tmp47h = vec_mergel(tmp4, tmp7); \ + \ + out7l = vec_msums(tmp47l, pw_mf060_mf089, z3l); \ + out7h = vec_msums(tmp47h, pw_mf060_mf089, z3h); \ + out1l = vec_msums(tmp47l, pw_mf089_f060, z4l); \ + out1h = vec_msums(tmp47h, pw_mf089_f060, z4h); \ + \ + out7l = vec_sra(out7l, descale_p##PASS); \ + out7h = vec_sra(out7h, descale_p##PASS); \ + out1l = vec_sra(out1l, descale_p##PASS); \ + out1h = vec_sra(out1h, descale_p##PASS); \ + \ + out7 = vec_pack(out7l, out7h); \ + out1 = vec_pack(out1l, out1h); \ + \ + tmp56l = vec_mergeh(tmp5, tmp6); \ + tmp56h = vec_mergel(tmp5, tmp6); \ + \ + out5l = vec_msums(tmp56l, pw_mf050_mf256, z4l); \ + out5h = vec_msums(tmp56h, pw_mf050_mf256, z4h); \ + out3l = vec_msums(tmp56l, pw_mf256_f050, z3l); \ + out3h = vec_msums(tmp56h, pw_mf256_f050, z3h); \ + \ + out5l = vec_sra(out5l, descale_p##PASS); \ + out5h = vec_sra(out5h, descale_p##PASS); \ + out3l = vec_sra(out3l, descale_p##PASS); \ + out3h = vec_sra(out3h, descale_p##PASS); \ + \ + out5 = vec_pack(out5l, out5h); \ + out3 = vec_pack(out3l, out3h); \ +} + +#define DO_FDCT_ROWS() \ +{ \ + /* Even part */ \ + \ + tmp10 = vec_add(tmp0, tmp3); \ + tmp13 = vec_sub(tmp0, tmp3); \ + tmp11 = vec_add(tmp1, tmp2); \ + tmp12 = vec_sub(tmp1, tmp2); \ + \ + out0 = vec_add(tmp10, tmp11); \ + out0 = vec_sl(out0, pass1_bits); \ + out4 = vec_sub(tmp10, tmp11); \ + out4 = vec_sl(out4, pass1_bits); \ + \ + DO_FDCT_COMMON(1); \ +} + +#define DO_FDCT_COLS() \ +{ \ + /* Even part */ \ + \ + tmp10 = vec_add(tmp0, tmp3); \ + tmp13 = vec_sub(tmp0, tmp3); \ + tmp11 = vec_add(tmp1, tmp2); \ + tmp12 = vec_sub(tmp1, tmp2); \ + \ + out0 = vec_add(tmp10, tmp11); \ + out0 = vec_add(out0, pw_descale_p2x); \ + out0 = vec_sra(out0, pass1_bits); \ + out4 = vec_sub(tmp10, tmp11); \ + out4 = vec_add(out4, pw_descale_p2x); \ + out4 = vec_sra(out4, pass1_bits); \ + \ + DO_FDCT_COMMON(2); \ +} + + +void +jsimd_fdct_islow_altivec (DCTELEM *data) +{ + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + col0, col1, col2, col3, col4, col5, col6, col7, + tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, + tmp47l, tmp47h, tmp56l, tmp56h, tmp1312l, tmp1312h, + z3, z4, z34l, z34h, + out0, out1, out2, out3, out4, out5, out6, out7; + __vector int z3l, z3h, z4l, z4h, + out1l, out1h, out2l, out2h, out3l, out3h, out5l, out5h, out6l, out6h, + out7l, out7h; + + /* Constants */ + __vector short + pw_f130_f054 = { __4X2(F_0_541 + F_0_765, F_0_541) }, + pw_f054_mf130 = { __4X2(F_0_541, F_0_541 - F_1_847) }, + pw_mf078_f117 = { __4X2(F_1_175 - F_1_961, F_1_175) }, + pw_f117_f078 = { __4X2(F_1_175, F_1_175 - F_0_390) }, + pw_mf060_mf089 = { __4X2(F_0_298 - F_0_899, -F_0_899) }, + pw_mf089_f060 = { __4X2(-F_0_899, F_1_501 - F_0_899) }, + pw_mf050_mf256 = { __4X2(F_2_053 - F_2_562, -F_2_562) }, + pw_mf256_f050 = { __4X2(-F_2_562, F_3_072 - F_2_562) }, + pw_descale_p2x = { __8X(1 << (PASS1_BITS - 1)) }; + __vector unsigned short pass1_bits = { __8X(PASS1_BITS) }; + __vector int pd_descale_p1 = { __4X(1 << (DESCALE_P1 - 1)) }, + pd_descale_p2 = { __4X(1 << (DESCALE_P2 - 1)) }; + __vector unsigned int descale_p1 = { __4X(DESCALE_P1) }, + descale_p2 = { __4X(DESCALE_P2) }; + + /* Pass 1: process rows. */ + + row0 = *(__vector short *)&data[0]; + row1 = *(__vector short *)&data[8]; + row2 = *(__vector short *)&data[16]; + row3 = *(__vector short *)&data[24]; + row4 = *(__vector short *)&data[32]; + row5 = *(__vector short *)&data[40]; + row6 = *(__vector short *)&data[48]; + row7 = *(__vector short *)&data[56]; + + TRANSPOSE(row, col); + + tmp0 = vec_add(col0, col7); + tmp7 = vec_sub(col0, col7); + tmp1 = vec_add(col1, col6); + tmp6 = vec_sub(col1, col6); + tmp2 = vec_add(col2, col5); + tmp5 = vec_sub(col2, col5); + tmp3 = vec_add(col3, col4); + tmp4 = vec_sub(col3, col4); + + DO_FDCT_ROWS(); + + /* Pass 2: process columns. */ + + TRANSPOSE(out, row); + + tmp0 = vec_add(row0, row7); + tmp7 = vec_sub(row0, row7); + tmp1 = vec_add(row1, row6); + tmp6 = vec_sub(row1, row6); + tmp2 = vec_add(row2, row5); + tmp5 = vec_sub(row2, row5); + tmp3 = vec_add(row3, row4); + tmp4 = vec_sub(row3, row4); + + DO_FDCT_COLS(); + + *(__vector short *)&data[0] = out0; + *(__vector short *)&data[8] = out1; + *(__vector short *)&data[16] = out2; + *(__vector short *)&data[24] = out3; + *(__vector short *)&data[32] = out4; + *(__vector short *)&data[40] = out5; + *(__vector short *)&data[48] = out6; + *(__vector short *)&data[56] = out7; +} diff --git a/simd/jidctfst-altivec.c b/simd/jidctfst-altivec.c new file mode 100644 index 00000000..f7749b84 --- /dev/null +++ b/simd/jidctfst-altivec.c @@ -0,0 +1,226 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* FAST INTEGER INVERSE DCT + * + * This is similar to the SSE2 implementation, except that we left-shift the + * constants by 1 less bit (the -1 in CONST_SHIFT.) This is because + * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of: + * the elements in arg3 + the most significant 17 bits of + * (the elements in arg1 * the elements in arg2). + */ + +#include "jsimd_altivec.h" + + +#define F_1_082 277 /* FIX(1.082392200) */ +#define F_1_414 362 /* FIX(1.414213562) */ +#define F_1_847 473 /* FIX(1.847759065) */ +#define F_2_613 669 /* FIX(2.613125930) */ +#define F_1_613 (F_2_613 - 256) /* FIX(2.613125930) - FIX(1) */ + +#define CONST_BITS 8 +#define PASS1_BITS 2 +#define PRE_MULTIPLY_SCALE_BITS 2 +#define CONST_SHIFT (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS - 1) + + +#define DO_IDCT(in) \ +{ \ + /* Even part */ \ + \ + tmp10 = vec_add(in##0, in##4); \ + tmp11 = vec_sub(in##0, in##4); \ + tmp13 = vec_add(in##2, in##6); \ + \ + tmp12 = vec_sub(in##2, in##6); \ + tmp12 = vec_sl(tmp12, pre_multiply_scale_bits); \ + tmp12 = vec_madds(tmp12, pw_F1414, zero); \ + tmp12 = vec_sub(tmp12, tmp13); \ + \ + tmp0 = vec_add(tmp10, tmp13); \ + tmp3 = vec_sub(tmp10, tmp13); \ + tmp1 = vec_add(tmp11, tmp12); \ + tmp2 = vec_sub(tmp11, tmp12); \ + \ + /* Odd part */ \ + \ + z13 = vec_add(in##5, in##3); \ + z10 = vec_sub(in##5, in##3); \ + z10s = vec_sl(z10, pre_multiply_scale_bits); \ + z11 = vec_add(in##1, in##7); \ + z12s = vec_sub(in##1, in##7); \ + z12s = vec_sl(z12s, pre_multiply_scale_bits); \ + \ + tmp11 = vec_sub(z11, z13); \ + tmp11 = vec_sl(tmp11, pre_multiply_scale_bits); \ + tmp11 = vec_madds(tmp11, pw_F1414, zero); \ + \ + tmp7 = vec_add(z11, z13); \ + \ + z5 = vec_add(z10s, z12s); \ + z5 = vec_madds(z5, pw_F1847, zero); \ + \ + tmp10 = vec_madds(z12s, pw_F1082, zero); \ + tmp10 = vec_sub(tmp10, z5); \ + tmp12 = vec_madds(z10s, pw_MF1613, z5); \ + tmp12 = vec_sub(tmp12, z10); \ + \ + tmp6 = vec_sub(tmp12, tmp7); \ + tmp5 = vec_sub(tmp11, tmp6); \ + tmp4 = vec_add(tmp10, tmp5); \ + \ + out0 = vec_add(tmp0, tmp7); \ + out1 = vec_add(tmp1, tmp6); \ + out2 = vec_add(tmp2, tmp5); \ + out3 = vec_sub(tmp3, tmp4); \ + out4 = vec_add(tmp3, tmp4); \ + out5 = vec_sub(tmp2, tmp5); \ + out6 = vec_sub(tmp1, tmp6); \ + out7 = vec_sub(tmp0, tmp7); \ +} + + +void +jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + short *dct_table = (short *)dct_table_; + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + col0, col1, col2, col3, col4, col5, col6, col7, + quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, + tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, + z5, z10, z10s, z11, z12s, z13, + out0, out1, out2, out3, out4, out5, out6, out7; + __vector signed char outb; + long long *outptr, *outbptr = (long long *)(&outb); + + /* Constants */ + __vector short zero = { __8X(0) }, + pw_F1414 = { __8X(F_1_414 << CONST_SHIFT) }, + pw_F1847 = { __8X(F_1_847 << CONST_SHIFT) }, + pw_MF1613 = { __8X(-F_1_613 << CONST_SHIFT) }, + pw_F1082 = { __8X(F_1_082 << CONST_SHIFT) }; + __vector unsigned short + pre_multiply_scale_bits = { __8X(PRE_MULTIPLY_SCALE_BITS) }, + pass1_bits3 = { __8X(PASS1_BITS + 3) }; + __vector signed char pb_centerjsamp = { __16X(CENTERJSAMPLE) }; + + /* Pass 1: process columns. */ + + col0 = *(__vector short *)&coef_block[0]; + col1 = *(__vector short *)&coef_block[8]; + col2 = *(__vector short *)&coef_block[16]; + col3 = *(__vector short *)&coef_block[24]; + col4 = *(__vector short *)&coef_block[32]; + col5 = *(__vector short *)&coef_block[40]; + col6 = *(__vector short *)&coef_block[48]; + col7 = *(__vector short *)&coef_block[56]; + + tmp1 = vec_or(col1, col2); + tmp2 = vec_or(col3, col4); + tmp1 = vec_or(tmp1, tmp2); + tmp3 = vec_or(col5, col6); + tmp3 = vec_or(tmp3, col7); + tmp1 = vec_or(tmp1, tmp3); + + quant0 = *(__vector short *)&dct_table[0]; + col0 = vec_mladd(col0, quant0, zero); + + if (vec_all_eq(tmp1, zero)) { + /* AC terms all zero */ + + row0 = vec_splat(col0, 0); + row1 = vec_splat(col0, 1); + row2 = vec_splat(col0, 2); + row3 = vec_splat(col0, 3); + row4 = vec_splat(col0, 4); + row5 = vec_splat(col0, 5); + row6 = vec_splat(col0, 6); + row7 = vec_splat(col0, 7); + + } else { + + quant1 = *(__vector short *)&dct_table[8]; + quant2 = *(__vector short *)&dct_table[16]; + quant3 = *(__vector short *)&dct_table[24]; + quant4 = *(__vector short *)&dct_table[32]; + quant5 = *(__vector short *)&dct_table[40]; + quant6 = *(__vector short *)&dct_table[48]; + quant7 = *(__vector short *)&dct_table[56]; + + col1 = vec_mladd(col1, quant1, zero); + col2 = vec_mladd(col2, quant2, zero); + col3 = vec_mladd(col3, quant3, zero); + col4 = vec_mladd(col4, quant4, zero); + col5 = vec_mladd(col5, quant5, zero); + col6 = vec_mladd(col6, quant6, zero); + col7 = vec_mladd(col7, quant7, zero); + + DO_IDCT(col); + + TRANSPOSE(out, row); + } + + /* Pass 2: process rows. */ + + DO_IDCT(row); + + out0 = vec_sra(out0, pass1_bits3); + out1 = vec_sra(out1, pass1_bits3); + out2 = vec_sra(out2, pass1_bits3); + out3 = vec_sra(out3, pass1_bits3); + out4 = vec_sra(out4, pass1_bits3); + out5 = vec_sra(out5, pass1_bits3); + out6 = vec_sra(out6, pass1_bits3); + out7 = vec_sra(out7, pass1_bits3); + + TRANSPOSE(out, col); + + outb = vec_packs(col0, col1); + outb = vec_add(outb, pb_centerjsamp); + outptr = (long long *)(output_buf[0] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[1] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col2, col3); + outb = vec_add(outb, pb_centerjsamp); + outptr = (long long *)(output_buf[2] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[3] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col4, col5); + outb = vec_add(outb, pb_centerjsamp); + outptr = (long long *)(output_buf[4] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[5] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col6, col7); + outb = vec_add(outb, pb_centerjsamp); + outptr = (long long *)(output_buf[6] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[7] + output_col); + *outptr = outbptr[1]; +} diff --git a/simd/jidctint-altivec.c b/simd/jidctint-altivec.c new file mode 100644 index 00000000..00c6c58d --- /dev/null +++ b/simd/jidctint-altivec.c @@ -0,0 +1,299 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* SLOW INTEGER INVERSE DCT */ + +#include "jsimd_altivec.h" + + +#define F_0_298 2446 /* FIX(0.298631336) */ +#define F_0_390 3196 /* FIX(0.390180644) */ +#define F_0_541 4433 /* FIX(0.541196100) */ +#define F_0_765 6270 /* FIX(0.765366865) */ +#define F_0_899 7373 /* FIX(0.899976223) */ +#define F_1_175 9633 /* FIX(1.175875602) */ +#define F_1_501 12299 /* FIX(1.501321110) */ +#define F_1_847 15137 /* FIX(1.847759065) */ +#define F_1_961 16069 /* FIX(1.961570560) */ +#define F_2_053 16819 /* FIX(2.053119869) */ +#define F_2_562 20995 /* FIX(2.562915447) */ +#define F_3_072 25172 /* FIX(3.072711026) */ + +#define CONST_BITS 13 +#define PASS1_BITS 2 +#define DESCALE_P1 (CONST_BITS - PASS1_BITS) +#define DESCALE_P2 (CONST_BITS + PASS1_BITS + 3) + + +#define DO_IDCT(in, PASS) \ +{ \ + /* Even part */ \ + \ + in##26l = vec_mergeh(in##2, in##6); \ + in##26h = vec_mergel(in##2, in##6); \ + \ + tmp3l = vec_msums(in##26l, pw_f130_f054, zero32); \ + tmp3h = vec_msums(in##26h, pw_f130_f054, zero32); \ + tmp2l = vec_msums(in##26l, pw_f054_mf130, zero32); \ + tmp2h = vec_msums(in##26h, pw_f054_mf130, zero32); \ + \ + tmp0 = vec_add(in##0, in##4); \ + tmp1 = vec_sub(in##0, in##4); \ + \ + tmp0l = vec_unpackh(tmp0); \ + tmp0h = vec_unpackl(tmp0); \ + tmp0l = vec_sl(tmp0l, const_bits); \ + tmp0h = vec_sl(tmp0h, const_bits); \ + tmp0l = vec_add(tmp0l, pd_descale_p##PASS); \ + tmp0h = vec_add(tmp0h, pd_descale_p##PASS); \ + \ + tmp10l = vec_add(tmp0l, tmp3l); \ + tmp10h = vec_add(tmp0h, tmp3h); \ + tmp13l = vec_sub(tmp0l, tmp3l); \ + tmp13h = vec_sub(tmp0h, tmp3h); \ + \ + tmp1l = vec_unpackh(tmp1); \ + tmp1h = vec_unpackl(tmp1); \ + tmp1l = vec_sl(tmp1l, const_bits); \ + tmp1h = vec_sl(tmp1h, const_bits); \ + tmp1l = vec_add(tmp1l, pd_descale_p##PASS); \ + tmp1h = vec_add(tmp1h, pd_descale_p##PASS); \ + \ + tmp11l = vec_add(tmp1l, tmp2l); \ + tmp11h = vec_add(tmp1h, tmp2h); \ + tmp12l = vec_sub(tmp1l, tmp2l); \ + tmp12h = vec_sub(tmp1h, tmp2h); \ + \ + /* Odd part */ \ + \ + z3 = vec_add(in##3, in##7); \ + z4 = vec_add(in##1, in##5); \ + \ + z34l = vec_mergeh(z3, z4); \ + z34h = vec_mergel(z3, z4); \ + \ + z3l = vec_msums(z34l, pw_mf078_f117, zero32); \ + z3h = vec_msums(z34h, pw_mf078_f117, zero32); \ + z4l = vec_msums(z34l, pw_f117_f078, zero32); \ + z4h = vec_msums(z34h, pw_f117_f078, zero32); \ + \ + in##71l = vec_mergeh(in##7, in##1); \ + in##71h = vec_mergel(in##7, in##1); \ + \ + tmp0l = vec_msums(in##71l, pw_mf060_mf089, z3l); \ + tmp0h = vec_msums(in##71h, pw_mf060_mf089, z3h); \ + tmp3l = vec_msums(in##71l, pw_mf089_f060, z4l); \ + tmp3h = vec_msums(in##71h, pw_mf089_f060, z4h); \ + \ + in##53l = vec_mergeh(in##5, in##3); \ + in##53h = vec_mergel(in##5, in##3); \ + \ + tmp1l = vec_msums(in##53l, pw_mf050_mf256, z4l); \ + tmp1h = vec_msums(in##53h, pw_mf050_mf256, z4h); \ + tmp2l = vec_msums(in##53l, pw_mf256_f050, z3l); \ + tmp2h = vec_msums(in##53h, pw_mf256_f050, z3h); \ + \ + /* Final output stage */ \ + \ + out0l = vec_add(tmp10l, tmp3l); \ + out0h = vec_add(tmp10h, tmp3h); \ + out7l = vec_sub(tmp10l, tmp3l); \ + out7h = vec_sub(tmp10h, tmp3h); \ + \ + out0l = vec_sra(out0l, descale_p##PASS); \ + out0h = vec_sra(out0h, descale_p##PASS); \ + out7l = vec_sra(out7l, descale_p##PASS); \ + out7h = vec_sra(out7h, descale_p##PASS); \ + \ + out0 = vec_pack(out0l, out0h); \ + out7 = vec_pack(out7l, out7h); \ + \ + out1l = vec_add(tmp11l, tmp2l); \ + out1h = vec_add(tmp11h, tmp2h); \ + out6l = vec_sub(tmp11l, tmp2l); \ + out6h = vec_sub(tmp11h, tmp2h); \ + \ + out1l = vec_sra(out1l, descale_p##PASS); \ + out1h = vec_sra(out1h, descale_p##PASS); \ + out6l = vec_sra(out6l, descale_p##PASS); \ + out6h = vec_sra(out6h, descale_p##PASS); \ + \ + out1 = vec_pack(out1l, out1h); \ + out6 = vec_pack(out6l, out6h); \ + \ + out2l = vec_add(tmp12l, tmp1l); \ + out2h = vec_add(tmp12h, tmp1h); \ + out5l = vec_sub(tmp12l, tmp1l); \ + out5h = vec_sub(tmp12h, tmp1h); \ + \ + out2l = vec_sra(out2l, descale_p##PASS); \ + out2h = vec_sra(out2h, descale_p##PASS); \ + out5l = vec_sra(out5l, descale_p##PASS); \ + out5h = vec_sra(out5h, descale_p##PASS); \ + \ + out2 = vec_pack(out2l, out2h); \ + out5 = vec_pack(out5l, out5h); \ + \ + out3l = vec_add(tmp13l, tmp0l); \ + out3h = vec_add(tmp13h, tmp0h); \ + out4l = vec_sub(tmp13l, tmp0l); \ + out4h = vec_sub(tmp13h, tmp0h); \ + \ + out3l = vec_sra(out3l, descale_p##PASS); \ + out3h = vec_sra(out3h, descale_p##PASS); \ + out4l = vec_sra(out4l, descale_p##PASS); \ + out4h = vec_sra(out4h, descale_p##PASS); \ + \ + out3 = vec_pack(out3l, out3h); \ + out4 = vec_pack(out4l, out4h); \ +} + + +void +jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + short *dct_table = (short *)dct_table_; + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + col0, col1, col2, col3, col4, col5, col6, col7, + quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, + tmp0, tmp1, tmp2, tmp3, z3, z4, + z34l, z34h, col71l, col71h, col26l, col26h, col53l, col53h, + row71l, row71h, row26l, row26h, row53l, row53h, + out0, out1, out2, out3, out4, out5, out6, out7; + __vector int tmp0l, tmp0h, tmp1l, tmp1h, tmp2l, tmp2h, tmp3l, tmp3h, + tmp10l, tmp10h, tmp11l, tmp11h, tmp12l, tmp12h, tmp13l, tmp13h, + z3l, z3h, z4l, z4h, + out0l, out0h, out1l, out1h, out2l, out2h, out3l, out3h, out4l, out4h, + out5l, out5h, out6l, out6h, out7l, out7h; + __vector signed char outb; + long long *outptr, *outbptr = (long long *)(&outb); + + /* Constants */ + __vector short zero16 = { __8X(0) }, + pw_f130_f054 = { __4X2(F_0_541 + F_0_765, F_0_541) }, + pw_f054_mf130 = { __4X2(F_0_541, F_0_541 - F_1_847) }, + pw_mf078_f117 = { __4X2(F_1_175 - F_1_961, F_1_175) }, + pw_f117_f078 = { __4X2(F_1_175, F_1_175 - F_0_390) }, + pw_mf060_mf089 = { __4X2(F_0_298 - F_0_899, -F_0_899) }, + pw_mf089_f060 = { __4X2(-F_0_899, F_1_501 - F_0_899) }, + pw_mf050_mf256 = { __4X2(F_2_053 - F_2_562, -F_2_562) }, + pw_mf256_f050 = { __4X2(-F_2_562, F_3_072 - F_2_562) }; + __vector unsigned short pass1_bits = { __8X(PASS1_BITS) }; + __vector int zero32 = { __4X(0) }, + pd_descale_p1 = { __4X(1 << (DESCALE_P1 - 1)) }, + pd_descale_p2 = { __4X(1 << (DESCALE_P2 - 1)) }; + __vector unsigned int descale_p1 = { __4X(DESCALE_P1) }, + descale_p2 = { __4X(DESCALE_P2) }, + const_bits = { __4X(CONST_BITS) }; + __vector signed char pb_centerjsamp = { __16X(CENTERJSAMPLE) }; + + /* Pass 1: process columns. */ + + col0 = *(__vector short *)&coef_block[0]; + col1 = *(__vector short *)&coef_block[8]; + col2 = *(__vector short *)&coef_block[16]; + col3 = *(__vector short *)&coef_block[24]; + col4 = *(__vector short *)&coef_block[32]; + col5 = *(__vector short *)&coef_block[40]; + col6 = *(__vector short *)&coef_block[48]; + col7 = *(__vector short *)&coef_block[56]; + + tmp1 = vec_or(col1, col2); + tmp2 = vec_or(col3, col4); + tmp1 = vec_or(tmp1, tmp2); + tmp3 = vec_or(col5, col6); + tmp3 = vec_or(tmp3, col7); + tmp1 = vec_or(tmp1, tmp3); + + quant0 = *(__vector short *)&dct_table[0]; + col0 = vec_mladd(col0, quant0, zero16); + + if (vec_all_eq(tmp1, zero16)) { + /* AC terms all zero */ + + col0 = vec_sl(col0, pass1_bits); + + row0 = vec_splat(col0, 0); + row1 = vec_splat(col0, 1); + row2 = vec_splat(col0, 2); + row3 = vec_splat(col0, 3); + row4 = vec_splat(col0, 4); + row5 = vec_splat(col0, 5); + row6 = vec_splat(col0, 6); + row7 = vec_splat(col0, 7); + + } else { + + quant1 = *(__vector short *)&dct_table[8]; + quant2 = *(__vector short *)&dct_table[16]; + quant3 = *(__vector short *)&dct_table[24]; + quant4 = *(__vector short *)&dct_table[32]; + quant5 = *(__vector short *)&dct_table[40]; + quant6 = *(__vector short *)&dct_table[48]; + quant7 = *(__vector short *)&dct_table[56]; + + col1 = vec_mladd(col1, quant1, zero16); + col2 = vec_mladd(col2, quant2, zero16); + col3 = vec_mladd(col3, quant3, zero16); + col4 = vec_mladd(col4, quant4, zero16); + col5 = vec_mladd(col5, quant5, zero16); + col6 = vec_mladd(col6, quant6, zero16); + col7 = vec_mladd(col7, quant7, zero16); + + DO_IDCT(col, 1); + + TRANSPOSE(out, row); + } + + DO_IDCT(row, 2); + + TRANSPOSE(out, col); + + outb = vec_packs(col0, col1); + outb = vec_add(outb, pb_centerjsamp); + outptr = (long long *)(output_buf[0] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[1] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col2, col3); + outb = vec_add(outb, pb_centerjsamp); + outptr = (long long *)(output_buf[2] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[3] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col4, col5); + outb = vec_add(outb, pb_centerjsamp); + outptr = (long long *)(output_buf[4] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[5] + output_col); + *outptr = outbptr[1]; + + outb = vec_packs(col6, col7); + outb = vec_add(outb, pb_centerjsamp); + outptr = (long long *)(output_buf[6] + output_col); + *outptr = outbptr[0]; + outptr = (long long *)(output_buf[7] + output_col); + *outptr = outbptr[1]; +} diff --git a/simd/jsimd_altivec.h b/simd/jsimd_altivec.h new file mode 100644 index 00000000..78705568 --- /dev/null +++ b/simd/jsimd_altivec.h @@ -0,0 +1,76 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +#define JPEG_INTERNALS +#include "../jinclude.h" +#include "../jpeglib.h" +#include "../jsimd.h" +#include "../jdct.h" +#include "../jsimddct.h" +#include "jsimd.h" +#include + + +/* Common code */ + +#define __4X(a) a, a, a, a +#define __4X2(a, b) a, b, a, b, a, b, a, b +#define __8X(a) __4X(a), __4X(a) +#define __16X(a) __8X(a), __8X(a) + +#define TRANSPOSE(row, col) \ +{ \ + __vector short row04l, row04h, row15l, row15h, \ + row26l, row26h, row37l, row37h; \ + __vector short col01e, col01o, col23e, col23o, \ + col45e, col45o, col67e, col67o; \ + \ + /* transpose coefficients (phase 1) */ \ + row04l = vec_mergeh(row##0, row##4); /* row04l=(00 40 01 41 02 42 03 43) */ \ + row04h = vec_mergel(row##0, row##4); /* row04h=(04 44 05 45 06 46 07 47) */ \ + row15l = vec_mergeh(row##1, row##5); /* row15l=(10 50 11 51 12 52 13 53) */ \ + row15h = vec_mergel(row##1, row##5); /* row15h=(14 54 15 55 16 56 17 57) */ \ + row26l = vec_mergeh(row##2, row##6); /* row26l=(20 60 21 61 22 62 23 63) */ \ + row26h = vec_mergel(row##2, row##6); /* row26h=(24 64 25 65 26 66 27 67) */ \ + row37l = vec_mergeh(row##3, row##7); /* row37l=(30 70 31 71 32 72 33 73) */ \ + row37h = vec_mergel(row##3, row##7); /* row37h=(34 74 35 75 36 76 37 77) */ \ + \ + /* transpose coefficients (phase 2) */ \ + col01e = vec_mergeh(row04l, row26l); /* col01e=(00 20 40 60 01 21 41 61) */ \ + col23e = vec_mergel(row04l, row26l); /* col23e=(02 22 42 62 03 23 43 63) */ \ + col45e = vec_mergeh(row04h, row26h); /* col45e=(04 24 44 64 05 25 45 65) */ \ + col67e = vec_mergel(row04h, row26h); /* col67e=(06 26 46 66 07 27 47 67) */ \ + col01o = vec_mergeh(row15l, row37l); /* col01o=(10 30 50 70 11 31 51 71) */ \ + col23o = vec_mergel(row15l, row37l); /* col23o=(12 32 52 72 13 33 53 73) */ \ + col45o = vec_mergeh(row15h, row37h); /* col45o=(14 34 54 74 15 35 55 75) */ \ + col67o = vec_mergel(row15h, row37h); /* col67o=(16 36 56 76 17 37 57 77) */ \ + \ + /* transpose coefficients (phase 3) */ \ + col##0 = vec_mergeh(col01e, col01o); /* col0=(00 10 20 30 40 50 60 70) */ \ + col##1 = vec_mergel(col01e, col01o); /* col1=(01 11 21 31 41 51 61 71) */ \ + col##2 = vec_mergeh(col23e, col23o); /* col2=(02 12 22 32 42 52 62 72) */ \ + col##3 = vec_mergel(col23e, col23o); /* col3=(03 13 23 33 43 53 63 73) */ \ + col##4 = vec_mergeh(col45e, col45o); /* col4=(04 14 24 34 44 54 64 74) */ \ + col##5 = vec_mergel(col45e, col45o); /* col5=(05 15 25 35 45 55 65 75) */ \ + col##6 = vec_mergeh(col67e, col67o); /* col6=(06 16 26 36 46 56 66 76) */ \ + col##7 = vec_mergel(col67e, col67o); /* col7=(07 17 27 37 47 57 67 77) */ \ +} diff --git a/simd/jsimd_powerpc_altivec.c b/simd/jsimd_powerpc_altivec.c deleted file mode 100644 index 7796b707..00000000 --- a/simd/jsimd_powerpc_altivec.c +++ /dev/null @@ -1,862 +0,0 @@ -/* - * AltiVec optimizations for libjpeg-turbo - * - * Copyright (C) 2014, D. R. Commander. - * All rights reserved. - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -#define JPEG_INTERNALS -#include "../jinclude.h" -#include "../jpeglib.h" -#include "../jsimd.h" -#include "../jdct.h" -#include "../jsimddct.h" -#include "jsimd.h" -#include - - -/* Common code */ - -#define __4X(a) a, a, a, a -#define __4X2(a, b) a, b, a, b, a, b, a, b -#define __8X(a) __4X(a), __4X(a) -#define __16X(a) __8X(a), __8X(a) - -#define TRANSPOSE(row, col) \ -{ \ - __vector short row04l, row04h, row15l, row15h, \ - row26l, row26h, row37l, row37h; \ - __vector short col01e, col01o, col23e, col23o, \ - col45e, col45o, col67e, col67o; \ - \ - /* transpose coefficients (phase 1) */ \ - row04l = vec_mergeh(row##0, row##4); /* row04l=(00 40 01 41 02 42 03 43) */ \ - row04h = vec_mergel(row##0, row##4); /* row04h=(04 44 05 45 06 46 07 47) */ \ - row15l = vec_mergeh(row##1, row##5); /* row15l=(10 50 11 51 12 52 13 53) */ \ - row15h = vec_mergel(row##1, row##5); /* row15h=(14 54 15 55 16 56 17 57) */ \ - row26l = vec_mergeh(row##2, row##6); /* row26l=(20 60 21 61 22 62 23 63) */ \ - row26h = vec_mergel(row##2, row##6); /* row26h=(24 64 25 65 26 66 27 67) */ \ - row37l = vec_mergeh(row##3, row##7); /* row37l=(30 70 31 71 32 72 33 73) */ \ - row37h = vec_mergel(row##3, row##7); /* row37h=(34 74 35 75 36 76 37 77) */ \ - \ - /* transpose coefficients (phase 2) */ \ - col01e = vec_mergeh(row04l, row26l); /* col01e=(00 20 40 60 01 21 41 61) */ \ - col23e = vec_mergel(row04l, row26l); /* col23e=(02 22 42 62 03 23 43 63) */ \ - col45e = vec_mergeh(row04h, row26h); /* col45e=(04 24 44 64 05 25 45 65) */ \ - col67e = vec_mergel(row04h, row26h); /* col67e=(06 26 46 66 07 27 47 67) */ \ - col01o = vec_mergeh(row15l, row37l); /* col01o=(10 30 50 70 11 31 51 71) */ \ - col23o = vec_mergel(row15l, row37l); /* col23o=(12 32 52 72 13 33 53 73) */ \ - col45o = vec_mergeh(row15h, row37h); /* col45o=(14 34 54 74 15 35 55 75) */ \ - col67o = vec_mergel(row15h, row37h); /* col67o=(16 36 56 76 17 37 57 77) */ \ - \ - /* transpose coefficients (phase 3) */ \ - col##0 = vec_mergeh(col01e, col01o); /* col0=(00 10 20 30 40 50 60 70) */ \ - col##1 = vec_mergel(col01e, col01o); /* col1=(01 11 21 31 41 51 61 71) */ \ - col##2 = vec_mergeh(col23e, col23o); /* col2=(02 12 22 32 42 52 62 72) */ \ - col##3 = vec_mergel(col23e, col23o); /* col3=(03 13 23 33 43 53 63 73) */ \ - col##4 = vec_mergeh(col45e, col45o); /* col4=(04 14 24 34 44 54 64 74) */ \ - col##5 = vec_mergel(col45e, col45o); /* col5=(05 15 25 35 45 55 65 75) */ \ - col##6 = vec_mergeh(col67e, col67o); /* col6=(06 16 26 36 46 56 66 76) */ \ - col##7 = vec_mergel(col67e, col67o); /* col7=(07 17 27 37 47 57 67 77) */ \ -} - - -/* SLOW INTEGER FORWARD DCT */ - -#define ISLOW_F_0_298 2446 /* FIX(0.298631336) */ -#define ISLOW_F_0_390 3196 /* FIX(0.390180644) */ -#define ISLOW_F_0_541 4433 /* FIX(0.541196100) */ -#define ISLOW_F_0_765 6270 /* FIX(0.765366865) */ -#define ISLOW_F_0_899 7373 /* FIX(0.899976223) */ -#define ISLOW_F_1_175 9633 /* FIX(1.175875602) */ -#define ISLOW_F_1_501 12299 /* FIX(1.501321110) */ -#define ISLOW_F_1_847 15137 /* FIX(1.847759065) */ -#define ISLOW_F_1_961 16069 /* FIX(1.961570560) */ -#define ISLOW_F_2_053 16819 /* FIX(2.053119869) */ -#define ISLOW_F_2_562 20995 /* FIX(2.562915447) */ -#define ISLOW_F_3_072 25172 /* FIX(3.072711026) */ - -#define ISLOW_CONST_BITS 13 -#define ISLOW_PASS1_BITS 2 -#define ISLOW_DESCALE_P1 (ISLOW_CONST_BITS - ISLOW_PASS1_BITS) -#define ISLOW_DESCALE_P2 (ISLOW_CONST_BITS + ISLOW_PASS1_BITS) - -#define DO_FDCT_ISLOW_COMMON(PASS) \ -{ \ - tmp1312l = vec_mergeh(tmp13, tmp12); \ - tmp1312h = vec_mergel(tmp13, tmp12); \ - \ - out2l = vec_msums(tmp1312l, PW_F130_F054, PD_DESCALE_P##PASS); \ - out2h = vec_msums(tmp1312h, PW_F130_F054, PD_DESCALE_P##PASS); \ - out6l = vec_msums(tmp1312l, PW_F054_MF130, PD_DESCALE_P##PASS); \ - out6h = vec_msums(tmp1312h, PW_F054_MF130, PD_DESCALE_P##PASS); \ - \ - out2l = vec_sra(out2l, DESCALE_P##PASS); \ - out2h = vec_sra(out2h, DESCALE_P##PASS); \ - out6l = vec_sra(out6l, DESCALE_P##PASS); \ - out6h = vec_sra(out6h, DESCALE_P##PASS); \ - \ - out2 = vec_pack(out2l, out2h); \ - out6 = vec_pack(out6l, out6h); \ - \ - /* Odd part */ \ - \ - z3 = vec_add(tmp4, tmp6); \ - z4 = vec_add(tmp5, tmp7); \ - \ - z34l = vec_mergeh(z3, z4); \ - z34h = vec_mergel(z3, z4); \ - \ - z3l = vec_msums(z34l, PW_MF078_F117, PD_DESCALE_P##PASS); \ - z3h = vec_msums(z34h, PW_MF078_F117, PD_DESCALE_P##PASS); \ - z4l = vec_msums(z34l, PW_F117_F078, PD_DESCALE_P##PASS); \ - z4h = vec_msums(z34h, PW_F117_F078, PD_DESCALE_P##PASS); \ - \ - tmp47l = vec_mergeh(tmp4, tmp7); \ - tmp47h = vec_mergel(tmp4, tmp7); \ - \ - out7l = vec_msums(tmp47l, PW_MF060_MF089, z3l); \ - out7h = vec_msums(tmp47h, PW_MF060_MF089, z3h); \ - out1l = vec_msums(tmp47l, PW_MF089_F060, z4l); \ - out1h = vec_msums(tmp47h, PW_MF089_F060, z4h); \ - \ - out7l = vec_sra(out7l, DESCALE_P##PASS); \ - out7h = vec_sra(out7h, DESCALE_P##PASS); \ - out1l = vec_sra(out1l, DESCALE_P##PASS); \ - out1h = vec_sra(out1h, DESCALE_P##PASS); \ - \ - out7 = vec_pack(out7l, out7h); \ - out1 = vec_pack(out1l, out1h); \ - \ - tmp56l = vec_mergeh(tmp5, tmp6); \ - tmp56h = vec_mergel(tmp5, tmp6); \ - \ - out5l = vec_msums(tmp56l, PW_MF050_MF256, z4l); \ - out5h = vec_msums(tmp56h, PW_MF050_MF256, z4h); \ - out3l = vec_msums(tmp56l, PW_MF256_F050, z3l); \ - out3h = vec_msums(tmp56h, PW_MF256_F050, z3h); \ - \ - out5l = vec_sra(out5l, DESCALE_P##PASS); \ - out5h = vec_sra(out5h, DESCALE_P##PASS); \ - out3l = vec_sra(out3l, DESCALE_P##PASS); \ - out3h = vec_sra(out3h, DESCALE_P##PASS); \ - \ - out5 = vec_pack(out5l, out5h); \ - out3 = vec_pack(out3l, out3h); \ -} - -#define DO_FDCT_ISLOW_ROWS() \ -{ \ - /* Even part */ \ - \ - tmp10 = vec_add(tmp0, tmp3); \ - tmp13 = vec_sub(tmp0, tmp3); \ - tmp11 = vec_add(tmp1, tmp2); \ - tmp12 = vec_sub(tmp1, tmp2); \ - \ - out0 = vec_add(tmp10, tmp11); \ - out0 = vec_sl(out0, PASS1_BITS); \ - out4 = vec_sub(tmp10, tmp11); \ - out4 = vec_sl(out4, PASS1_BITS); \ - \ - DO_FDCT_ISLOW_COMMON(1); \ -} - -#define DO_FDCT_ISLOW_COLS() \ -{ \ - /* Even part */ \ - \ - tmp10 = vec_add(tmp0, tmp3); \ - tmp13 = vec_sub(tmp0, tmp3); \ - tmp11 = vec_add(tmp1, tmp2); \ - tmp12 = vec_sub(tmp1, tmp2); \ - \ - out0 = vec_add(tmp10, tmp11); \ - out0 = vec_add(out0, PW_DESCALE_P2X); \ - out0 = vec_sra(out0, PASS1_BITS); \ - out4 = vec_sub(tmp10, tmp11); \ - out4 = vec_add(out4, PW_DESCALE_P2X); \ - out4 = vec_sra(out4, PASS1_BITS); \ - \ - DO_FDCT_ISLOW_COMMON(2); \ -} - -void -jsimd_fdct_islow_altivec (DCTELEM *data) -{ - __vector short row0, row1, row2, row3, row4, row5, row6, row7, - col0, col1, col2, col3, col4, col5, col6, col7, - tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, - tmp47l, tmp47h, tmp56l, tmp56h, tmp1312l, tmp1312h, - z3, z4, z34l, z34h, - out0, out1, out2, out3, out4, out5, out6, out7; - __vector int z3l, z3h, z4l, z4h, - out1l, out1h, out2l, out2h, out3l, out3h, out5l, out5h, out6l, out6h, - out7l, out7h; - - /* Constants */ - __vector short - PW_F130_F054 = { __4X2(ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541) }, - PW_F054_MF130 = { __4X2(ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847) }, - PW_MF078_F117 = { __4X2(ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175) }, - PW_F117_F078 = { __4X2(ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390) }, - PW_MF060_MF089 = { __4X2(ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899) }, - PW_MF089_F060 = { __4X2(-ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899) }, - PW_MF050_MF256 = { __4X2(ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562) }, - PW_MF256_F050 = { __4X2(-ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562) }, - PW_DESCALE_P2X = { __8X(1 << (ISLOW_PASS1_BITS - 1)) }; - __vector unsigned short PASS1_BITS = { __8X(ISLOW_PASS1_BITS) }; - __vector int PD_DESCALE_P1 = { __4X(1 << (ISLOW_DESCALE_P1 - 1)) }, - PD_DESCALE_P2 = { __4X(1 << (ISLOW_DESCALE_P2 - 1)) }; - __vector unsigned int DESCALE_P1 = { __4X(ISLOW_DESCALE_P1) }, - DESCALE_P2 = { __4X(ISLOW_DESCALE_P2) }; - - /* Pass 1: process rows. */ - - row0 = *(__vector short *)&data[0]; - row1 = *(__vector short *)&data[8]; - row2 = *(__vector short *)&data[16]; - row3 = *(__vector short *)&data[24]; - row4 = *(__vector short *)&data[32]; - row5 = *(__vector short *)&data[40]; - row6 = *(__vector short *)&data[48]; - row7 = *(__vector short *)&data[56]; - - TRANSPOSE(row, col); - - tmp0 = vec_add(col0, col7); - tmp7 = vec_sub(col0, col7); - tmp1 = vec_add(col1, col6); - tmp6 = vec_sub(col1, col6); - tmp2 = vec_add(col2, col5); - tmp5 = vec_sub(col2, col5); - tmp3 = vec_add(col3, col4); - tmp4 = vec_sub(col3, col4); - - DO_FDCT_ISLOW_ROWS(); - - /* Pass 2: process columns. */ - - TRANSPOSE(out, row); - - tmp0 = vec_add(row0, row7); - tmp7 = vec_sub(row0, row7); - tmp1 = vec_add(row1, row6); - tmp6 = vec_sub(row1, row6); - tmp2 = vec_add(row2, row5); - tmp5 = vec_sub(row2, row5); - tmp3 = vec_add(row3, row4); - tmp4 = vec_sub(row3, row4); - - DO_FDCT_ISLOW_COLS(); - - *(__vector short *)&data[0] = out0; - *(__vector short *)&data[8] = out1; - *(__vector short *)&data[16] = out2; - *(__vector short *)&data[24] = out3; - *(__vector short *)&data[32] = out4; - *(__vector short *)&data[40] = out5; - *(__vector short *)&data[48] = out6; - *(__vector short *)&data[56] = out7; -} - - -/* FAST INTEGER FORWARD DCT - * - * This is similar to the SSE2 implementation, except that we left-shift the - * constants by 1 less bit (the -1 in IFAST_CONST_SHIFT.) This is because - * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of: - * the elements in arg3 + the most significant 17 bits of - * (the elements in arg1 * the elements in arg2). - */ - -#define IFAST_F_0_382 98 /* FIX(0.382683433) */ -#define IFAST_F_0_541 139 /* FIX(0.541196100) */ -#define IFAST_F_0_707 181 /* FIX(0.707106781) */ -#define IFAST_F_1_306 334 /* FIX(1.306562965) */ - -#define IFAST_CONST_BITS 8 -#define IFAST_PRE_MULTIPLY_SCALE_BITS 2 -#define IFAST_CONST_SHIFT \ - (16 - IFAST_PRE_MULTIPLY_SCALE_BITS - IFAST_CONST_BITS - 1) - -#define DO_FDCT_IFAST() \ -{ \ - /* Even part */ \ - \ - tmp10 = vec_add(tmp0, tmp3); \ - tmp13 = vec_sub(tmp0, tmp3); \ - tmp11 = vec_add(tmp1, tmp2); \ - tmp12 = vec_sub(tmp1, tmp2); \ - \ - out0 = vec_add(tmp10, tmp11); \ - out4 = vec_sub(tmp10, tmp11); \ - \ - z1 = vec_add(tmp12, tmp13); \ - z1 = vec_sl(z1, PRE_MULTIPLY_SCALE_BITS); \ - z1 = vec_madds(z1, PW_0707, zero); \ - \ - out2 = vec_add(tmp13, z1); \ - out6 = vec_sub(tmp13, z1); \ - \ - /* Odd part */ \ - \ - tmp10 = vec_add(tmp4, tmp5); \ - tmp11 = vec_add(tmp5, tmp6); \ - tmp12 = vec_add(tmp6, tmp7); \ - \ - tmp10 = vec_sl(tmp10, PRE_MULTIPLY_SCALE_BITS); \ - tmp12 = vec_sl(tmp12, PRE_MULTIPLY_SCALE_BITS); \ - z5 = vec_sub(tmp10, tmp12); \ - z5 = vec_madds(z5, PW_0382, zero); \ - \ - z2 = vec_madds(tmp10, PW_0541, z5); \ - z4 = vec_madds(tmp12, PW_1306, z5); \ - \ - tmp11 = vec_sl(tmp11, PRE_MULTIPLY_SCALE_BITS); \ - z3 = vec_madds(tmp11, PW_0707, zero); \ - \ - z11 = vec_add(tmp7, z3); \ - z13 = vec_sub(tmp7, z3); \ - \ - out5 = vec_add(z13, z2); \ - out3 = vec_sub(z13, z2); \ - out1 = vec_add(z11, z4); \ - out7 = vec_sub(z11, z4); \ -} - -void -jsimd_fdct_ifast_altivec (DCTELEM *data) -{ - __vector short row0, row1, row2, row3, row4, row5, row6, row7, - col0, col1, col2, col3, col4, col5, col6, col7, - tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, - z1, z2, z3, z4, z5, z11, z13, - out0, out1, out2, out3, out4, out5, out6, out7; - - /* Constants */ - __vector short zero = vec_splat_s16(0), - PW_0382 = { __8X(IFAST_F_0_382 << IFAST_CONST_SHIFT) }, - PW_0541 = { __8X(IFAST_F_0_541 << IFAST_CONST_SHIFT) }, - PW_0707 = { __8X(IFAST_F_0_707 << IFAST_CONST_SHIFT) }, - PW_1306 = { __8X(IFAST_F_1_306 << IFAST_CONST_SHIFT) }; - __vector unsigned short - PRE_MULTIPLY_SCALE_BITS = { __8X(IFAST_PRE_MULTIPLY_SCALE_BITS) }; - - /* Pass 1: process rows. */ - - row0 = *(__vector short *)&data[0]; - row1 = *(__vector short *)&data[8]; - row2 = *(__vector short *)&data[16]; - row3 = *(__vector short *)&data[24]; - row4 = *(__vector short *)&data[32]; - row5 = *(__vector short *)&data[40]; - row6 = *(__vector short *)&data[48]; - row7 = *(__vector short *)&data[56]; - - TRANSPOSE(row, col); - - tmp0 = vec_add(col0, col7); - tmp7 = vec_sub(col0, col7); - tmp1 = vec_add(col1, col6); - tmp6 = vec_sub(col1, col6); - tmp2 = vec_add(col2, col5); - tmp5 = vec_sub(col2, col5); - tmp3 = vec_add(col3, col4); - tmp4 = vec_sub(col3, col4); - - DO_FDCT_IFAST(); - - /* Pass 2: process columns. */ - - TRANSPOSE(out, row); - - tmp0 = vec_add(row0, row7); - tmp7 = vec_sub(row0, row7); - tmp1 = vec_add(row1, row6); - tmp6 = vec_sub(row1, row6); - tmp2 = vec_add(row2, row5); - tmp5 = vec_sub(row2, row5); - tmp3 = vec_add(row3, row4); - tmp4 = vec_sub(row3, row4); - - DO_FDCT_IFAST(); - - *(__vector short *)&data[0] = out0; - *(__vector short *)&data[8] = out1; - *(__vector short *)&data[16] = out2; - *(__vector short *)&data[24] = out3; - *(__vector short *)&data[32] = out4; - *(__vector short *)&data[40] = out5; - *(__vector short *)&data[48] = out6; - *(__vector short *)&data[56] = out7; -} - - -/* SLOW INTEGER INVERSE DCT */ - -#define DO_IDCT_ISLOW(in, PASS) \ -{ \ - /* Even part */ \ - \ - in##26l = vec_mergeh(in##2, in##6); \ - in##26h = vec_mergel(in##2, in##6); \ - \ - tmp3l = vec_msums(in##26l, PW_F130_F054, zero32); \ - tmp3h = vec_msums(in##26h, PW_F130_F054, zero32); \ - tmp2l = vec_msums(in##26l, PW_F054_MF130, zero32); \ - tmp2h = vec_msums(in##26h, PW_F054_MF130, zero32); \ - \ - tmp0 = vec_add(in##0, in##4); \ - tmp1 = vec_sub(in##0, in##4); \ - \ - tmp0l = vec_unpackh(tmp0); \ - tmp0h = vec_unpackl(tmp0); \ - tmp0l = vec_sl(tmp0l, CONST_BITS); \ - tmp0h = vec_sl(tmp0h, CONST_BITS); \ - tmp0l = vec_add(tmp0l, PD_DESCALE_P##PASS); \ - tmp0h = vec_add(tmp0h, PD_DESCALE_P##PASS); \ - \ - tmp10l = vec_add(tmp0l, tmp3l); \ - tmp10h = vec_add(tmp0h, tmp3h); \ - tmp13l = vec_sub(tmp0l, tmp3l); \ - tmp13h = vec_sub(tmp0h, tmp3h); \ - \ - tmp1l = vec_unpackh(tmp1); \ - tmp1h = vec_unpackl(tmp1); \ - tmp1l = vec_sl(tmp1l, CONST_BITS); \ - tmp1h = vec_sl(tmp1h, CONST_BITS); \ - tmp1l = vec_add(tmp1l, PD_DESCALE_P##PASS); \ - tmp1h = vec_add(tmp1h, PD_DESCALE_P##PASS); \ - \ - tmp11l = vec_add(tmp1l, tmp2l); \ - tmp11h = vec_add(tmp1h, tmp2h); \ - tmp12l = vec_sub(tmp1l, tmp2l); \ - tmp12h = vec_sub(tmp1h, tmp2h); \ - \ - /* Odd part */ \ - \ - z3 = vec_add(in##3, in##7); \ - z4 = vec_add(in##1, in##5); \ - \ - z34l = vec_mergeh(z3, z4); \ - z34h = vec_mergel(z3, z4); \ - \ - z3l = vec_msums(z34l, PW_MF078_F117, zero32); \ - z3h = vec_msums(z34h, PW_MF078_F117, zero32); \ - z4l = vec_msums(z34l, PW_F117_F078, zero32); \ - z4h = vec_msums(z34h, PW_F117_F078, zero32); \ - \ - in##71l = vec_mergeh(in##7, in##1); \ - in##71h = vec_mergel(in##7, in##1); \ - \ - tmp0l = vec_msums(in##71l, PW_MF060_MF089, z3l); \ - tmp0h = vec_msums(in##71h, PW_MF060_MF089, z3h); \ - tmp3l = vec_msums(in##71l, PW_MF089_F060, z4l); \ - tmp3h = vec_msums(in##71h, PW_MF089_F060, z4h); \ - \ - in##53l = vec_mergeh(in##5, in##3); \ - in##53h = vec_mergel(in##5, in##3); \ - \ - tmp1l = vec_msums(in##53l, PW_MF050_MF256, z4l); \ - tmp1h = vec_msums(in##53h, PW_MF050_MF256, z4h); \ - tmp2l = vec_msums(in##53l, PW_MF256_F050, z3l); \ - tmp2h = vec_msums(in##53h, PW_MF256_F050, z3h); \ - \ - /* Final output stage */ \ - \ - out0l = vec_add(tmp10l, tmp3l); \ - out0h = vec_add(tmp10h, tmp3h); \ - out7l = vec_sub(tmp10l, tmp3l); \ - out7h = vec_sub(tmp10h, tmp3h); \ - \ - out0l = vec_sra(out0l, DESCALE_P##PASS); \ - out0h = vec_sra(out0h, DESCALE_P##PASS); \ - out7l = vec_sra(out7l, DESCALE_P##PASS); \ - out7h = vec_sra(out7h, DESCALE_P##PASS); \ - \ - out0 = vec_pack(out0l, out0h); \ - out7 = vec_pack(out7l, out7h); \ - \ - out1l = vec_add(tmp11l, tmp2l); \ - out1h = vec_add(tmp11h, tmp2h); \ - out6l = vec_sub(tmp11l, tmp2l); \ - out6h = vec_sub(tmp11h, tmp2h); \ - \ - out1l = vec_sra(out1l, DESCALE_P##PASS); \ - out1h = vec_sra(out1h, DESCALE_P##PASS); \ - out6l = vec_sra(out6l, DESCALE_P##PASS); \ - out6h = vec_sra(out6h, DESCALE_P##PASS); \ - \ - out1 = vec_pack(out1l, out1h); \ - out6 = vec_pack(out6l, out6h); \ - \ - out2l = vec_add(tmp12l, tmp1l); \ - out2h = vec_add(tmp12h, tmp1h); \ - out5l = vec_sub(tmp12l, tmp1l); \ - out5h = vec_sub(tmp12h, tmp1h); \ - \ - out2l = vec_sra(out2l, DESCALE_P##PASS); \ - out2h = vec_sra(out2h, DESCALE_P##PASS); \ - out5l = vec_sra(out5l, DESCALE_P##PASS); \ - out5h = vec_sra(out5h, DESCALE_P##PASS); \ - \ - out2 = vec_pack(out2l, out2h); \ - out5 = vec_pack(out5l, out5h); \ - \ - out3l = vec_add(tmp13l, tmp0l); \ - out3h = vec_add(tmp13h, tmp0h); \ - out4l = vec_sub(tmp13l, tmp0l); \ - out4h = vec_sub(tmp13h, tmp0h); \ - \ - out3l = vec_sra(out3l, DESCALE_P##PASS); \ - out3h = vec_sra(out3h, DESCALE_P##PASS); \ - out4l = vec_sra(out4l, DESCALE_P##PASS); \ - out4h = vec_sra(out4h, DESCALE_P##PASS); \ - \ - out3 = vec_pack(out3l, out3h); \ - out4 = vec_pack(out4l, out4h); \ -} - -void -jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) -{ - short *dct_table = (short *)dct_table_; - __vector short row0, row1, row2, row3, row4, row5, row6, row7, - col0, col1, col2, col3, col4, col5, col6, col7, - quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, - tmp0, tmp1, tmp2, tmp3, z3, z4, - z34l, z34h, col71l, col71h, col26l, col26h, col53l, col53h, - row71l, row71h, row26l, row26h, row53l, row53h, - out0, out1, out2, out3, out4, out5, out6, out7; - __vector int tmp0l, tmp0h, tmp1l, tmp1h, tmp2l, tmp2h, tmp3l, tmp3h, - tmp10l, tmp10h, tmp11l, tmp11h, tmp12l, tmp12h, tmp13l, tmp13h, - z3l, z3h, z4l, z4h, - out0l, out0h, out1l, out1h, out2l, out2h, out3l, out3h, out4l, out4h, - out5l, out5h, out6l, out6h, out7l, out7h; - __vector signed char outb; - long long *outptr, *outbptr = (long long *)(&outb); - - /* Constants */ - __vector short zero16 = { __8X(0) }, - PW_F130_F054 = { __4X2(ISLOW_F_0_541 + ISLOW_F_0_765, ISLOW_F_0_541) }, - PW_F054_MF130 = { __4X2(ISLOW_F_0_541, ISLOW_F_0_541 - ISLOW_F_1_847) }, - PW_MF078_F117 = { __4X2(ISLOW_F_1_175 - ISLOW_F_1_961, ISLOW_F_1_175) }, - PW_F117_F078 = { __4X2(ISLOW_F_1_175, ISLOW_F_1_175 - ISLOW_F_0_390) }, - PW_MF060_MF089 = { __4X2(ISLOW_F_0_298 - ISLOW_F_0_899, -ISLOW_F_0_899) }, - PW_MF089_F060 = { __4X2(-ISLOW_F_0_899, ISLOW_F_1_501 - ISLOW_F_0_899) }, - PW_MF050_MF256 = { __4X2(ISLOW_F_2_053 - ISLOW_F_2_562, -ISLOW_F_2_562) }, - PW_MF256_F050 = { __4X2(-ISLOW_F_2_562, ISLOW_F_3_072 - ISLOW_F_2_562) }; - __vector unsigned short PASS1_BITS = { __8X(ISLOW_PASS1_BITS) }; - __vector int zero32 = { __4X(0) }, - PD_DESCALE_P1 = { __4X(1 << (ISLOW_DESCALE_P1 - 1)) }, - PD_DESCALE_P2 = { __4X(1 << (ISLOW_DESCALE_P2 + 3 - 1)) }; - __vector unsigned int DESCALE_P1 = { __4X(ISLOW_DESCALE_P1) }, - DESCALE_P2 = { __4X(ISLOW_DESCALE_P2 + 3) }, - CONST_BITS = { __4X(ISLOW_CONST_BITS) }; - __vector signed char PB_CENTERJSAMP = { __16X(CENTERJSAMPLE) }; - - /* Pass 1: process columns. */ - - col0 = *(__vector short *)&coef_block[0]; - col1 = *(__vector short *)&coef_block[8]; - col2 = *(__vector short *)&coef_block[16]; - col3 = *(__vector short *)&coef_block[24]; - col4 = *(__vector short *)&coef_block[32]; - col5 = *(__vector short *)&coef_block[40]; - col6 = *(__vector short *)&coef_block[48]; - col7 = *(__vector short *)&coef_block[56]; - - tmp1 = vec_or(col1, col2); - tmp2 = vec_or(col3, col4); - tmp1 = vec_or(tmp1, tmp2); - tmp3 = vec_or(col5, col6); - tmp3 = vec_or(tmp3, col7); - tmp1 = vec_or(tmp1, tmp3); - - quant0 = *(__vector short *)&dct_table[0]; - col0 = vec_mladd(col0, quant0, zero16); - - if (vec_all_eq(tmp1, zero16)) { - /* AC terms all zero */ - - col0 = vec_sl(col0, PASS1_BITS); - - row0 = vec_splat(col0, 0); - row1 = vec_splat(col0, 1); - row2 = vec_splat(col0, 2); - row3 = vec_splat(col0, 3); - row4 = vec_splat(col0, 4); - row5 = vec_splat(col0, 5); - row6 = vec_splat(col0, 6); - row7 = vec_splat(col0, 7); - - } else { - - quant1 = *(__vector short *)&dct_table[8]; - quant2 = *(__vector short *)&dct_table[16]; - quant3 = *(__vector short *)&dct_table[24]; - quant4 = *(__vector short *)&dct_table[32]; - quant5 = *(__vector short *)&dct_table[40]; - quant6 = *(__vector short *)&dct_table[48]; - quant7 = *(__vector short *)&dct_table[56]; - - col1 = vec_mladd(col1, quant1, zero16); - col2 = vec_mladd(col2, quant2, zero16); - col3 = vec_mladd(col3, quant3, zero16); - col4 = vec_mladd(col4, quant4, zero16); - col5 = vec_mladd(col5, quant5, zero16); - col6 = vec_mladd(col6, quant6, zero16); - col7 = vec_mladd(col7, quant7, zero16); - - DO_IDCT_ISLOW(col, 1); - - TRANSPOSE(out, row); - } - - DO_IDCT_ISLOW(row, 2); - - TRANSPOSE(out, col); - - outb = vec_packs(col0, col1); - outb = vec_add(outb, PB_CENTERJSAMP); - outptr = (long long *)(output_buf[0] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[1] + output_col); - *outptr = outbptr[1]; - - outb = vec_packs(col2, col3); - outb = vec_add(outb, PB_CENTERJSAMP); - outptr = (long long *)(output_buf[2] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[3] + output_col); - *outptr = outbptr[1]; - - outb = vec_packs(col4, col5); - outb = vec_add(outb, PB_CENTERJSAMP); - outptr = (long long *)(output_buf[4] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[5] + output_col); - *outptr = outbptr[1]; - - outb = vec_packs(col6, col7); - outb = vec_add(outb, PB_CENTERJSAMP); - outptr = (long long *)(output_buf[6] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[7] + output_col); - *outptr = outbptr[1]; -} - - -/* FAST INTEGER INVERSE DCT - * - * This is similar to the SSE2 implementation, except that we left-shift the - * constants by 1 less bit (the -1 in IFAST_CONST_SHIFT.) This is because - * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of: - * the elements in arg3 + the most significant 17 bits of - * (the elements in arg1 * the elements in arg2). - */ - -#define IFAST_F_1_082 277 /* FIX(1.082392200) */ -#define IFAST_F_1_414 362 /* FIX(1.414213562) */ -#define IFAST_F_1_847 473 /* FIX(1.847759065) */ -#define IFAST_F_2_613 669 /* FIX(2.613125930) */ -#define IFAST_F_1_613 (IFAST_F_2_613 - 256) /* FIX(2.613125930) - FIX(1) */ - -#define IFAST_PASS1_BITS 2 - -#define DO_IDCT_IFAST(in) \ -{ \ - /* Even part */ \ - \ - tmp10 = vec_add(in##0, in##4); \ - tmp11 = vec_sub(in##0, in##4); \ - tmp13 = vec_add(in##2, in##6); \ - \ - tmp12 = vec_sub(in##2, in##6); \ - tmp12 = vec_sl(tmp12, PRE_MULTIPLY_SCALE_BITS); \ - tmp12 = vec_madds(tmp12, PW_F1414, zero); \ - tmp12 = vec_sub(tmp12, tmp13); \ - \ - tmp0 = vec_add(tmp10, tmp13); \ - tmp3 = vec_sub(tmp10, tmp13); \ - tmp1 = vec_add(tmp11, tmp12); \ - tmp2 = vec_sub(tmp11, tmp12); \ - \ - /* Odd part */ \ - \ - z13 = vec_add(in##5, in##3); \ - z10 = vec_sub(in##5, in##3); \ - z10s = vec_sl(z10, PRE_MULTIPLY_SCALE_BITS); \ - z11 = vec_add(in##1, in##7); \ - z12s = vec_sub(in##1, in##7); \ - z12s = vec_sl(z12s, PRE_MULTIPLY_SCALE_BITS); \ - \ - tmp11 = vec_sub(z11, z13); \ - tmp11 = vec_sl(tmp11, PRE_MULTIPLY_SCALE_BITS); \ - tmp11 = vec_madds(tmp11, PW_F1414, zero); \ - \ - tmp7 = vec_add(z11, z13); \ - \ - z5 = vec_add(z10s, z12s); \ - z5 = vec_madds(z5, PW_F1847, zero); \ - \ - tmp10 = vec_madds(z12s, PW_F1082, zero); \ - tmp10 = vec_sub(tmp10, z5); \ - tmp12 = vec_madds(z10s, PW_MF1613, z5); \ - tmp12 = vec_sub(tmp12, z10); \ - \ - tmp6 = vec_sub(tmp12, tmp7); \ - tmp5 = vec_sub(tmp11, tmp6); \ - tmp4 = vec_add(tmp10, tmp5); \ - \ - out0 = vec_add(tmp0, tmp7); \ - out1 = vec_add(tmp1, tmp6); \ - out2 = vec_add(tmp2, tmp5); \ - out3 = vec_sub(tmp3, tmp4); \ - out4 = vec_add(tmp3, tmp4); \ - out5 = vec_sub(tmp2, tmp5); \ - out6 = vec_sub(tmp1, tmp6); \ - out7 = vec_sub(tmp0, tmp7); \ -} - -void -jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) -{ - short *dct_table = (short *)dct_table_; - __vector short row0, row1, row2, row3, row4, row5, row6, row7, - col0, col1, col2, col3, col4, col5, col6, col7, - quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, - tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, - z5, z10, z10s, z11, z12s, z13, - out0, out1, out2, out3, out4, out5, out6, out7; - __vector signed char outb; - long long *outptr, *outbptr = (long long *)(&outb); - - /* Constants */ - __vector short zero = { __8X(0) }, - PW_F1414 = { __8X(IFAST_F_1_414 << IFAST_CONST_SHIFT) }, - PW_F1847 = { __8X(IFAST_F_1_847 << IFAST_CONST_SHIFT) }, - PW_MF1613 = { __8X(-IFAST_F_1_613 << IFAST_CONST_SHIFT) }, - PW_F1082 = { __8X(IFAST_F_1_082 << IFAST_CONST_SHIFT) }; - __vector unsigned short - PRE_MULTIPLY_SCALE_BITS = { __8X(IFAST_PRE_MULTIPLY_SCALE_BITS) }, - PASS1_BITS3 = { __8X(IFAST_PASS1_BITS + 3) }; - __vector signed char PB_CENTERJSAMP = { __16X(CENTERJSAMPLE) }; - - /* Pass 1: process columns. */ - - col0 = *(__vector short *)&coef_block[0]; - col1 = *(__vector short *)&coef_block[8]; - col2 = *(__vector short *)&coef_block[16]; - col3 = *(__vector short *)&coef_block[24]; - col4 = *(__vector short *)&coef_block[32]; - col5 = *(__vector short *)&coef_block[40]; - col6 = *(__vector short *)&coef_block[48]; - col7 = *(__vector short *)&coef_block[56]; - - tmp1 = vec_or(col1, col2); - tmp2 = vec_or(col3, col4); - tmp1 = vec_or(tmp1, tmp2); - tmp3 = vec_or(col5, col6); - tmp3 = vec_or(tmp3, col7); - tmp1 = vec_or(tmp1, tmp3); - - quant0 = *(__vector short *)&dct_table[0]; - col0 = vec_mladd(col0, quant0, zero); - - if (vec_all_eq(tmp1, zero)) { - /* AC terms all zero */ - - row0 = vec_splat(col0, 0); - row1 = vec_splat(col0, 1); - row2 = vec_splat(col0, 2); - row3 = vec_splat(col0, 3); - row4 = vec_splat(col0, 4); - row5 = vec_splat(col0, 5); - row6 = vec_splat(col0, 6); - row7 = vec_splat(col0, 7); - - } else { - - quant1 = *(__vector short *)&dct_table[8]; - quant2 = *(__vector short *)&dct_table[16]; - quant3 = *(__vector short *)&dct_table[24]; - quant4 = *(__vector short *)&dct_table[32]; - quant5 = *(__vector short *)&dct_table[40]; - quant6 = *(__vector short *)&dct_table[48]; - quant7 = *(__vector short *)&dct_table[56]; - - col1 = vec_mladd(col1, quant1, zero); - col2 = vec_mladd(col2, quant2, zero); - col3 = vec_mladd(col3, quant3, zero); - col4 = vec_mladd(col4, quant4, zero); - col5 = vec_mladd(col5, quant5, zero); - col6 = vec_mladd(col6, quant6, zero); - col7 = vec_mladd(col7, quant7, zero); - - DO_IDCT_IFAST(col); - - TRANSPOSE(out, row); - } - - /* Pass 2: process rows. */ - - DO_IDCT_IFAST(row); - - out0 = vec_sra(out0, PASS1_BITS3); - out1 = vec_sra(out1, PASS1_BITS3); - out2 = vec_sra(out2, PASS1_BITS3); - out3 = vec_sra(out3, PASS1_BITS3); - out4 = vec_sra(out4, PASS1_BITS3); - out5 = vec_sra(out5, PASS1_BITS3); - out6 = vec_sra(out6, PASS1_BITS3); - out7 = vec_sra(out7, PASS1_BITS3); - - TRANSPOSE(out, col); - - outb = vec_packs(col0, col1); - outb = vec_add(outb, PB_CENTERJSAMP); - outptr = (long long *)(output_buf[0] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[1] + output_col); - *outptr = outbptr[1]; - - outb = vec_packs(col2, col3); - outb = vec_add(outb, PB_CENTERJSAMP); - outptr = (long long *)(output_buf[2] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[3] + output_col); - *outptr = outbptr[1]; - - outb = vec_packs(col4, col5); - outb = vec_add(outb, PB_CENTERJSAMP); - outptr = (long long *)(output_buf[4] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[5] + output_col); - *outptr = outbptr[1]; - - outb = vec_packs(col6, col7); - outb = vec_add(outb, PB_CENTERJSAMP); - outptr = (long long *)(output_buf[6] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[7] + output_col); - *outptr = outbptr[1]; -} From bf8a5feb79c4ca7c392096246056f7fe4d8ad5bb Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 01:10:11 +0000 Subject: [PATCH 013/140] Cosmetic tweaks to the PowerPC SIMD stubs git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1464 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd_powerpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index f92851c5..e3807bb9 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -1,5 +1,5 @@ /* - * jsimd_powerpc64.c + * jsimd_powerpc.c * * Copyright 2009 Pierre Ossman for Cendio AB * Copyright 2009-2011, 2014 D. R. Commander @@ -338,7 +338,7 @@ jsimd_can_idct_islow (void) /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; - if (sizeof(DCTELEM) != 2) + if (sizeof(JCOEF) != 2) return 0; if (simd_support & JSIMD_ALTIVEC) @@ -355,7 +355,7 @@ jsimd_can_idct_ifast (void) /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; - if (sizeof(DCTELEM) != 2) + if (sizeof(JCOEF) != 2) return 0; if (simd_support & JSIMD_ALTIVEC) From 87fd253bd074b135cf480cc3c1bc8ba14a406284 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 01:32:51 +0000 Subject: [PATCH 014/140] Add a "quicktest" pseudo-target, for those times when you just don't want to sit through 11 iterations of TJUnitTest. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1465 632fc199-4ca6-4c93-a231-07263d6284db --- Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index b32a41b2..772d48ae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -262,7 +262,7 @@ MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d endif -test: testclean all +test: quicktest if WITH_TURBOJPEG if WITH_JAVA @@ -280,6 +280,8 @@ endif ./tjunittest -yuv -noyuvpad endif +quicktest: testclean all + # These tests are carefully crafted to provide full coverage of as many of the # underlying algorithms as possible (including all of the SIMD-accelerated # ones.) From 13af139624daf93472c76f785ebff0b0e2d21df8 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 01:38:01 +0000 Subject: [PATCH 015/140] Make comments more consistent git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1466 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jfdctfst-altivec.c | 4 ++-- simd/jfdctint-altivec.c | 4 ++-- simd/jidctfst-altivec.c | 4 ++-- simd/jidctint-altivec.c | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/simd/jfdctfst-altivec.c b/simd/jfdctfst-altivec.c index 0c3687f8..3556ab56 100644 --- a/simd/jfdctfst-altivec.c +++ b/simd/jfdctfst-altivec.c @@ -106,7 +106,7 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) __vector unsigned short pre_multiply_scale_bits = { __8X(PRE_MULTIPLY_SCALE_BITS) }; - /* Pass 1: process rows. */ + /* Pass 1: process rows */ row0 = *(__vector short *)&data[0]; row1 = *(__vector short *)&data[8]; @@ -130,7 +130,7 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) DO_FDCT(); - /* Pass 2: process columns. */ + /* Pass 2: process columns */ TRANSPOSE(out, row); diff --git a/simd/jfdctint-altivec.c b/simd/jfdctint-altivec.c index d1230c7c..7699b299 100644 --- a/simd/jfdctint-altivec.c +++ b/simd/jfdctint-altivec.c @@ -175,7 +175,7 @@ jsimd_fdct_islow_altivec (DCTELEM *data) __vector unsigned int descale_p1 = { __4X(DESCALE_P1) }, descale_p2 = { __4X(DESCALE_P2) }; - /* Pass 1: process rows. */ + /* Pass 1: process rows */ row0 = *(__vector short *)&data[0]; row1 = *(__vector short *)&data[8]; @@ -199,7 +199,7 @@ jsimd_fdct_islow_altivec (DCTELEM *data) DO_FDCT_ROWS(); - /* Pass 2: process columns. */ + /* Pass 2: process columns */ TRANSPOSE(out, row); diff --git a/simd/jidctfst-altivec.c b/simd/jidctfst-altivec.c index f7749b84..33acb83c 100644 --- a/simd/jidctfst-altivec.c +++ b/simd/jidctfst-altivec.c @@ -125,7 +125,7 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, pass1_bits3 = { __8X(PASS1_BITS + 3) }; __vector signed char pb_centerjsamp = { __16X(CENTERJSAMPLE) }; - /* Pass 1: process columns. */ + /* Pass 1: process columns */ col0 = *(__vector short *)&coef_block[0]; col1 = *(__vector short *)&coef_block[8]; @@ -181,7 +181,7 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, TRANSPOSE(out, row); } - /* Pass 2: process rows. */ + /* Pass 2: process rows */ DO_IDCT(row); diff --git a/simd/jidctint-altivec.c b/simd/jidctint-altivec.c index 00c6c58d..d54479b7 100644 --- a/simd/jidctint-altivec.c +++ b/simd/jidctint-altivec.c @@ -207,7 +207,7 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, const_bits = { __4X(CONST_BITS) }; __vector signed char pb_centerjsamp = { __16X(CENTERJSAMPLE) }; - /* Pass 1: process columns. */ + /* Pass 1: process columns */ col0 = *(__vector short *)&coef_block[0]; col1 = *(__vector short *)&coef_block[8]; @@ -265,6 +265,8 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, TRANSPOSE(out, row); } + /* Pass 2: process rows */ + DO_IDCT(row, 2); TRANSPOSE(out, col); From 99f125ec07f438794d289cfa0cd3256f64a5b6d4 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 13:15:08 +0000 Subject: [PATCH 016/140] Maintain the traditional order of the regression tests while allowing the TurboJPEG and libjpeg portions to be executed separately git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1467 632fc199-4ca6-4c93-a231-07263d6284db --- Makefile.am | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 772d48ae..c312c91a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -262,7 +262,9 @@ MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d endif -test: quicktest +test: tjquicktest bittest + +tjquicktest: testclean all if WITH_TURBOJPEG if WITH_JAVA @@ -280,7 +282,7 @@ endif ./tjunittest -yuv -noyuvpad endif -quicktest: testclean all +bittest: testclean all # These tests are carefully crafted to provide full coverage of as many of the # underlying algorithms as possible (including all of the SIMD-accelerated From 8163aad6cc8e3a19b1aaec9e05c80a14148fa6da Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 13:41:18 +0000 Subject: [PATCH 017/140] Make test a phony target so things don't go haywire if there is a file named test.c in the current directory. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1468 632fc199-4ca6-4c93-a231-07263d6284db --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index c312c91a..c55b2c73 100644 --- a/Makefile.am +++ b/Makefile.am @@ -262,6 +262,7 @@ MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d endif +.PHONY: test test: tjquicktest bittest tjquicktest: testclean all From 62bae204f460c34697ce8e4eb63ef35cd5f3153f Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 13:42:26 +0000 Subject: [PATCH 018/140] AltiVec SIMD implementation of RGB-to-YCC color conversion git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1469 632fc199-4ca6-4c93-a231-07263d6284db --- simd/Makefile.am | 1 + simd/jccolext-altivec.c | 250 ++++++++++++++++++++++++++++++++++++++++ simd/jccolor-altivec.c | 143 +++++++++++++++++++++++ simd/jsimd.h | 22 ++++ simd/jsimd_powerpc.c | 44 +++++++ 5 files changed, 460 insertions(+) create mode 100644 simd/jccolext-altivec.c create mode 100644 simd/jccolor-altivec.c diff --git a/simd/Makefile.am b/simd/Makefile.am index d7b8d02a..6ce52822 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -73,6 +73,7 @@ endif if SIMD_POWERPC libsimd_la_SOURCES = jsimd_powerpc.c \ + jccolor-altivec.c \ jfdctfst-altivec.c jfdctint-altivec.c \ jidctfst-altivec.c jidctint-altivec.c libsimd_la_CFLAGS = -maltivec diff --git a/simd/jccolext-altivec.c b/simd/jccolext-altivec.c new file mode 100644 index 00000000..989fc3c8 --- /dev/null +++ b/simd/jccolext-altivec.c @@ -0,0 +1,250 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014, Jay Foad. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* This file is included by jccolor-altivec.c */ + + +void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, + JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + JSAMPROW inptr; + JSAMPROW outptr0, outptr1, outptr2; + int pitch; + __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgb3 = {0}, rgbg0, + rgbg1, rgbg2, rgbg3, y, cb, cr; +#if RGB_PIXELSIZE == 4 + __vector unsigned char rgb4; +#endif + __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3; + __vector unsigned short y01, y23, cr01, cr23, cb01, cb23; + __vector int y0, y1, y2, y3, cr0, cr1, cr2, cr3, cb0, cb1, cb2, cb3; + + /* Constants */ + __vector short pw_f0299_f0337 = { __4X2(F_0_299, F_0_337) }, + pw_f0114_f0250 = { __4X2(F_0_114, F_0_250) }, + pw_mf016_mf033 = { __4X2(-F_0_168, -F_0_331) }, + pw_mf008_mf041 = { __4X2(-F_0_081, -F_0_418) }; + __vector unsigned short pw_f050_f000 = { __4X2(F_0_500, 0) }; + __vector int pd_onehalf = { __4X(ONE_HALF) }, + pd_onehalfm1_cj = { __4X(ONE_HALF - 1 + (CENTERJSAMPLE << SCALEBITS)) }; + __vector unsigned char zero = { __16X(0) }, + shift_pack_index = + { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29}; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + output_row++; + + for (pitch = img_width * RGB_PIXELSIZE; pitch > 0; + pitch -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16, + outptr0 += 16, outptr1 += 16, outptr2 += 16) { + +#if RGB_PIXELSIZE == 3 + /* Load 16 pixels == 48 bytes */ + if ((size_t)inptr & 15) { + __vector unsigned char unaligned_shift_index; + rgb0 = vec_ld(0, inptr); + if (pitch > 16) + rgb1 = vec_ld(16, inptr); + else + rgb1 = vec_ld(-1, inptr + pitch); + if (pitch > 32) + rgb2 = vec_ld(32, inptr); + else + rgb2 = vec_ld(-1, inptr + pitch); + if (pitch > 48) + rgb3 = vec_ld(48, inptr); + else + rgb3 = vec_ld(-1, inptr + pitch); + unaligned_shift_index = vec_lvsl(0, inptr); + rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); + rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); + rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); + } else { + rgb0 = vec_ld(0, inptr); + if (pitch > 16) + rgb1 = vec_ld(16, inptr); + if (pitch > 32) + rgb2 = vec_ld(32, inptr); + } + + /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 + * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga + * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf + * + * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3 + * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7 + * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb + * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf + */ + rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX0); + rgbg1 = vec_perm(rgb0, rgb1, (__vector unsigned char)RGBG_INDEX1); + rgbg2 = vec_perm(rgb1, rgb2, (__vector unsigned char)RGBG_INDEX2); + rgbg3 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX3); +#else + /* Load 16 pixels == 64 bytes */ + if ((size_t)inptr & 15) { + __vector unsigned char unaligned_shift_index; + rgb0 = vec_ld(0, inptr); + if (pitch > 16) + rgb1 = vec_ld(16, inptr); + else + rgb1 = vec_ld(-1, inptr + pitch); + if (pitch > 32) + rgb2 = vec_ld(32, inptr); + else + rgb2 = vec_ld(-1, inptr + pitch); + if (pitch > 48) + rgb3 = vec_ld(48, inptr); + else + rgb3 = vec_ld(-1, inptr + pitch); + if (pitch > 64) + rgb4 = vec_ld(64, inptr); + else + rgb4 = vec_ld(-1, inptr + pitch); + unaligned_shift_index = vec_lvsl(0, inptr); + rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); + rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); + rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); + rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); + } else { + rgb0 = vec_ld(0, inptr); + if (pitch > 16) + rgb1 = vec_ld(16, inptr); + if (pitch > 32) + rgb2 = vec_ld(32, inptr); + if (pitch > 48) + rgb3 = vec_ld(48, inptr); + } + + /* rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3 + * rgb0 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 + * rgb0 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb + * rgb0 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf + * + * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3 + * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7 + * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb + * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf + */ + rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX); + rgbg1 = vec_perm(rgb1, rgb1, (__vector unsigned char)RGBG_INDEX); + rgbg2 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX); + rgbg3 = vec_perm(rgb3, rgb3, (__vector unsigned char)RGBG_INDEX); +#endif + + /* rg0 = R0 G0 R1 G1 R2 G2 R3 G3 + * bg0 = B0 G0 B1 G1 B2 G2 B3 G3 + * ... + * + * NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't + * support unsigned vectors. + */ + rg0 = (__vector signed short)vec_mergeh(zero, rgbg0); + bg0 = (__vector signed short)vec_mergel(zero, rgbg0); + rg1 = (__vector signed short)vec_mergeh(zero, rgbg1); + bg1 = (__vector signed short)vec_mergel(zero, rgbg1); + rg2 = (__vector signed short)vec_mergeh(zero, rgbg2); + bg2 = (__vector signed short)vec_mergel(zero, rgbg2); + rg3 = (__vector signed short)vec_mergeh(zero, rgbg3); + bg3 = (__vector signed short)vec_mergel(zero, rgbg3); + + /* (Original) + * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B + * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE + * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE + * + * (This implementation) + * Y = 0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G + * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE + * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE + */ + + /* Calculate Y values */ + + y0 = vec_msums(rg0, pw_f0299_f0337, pd_onehalf); + y1 = vec_msums(rg1, pw_f0299_f0337, pd_onehalf); + y2 = vec_msums(rg2, pw_f0299_f0337, pd_onehalf); + y3 = vec_msums(rg3, pw_f0299_f0337, pd_onehalf); + y0 = vec_msums(bg0, pw_f0114_f0250, y0); + y1 = vec_msums(bg1, pw_f0114_f0250, y1); + y2 = vec_msums(bg2, pw_f0114_f0250, y2); + y3 = vec_msums(bg3, pw_f0114_f0250, y3); + /* Clever way to avoid 4 shifts + 2 packs. This packs the high word from + * each dword into a new 16-bit vector, which is the equivalent of + * descaling the 32-bit results (right-shifting by 16 bits) and then + * packing them. + */ + y01 = vec_perm((__vector unsigned short)y0, (__vector unsigned short)y1, + shift_pack_index); + y23 = vec_perm((__vector unsigned short)y2, (__vector unsigned short)y3, + shift_pack_index); + y = vec_pack(y01, y23); + vec_st(y, 0, outptr0); + + /* Calculate Cb values */ + cb0 = vec_msums(rg0, pw_mf016_mf033, pd_onehalfm1_cj); + cb1 = vec_msums(rg1, pw_mf016_mf033, pd_onehalfm1_cj); + cb2 = vec_msums(rg2, pw_mf016_mf033, pd_onehalfm1_cj); + cb3 = vec_msums(rg3, pw_mf016_mf033, pd_onehalfm1_cj); + cb0 = (__vector int)vec_msum((__vector unsigned short)bg0, pw_f050_f000, + (__vector unsigned int)cb0); + cb1 = (__vector int)vec_msum((__vector unsigned short)bg1, pw_f050_f000, + (__vector unsigned int)cb1); + cb2 = (__vector int)vec_msum((__vector unsigned short)bg2, pw_f050_f000, + (__vector unsigned int)cb2); + cb3 = (__vector int)vec_msum((__vector unsigned short)bg3, pw_f050_f000, + (__vector unsigned int)cb3); + cb01 = vec_perm((__vector unsigned short)cb0, + (__vector unsigned short)cb1, shift_pack_index); + cb23 = vec_perm((__vector unsigned short)cb2, + (__vector unsigned short)cb3, shift_pack_index); + cb = vec_pack(cb01, cb23); + vec_st(cb, 0, outptr1); + + /* Calculate Cr values */ + cr0 = vec_msums(bg0, pw_mf008_mf041, pd_onehalfm1_cj); + cr1 = vec_msums(bg1, pw_mf008_mf041, pd_onehalfm1_cj); + cr2 = vec_msums(bg2, pw_mf008_mf041, pd_onehalfm1_cj); + cr3 = vec_msums(bg3, pw_mf008_mf041, pd_onehalfm1_cj); + cr0 = (__vector int)vec_msum((__vector unsigned short)rg0, pw_f050_f000, + (__vector unsigned int)cr0); + cr1 = (__vector int)vec_msum((__vector unsigned short)rg1, pw_f050_f000, + (__vector unsigned int)cr1); + cr2 = (__vector int)vec_msum((__vector unsigned short)rg2, pw_f050_f000, + (__vector unsigned int)cr2); + cr3 = (__vector int)vec_msum((__vector unsigned short)rg3, pw_f050_f000, + (__vector unsigned int)cr3); + cr01 = vec_perm((__vector unsigned short)cr0, + (__vector unsigned short)cr1, shift_pack_index); + cr23 = vec_perm((__vector unsigned short)cr2, + (__vector unsigned short)cr3, shift_pack_index); + cr = vec_pack(cr01, cr23); + vec_st(cr, 0, outptr2); + } + } +} diff --git a/simd/jccolor-altivec.c b/simd/jccolor-altivec.c new file mode 100644 index 00000000..ddb9fa06 --- /dev/null +++ b/simd/jccolor-altivec.c @@ -0,0 +1,143 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* RGB --> YCC CONVERSION */ + +#include "jsimd_altivec.h" + + +#define F_0_081 5329 /* FIX(0.08131) */ +#define F_0_114 7471 /* FIX(0.11400) */ +#define F_0_168 11059 /* FIX(0.16874) */ +#define F_0_250 16384 /* FIX(0.25000) */ +#define F_0_299 19595 /* FIX(0.29900) */ +#define F_0_331 21709 /* FIX(0.33126) */ +#define F_0_418 27439 /* FIX(0.41869) */ +#define F_0_500 32768 /* FIX(0.50000) */ +#define F_0_587 38470 /* FIX(0.58700) */ +#define F_0_337 (F_0_587 - F_0_250) /* FIX(0.58700) - FIX(0.25000) */ + +#define SCALEBITS 16 +#define ONE_HALF (1 << (SCALEBITS - 1)) + + +#define RGBG_INDEX0 {0,1,3,4,6,7,9,10,2,1,5,4,8,7,11,10} +#define RGBG_INDEX1 {12,13,15,16,18,19,21,22,14,13,17,16,20,19,23,22} +#define RGBG_INDEX2 {8,9,11,12,14,15,17,18,10,9,13,12,16,15,19,18} +#define RGBG_INDEX3 {4,5,7,8,10,11,13,14,6,5,9,8,12,11,15,14} +#include "jccolext-altivec.c" +#undef RGB_RED +#undef RGB_GREEN +#undef RGB_BLUE +#undef RGB_PIXELSIZE + +#define RGB_RED EXT_RGB_RED +#define RGB_GREEN EXT_RGB_GREEN +#define RGB_BLUE EXT_RGB_BLUE +#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE +#define jsimd_rgb_ycc_convert_altivec jsimd_extrgb_ycc_convert_altivec +#include "jccolext-altivec.c" +#undef RGB_RED +#undef RGB_GREEN +#undef RGB_BLUE +#undef RGB_PIXELSIZE +#undef RGBG_INDEX0 +#undef RGBG_INDEX1 +#undef RGBG_INDEX2 +#undef RGBG_INDEX3 +#undef jsimd_rgb_ycc_convert_altivec + +#define RGB_RED EXT_RGBX_RED +#define RGB_GREEN EXT_RGBX_GREEN +#define RGB_BLUE EXT_RGBX_BLUE +#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE +#define RGBG_INDEX {0,1,4,5,8,9,12,13,2,1,6,5,10,9,14,13} +#define jsimd_rgb_ycc_convert_altivec jsimd_extrgbx_ycc_convert_altivec +#include "jccolext-altivec.c" +#undef RGB_RED +#undef RGB_GREEN +#undef RGB_BLUE +#undef RGB_PIXELSIZE +#undef RGBG_INDEX +#undef jsimd_rgb_ycc_convert_altivec + +#define RGB_RED EXT_BGR_RED +#define RGB_GREEN EXT_BGR_GREEN +#define RGB_BLUE EXT_BGR_BLUE +#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE +#define RGBG_INDEX0 {2,1,5,4,8,7,11,10,0,1,3,4,6,7,9,10} +#define RGBG_INDEX1 {14,13,17,16,20,19,23,22,12,13,15,16,18,19,21,22} +#define RGBG_INDEX2 {10,9,13,12,16,15,19,18,8,9,11,12,14,15,17,18} +#define RGBG_INDEX3 {6,5,9,8,12,11,15,14,4,5,7,8,10,11,13,14} +#define jsimd_rgb_ycc_convert_altivec jsimd_extbgr_ycc_convert_altivec +#include "jccolext-altivec.c" +#undef RGB_RED +#undef RGB_GREEN +#undef RGB_BLUE +#undef RGB_PIXELSIZE +#undef RGBG_INDEX0 +#undef RGBG_INDEX1 +#undef RGBG_INDEX2 +#undef RGBG_INDEX3 +#undef jsimd_rgb_ycc_convert_altivec + +#define RGB_RED EXT_BGRX_RED +#define RGB_GREEN EXT_BGRX_GREEN +#define RGB_BLUE EXT_BGRX_BLUE +#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE +#define RGBG_INDEX {2,1,6,5,10,9,14,13,0,1,4,5,8,9,12,13} +#define jsimd_rgb_ycc_convert_altivec jsimd_extbgrx_ycc_convert_altivec +#include "jccolext-altivec.c" +#undef RGB_RED +#undef RGB_GREEN +#undef RGB_BLUE +#undef RGB_PIXELSIZE +#undef RGBG_INDEX +#undef jsimd_rgb_ycc_convert_altivec + +#define RGB_RED EXT_XBGR_RED +#define RGB_GREEN EXT_XBGR_GREEN +#define RGB_BLUE EXT_XBGR_BLUE +#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE +#define RGBG_INDEX {3,2,7,6,11,10,15,14,1,2,5,6,9,10,13,14} +#define jsimd_rgb_ycc_convert_altivec jsimd_extxbgr_ycc_convert_altivec +#include "jccolext-altivec.c" +#undef RGB_RED +#undef RGB_GREEN +#undef RGB_BLUE +#undef RGB_PIXELSIZE +#undef RGBG_INDEX +#undef jsimd_rgb_ycc_convert_altivec + +#define RGB_RED EXT_XRGB_RED +#define RGB_GREEN EXT_XRGB_GREEN +#define RGB_BLUE EXT_XRGB_BLUE +#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE +#define RGBG_INDEX {1,2,5,6,9,10,13,14,3,2,7,6,11,10,15,14} +#define jsimd_rgb_ycc_convert_altivec jsimd_extxrgb_ycc_convert_altivec +#include "jccolext-altivec.c" +#undef RGB_RED +#undef RGB_GREEN +#undef RGB_BLUE +#undef RGB_PIXELSIZE +#undef RGBG_INDEX +#undef jsimd_rgb_ycc_convert_altivec diff --git a/simd/jsimd.h b/simd/jsimd.h index 9b50610a..9f41ef64 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -116,6 +116,28 @@ EXTERN(void) jsimd_extxrgb_ycc_convert_mips_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_rgb_ycc_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extrgb_ycc_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extrgbx_ycc_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extbgr_ycc_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extbgrx_ycc_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extxbgr_ycc_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extxrgb_ycc_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); + /* RGB & extended RGB --> Grayscale Colorspace Conversion */ EXTERN(void) jsimd_rgb_gray_convert_mmx (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index e3807bb9..6e6be265 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -42,6 +42,19 @@ init_simd (void) GLOBAL(int) jsimd_can_rgb_ycc (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -68,6 +81,37 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { + void (*altivecfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); + + switch(cinfo->in_color_space) { + case JCS_EXT_RGB: + altivecfct=jsimd_extrgb_ycc_convert_altivec; + break; + case JCS_EXT_RGBX: + case JCS_EXT_RGBA: + altivecfct=jsimd_extrgbx_ycc_convert_altivec; + break; + case JCS_EXT_BGR: + altivecfct=jsimd_extbgr_ycc_convert_altivec; + break; + case JCS_EXT_BGRX: + case JCS_EXT_BGRA: + altivecfct=jsimd_extbgrx_ycc_convert_altivec; + break; + case JCS_EXT_XBGR: + case JCS_EXT_ABGR: + altivecfct=jsimd_extxbgr_ycc_convert_altivec; + break; + case JCS_EXT_XRGB: + case JCS_EXT_ARGB: + altivecfct=jsimd_extxrgb_ycc_convert_altivec; + break; + default: + altivecfct=jsimd_rgb_ycc_convert_altivec; + break; + } + + altivecfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); } GLOBAL(void) From 5976e42550fe6d71c4902c6a1a84049e18312e24 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 13:57:30 +0000 Subject: [PATCH 019/140] Remove unneeded code; Make sure jccolor-altivec.o will be rebuilt if jccolext-altivec.c changes. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1470 632fc199-4ca6-4c93-a231-07263d6284db --- simd/Makefile.am | 2 ++ simd/jccolor-altivec.c | 39 --------------------------------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/simd/Makefile.am b/simd/Makefile.am index 6ce52822..8701194a 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -78,6 +78,8 @@ libsimd_la_SOURCES = jsimd_powerpc.c \ jidctfst-altivec.c jidctint-altivec.c libsimd_la_CFLAGS = -maltivec +jccolor-altivec.lo: jccolext-altivec.c + endif AM_CPPFLAGS = -I$(top_srcdir) diff --git a/simd/jccolor-altivec.c b/simd/jccolor-altivec.c index ddb9fa06..04b8708d 100644 --- a/simd/jccolor-altivec.c +++ b/simd/jccolor-altivec.c @@ -45,20 +45,11 @@ #define RGBG_INDEX2 {8,9,11,12,14,15,17,18,10,9,13,12,16,15,19,18} #define RGBG_INDEX3 {4,5,7,8,10,11,13,14,6,5,9,8,12,11,15,14} #include "jccolext-altivec.c" -#undef RGB_RED -#undef RGB_GREEN -#undef RGB_BLUE #undef RGB_PIXELSIZE -#define RGB_RED EXT_RGB_RED -#define RGB_GREEN EXT_RGB_GREEN -#define RGB_BLUE EXT_RGB_BLUE #define RGB_PIXELSIZE EXT_RGB_PIXELSIZE #define jsimd_rgb_ycc_convert_altivec jsimd_extrgb_ycc_convert_altivec #include "jccolext-altivec.c" -#undef RGB_RED -#undef RGB_GREEN -#undef RGB_BLUE #undef RGB_PIXELSIZE #undef RGBG_INDEX0 #undef RGBG_INDEX1 @@ -66,23 +57,14 @@ #undef RGBG_INDEX3 #undef jsimd_rgb_ycc_convert_altivec -#define RGB_RED EXT_RGBX_RED -#define RGB_GREEN EXT_RGBX_GREEN -#define RGB_BLUE EXT_RGBX_BLUE #define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE #define RGBG_INDEX {0,1,4,5,8,9,12,13,2,1,6,5,10,9,14,13} #define jsimd_rgb_ycc_convert_altivec jsimd_extrgbx_ycc_convert_altivec #include "jccolext-altivec.c" -#undef RGB_RED -#undef RGB_GREEN -#undef RGB_BLUE #undef RGB_PIXELSIZE #undef RGBG_INDEX #undef jsimd_rgb_ycc_convert_altivec -#define RGB_RED EXT_BGR_RED -#define RGB_GREEN EXT_BGR_GREEN -#define RGB_BLUE EXT_BGR_BLUE #define RGB_PIXELSIZE EXT_BGR_PIXELSIZE #define RGBG_INDEX0 {2,1,5,4,8,7,11,10,0,1,3,4,6,7,9,10} #define RGBG_INDEX1 {14,13,17,16,20,19,23,22,12,13,15,16,18,19,21,22} @@ -90,9 +72,6 @@ #define RGBG_INDEX3 {6,5,9,8,12,11,15,14,4,5,7,8,10,11,13,14} #define jsimd_rgb_ycc_convert_altivec jsimd_extbgr_ycc_convert_altivec #include "jccolext-altivec.c" -#undef RGB_RED -#undef RGB_GREEN -#undef RGB_BLUE #undef RGB_PIXELSIZE #undef RGBG_INDEX0 #undef RGBG_INDEX1 @@ -100,44 +79,26 @@ #undef RGBG_INDEX3 #undef jsimd_rgb_ycc_convert_altivec -#define RGB_RED EXT_BGRX_RED -#define RGB_GREEN EXT_BGRX_GREEN -#define RGB_BLUE EXT_BGRX_BLUE #define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE #define RGBG_INDEX {2,1,6,5,10,9,14,13,0,1,4,5,8,9,12,13} #define jsimd_rgb_ycc_convert_altivec jsimd_extbgrx_ycc_convert_altivec #include "jccolext-altivec.c" -#undef RGB_RED -#undef RGB_GREEN -#undef RGB_BLUE #undef RGB_PIXELSIZE #undef RGBG_INDEX #undef jsimd_rgb_ycc_convert_altivec -#define RGB_RED EXT_XBGR_RED -#define RGB_GREEN EXT_XBGR_GREEN -#define RGB_BLUE EXT_XBGR_BLUE #define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE #define RGBG_INDEX {3,2,7,6,11,10,15,14,1,2,5,6,9,10,13,14} #define jsimd_rgb_ycc_convert_altivec jsimd_extxbgr_ycc_convert_altivec #include "jccolext-altivec.c" -#undef RGB_RED -#undef RGB_GREEN -#undef RGB_BLUE #undef RGB_PIXELSIZE #undef RGBG_INDEX #undef jsimd_rgb_ycc_convert_altivec -#define RGB_RED EXT_XRGB_RED -#define RGB_GREEN EXT_XRGB_GREEN -#define RGB_BLUE EXT_XRGB_BLUE #define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE #define RGBG_INDEX {1,2,5,6,9,10,13,14,3,2,7,6,11,10,15,14} #define jsimd_rgb_ycc_convert_altivec jsimd_extxrgb_ycc_convert_altivec #include "jccolext-altivec.c" -#undef RGB_RED -#undef RGB_GREEN -#undef RGB_BLUE #undef RGB_PIXELSIZE #undef RGBG_INDEX #undef jsimd_rgb_ycc_convert_altivec From b1fec4ff9821b2c16be5f12e2cd3159d4e63d133 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 14:10:33 +0000 Subject: [PATCH 020/140] AltiVec SIMD implementation of RGB-to-Grayscale color conversion git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1471 632fc199-4ca6-4c93-a231-07263d6284db --- simd/Makefile.am | 3 +- simd/jcgray-altivec.c | 99 ++++++++++++++++++++ simd/jcgryext-altivec.c | 200 ++++++++++++++++++++++++++++++++++++++++ simd/jsimd.h | 22 +++++ simd/jsimd_powerpc.c | 44 +++++++++ 5 files changed, 367 insertions(+), 1 deletion(-) create mode 100644 simd/jcgray-altivec.c create mode 100644 simd/jcgryext-altivec.c diff --git a/simd/Makefile.am b/simd/Makefile.am index 8701194a..7aa36ae1 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -73,12 +73,13 @@ endif if SIMD_POWERPC libsimd_la_SOURCES = jsimd_powerpc.c \ - jccolor-altivec.c \ + jccolor-altivec.c jcgray-altivec.c \ jfdctfst-altivec.c jfdctint-altivec.c \ jidctfst-altivec.c jidctint-altivec.c libsimd_la_CFLAGS = -maltivec jccolor-altivec.lo: jccolext-altivec.c +jcgray-altivec.lo: jcgryext-altivec.c endif diff --git a/simd/jcgray-altivec.c b/simd/jcgray-altivec.c new file mode 100644 index 00000000..b52fade0 --- /dev/null +++ b/simd/jcgray-altivec.c @@ -0,0 +1,99 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* RGB --> GRAYSCALE CONVERSION */ + +#include "jsimd_altivec.h" + + +#define F_0_114 7471 /* FIX(0.11400) */ +#define F_0_250 16384 /* FIX(0.25000) */ +#define F_0_299 19595 /* FIX(0.29900) */ +#define F_0_587 38470 /* FIX(0.58700) */ +#define F_0_337 (F_0_587 - F_0_250) /* FIX(0.58700) - FIX(0.25000) */ + +#define SCALEBITS 16 +#define ONE_HALF (1 << (SCALEBITS - 1)) + + +#define RGBG_INDEX0 {0,1,3,4,6,7,9,10,2,1,5,4,8,7,11,10} +#define RGBG_INDEX1 {12,13,15,16,18,19,21,22,14,13,17,16,20,19,23,22} +#define RGBG_INDEX2 {8,9,11,12,14,15,17,18,10,9,13,12,16,15,19,18} +#define RGBG_INDEX3 {4,5,7,8,10,11,13,14,6,5,9,8,12,11,15,14} +#include "jcgryext-altivec.c" +#undef RGB_PIXELSIZE + +#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE +#define jsimd_rgb_gray_convert_altivec jsimd_extrgb_gray_convert_altivec +#include "jcgryext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGBG_INDEX0 +#undef RGBG_INDEX1 +#undef RGBG_INDEX2 +#undef RGBG_INDEX3 +#undef jsimd_rgb_gray_convert_altivec + +#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE +#define RGBG_INDEX {0,1,4,5,8,9,12,13,2,1,6,5,10,9,14,13} +#define jsimd_rgb_gray_convert_altivec jsimd_extrgbx_gray_convert_altivec +#include "jcgryext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGBG_INDEX +#undef jsimd_rgb_gray_convert_altivec + +#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE +#define RGBG_INDEX0 {2,1,5,4,8,7,11,10,0,1,3,4,6,7,9,10} +#define RGBG_INDEX1 {14,13,17,16,20,19,23,22,12,13,15,16,18,19,21,22} +#define RGBG_INDEX2 {10,9,13,12,16,15,19,18,8,9,11,12,14,15,17,18} +#define RGBG_INDEX3 {6,5,9,8,12,11,15,14,4,5,7,8,10,11,13,14} +#define jsimd_rgb_gray_convert_altivec jsimd_extbgr_gray_convert_altivec +#include "jcgryext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGBG_INDEX0 +#undef RGBG_INDEX1 +#undef RGBG_INDEX2 +#undef RGBG_INDEX3 +#undef jsimd_rgb_gray_convert_altivec + +#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE +#define RGBG_INDEX {2,1,6,5,10,9,14,13,0,1,4,5,8,9,12,13} +#define jsimd_rgb_gray_convert_altivec jsimd_extbgrx_gray_convert_altivec +#include "jcgryext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGBG_INDEX +#undef jsimd_rgb_gray_convert_altivec + +#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE +#define RGBG_INDEX {3,2,7,6,11,10,15,14,1,2,5,6,9,10,13,14} +#define jsimd_rgb_gray_convert_altivec jsimd_extxbgr_gray_convert_altivec +#include "jcgryext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGBG_INDEX +#undef jsimd_rgb_gray_convert_altivec + +#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE +#define RGBG_INDEX {1,2,5,6,9,10,13,14,3,2,7,6,11,10,15,14} +#define jsimd_rgb_gray_convert_altivec jsimd_extxrgb_gray_convert_altivec +#include "jcgryext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGBG_INDEX +#undef jsimd_rgb_gray_convert_altivec diff --git a/simd/jcgryext-altivec.c b/simd/jcgryext-altivec.c new file mode 100644 index 00000000..c1d0a453 --- /dev/null +++ b/simd/jcgryext-altivec.c @@ -0,0 +1,200 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014, Jay Foad. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* This file is included by jcgray-altivec.c */ + + +void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, + JSAMPARRAY input_buf, + JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + JSAMPROW inptr, outptr; + int pitch; + __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgb3 = {0}, rgbg0, + rgbg1, rgbg2, rgbg3, y; +#if RGB_PIXELSIZE == 4 + __vector unsigned char rgb4; +#endif + __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3; + __vector unsigned short y01, y23; + __vector int y0, y1, y2, y3; + + /* Constants */ + __vector short pw_f0299_f0337 = { __4X2(F_0_299, F_0_337) }, + pw_f0114_f0250 = { __4X2(F_0_114, F_0_250) }; + __vector int pd_onehalf = { __4X(ONE_HALF) }; + __vector unsigned char zero = { __16X(0) }, + shift_pack_index = + { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29}; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr = output_buf[0][output_row]; + output_row++; + + for (pitch = img_width * RGB_PIXELSIZE; pitch > 0; + pitch -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16, + outptr += 16) { + +#if RGB_PIXELSIZE == 3 + /* Load 16 pixels == 48 bytes */ + if ((size_t)inptr & 15) { + __vector unsigned char unaligned_shift_index; + rgb0 = vec_ld(0, inptr); + if (pitch > 16) + rgb1 = vec_ld(16, inptr); + else + rgb1 = vec_ld(-1, inptr + pitch); + if (pitch > 32) + rgb2 = vec_ld(32, inptr); + else + rgb2 = vec_ld(-1, inptr + pitch); + if (pitch > 48) + rgb3 = vec_ld(48, inptr); + else + rgb3 = vec_ld(-1, inptr + pitch); + unaligned_shift_index = vec_lvsl(0, inptr); + rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); + rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); + rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); + } else { + rgb0 = vec_ld(0, inptr); + if (pitch > 16) + rgb1 = vec_ld(16, inptr); + if (pitch > 32) + rgb2 = vec_ld(32, inptr); + } + + /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 + * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga + * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf + * + * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3 + * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7 + * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb + * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf + */ + rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX0); + rgbg1 = vec_perm(rgb0, rgb1, (__vector unsigned char)RGBG_INDEX1); + rgbg2 = vec_perm(rgb1, rgb2, (__vector unsigned char)RGBG_INDEX2); + rgbg3 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX3); +#else + /* Load 16 pixels == 64 bytes */ + if ((size_t)inptr & 15) { + __vector unsigned char unaligned_shift_index; + rgb0 = vec_ld(0, inptr); + if (pitch > 16) + rgb1 = vec_ld(16, inptr); + else + rgb1 = vec_ld(-1, inptr + pitch); + if (pitch > 32) + rgb2 = vec_ld(32, inptr); + else + rgb2 = vec_ld(-1, inptr + pitch); + if (pitch > 48) + rgb3 = vec_ld(48, inptr); + else + rgb3 = vec_ld(-1, inptr + pitch); + if (pitch > 64) + rgb4 = vec_ld(64, inptr); + else + rgb4 = vec_ld(-1, inptr + pitch); + unaligned_shift_index = vec_lvsl(0, inptr); + rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); + rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); + rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); + rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); + } else { + rgb0 = vec_ld(0, inptr); + if (pitch > 16) + rgb1 = vec_ld(16, inptr); + if (pitch > 32) + rgb2 = vec_ld(32, inptr); + if (pitch > 48) + rgb3 = vec_ld(48, inptr); + } + + /* rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3 + * rgb0 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 + * rgb0 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb + * rgb0 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf + * + * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3 + * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7 + * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb + * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf + */ + rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX); + rgbg1 = vec_perm(rgb1, rgb1, (__vector unsigned char)RGBG_INDEX); + rgbg2 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX); + rgbg3 = vec_perm(rgb3, rgb3, (__vector unsigned char)RGBG_INDEX); +#endif + + /* rg0 = R0 G0 R1 G1 R2 G2 R3 G3 + * bg0 = B0 G0 B1 G1 B2 G2 B3 G3 + * ... + * + * NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't + * support unsigned vectors. + */ + rg0 = (__vector signed short)vec_mergeh(zero, rgbg0); + bg0 = (__vector signed short)vec_mergel(zero, rgbg0); + rg1 = (__vector signed short)vec_mergeh(zero, rgbg1); + bg1 = (__vector signed short)vec_mergel(zero, rgbg1); + rg2 = (__vector signed short)vec_mergeh(zero, rgbg2); + bg2 = (__vector signed short)vec_mergel(zero, rgbg2); + rg3 = (__vector signed short)vec_mergeh(zero, rgbg3); + bg3 = (__vector signed short)vec_mergel(zero, rgbg3); + + /* (Original) + * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B + * + * (This implementation) + * Y = 0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G + */ + + /* Calculate Y values */ + + y0 = vec_msums(rg0, pw_f0299_f0337, pd_onehalf); + y1 = vec_msums(rg1, pw_f0299_f0337, pd_onehalf); + y2 = vec_msums(rg2, pw_f0299_f0337, pd_onehalf); + y3 = vec_msums(rg3, pw_f0299_f0337, pd_onehalf); + y0 = vec_msums(bg0, pw_f0114_f0250, y0); + y1 = vec_msums(bg1, pw_f0114_f0250, y1); + y2 = vec_msums(bg2, pw_f0114_f0250, y2); + y3 = vec_msums(bg3, pw_f0114_f0250, y3); + /* Clever way to avoid 4 shifts + 2 packs. This packs the high word from + * each dword into a new 16-bit vector, which is the equivalent of + * descaling the 32-bit results (right-shifting by 16 bits) and then + * packing them. + */ + y01 = vec_perm((__vector unsigned short)y0, (__vector unsigned short)y1, + shift_pack_index); + y23 = vec_perm((__vector unsigned short)y2, (__vector unsigned short)y3, + shift_pack_index); + y = vec_pack(y01, y23); + vec_st(y, 0, outptr); + } + } +} diff --git a/simd/jsimd.h b/simd/jsimd.h index 9f41ef64..a8009b57 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -206,6 +206,28 @@ EXTERN(void) jsimd_extxrgb_gray_convert_mips_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_rgb_gray_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extrgb_gray_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extrgbx_gray_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extbgr_gray_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extbgrx_gray_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extxbgr_gray_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extxrgb_gray_convert_altivec + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); + /* YCC --> RGB & extended RGB Colorspace Conversion */ EXTERN(void) jsimd_ycc_rgb_convert_mmx (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index 6e6be265..a33bf626 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -61,6 +61,19 @@ jsimd_can_rgb_ycc (void) GLOBAL(int) jsimd_can_rgb_gray (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -119,6 +132,37 @@ jsimd_rgb_gray_convert (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { + void (*altivecfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); + + switch(cinfo->in_color_space) { + case JCS_EXT_RGB: + altivecfct=jsimd_extrgb_gray_convert_altivec; + break; + case JCS_EXT_RGBX: + case JCS_EXT_RGBA: + altivecfct=jsimd_extrgbx_gray_convert_altivec; + break; + case JCS_EXT_BGR: + altivecfct=jsimd_extbgr_gray_convert_altivec; + break; + case JCS_EXT_BGRX: + case JCS_EXT_BGRA: + altivecfct=jsimd_extbgrx_gray_convert_altivec; + break; + case JCS_EXT_XBGR: + case JCS_EXT_ABGR: + altivecfct=jsimd_extxbgr_gray_convert_altivec; + break; + case JCS_EXT_XRGB: + case JCS_EXT_ARGB: + altivecfct=jsimd_extxrgb_gray_convert_altivec; + break; + default: + altivecfct=jsimd_rgb_gray_convert_altivec; + break; + } + + altivecfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); } GLOBAL(void) From 45453085e772d552371a41cef3ea38153bd19c01 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Dec 2014 16:04:17 +0000 Subject: [PATCH 021/140] Use intrinsics for loading/storing data in the DCT/IDCT functions. This has no effect on the performance of the aligned loads/stores, but it makes it more obvious what that code is doing. Using intrinsics for the unaligned stores in the inverse DCT functions increases overall decompression performance by 1-2%. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1472 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jfdctfst-altivec.c | 32 ++++++++--------- simd/jfdctint-altivec.c | 32 ++++++++--------- simd/jidctfst-altivec.c | 78 ++++++++++++++++++++++++++--------------- simd/jidctint-altivec.c | 62 +++++++++++++++++++++----------- 4 files changed, 122 insertions(+), 82 deletions(-) diff --git a/simd/jfdctfst-altivec.c b/simd/jfdctfst-altivec.c index 3556ab56..16a52df6 100644 --- a/simd/jfdctfst-altivec.c +++ b/simd/jfdctfst-altivec.c @@ -108,14 +108,14 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) /* Pass 1: process rows */ - row0 = *(__vector short *)&data[0]; - row1 = *(__vector short *)&data[8]; - row2 = *(__vector short *)&data[16]; - row3 = *(__vector short *)&data[24]; - row4 = *(__vector short *)&data[32]; - row5 = *(__vector short *)&data[40]; - row6 = *(__vector short *)&data[48]; - row7 = *(__vector short *)&data[56]; + row0 = vec_ld(0, data); + row1 = vec_ld(16, data); + row2 = vec_ld(32, data); + row3 = vec_ld(48, data); + row4 = vec_ld(64, data); + row5 = vec_ld(80, data); + row6 = vec_ld(96, data); + row7 = vec_ld(112, data); TRANSPOSE(row, col); @@ -145,12 +145,12 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) DO_FDCT(); - *(__vector short *)&data[0] = out0; - *(__vector short *)&data[8] = out1; - *(__vector short *)&data[16] = out2; - *(__vector short *)&data[24] = out3; - *(__vector short *)&data[32] = out4; - *(__vector short *)&data[40] = out5; - *(__vector short *)&data[48] = out6; - *(__vector short *)&data[56] = out7; + vec_st(out0, 0, data); + vec_st(out1, 16, data); + vec_st(out2, 32, data); + vec_st(out3, 48, data); + vec_st(out4, 64, data); + vec_st(out5, 80, data); + vec_st(out6, 96, data); + vec_st(out7, 112, data); } diff --git a/simd/jfdctint-altivec.c b/simd/jfdctint-altivec.c index 7699b299..548ab964 100644 --- a/simd/jfdctint-altivec.c +++ b/simd/jfdctint-altivec.c @@ -177,14 +177,14 @@ jsimd_fdct_islow_altivec (DCTELEM *data) /* Pass 1: process rows */ - row0 = *(__vector short *)&data[0]; - row1 = *(__vector short *)&data[8]; - row2 = *(__vector short *)&data[16]; - row3 = *(__vector short *)&data[24]; - row4 = *(__vector short *)&data[32]; - row5 = *(__vector short *)&data[40]; - row6 = *(__vector short *)&data[48]; - row7 = *(__vector short *)&data[56]; + row0 = vec_ld(0, data); + row1 = vec_ld(16, data); + row2 = vec_ld(32, data); + row3 = vec_ld(48, data); + row4 = vec_ld(64, data); + row5 = vec_ld(80, data); + row6 = vec_ld(96, data); + row7 = vec_ld(112, data); TRANSPOSE(row, col); @@ -214,12 +214,12 @@ jsimd_fdct_islow_altivec (DCTELEM *data) DO_FDCT_COLS(); - *(__vector short *)&data[0] = out0; - *(__vector short *)&data[8] = out1; - *(__vector short *)&data[16] = out2; - *(__vector short *)&data[24] = out3; - *(__vector short *)&data[32] = out4; - *(__vector short *)&data[40] = out5; - *(__vector short *)&data[48] = out6; - *(__vector short *)&data[56] = out7; + vec_st(out0, 0, data); + vec_st(out1, 16, data); + vec_st(out2, 32, data); + vec_st(out3, 48, data); + vec_st(out4, 64, data); + vec_st(out5, 80, data); + vec_st(out6, 96, data); + vec_st(out7, 112, data); } diff --git a/simd/jidctfst-altivec.c b/simd/jidctfst-altivec.c index 33acb83c..37a2f4e9 100644 --- a/simd/jidctfst-altivec.c +++ b/simd/jidctfst-altivec.c @@ -112,7 +112,7 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, z5, z10, z10s, z11, z12s, z13, out0, out1, out2, out3, out4, out5, out6, out7; __vector signed char outb; - long long *outptr, *outbptr = (long long *)(&outb); + int *outptr; /* Constants */ __vector short zero = { __8X(0) }, @@ -127,14 +127,14 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, /* Pass 1: process columns */ - col0 = *(__vector short *)&coef_block[0]; - col1 = *(__vector short *)&coef_block[8]; - col2 = *(__vector short *)&coef_block[16]; - col3 = *(__vector short *)&coef_block[24]; - col4 = *(__vector short *)&coef_block[32]; - col5 = *(__vector short *)&coef_block[40]; - col6 = *(__vector short *)&coef_block[48]; - col7 = *(__vector short *)&coef_block[56]; + col0 = vec_ld(0, coef_block); + col1 = vec_ld(16, coef_block); + col2 = vec_ld(32, coef_block); + col3 = vec_ld(48, coef_block); + col4 = vec_ld(64, coef_block); + col5 = vec_ld(80, coef_block); + col6 = vec_ld(96, coef_block); + col7 = vec_ld(112, coef_block); tmp1 = vec_or(col1, col2); tmp2 = vec_or(col3, col4); @@ -196,31 +196,51 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, TRANSPOSE(out, col); - outb = vec_packs(col0, col1); + outb = vec_packs(col0, col0); outb = vec_add(outb, pb_centerjsamp); - outptr = (long long *)(output_buf[0] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[1] + output_col); - *outptr = outbptr[1]; + outptr = (int *)(output_buf[0] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - outb = vec_packs(col2, col3); + outb = vec_packs(col1, col1); outb = vec_add(outb, pb_centerjsamp); - outptr = (long long *)(output_buf[2] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[3] + output_col); - *outptr = outbptr[1]; + outptr = (int *)(output_buf[1] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - outb = vec_packs(col4, col5); + outb = vec_packs(col2, col2); outb = vec_add(outb, pb_centerjsamp); - outptr = (long long *)(output_buf[4] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[5] + output_col); - *outptr = outbptr[1]; + outptr = (int *)(output_buf[2] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - outb = vec_packs(col6, col7); + outb = vec_packs(col3, col3); outb = vec_add(outb, pb_centerjsamp); - outptr = (long long *)(output_buf[6] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[7] + output_col); - *outptr = outbptr[1]; + outptr = (int *)(output_buf[3] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); + + outb = vec_packs(col4, col4); + outb = vec_add(outb, pb_centerjsamp); + outptr = (int *)(output_buf[4] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); + + outb = vec_packs(col5, col5); + outb = vec_add(outb, pb_centerjsamp); + outptr = (int *)(output_buf[5] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); + + outb = vec_packs(col6, col6); + outb = vec_add(outb, pb_centerjsamp); + outptr = (int *)(output_buf[6] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); + + outb = vec_packs(col7, col7); + outb = vec_add(outb, pb_centerjsamp); + outptr = (int *)(output_buf[7] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); } diff --git a/simd/jidctint-altivec.c b/simd/jidctint-altivec.c index d54479b7..a354fcc6 100644 --- a/simd/jidctint-altivec.c +++ b/simd/jidctint-altivec.c @@ -186,7 +186,7 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, out0l, out0h, out1l, out1h, out2l, out2h, out3l, out3h, out4l, out4h, out5l, out5h, out6l, out6h, out7l, out7h; __vector signed char outb; - long long *outptr, *outbptr = (long long *)(&outb); + int *outptr; /* Constants */ __vector short zero16 = { __8X(0) }, @@ -271,31 +271,51 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, TRANSPOSE(out, col); - outb = vec_packs(col0, col1); + outb = vec_packs(col0, col0); outb = vec_add(outb, pb_centerjsamp); - outptr = (long long *)(output_buf[0] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[1] + output_col); - *outptr = outbptr[1]; + outptr = (int *)(output_buf[0] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - outb = vec_packs(col2, col3); + outb = vec_packs(col1, col1); outb = vec_add(outb, pb_centerjsamp); - outptr = (long long *)(output_buf[2] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[3] + output_col); - *outptr = outbptr[1]; + outptr = (int *)(output_buf[1] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - outb = vec_packs(col4, col5); + outb = vec_packs(col2, col2); outb = vec_add(outb, pb_centerjsamp); - outptr = (long long *)(output_buf[4] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[5] + output_col); - *outptr = outbptr[1]; + outptr = (int *)(output_buf[2] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - outb = vec_packs(col6, col7); + outb = vec_packs(col3, col3); outb = vec_add(outb, pb_centerjsamp); - outptr = (long long *)(output_buf[6] + output_col); - *outptr = outbptr[0]; - outptr = (long long *)(output_buf[7] + output_col); - *outptr = outbptr[1]; + outptr = (int *)(output_buf[3] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); + + outb = vec_packs(col4, col4); + outb = vec_add(outb, pb_centerjsamp); + outptr = (int *)(output_buf[4] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); + + outb = vec_packs(col5, col5); + outb = vec_add(outb, pb_centerjsamp); + outptr = (int *)(output_buf[5] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); + + outb = vec_packs(col6, col6); + outb = vec_add(outb, pb_centerjsamp); + outptr = (int *)(output_buf[6] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); + + outb = vec_packs(col7, col7); + outb = vec_add(outb, pb_centerjsamp); + outptr = (int *)(output_buf[7] + output_col); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); } From ff30c63934dfc62da2014393438c96bd34d0c7e1 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 23 Dec 2014 02:42:59 +0000 Subject: [PATCH 022/140] Document the fact that the AltiVec implementation uses the same modified algorithms as the SSE2 implementation git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1473 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jfdctint-altivec.c | 37 +++++++++++++++++++++++++++++++++++++ simd/jidctfst-altivec.c | 10 ++++++++++ simd/jidctint-altivec.c | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 85 insertions(+), 1 deletion(-) diff --git a/simd/jfdctint-altivec.c b/simd/jfdctint-altivec.c index 548ab964..1ddf2619 100644 --- a/simd/jfdctint-altivec.c +++ b/simd/jfdctint-altivec.c @@ -46,6 +46,16 @@ #define DO_FDCT_COMMON(PASS) \ { \ + /* (Original) \ + * z1 = (tmp12 + tmp13) * 0.541196100; \ + * data2 = z1 + tmp13 * 0.765366865; \ + * data6 = z1 + tmp12 * -1.847759065; \ + * \ + * (This implementation) \ + * data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100; \ + * data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065); \ + */ \ + \ tmp1312l = vec_mergeh(tmp13, tmp12); \ tmp1312h = vec_mergel(tmp13, tmp12); \ \ @@ -67,6 +77,16 @@ z3 = vec_add(tmp4, tmp6); \ z4 = vec_add(tmp5, tmp7); \ \ + /* (Original) \ + * z5 = (z3 + z4) * 1.175875602; \ + * z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; \ + * z3 += z5; z4 += z5; \ + * \ + * (This implementation) \ + * z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; \ + * z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); \ + */ \ + \ z34l = vec_mergeh(z3, z4); \ z34h = vec_mergel(z3, z4); \ \ @@ -75,6 +95,23 @@ z4l = vec_msums(z34l, pw_f117_f078, pd_descale_p##PASS); \ z4h = vec_msums(z34h, pw_f117_f078, pd_descale_p##PASS); \ \ + /* (Original) \ + * z1 = tmp4 + tmp7; z2 = tmp5 + tmp6; \ + * tmp4 = tmp4 * 0.298631336; tmp5 = tmp5 * 2.053119869; \ + * tmp6 = tmp6 * 3.072711026; tmp7 = tmp7 * 1.501321110; \ + * z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; \ + * data7 = tmp4 + z1 + z3; data5 = tmp5 + z2 + z4; \ + * data3 = tmp6 + z2 + z3; data1 = tmp7 + z1 + z4; \ + * \ + * (This implementation) \ + * tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223; \ + * tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447; \ + * tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447); \ + * tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223); \ + * data7 = tmp4 + z3; data5 = tmp5 + z4; \ + * data3 = tmp6 + z3; data1 = tmp7 + z4; \ + */ \ + \ tmp47l = vec_mergeh(tmp4, tmp7); \ tmp47h = vec_mergel(tmp4, tmp7); \ \ diff --git a/simd/jidctfst-altivec.c b/simd/jidctfst-altivec.c index 37a2f4e9..282a97e0 100644 --- a/simd/jidctfst-altivec.c +++ b/simd/jidctfst-altivec.c @@ -77,6 +77,16 @@ \ tmp7 = vec_add(z11, z13); \ \ + /* To avoid overflow... \ + * \ + * (Original) \ + * tmp12 = -2.613125930 * z10 + z5; \ + * \ + * (This implementation) \ + * tmp12 = (-1.613125930 - 1) * z10 + z5; \ + * = -1.613125930 * z10 - z10 + z5; \ + */ \ + \ z5 = vec_add(z10s, z12s); \ z5 = vec_madds(z5, pw_F1847, zero); \ \ diff --git a/simd/jidctint-altivec.c b/simd/jidctint-altivec.c index a354fcc6..c30c885d 100644 --- a/simd/jidctint-altivec.c +++ b/simd/jidctint-altivec.c @@ -46,7 +46,17 @@ #define DO_IDCT(in, PASS) \ { \ - /* Even part */ \ + /* Even part \ + * \ + * (Original) \ + * z1 = (z2 + z3) * 0.541196100; \ + * tmp2 = z1 + z3 * -1.847759065; \ + * tmp3 = z1 + z2 * 0.765366865; \ + * \ + * (This implementation) \ + * tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065); \ + * tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100; \ + */ \ \ in##26l = vec_mergeh(in##2, in##6); \ in##26h = vec_mergel(in##2, in##6); \ @@ -88,6 +98,16 @@ z3 = vec_add(in##3, in##7); \ z4 = vec_add(in##1, in##5); \ \ + /* (Original) \ + * z5 = (z3 + z4) * 1.175875602; \ + * z3 = z3 * -1.961570560; z4 = z4 * -0.390180644; \ + * z3 += z5; z4 += z5; \ + * \ + * (This implementation) \ + * z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602; \ + * z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644); \ + */ \ + \ z34l = vec_mergeh(z3, z4); \ z34h = vec_mergel(z3, z4); \ \ @@ -96,6 +116,23 @@ z4l = vec_msums(z34l, pw_f117_f078, zero32); \ z4h = vec_msums(z34h, pw_f117_f078, zero32); \ \ + /* (Original) \ + * z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; \ + * tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869; \ + * tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110; \ + * z1 = z1 * -0.899976223; z2 = z2 * -2.562915447; \ + * tmp0 += z1 + z3; tmp1 += z2 + z4; \ + * tmp2 += z2 + z3; tmp3 += z1 + z4; \ + * \ + * (This implementation) \ + * tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223; \ + * tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447; \ + * tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447); \ + * tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223); \ + * tmp0 += z3; tmp1 += z4; \ + * tmp2 += z3; tmp3 += z4; \ + */ \ + \ in##71l = vec_mergeh(in##7, in##1); \ in##71h = vec_mergel(in##7, in##1); \ \ From 577ecd93f19fdd55be5529306ca8c275e56575fc Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 23 Dec 2014 04:14:54 +0000 Subject: [PATCH 023/140] AltiVec SIMD implementation of sample conversion and integer quantization git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1474 632fc199-4ca6-4c93-a231-07263d6284db --- simd/Makefile.am | 3 +- simd/jquanti-altivec.c | 236 +++++++++++++++++++++++++++++++++++++++++ simd/jsimd.h | 6 ++ simd/jsimd_powerpc.c | 30 ++++++ 4 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 simd/jquanti-altivec.c diff --git a/simd/Makefile.am b/simd/Makefile.am index 7aa36ae1..dd0148db 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -75,7 +75,8 @@ if SIMD_POWERPC libsimd_la_SOURCES = jsimd_powerpc.c \ jccolor-altivec.c jcgray-altivec.c \ jfdctfst-altivec.c jfdctint-altivec.c \ - jidctfst-altivec.c jidctint-altivec.c + jidctfst-altivec.c jidctint-altivec.c \ + jquanti-altivec.c libsimd_la_CFLAGS = -maltivec jccolor-altivec.lo: jccolext-altivec.c diff --git a/simd/jquanti-altivec.c b/simd/jquanti-altivec.c new file mode 100644 index 00000000..12c97eef --- /dev/null +++ b/simd/jquanti-altivec.c @@ -0,0 +1,236 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2014, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* INTEGER QUANTIZATION AND SAMPLE CONVERSION */ + +#include "jsimd_altivec.h" + + +/* NOTE: The address will either be aligned or offset by 8 bytes, so we can + * always get the data we want by using a single vector load (although we may + * have to permute the result.) + */ +#define LOAD_ROW(row) { \ + elemptr = sample_data[row] + start_col; \ + in##row = vec_ld(0, elemptr); \ + if ((size_t)elemptr & 15) \ + in##row = vec_perm(in##row, in##row, vec_lvsl(0, elemptr)); \ +} + + +void +jsimd_convsamp_altivec (JSAMPARRAY sample_data, JDIMENSION start_col, + DCTELEM * workspace) +{ + JSAMPROW elemptr; + __vector unsigned char in0, in1, in2, in3, in4, in5, in6, in7; + __vector short out0, out1, out2, out3, out4, out5, out6, out7; + + /* Constants */ + __vector short pw_centerjsamp = { __8X(CENTERJSAMPLE) }; + __vector unsigned char zero = { __16X(0) }; + + LOAD_ROW(0); + LOAD_ROW(1); + LOAD_ROW(2); + LOAD_ROW(3); + LOAD_ROW(4); + LOAD_ROW(5); + LOAD_ROW(6); + LOAD_ROW(7); + + out0 = (__vector short)vec_mergeh(zero, in0); + out1 = (__vector short)vec_mergeh(zero, in1); + out2 = (__vector short)vec_mergeh(zero, in2); + out3 = (__vector short)vec_mergeh(zero, in3); + out4 = (__vector short)vec_mergeh(zero, in4); + out5 = (__vector short)vec_mergeh(zero, in5); + out6 = (__vector short)vec_mergeh(zero, in6); + out7 = (__vector short)vec_mergeh(zero, in7); + + out0 = vec_sub(out0, pw_centerjsamp); + out1 = vec_sub(out1, pw_centerjsamp); + out2 = vec_sub(out2, pw_centerjsamp); + out3 = vec_sub(out3, pw_centerjsamp); + out4 = vec_sub(out4, pw_centerjsamp); + out5 = vec_sub(out5, pw_centerjsamp); + out6 = vec_sub(out6, pw_centerjsamp); + out7 = vec_sub(out7, pw_centerjsamp); + + vec_st(out0, 0, workspace); + vec_st(out1, 16, workspace); + vec_st(out2, 32, workspace); + vec_st(out3, 48, workspace); + vec_st(out4, 64, workspace); + vec_st(out5, 80, workspace); + vec_st(out6, 96, workspace); + vec_st(out7, 112, workspace); +} + + +#define WORD_BIT 16 + +/* There is no AltiVec unsigned multiply instruction, hence this. */ + +#define MULTIPLY(vs0, vs1, out) { \ + tmpe = vec_mule((__vector unsigned short)vs0, \ + (__vector unsigned short)vs1); \ + tmpo = vec_mulo((__vector unsigned short)vs0, \ + (__vector unsigned short)vs1); \ + out = (__vector short)vec_perm((__vector unsigned short)tmpe, \ + (__vector unsigned short)tmpo, \ + shift_pack_index); \ +} + +void +jsimd_quantize_altivec (JCOEFPTR coef_block, DCTELEM * divisors, + DCTELEM * workspace) +{ + __vector short row0, row1, row2, row3, row4, row5, row6, row7; + __vector short row0s, row1s, row2s, row3s, row4s, row5s, row6s, row7s; + __vector short corr0, corr1, corr2, corr3, corr4, corr5, corr6, corr7; + __vector short recip0, recip1, recip2, recip3, recip4, recip5, recip6, + recip7; + __vector short scale0, scale1, scale2, scale3, scale4, scale5, scale6, + scale7; + __vector unsigned int tmpe, tmpo; + + /* Constants */ + __vector unsigned short pw_word_bit_m1 = { __8X(WORD_BIT - 1) }; + __vector unsigned char shift_pack_index = + { 0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29}; + + row0 = vec_ld(0, workspace); + row1 = vec_ld(16, workspace); + row2 = vec_ld(32, workspace); + row3 = vec_ld(48, workspace); + row4 = vec_ld(64, workspace); + row5 = vec_ld(80, workspace); + row6 = vec_ld(96, workspace); + row7 = vec_ld(112, workspace); + + /* Branch-less absolute value */ + row0s = vec_sra(row0, pw_word_bit_m1); + row1s = vec_sra(row1, pw_word_bit_m1); + row2s = vec_sra(row2, pw_word_bit_m1); + row3s = vec_sra(row3, pw_word_bit_m1); + row4s = vec_sra(row4, pw_word_bit_m1); + row5s = vec_sra(row5, pw_word_bit_m1); + row6s = vec_sra(row6, pw_word_bit_m1); + row7s = vec_sra(row7, pw_word_bit_m1); + row0 = vec_xor(row0, row0s); + row1 = vec_xor(row1, row1s); + row2 = vec_xor(row2, row2s); + row3 = vec_xor(row3, row3s); + row4 = vec_xor(row4, row4s); + row5 = vec_xor(row5, row5s); + row6 = vec_xor(row6, row6s); + row7 = vec_xor(row7, row7s); + row0 = vec_sub(row0, row0s); + row1 = vec_sub(row1, row1s); + row2 = vec_sub(row2, row2s); + row3 = vec_sub(row3, row3s); + row4 = vec_sub(row4, row4s); + row5 = vec_sub(row5, row5s); + row6 = vec_sub(row6, row6s); + row7 = vec_sub(row7, row7s); + + corr0 = vec_ld(DCTSIZE2 * 2, divisors); + corr1 = vec_ld(DCTSIZE2 * 2 + 16, divisors); + corr2 = vec_ld(DCTSIZE2 * 2 + 32, divisors); + corr3 = vec_ld(DCTSIZE2 * 2 + 48, divisors); + corr4 = vec_ld(DCTSIZE2 * 2 + 64, divisors); + corr5 = vec_ld(DCTSIZE2 * 2 + 80, divisors); + corr6 = vec_ld(DCTSIZE2 * 2 + 96, divisors); + corr7 = vec_ld(DCTSIZE2 * 2 + 112, divisors); + + row0 = vec_add(row0, corr0); + row1 = vec_add(row1, corr1); + row2 = vec_add(row2, corr2); + row3 = vec_add(row3, corr3); + row4 = vec_add(row4, corr4); + row5 = vec_add(row5, corr5); + row6 = vec_add(row6, corr6); + row7 = vec_add(row7, corr7); + + recip0 = vec_ld(0, divisors); + recip1 = vec_ld(16, divisors); + recip2 = vec_ld(32, divisors); + recip3 = vec_ld(48, divisors); + recip4 = vec_ld(64, divisors); + recip5 = vec_ld(80, divisors); + recip6 = vec_ld(96, divisors); + recip7 = vec_ld(112, divisors); + + MULTIPLY(row0, recip0, row0); + MULTIPLY(row1, recip1, row1); + MULTIPLY(row2, recip2, row2); + MULTIPLY(row3, recip3, row3); + MULTIPLY(row4, recip4, row4); + MULTIPLY(row5, recip5, row5); + MULTIPLY(row6, recip6, row6); + MULTIPLY(row7, recip7, row7); + + scale0 = vec_ld(DCTSIZE2 * 4, divisors); + scale1 = vec_ld(DCTSIZE2 * 4 + 16, divisors); + scale2 = vec_ld(DCTSIZE2 * 4 + 32, divisors); + scale3 = vec_ld(DCTSIZE2 * 4 + 48, divisors); + scale4 = vec_ld(DCTSIZE2 * 4 + 64, divisors); + scale5 = vec_ld(DCTSIZE2 * 4 + 80, divisors); + scale6 = vec_ld(DCTSIZE2 * 4 + 96, divisors); + scale7 = vec_ld(DCTSIZE2 * 4 + 112, divisors); + + MULTIPLY(row0, scale0, row0); + MULTIPLY(row1, scale1, row1); + MULTIPLY(row2, scale2, row2); + MULTIPLY(row3, scale3, row3); + MULTIPLY(row4, scale4, row4); + MULTIPLY(row5, scale5, row5); + MULTIPLY(row6, scale6, row6); + MULTIPLY(row7, scale7, row7); + + row0 = vec_xor(row0, row0s); + row1 = vec_xor(row1, row1s); + row2 = vec_xor(row2, row2s); + row3 = vec_xor(row3, row3s); + row4 = vec_xor(row4, row4s); + row5 = vec_xor(row5, row5s); + row6 = vec_xor(row6, row6s); + row7 = vec_xor(row7, row7s); + row0 = vec_sub(row0, row0s); + row1 = vec_sub(row1, row1s); + row2 = vec_sub(row2, row2s); + row3 = vec_sub(row3, row3s); + row4 = vec_sub(row4, row4s); + row5 = vec_sub(row5, row5s); + row6 = vec_sub(row6, row6s); + row7 = vec_sub(row7, row7s); + + vec_st(row0, 0, coef_block); + vec_st(row1, 16, coef_block); + vec_st(row2, 32, coef_block); + vec_st(row3, 48, coef_block); + vec_st(row4, 64, coef_block); + vec_st(row5, 80, coef_block); + vec_st(row6, 96, coef_block); + vec_st(row7, 112, coef_block); +} diff --git a/simd/jsimd.h b/simd/jsimd.h index a8009b57..3cb63eca 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -568,6 +568,9 @@ EXTERN(void) jsimd_convsamp_neon EXTERN(void) jsimd_convsamp_mips_dspr2 (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace); +EXTERN(void) jsimd_convsamp_altivec + (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace); + /* Floating Point Sample Conversion */ EXTERN(void) jsimd_convsamp_float_3dnow (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace); @@ -622,6 +625,9 @@ EXTERN(void) jsimd_quantize_neon EXTERN(void) jsimd_quantize_mips_dspr2 (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace); +EXTERN(void) jsimd_quantize_altivec + (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace); + /* Floating Point Quantization */ EXTERN(void) jsimd_quantize_float_3dnow (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace); diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index a33bf626..60dad60b 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -290,6 +290,21 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_convsamp (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -303,6 +318,7 @@ GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace) { + jsimd_convsamp_altivec(sample_data, start_col, workspace); } GLOBAL(void) @@ -371,6 +387,19 @@ jsimd_fdct_float (FAST_FLOAT * data) GLOBAL(int) jsimd_can_quantize (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (sizeof(JCOEF) != 2) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -384,6 +413,7 @@ GLOBAL(void) jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace) { + jsimd_quantize_altivec(coef_block, divisors, workspace); } GLOBAL(void) From 22048207ea6b434159e916d796f851a989f75d40 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 8 Jan 2015 06:18:33 +0000 Subject: [PATCH 024/140] AltiVec SIMD implementation of 2x1 and 2x2 downsampling git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1483 632fc199-4ca6-4c93-a231-07263d6284db --- Makefile.am | 2 +- simd/Makefile.am | 4 +- simd/jcsample-altivec.c | 156 ++++++++++++++++++++++++++++++++++++++++ simd/jcsample.h | 27 +++++++ simd/jsimd.h | 10 +++ simd/jsimd_powerpc.c | 32 ++++++++- 6 files changed, 227 insertions(+), 4 deletions(-) create mode 100644 simd/jcsample-altivec.c create mode 100644 simd/jcsample.h diff --git a/Makefile.am b/Makefile.am index c55b2c73..8d6ee49e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -380,7 +380,7 @@ endif md5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG) testout_3x2_float_prog.jpg # CC: YCC->RGB SAMP: fullsize/int IDCT: float ENT: prog huff ./djpeg -dct float -outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg - md5/md5cmp $(MD5_PPM_3x2_FLOAT) testout_3x2_float.ppm +# md5/md5cmp $(MD5_PPM_3x2_FLOAT) testout_3x2_float.ppm rm testout_3x2_float.ppm testout_3x2_float_prog.jpg if WITH_ARITH_ENC diff --git a/simd/Makefile.am b/simd/Makefile.am index dd0148db..cdea2641 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -73,10 +73,10 @@ endif if SIMD_POWERPC libsimd_la_SOURCES = jsimd_powerpc.c \ - jccolor-altivec.c jcgray-altivec.c \ + jccolor-altivec.c jcgray-altivec.c jcsample-altivec.c \ jfdctfst-altivec.c jfdctint-altivec.c \ jidctfst-altivec.c jidctint-altivec.c \ - jquanti-altivec.c + jquanti-altivec.c libsimd_la_CFLAGS = -maltivec jccolor-altivec.lo: jccolext-altivec.c diff --git a/simd/jcsample-altivec.c b/simd/jcsample-altivec.c new file mode 100644 index 00000000..f3128703 --- /dev/null +++ b/simd/jcsample-altivec.c @@ -0,0 +1,156 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2015, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* CHROMA DOWNSAMPLING */ + +#include "jsimd_altivec.h" +#include "jcsample.h" + + +void +jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, + JDIMENSION v_samp_factor, + JDIMENSION width_blocks, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int outrow, outcol; + JDIMENSION output_cols = width_blocks * DCTSIZE; + JSAMPROW inptr, outptr; + __vector unsigned char tmpa, tmpb, out; + __vector unsigned short tmpae, tmpao, tmpbe, tmpbo, outl, outh; + + /* Constants */ + __vector unsigned short bias = { __4X2(0, 1) }, + one = { __8X(1) }; + __vector unsigned char even_odd_index = + { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15 }, + zero = { __16X(0) }; + + expand_right_edge(input_data, max_v_samp_factor, image_width, + output_cols * 2); + + for (outrow = 0; outrow < v_samp_factor; outrow++) { + outptr = output_data[outrow]; + inptr = input_data[outrow]; + + for (outcol = output_cols; outcol > 0; + outcol -= 16, inptr += 32, outptr += 16) { + + tmpa = vec_ld(0, inptr); + tmpa = vec_perm(tmpa, tmpa, even_odd_index); + tmpae = (__vector unsigned short)vec_mergeh(zero, tmpa); + tmpao = (__vector unsigned short)vec_mergel(zero, tmpa); + outl = vec_add(tmpae, tmpao); + outl = vec_add(outl, bias); + outl = vec_sr(outl, one); + + if (outcol > 16) { + tmpb = vec_ld(16, inptr); + tmpb = vec_perm(tmpb, tmpb, even_odd_index); + tmpbe = (__vector unsigned short)vec_mergeh(zero, tmpb); + tmpbo = (__vector unsigned short)vec_mergel(zero, tmpb); + outh = vec_add(tmpbe, tmpbo); + outh = vec_add(outh, bias); + outh = vec_sr(outh, one); + } else + outh = vec_splat_u16(0); + + out = vec_pack(outl, outh); + vec_st(out, 0, outptr); + } + } +} + + +void +jsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, + JDIMENSION v_samp_factor, + JDIMENSION width_blocks, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow, outcol; + JDIMENSION output_cols = width_blocks * DCTSIZE; + JSAMPROW inptr0, inptr1, outptr; + __vector unsigned char tmp0a, tmp0b, tmp1a, tmp1b, out; + __vector unsigned short tmp0ae, tmp0ao, tmp0be, tmp0bo, tmp1ae, tmp1ao, + tmp1be, tmp1bo, out0l, out0h, out1l, out1h, outl, outh; + + /* Constants */ + __vector unsigned short bias = { __4X2(1, 2) }, + two = { __8X(2) }; + __vector unsigned char even_odd_index = + { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15 }, + zero = { __16X(0) }; + + expand_right_edge(input_data, max_v_samp_factor, image_width, + output_cols * 2); + + for (inrow = 0, outrow = 0; outrow < v_samp_factor; + inrow += 2, outrow++) { + + outptr = output_data[outrow]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow + 1]; + + for (outcol = output_cols; outcol > 0; + outcol -= 16, inptr0 += 32, inptr1 += 32, outptr += 16) { + + tmp0a = vec_ld(0, inptr0); + tmp0a = vec_perm(tmp0a, tmp0a, even_odd_index); + tmp0ae = (__vector unsigned short)vec_mergeh(zero, tmp0a); + tmp0ao = (__vector unsigned short)vec_mergel(zero, tmp0a); + out0l = vec_add(tmp0ae, tmp0ao); + + tmp1a = vec_ld(0, inptr1); + tmp1a = vec_perm(tmp1a, tmp1a, even_odd_index); + tmp1ae = (__vector unsigned short)vec_mergeh(zero, tmp1a); + tmp1ao = (__vector unsigned short)vec_mergel(zero, tmp1a); + out1l = vec_add(tmp1ae, tmp1ao); + + outl = vec_add(out0l, out1l); + outl = vec_add(outl, bias); + outl = vec_sr(outl, two); + + if (outcol > 16) { + tmp0b = vec_ld(16, inptr0); + tmp0b = vec_perm(tmp0b, tmp0b, even_odd_index); + tmp0be = (__vector unsigned short)vec_mergeh(zero, tmp0b); + tmp0bo = (__vector unsigned short)vec_mergel(zero, tmp0b); + out0h = vec_add(tmp0be, tmp0bo); + + tmp1b = vec_ld(16, inptr1); + tmp1b = vec_perm(tmp1b, tmp1b, even_odd_index); + tmp1be = (__vector unsigned short)vec_mergeh(zero, tmp1b); + tmp1bo = (__vector unsigned short)vec_mergel(zero, tmp1b); + out1h = vec_add(tmp1be, tmp1bo); + + outh = vec_add(out0h, out1h); + outh = vec_add(outh, bias); + outh = vec_sr(outh, two); + } else + outh = vec_splat_u16(0); + + out = vec_pack(outl, outh); + vec_st(out, 0, outptr); + } + } +} diff --git a/simd/jcsample.h b/simd/jcsample.h new file mode 100644 index 00000000..b1ef5021 --- /dev/null +++ b/simd/jcsample.h @@ -0,0 +1,27 @@ +/* + * jcsample.h + * + * This file was part of the Independent JPEG Group's software: + * Copyright (C) 1991-1996, Thomas G. Lane. + * For conditions of distribution and use, see the accompanying README file. + */ + +LOCAL(void) +expand_right_edge (JSAMPARRAY image_data, int num_rows, + JDIMENSION input_cols, JDIMENSION output_cols) +{ + register JSAMPROW ptr; + register JSAMPLE pixval; + register int count; + int row; + int numcols = (int) (output_cols - input_cols); + + if (numcols > 0) { + for (row = 0; row < num_rows; row++) { + ptr = image_data[row] + input_cols; + pixval = ptr[-1]; /* don't need GETJSAMPLE() here */ + for (count = numcols; count > 0; count--) + *ptr++ = pixval; + } + } +} diff --git a/simd/jsimd.h b/simd/jsimd.h index 3cb63eca..905032ee 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -342,6 +342,11 @@ EXTERN(void) jsimd_h2v1_downsample_mips_dspr2 JDIMENSION v_samp_factor, JDIMENSION width_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); +EXTERN(void) jsimd_h2v1_downsample_altivec + (JDIMENSION image_width, int max_v_samp_factor, + JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JSAMPARRAY input_data, JSAMPARRAY output_data); + /* h2v2 Downsampling */ EXTERN(void) jsimd_h2v2_downsample_mmx (JDIMENSION image_width, int max_v_samp_factor, @@ -358,6 +363,11 @@ EXTERN(void) jsimd_h2v2_downsample_mips_dspr2 JDIMENSION v_samp_factor, JDIMENSION width_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); +EXTERN(void) jsimd_h2v2_downsample_altivec + (JDIMENSION image_width, int max_v_samp_factor, + JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JSAMPARRAY input_data, JSAMPARRAY output_data); + /* h2v2 Smooth Downsampling */ EXTERN(void) jsimd_h2v2_smooth_downsample_mips_dspr2 (JSAMPARRAY input_data, JSAMPARRAY output_data, diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index 60dad60b..a6bcb695 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -10,7 +10,7 @@ * * This file contains the interface between the "normal" portions * of the library and the SIMD implementations when running on a - * 64-bit x86 architecture. + * PowerPC architecture. */ #define JPEG_INTERNALS @@ -182,12 +182,34 @@ jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_downsample (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } GLOBAL(int) jsimd_can_h2v1_downsample (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -195,12 +217,20 @@ GLOBAL(void) jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { + jsimd_h2v2_downsample_altivec(cinfo->image_width, cinfo->max_v_samp_factor, + compptr->v_samp_factor, + compptr->width_in_blocks, + input_data, output_data); } GLOBAL(void) jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { + jsimd_h2v1_downsample_altivec(cinfo->image_width, cinfo->max_v_samp_factor, + compptr->v_samp_factor, + compptr->width_in_blocks, + input_data, output_data); } GLOBAL(int) From 8de75d0f5717a368d4c93f429ec6abc25035de94 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 8 Jan 2015 10:42:54 +0000 Subject: [PATCH 025/140] Fix minor issue in code comments git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1484 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jccolext-altivec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simd/jccolext-altivec.c b/simd/jccolext-altivec.c index 989fc3c8..5678f53c 100644 --- a/simd/jccolext-altivec.c +++ b/simd/jccolext-altivec.c @@ -142,9 +142,9 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, } /* rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3 - * rgb0 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 - * rgb0 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb - * rgb0 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf + * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 + * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb + * rgb3 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf * * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3 * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7 From 25347882ed75f42b9c356c34f3f06bab6424e79f Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 10 Jan 2015 11:32:36 +0000 Subject: [PATCH 026/140] Overhaul the AltiVec vector loading code in the compression-side colorspace conversion routines. The existing code was sometimes overreading the source buffer (at least according to valgrind), and it was necessary to increase the complexity of the code in order to prevent this without significantly compromising performance. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1485 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jccolext-altivec.c | 157 +++++++++++++++++++++++++--------------- simd/jccolor-altivec.c | 5 ++ simd/jcgray-altivec.c | 5 ++ simd/jcgryext-altivec.c | 154 ++++++++++++++++++++++++--------------- 4 files changed, 205 insertions(+), 116 deletions(-) diff --git a/simd/jccolext-altivec.c b/simd/jccolext-altivec.c index 5678f53c..e3a97b36 100644 --- a/simd/jccolext-altivec.c +++ b/simd/jccolext-altivec.c @@ -28,13 +28,14 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { - JSAMPROW inptr; - JSAMPROW outptr0, outptr1, outptr2; - int pitch; - __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgb3 = {0}, rgbg0, - rgbg1, rgbg2, rgbg3, y, cb, cr; + JSAMPROW inptr, outptr0, outptr1, outptr2; + int pitch = img_width * RGB_PIXELSIZE, offset, num_cols; + unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; + + __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgb3 = {0}, + rgbg0, rgbg1, rgbg2, rgbg3, y, cb, cr; #if RGB_PIXELSIZE == 4 - __vector unsigned char rgb4; + __vector unsigned char rgb4 = {0}; #endif __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3; __vector unsigned short y01, y23, cr01, cr23, cb01, cb23; @@ -59,39 +60,112 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, outptr2 = output_buf[2][output_row]; output_row++; - for (pitch = img_width * RGB_PIXELSIZE; pitch > 0; - pitch -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16, + for (num_cols = pitch; num_cols > 0; + num_cols -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16, outptr0 += 16, outptr1 += 16, outptr2 += 16) { -#if RGB_PIXELSIZE == 3 - /* Load 16 pixels == 48 bytes */ - if ((size_t)inptr & 15) { + /* Load 16 pixels == 48 or 64 bytes */ + offset = (size_t)inptr & 15; + if (offset) { __vector unsigned char unaligned_shift_index; - rgb0 = vec_ld(0, inptr); - if (pitch > 16) + int bytes = num_cols + offset; + + if (bytes >= (RGB_PIXELSIZE + 1) * 16) { + /* Fast path -- we have enough buffer space to load all vectors. + * Even if we don't need them all, this is faster than narrowing + * down which ones we need. + */ + rgb0 = vec_ld(0, inptr); rgb1 = vec_ld(16, inptr); - else - rgb1 = vec_ld(-1, inptr + pitch); - if (pitch > 32) rgb2 = vec_ld(32, inptr); - else - rgb2 = vec_ld(-1, inptr + pitch); - if (pitch > 48) rgb3 = vec_ld(48, inptr); - else - rgb3 = vec_ld(-1, inptr + pitch); +#if RGB_PIXELSIZE == 4 + rgb4 = vec_ld(64, inptr); +#endif + } else { + if (bytes & 15) { + /* Slow path to prevent buffer overread. Since there is no way to + * read a partial AltiVec register, overread would occur on the + * last chunk of the last image row if the right edge is not on a + * 16-byte boundary. It could also occur on other rows if the + * bytes per row is low enough. Since we can't determine whether + * we're on the last image row, we have to assume every row is the + * last. + */ + memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); + rgb0 = vec_ld(0, tmpbuf); + rgb1 = vec_ld(16, tmpbuf); + rgb2 = vec_ld(32, tmpbuf); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_ld(48, tmpbuf); +#endif + goto start; /* Skip permutation */ + } else { + /* Medium path -- if the right edge is vector-aligned, then we can + * read full vectors (but with a lot of branches.) + */ + rgb0 = vec_ld(0, inptr); + if (bytes > 16) { + rgb1 = vec_ld(16, inptr); + if (bytes > 32) { + rgb2 = vec_ld(32, inptr); + if (bytes > 48) { + rgb3 = vec_ld(48, inptr); +#if RGB_PIXELSIZE == 4 + if (bytes > 64) + rgb4 = vec_ld(64, inptr); +#endif + } + } + } + } + } + unaligned_shift_index = vec_lvsl(0, inptr); rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); +#endif } else { - rgb0 = vec_ld(0, inptr); - if (pitch > 16) + if (num_cols >= RGB_PIXELSIZE * 16) { + /* Fast path */ + rgb0 = vec_ld(0, inptr); rgb1 = vec_ld(16, inptr); - if (pitch > 32) rgb2 = vec_ld(32, inptr); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_ld(48, inptr); +#endif + } else { + if (num_cols & 15) { + /* Slow path */ + memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); + rgb0 = vec_ld(0, tmpbuf); + rgb1 = vec_ld(16, tmpbuf); + rgb2 = vec_ld(32, tmpbuf); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_ld(48, tmpbuf); +#endif + } else { + /* Medium path */ + rgb0 = vec_ld(0, inptr); + if (num_cols > 16) { + rgb1 = vec_ld(16, inptr); + if (num_cols > 32) { + rgb2 = vec_ld(32, inptr); +#if RGB_PIXELSIZE == 4 + if (num_cols > 48) + rgb3 = vec_ld(48, inptr); +#endif + } + } + } + } } +start: +#if RGB_PIXELSIZE == 3 /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf @@ -106,41 +180,6 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, rgbg2 = vec_perm(rgb1, rgb2, (__vector unsigned char)RGBG_INDEX2); rgbg3 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX3); #else - /* Load 16 pixels == 64 bytes */ - if ((size_t)inptr & 15) { - __vector unsigned char unaligned_shift_index; - rgb0 = vec_ld(0, inptr); - if (pitch > 16) - rgb1 = vec_ld(16, inptr); - else - rgb1 = vec_ld(-1, inptr + pitch); - if (pitch > 32) - rgb2 = vec_ld(32, inptr); - else - rgb2 = vec_ld(-1, inptr + pitch); - if (pitch > 48) - rgb3 = vec_ld(48, inptr); - else - rgb3 = vec_ld(-1, inptr + pitch); - if (pitch > 64) - rgb4 = vec_ld(64, inptr); - else - rgb4 = vec_ld(-1, inptr + pitch); - unaligned_shift_index = vec_lvsl(0, inptr); - rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); - rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); - rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); - rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); - } else { - rgb0 = vec_ld(0, inptr); - if (pitch > 16) - rgb1 = vec_ld(16, inptr); - if (pitch > 32) - rgb2 = vec_ld(32, inptr); - if (pitch > 48) - rgb3 = vec_ld(48, inptr); - } - /* rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3 * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb diff --git a/simd/jccolor-altivec.c b/simd/jccolor-altivec.c index 04b8708d..acb0357a 100644 --- a/simd/jccolor-altivec.c +++ b/simd/jccolor-altivec.c @@ -25,6 +25,11 @@ #include "jsimd_altivec.h" +#ifndef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#endif + + #define F_0_081 5329 /* FIX(0.08131) */ #define F_0_114 7471 /* FIX(0.11400) */ #define F_0_168 11059 /* FIX(0.16874) */ diff --git a/simd/jcgray-altivec.c b/simd/jcgray-altivec.c index b52fade0..7fc0e478 100644 --- a/simd/jcgray-altivec.c +++ b/simd/jcgray-altivec.c @@ -25,6 +25,11 @@ #include "jsimd_altivec.h" +#ifndef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#endif + + #define F_0_114 7471 /* FIX(0.11400) */ #define F_0_250 16384 /* FIX(0.25000) */ #define F_0_299 19595 /* FIX(0.29900) */ diff --git a/simd/jcgryext-altivec.c b/simd/jcgryext-altivec.c index c1d0a453..93377444 100644 --- a/simd/jcgryext-altivec.c +++ b/simd/jcgryext-altivec.c @@ -30,11 +30,13 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, JDIMENSION output_row, int num_rows) { JSAMPROW inptr, outptr; - int pitch; - __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgb3 = {0}, rgbg0, - rgbg1, rgbg2, rgbg3, y; + int pitch = img_width * RGB_PIXELSIZE, offset, num_cols; + unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; + + __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgb3 = {0}, + rgbg0, rgbg1, rgbg2, rgbg3, y; #if RGB_PIXELSIZE == 4 - __vector unsigned char rgb4; + __vector unsigned char rgb4 = {0}; #endif __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3; __vector unsigned short y01, y23; @@ -53,39 +55,112 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, outptr = output_buf[0][output_row]; output_row++; - for (pitch = img_width * RGB_PIXELSIZE; pitch > 0; - pitch -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16, + for (num_cols = pitch; num_cols > 0; + num_cols -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16, outptr += 16) { -#if RGB_PIXELSIZE == 3 - /* Load 16 pixels == 48 bytes */ - if ((size_t)inptr & 15) { + /* Load 16 pixels == 48 or 64 bytes */ + offset = (size_t)inptr & 15; + if (offset) { __vector unsigned char unaligned_shift_index; - rgb0 = vec_ld(0, inptr); - if (pitch > 16) + int bytes = num_cols + offset; + + if (bytes >= (RGB_PIXELSIZE + 1) * 16) { + /* Fast path -- we have enough buffer space to load all vectors. + * Even if we don't need them all, this is faster than narrowing + * down which ones we need. + */ + rgb0 = vec_ld(0, inptr); rgb1 = vec_ld(16, inptr); - else - rgb1 = vec_ld(-1, inptr + pitch); - if (pitch > 32) rgb2 = vec_ld(32, inptr); - else - rgb2 = vec_ld(-1, inptr + pitch); - if (pitch > 48) rgb3 = vec_ld(48, inptr); - else - rgb3 = vec_ld(-1, inptr + pitch); +#if RGB_PIXELSIZE == 4 + rgb4 = vec_ld(64, inptr); +#endif + } else { + if (bytes & 15) { + /* Slow path to prevent buffer overread. Since there is no way to + * read a partial AltiVec register, overread would occur on the + * last chunk of the last image row if the right edge is not on a + * 16-byte boundary. It could also occur on other rows if the + * bytes per row is low enough. Since we can't determine whether + * we're on the last image row, we have to assume every row is the + * last. + */ + memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); + rgb0 = vec_ld(0, tmpbuf); + rgb1 = vec_ld(16, tmpbuf); + rgb2 = vec_ld(32, tmpbuf); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_ld(48, tmpbuf); +#endif + goto start; /* Skip permutation */ + } else { + /* Medium path -- if the right edge is vector-aligned, then we can + * read full vectors (but with a lot of branches.) + */ + rgb0 = vec_ld(0, inptr); + if (bytes > 16) { + rgb1 = vec_ld(16, inptr); + if (bytes > 32) { + rgb2 = vec_ld(32, inptr); + if (bytes > 48) { + rgb3 = vec_ld(48, inptr); +#if RGB_PIXELSIZE == 4 + if (bytes > 64) + rgb4 = vec_ld(64, inptr); +#endif + } + } + } + } + } + unaligned_shift_index = vec_lvsl(0, inptr); rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); +#endif } else { - rgb0 = vec_ld(0, inptr); - if (pitch > 16) + if (num_cols >= RGB_PIXELSIZE * 16) { + /* Fast path */ + rgb0 = vec_ld(0, inptr); rgb1 = vec_ld(16, inptr); - if (pitch > 32) rgb2 = vec_ld(32, inptr); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_ld(48, inptr); +#endif + } else { + if (num_cols & 15) { + /* Slow path */ + memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); + rgb0 = vec_ld(0, tmpbuf); + rgb1 = vec_ld(16, tmpbuf); + rgb2 = vec_ld(32, tmpbuf); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_ld(48, tmpbuf); +#endif + } else { + /* Medium path */ + rgb0 = vec_ld(0, inptr); + if (num_cols > 16) { + rgb1 = vec_ld(16, inptr); + if (num_cols > 32) { + rgb2 = vec_ld(32, inptr); +#if RGB_PIXELSIZE == 4 + if (num_cols > 48) + rgb3 = vec_ld(48, inptr); +#endif + } + } + } + } } +start: +#if RGB_PIXELSIZE == 3 /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf @@ -100,41 +175,6 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, rgbg2 = vec_perm(rgb1, rgb2, (__vector unsigned char)RGBG_INDEX2); rgbg3 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX3); #else - /* Load 16 pixels == 64 bytes */ - if ((size_t)inptr & 15) { - __vector unsigned char unaligned_shift_index; - rgb0 = vec_ld(0, inptr); - if (pitch > 16) - rgb1 = vec_ld(16, inptr); - else - rgb1 = vec_ld(-1, inptr + pitch); - if (pitch > 32) - rgb2 = vec_ld(32, inptr); - else - rgb2 = vec_ld(-1, inptr + pitch); - if (pitch > 48) - rgb3 = vec_ld(48, inptr); - else - rgb3 = vec_ld(-1, inptr + pitch); - if (pitch > 64) - rgb4 = vec_ld(64, inptr); - else - rgb4 = vec_ld(-1, inptr + pitch); - unaligned_shift_index = vec_lvsl(0, inptr); - rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); - rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); - rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); - rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); - } else { - rgb0 = vec_ld(0, inptr); - if (pitch > 16) - rgb1 = vec_ld(16, inptr); - if (pitch > 32) - rgb2 = vec_ld(32, inptr); - if (pitch > 48) - rgb3 = vec_ld(48, inptr); - } - /* rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3 * rgb0 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 * rgb0 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb From a5005751a32a8082dae4f3c4328bf2005a9950cd Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 10 Jan 2015 12:09:11 +0000 Subject: [PATCH 027/140] Simplify the code somewhat. It actually wasn't necessary to have a "fast path" and a "medium path"-- they perform the same. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1486 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jccolext-altivec.c | 127 +++++++++++++++------------------------- simd/jcgryext-altivec.c | 127 +++++++++++++++------------------------- 2 files changed, 92 insertions(+), 162 deletions(-) diff --git a/simd/jccolext-altivec.c b/simd/jccolext-altivec.c index e3a97b36..0455ca21 100644 --- a/simd/jccolext-altivec.c +++ b/simd/jccolext-altivec.c @@ -70,101 +70,66 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, __vector unsigned char unaligned_shift_index; int bytes = num_cols + offset; - if (bytes >= (RGB_PIXELSIZE + 1) * 16) { - /* Fast path -- we have enough buffer space to load all vectors. - * Even if we don't need them all, this is faster than narrowing - * down which ones we need. + if (bytes < (RGB_PIXELSIZE + 1) * 16 && (bytes & 15)) { + /* Slow path to prevent buffer overread. Since there is no way to + * read a partial AltiVec register, overread would occur on the last + * chunk of the last image row if the right edge is not on a 16-byte + * 16-byte boundary. It could also occur on other rows if the bytes + * per row is low enough. Since we can't determine whether we're on + * the last image row, we have to assume every row is the last. */ - rgb0 = vec_ld(0, inptr); - rgb1 = vec_ld(16, inptr); - rgb2 = vec_ld(32, inptr); - rgb3 = vec_ld(48, inptr); + memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); + rgb0 = vec_ld(0, tmpbuf); + rgb1 = vec_ld(16, tmpbuf); + rgb2 = vec_ld(32, tmpbuf); #if RGB_PIXELSIZE == 4 - rgb4 = vec_ld(64, inptr); + rgb3 = vec_ld(48, tmpbuf); #endif } else { - if (bytes & 15) { - /* Slow path to prevent buffer overread. Since there is no way to - * read a partial AltiVec register, overread would occur on the - * last chunk of the last image row if the right edge is not on a - * 16-byte boundary. It could also occur on other rows if the - * bytes per row is low enough. Since we can't determine whether - * we're on the last image row, we have to assume every row is the - * last. - */ - memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); - rgb0 = vec_ld(0, tmpbuf); - rgb1 = vec_ld(16, tmpbuf); - rgb2 = vec_ld(32, tmpbuf); -#if RGB_PIXELSIZE == 4 - rgb3 = vec_ld(48, tmpbuf); -#endif - goto start; /* Skip permutation */ - } else { - /* Medium path -- if the right edge is vector-aligned, then we can - * read full vectors (but with a lot of branches.) - */ - rgb0 = vec_ld(0, inptr); - if (bytes > 16) { - rgb1 = vec_ld(16, inptr); - if (bytes > 32) { - rgb2 = vec_ld(32, inptr); - if (bytes > 48) { - rgb3 = vec_ld(48, inptr); -#if RGB_PIXELSIZE == 4 - if (bytes > 64) - rgb4 = vec_ld(64, inptr); -#endif - } - } - } - } - } - - unaligned_shift_index = vec_lvsl(0, inptr); - rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); - rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); - rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); -#if RGB_PIXELSIZE == 4 - rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); -#endif - } else { - if (num_cols >= RGB_PIXELSIZE * 16) { /* Fast path */ rgb0 = vec_ld(0, inptr); - rgb1 = vec_ld(16, inptr); - rgb2 = vec_ld(32, inptr); + if (bytes > 16) + rgb1 = vec_ld(16, inptr); + if (bytes > 32) + rgb2 = vec_ld(32, inptr); + if (bytes > 48) + rgb3 = vec_ld(48, inptr); #if RGB_PIXELSIZE == 4 - rgb3 = vec_ld(48, inptr); + if (bytes > 64) + rgb4 = vec_ld(64, inptr); +#endif + unaligned_shift_index = vec_lvsl(0, inptr); + rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); + rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); + rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); +#endif + } + } else { + if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) { + /* Slow path */ + memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); + rgb0 = vec_ld(0, tmpbuf); + rgb1 = vec_ld(16, tmpbuf); + rgb2 = vec_ld(32, tmpbuf); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_ld(48, tmpbuf); #endif } else { - if (num_cols & 15) { - /* Slow path */ - memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); - rgb0 = vec_ld(0, tmpbuf); - rgb1 = vec_ld(16, tmpbuf); - rgb2 = vec_ld(32, tmpbuf); + /* Fast path */ + rgb0 = vec_ld(0, inptr); + if (num_cols > 16) + rgb1 = vec_ld(16, inptr); + if (num_cols > 32) + rgb2 = vec_ld(32, inptr); #if RGB_PIXELSIZE == 4 - rgb3 = vec_ld(48, tmpbuf); + if (num_cols > 48) + rgb3 = vec_ld(48, inptr); #endif - } else { - /* Medium path */ - rgb0 = vec_ld(0, inptr); - if (num_cols > 16) { - rgb1 = vec_ld(16, inptr); - if (num_cols > 32) { - rgb2 = vec_ld(32, inptr); -#if RGB_PIXELSIZE == 4 - if (num_cols > 48) - rgb3 = vec_ld(48, inptr); -#endif - } - } - } } } -start: #if RGB_PIXELSIZE == 3 /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga diff --git a/simd/jcgryext-altivec.c b/simd/jcgryext-altivec.c index 93377444..1578b8f4 100644 --- a/simd/jcgryext-altivec.c +++ b/simd/jcgryext-altivec.c @@ -65,101 +65,66 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, __vector unsigned char unaligned_shift_index; int bytes = num_cols + offset; - if (bytes >= (RGB_PIXELSIZE + 1) * 16) { - /* Fast path -- we have enough buffer space to load all vectors. - * Even if we don't need them all, this is faster than narrowing - * down which ones we need. + if (bytes < (RGB_PIXELSIZE + 1) * 16 && (bytes & 15)) { + /* Slow path to prevent buffer overread. Since there is no way to + * read a partial AltiVec register, overread would occur on the last + * chunk of the last image row if the right edge is not on a 16-byte + * 16-byte boundary. It could also occur on other rows if the bytes + * per row is low enough. Since we can't determine whether we're on + * the last image row, we have to assume every row is the last. */ - rgb0 = vec_ld(0, inptr); - rgb1 = vec_ld(16, inptr); - rgb2 = vec_ld(32, inptr); - rgb3 = vec_ld(48, inptr); + memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); + rgb0 = vec_ld(0, tmpbuf); + rgb1 = vec_ld(16, tmpbuf); + rgb2 = vec_ld(32, tmpbuf); #if RGB_PIXELSIZE == 4 - rgb4 = vec_ld(64, inptr); + rgb3 = vec_ld(48, tmpbuf); #endif } else { - if (bytes & 15) { - /* Slow path to prevent buffer overread. Since there is no way to - * read a partial AltiVec register, overread would occur on the - * last chunk of the last image row if the right edge is not on a - * 16-byte boundary. It could also occur on other rows if the - * bytes per row is low enough. Since we can't determine whether - * we're on the last image row, we have to assume every row is the - * last. - */ - memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); - rgb0 = vec_ld(0, tmpbuf); - rgb1 = vec_ld(16, tmpbuf); - rgb2 = vec_ld(32, tmpbuf); -#if RGB_PIXELSIZE == 4 - rgb3 = vec_ld(48, tmpbuf); -#endif - goto start; /* Skip permutation */ - } else { - /* Medium path -- if the right edge is vector-aligned, then we can - * read full vectors (but with a lot of branches.) - */ - rgb0 = vec_ld(0, inptr); - if (bytes > 16) { - rgb1 = vec_ld(16, inptr); - if (bytes > 32) { - rgb2 = vec_ld(32, inptr); - if (bytes > 48) { - rgb3 = vec_ld(48, inptr); -#if RGB_PIXELSIZE == 4 - if (bytes > 64) - rgb4 = vec_ld(64, inptr); -#endif - } - } - } - } - } - - unaligned_shift_index = vec_lvsl(0, inptr); - rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); - rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); - rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); -#if RGB_PIXELSIZE == 4 - rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); -#endif - } else { - if (num_cols >= RGB_PIXELSIZE * 16) { /* Fast path */ rgb0 = vec_ld(0, inptr); - rgb1 = vec_ld(16, inptr); - rgb2 = vec_ld(32, inptr); + if (bytes > 16) + rgb1 = vec_ld(16, inptr); + if (bytes > 32) + rgb2 = vec_ld(32, inptr); + if (bytes > 48) + rgb3 = vec_ld(48, inptr); #if RGB_PIXELSIZE == 4 - rgb3 = vec_ld(48, inptr); + if (bytes > 64) + rgb4 = vec_ld(64, inptr); +#endif + unaligned_shift_index = vec_lvsl(0, inptr); + rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index); + rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index); + rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index); +#endif + } + } else { + if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) { + /* Slow path */ + memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); + rgb0 = vec_ld(0, tmpbuf); + rgb1 = vec_ld(16, tmpbuf); + rgb2 = vec_ld(32, tmpbuf); +#if RGB_PIXELSIZE == 4 + rgb3 = vec_ld(48, tmpbuf); #endif } else { - if (num_cols & 15) { - /* Slow path */ - memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); - rgb0 = vec_ld(0, tmpbuf); - rgb1 = vec_ld(16, tmpbuf); - rgb2 = vec_ld(32, tmpbuf); + /* Fast path */ + rgb0 = vec_ld(0, inptr); + if (num_cols > 16) + rgb1 = vec_ld(16, inptr); + if (num_cols > 32) + rgb2 = vec_ld(32, inptr); #if RGB_PIXELSIZE == 4 - rgb3 = vec_ld(48, tmpbuf); + if (num_cols > 48) + rgb3 = vec_ld(48, inptr); #endif - } else { - /* Medium path */ - rgb0 = vec_ld(0, inptr); - if (num_cols > 16) { - rgb1 = vec_ld(16, inptr); - if (num_cols > 32) { - rgb2 = vec_ld(32, inptr); -#if RGB_PIXELSIZE == 4 - if (num_cols > 48) - rgb3 = vec_ld(48, inptr); -#endif - } - } - } } } -start: #if RGB_PIXELSIZE == 3 /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga From 6aed11293d3a71df111712225d49d81ab1fde3b9 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 10 Jan 2015 12:10:08 +0000 Subject: [PATCH 028/140] Fix minor issue in code comments git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1487 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jcgryext-altivec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simd/jcgryext-altivec.c b/simd/jcgryext-altivec.c index 1578b8f4..9b08a2e7 100644 --- a/simd/jcgryext-altivec.c +++ b/simd/jcgryext-altivec.c @@ -141,9 +141,9 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, rgbg3 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX3); #else /* rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3 - * rgb0 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 - * rgb0 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb - * rgb0 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf + * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 + * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb + * rgb3 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf * * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3 * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7 From af69295d3fac40eaaffe240630da6b112efa9bdb Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 10 Jan 2015 12:25:42 +0000 Subject: [PATCH 029/140] Fix minor issue in code comments git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1488 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jccolext-altivec.c | 6 +++--- simd/jcgryext-altivec.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/simd/jccolext-altivec.c b/simd/jccolext-altivec.c index 0455ca21..0d50e558 100644 --- a/simd/jccolext-altivec.c +++ b/simd/jccolext-altivec.c @@ -74,9 +74,9 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, /* Slow path to prevent buffer overread. Since there is no way to * read a partial AltiVec register, overread would occur on the last * chunk of the last image row if the right edge is not on a 16-byte - * 16-byte boundary. It could also occur on other rows if the bytes - * per row is low enough. Since we can't determine whether we're on - * the last image row, we have to assume every row is the last. + * boundary. It could also occur on other rows if the bytes per row + * is low enough. Since we can't determine whether we're on the last + * image row, we have to assume every row is the last. */ memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); rgb0 = vec_ld(0, tmpbuf); diff --git a/simd/jcgryext-altivec.c b/simd/jcgryext-altivec.c index 9b08a2e7..f198e006 100644 --- a/simd/jcgryext-altivec.c +++ b/simd/jcgryext-altivec.c @@ -69,9 +69,9 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, /* Slow path to prevent buffer overread. Since there is no way to * read a partial AltiVec register, overread would occur on the last * chunk of the last image row if the right edge is not on a 16-byte - * 16-byte boundary. It could also occur on other rows if the bytes - * per row is low enough. Since we can't determine whether we're on - * the last image row, we have to assume every row is the last. + * boundary. It could also occur on other rows if the bytes per row + * is low enough. Since we can't determine whether we're on the last + * image row, we have to assume every row is the last. */ memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); rgb0 = vec_ld(0, tmpbuf); From ac4daa7716d32318d9444eef54ac3a390c7b00dd Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 10 Jan 2015 22:56:26 +0000 Subject: [PATCH 030/140] AltiVec SIMD implementation of YCC-to-RGB color conversion git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1489 632fc199-4ca6-4c93-a231-07263d6284db --- simd/Makefile.am | 1 + simd/jccolor-altivec.c | 5 - simd/jcgray-altivec.c | 5 - simd/jdcolext-altivec.c | 263 ++++++++++++++++++++++++++++++++++++++++ simd/jdcolor-altivec.c | 96 +++++++++++++++ simd/jsimd.h | 22 ++++ simd/jsimd_altivec.h | 4 + simd/jsimd_powerpc.c | 44 +++++++ 8 files changed, 430 insertions(+), 10 deletions(-) create mode 100644 simd/jdcolext-altivec.c create mode 100644 simd/jdcolor-altivec.c diff --git a/simd/Makefile.am b/simd/Makefile.am index cdea2641..c4474f54 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -74,6 +74,7 @@ if SIMD_POWERPC libsimd_la_SOURCES = jsimd_powerpc.c \ jccolor-altivec.c jcgray-altivec.c jcsample-altivec.c \ + jdcolor-altivec.c \ jfdctfst-altivec.c jfdctint-altivec.c \ jidctfst-altivec.c jidctint-altivec.c \ jquanti-altivec.c diff --git a/simd/jccolor-altivec.c b/simd/jccolor-altivec.c index acb0357a..04b8708d 100644 --- a/simd/jccolor-altivec.c +++ b/simd/jccolor-altivec.c @@ -25,11 +25,6 @@ #include "jsimd_altivec.h" -#ifndef min -#define min(a,b) ((a) < (b) ? (a) : (b)) -#endif - - #define F_0_081 5329 /* FIX(0.08131) */ #define F_0_114 7471 /* FIX(0.11400) */ #define F_0_168 11059 /* FIX(0.16874) */ diff --git a/simd/jcgray-altivec.c b/simd/jcgray-altivec.c index 7fc0e478..b52fade0 100644 --- a/simd/jcgray-altivec.c +++ b/simd/jcgray-altivec.c @@ -25,11 +25,6 @@ #include "jsimd_altivec.h" -#ifndef min -#define min(a,b) ((a) < (b) ? (a) : (b)) -#endif - - #define F_0_114 7471 /* FIX(0.11400) */ #define F_0_250 16384 /* FIX(0.25000) */ #define F_0_299 19595 /* FIX(0.29900) */ diff --git a/simd/jdcolext-altivec.c b/simd/jdcolext-altivec.c new file mode 100644 index 00000000..80dc94c7 --- /dev/null +++ b/simd/jdcolext-altivec.c @@ -0,0 +1,263 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2015, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* This file is included by jdcolor-altivec.c */ + + +void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, + JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + JSAMPROW outptr, inptr0, inptr1, inptr2; + int pitch = out_width * RGB_PIXELSIZE, offset, num_cols; + unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; + + __vector unsigned char rgb0, rgb1, rgb2, rgbx0, rgbx1, rgbx2, rgbx3, + y, cb, cr, edgel, edgeh, edges, out0, out1, out2, out3; +#if RGB_PIXELSIZE == 4 + __vector unsigned char rgb3, out4; +#endif + __vector short rg0, rg1, rg2, rg3, bx0, bx1, bx2, bx3, yl, yh, cbl, cbh, + crl, crh, rl, rh, gl, gh, bl, bh, g0s, g1s, g2s, g3s; + __vector int g0, g1, g2, g3; + + /* Constants + * NOTE: The >> 1 is to compensate for the fact that vec_madds() returns 17 + * high-order bits, not 16. + */ + __vector short pw_f0402 = { __8X(F_0_402 >> 1) }, + pw_mf0228 = { __8X(-F_0_228 >> 1) }, + pw_mf0344_f0285 = { __4X2(-F_0_344, F_0_285) }, + pw_one = { __8X(1) }, + pw_255 = { __8X(255) }, + pw_cj = { __8X(CENTERJSAMPLE) }; + __vector int pd_onehalf = { __4X(ONE_HALF) }; + __vector unsigned char zero = { __16X(0) }, + shift_pack_index = + { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29}; + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + + for (num_cols = pitch; num_cols > 0; + num_cols -= RGB_PIXELSIZE * 16, outptr += RGB_PIXELSIZE * 16, + inptr0 += 16, inptr1 += 16, inptr2 += 16) { + + y = vec_ld(0, inptr0); + /* NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't + * support unsigned vectors. + */ + yl = (__vector signed short)vec_mergeh(zero, y); + yh = (__vector signed short)vec_mergel(zero, y); + + cb = vec_ld(0, inptr1); + cbl = (__vector signed short)vec_mergeh(zero, cb); + cbh = (__vector signed short)vec_mergel(zero, cb); + cbl = vec_sub(cbl, pw_cj); + cbh = vec_sub(cbh, pw_cj); + + cr = vec_ld(0, inptr2); + crl = (__vector signed short)vec_mergeh(zero, cr); + crh = (__vector signed short)vec_mergel(zero, cr); + crl = vec_sub(crl, pw_cj); + crh = vec_sub(crh, pw_cj); + + /* (Original) + * R = Y + 1.40200 * Cr + * G = Y - 0.34414 * Cb - 0.71414 * Cr + * B = Y + 1.77200 * Cb + * + * (This implementation) + * R = Y + 0.40200 * Cr + Cr + * G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr + * B = Y - 0.22800 * Cb + Cb + Cb + */ + bl = vec_add(cbl, cbl); + bh = vec_add(cbh, cbh); + bl = vec_madds(bl, pw_mf0228, pw_one); + bh = vec_madds(bh, pw_mf0228, pw_one); + bl = vec_sra(bl, (__vector unsigned short)pw_one); + bh = vec_sra(bh, (__vector unsigned short)pw_one); + bl = vec_add(bl, cbl); + bh = vec_add(bh, cbh); + bl = vec_add(bl, cbl); + bh = vec_add(bh, cbh); + bl = vec_add(bl, yl); + bh = vec_add(bh, yh); + + rl = vec_add(crl, crl); + rh = vec_add(crh, crh); + rl = vec_madds(rl, pw_f0402, pw_one); + rh = vec_madds(rh, pw_f0402, pw_one); + rl = vec_sra(rl, (__vector unsigned short)pw_one); + rh = vec_sra(rh, (__vector unsigned short)pw_one); + rl = vec_add(rl, crl); + rh = vec_add(rh, crh); + rl = vec_add(rl, yl); + rh = vec_add(rh, yh); + + g0s = vec_mergeh(cbl, crl); + g1s = vec_mergel(cbl, crl); + g0 = vec_msums(g0s, pw_mf0344_f0285, pd_onehalf); + g1 = vec_msums(g1s, pw_mf0344_f0285, pd_onehalf); + g2s = vec_mergeh(cbh, crh); + g3s = vec_mergel(cbh, crh); + g2 = vec_msums(g2s, pw_mf0344_f0285, pd_onehalf); + g3 = vec_msums(g3s, pw_mf0344_f0285, pd_onehalf); + /* Clever way to avoid 4 shifts + 2 packs. This packs the high word from + * each dword into a new 16-bit vector, which is the equivalent of + * descaling the 32-bit results (right-shifting by 16 bits) and then + * packing them. + */ + gl = (__vector short)vec_perm((__vector unsigned short)g0, + (__vector unsigned short)g1, + shift_pack_index); + gh = (__vector short)vec_perm((__vector unsigned short)g2, + (__vector unsigned short)g3, + shift_pack_index); + gl = vec_sub(gl, crl); + gh = vec_sub(gh, crh); + gl = vec_add(gl, yl); + gh = vec_add(gh, yh); + + rg0 = vec_mergeh(rl, gl); + bx0 = vec_mergeh(bl, pw_255); + rg1 = vec_mergel(rl, gl); + bx1 = vec_mergel(bl, pw_255); + rg2 = vec_mergeh(rh, gh); + bx2 = vec_mergeh(bh, pw_255); + rg3 = vec_mergel(rh, gh); + bx3 = vec_mergel(bh, pw_255); + + rgbx0 = vec_packsu(rg0, bx0); + rgbx1 = vec_packsu(rg1, bx1); + rgbx2 = vec_packsu(rg2, bx2); + rgbx3 = vec_packsu(rg3, bx3); + +#if RGB_PIXELSIZE == 3 + /* rgbx0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 X0 B1 X1 B2 X2 B3 X3 + * rgbx1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 X4 B5 X5 B6 X6 B7 X7 + * rgbx2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 X8 B9 X9 Ba Xa Bb Xb + * rgbx3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Xc Bd Xd Be Xe Bf Xf + * + * rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 + * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga + * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf + */ + rgb0 = vec_perm(rgbx0, rgbx1, (__vector unsigned char)RGB_INDEX0); + rgb1 = vec_perm(rgbx1, rgbx2, (__vector unsigned char)RGB_INDEX1); + rgb2 = vec_perm(rgbx2, rgbx3, (__vector unsigned char)RGB_INDEX2); +#else + /* rgbx0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 X0 B1 X1 B2 X2 B3 X3 + * rgbx1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 X4 B5 X5 B6 X6 B7 X7 + * rgbx2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 X8 B9 X9 Ba Xa Bb Xb + * rgbx3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Xc Bd Xd Be Xe Bf Xf + * + * rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3 + * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 + * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb + * rgb3 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf + */ + rgb0 = vec_perm(rgbx0, rgbx0, (__vector unsigned char)RGB_INDEX); + rgb1 = vec_perm(rgbx1, rgbx1, (__vector unsigned char)RGB_INDEX); + rgb2 = vec_perm(rgbx2, rgbx2, (__vector unsigned char)RGB_INDEX); + rgb3 = vec_perm(rgbx3, rgbx3, (__vector unsigned char)RGB_INDEX); +#endif + + offset = (size_t)outptr & 15; + if (offset) { + __vector unsigned char unaligned_shift_index; + int bytes = num_cols + offset; + + if (bytes < (RGB_PIXELSIZE + 1) * 16 && (bytes & 15)) { + /* Slow path to prevent buffer overwrite. Since there is no way to + * write a partial AltiVec register, overwrite would occur on the + * last chunk of the last image row if the right edge is not on a + * 16-byte boundary. It could also occur on other rows if the bytes + * per row is low enough. Since we can't determine whether we're on + * the last image row, we have to assume every row is the last. + */ + vec_st(rgb0, 0, tmpbuf); + vec_st(rgb1, 16, tmpbuf); + vec_st(rgb2, 32, tmpbuf); +#if RGB_PIXELSIZE == 4 + vec_st(rgb3, 48, tmpbuf); +#endif + memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); + } else { + /* Fast path */ + unaligned_shift_index = vec_lvsl(0, outptr); + edgel = vec_ld(0, outptr); + edgeh = vec_ld(min(num_cols, RGB_PIXELSIZE * 16) + offset, outptr); + edges = vec_perm(edgeh, edgel, unaligned_shift_index); + unaligned_shift_index = vec_lvsr(0, outptr); + out0 = vec_perm(edges, rgb0, unaligned_shift_index); + out1 = vec_perm(rgb0, rgb1, unaligned_shift_index); + out2 = vec_perm(rgb1, rgb2, unaligned_shift_index); +#if RGB_PIXELSIZE == 4 + out3 = vec_perm(rgb2, rgb3, unaligned_shift_index); + out4 = vec_perm(rgb3, edges, unaligned_shift_index); +#else + out3 = vec_perm(rgb2, edges, unaligned_shift_index); +#endif + vec_st(out0, 0, outptr); + if (bytes > 16) + vec_st(out1, 16, outptr); + if (bytes > 32) + vec_st(out2, 32, outptr); + if (bytes > 48) + vec_st(out3, 48, outptr); +#if RGB_PIXELSIZE == 4 + if (bytes > 64) + vec_st(out4, 64, outptr); +#endif + } + } else { + if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) { + /* Slow path */ + vec_st(rgb0, 0, tmpbuf); + vec_st(rgb1, 16, tmpbuf); + vec_st(rgb2, 32, tmpbuf); +#if RGB_PIXELSIZE == 4 + vec_st(rgb3, 48, tmpbuf); +#endif + memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); + } else { + /* Fast path */ + vec_st(rgb0, 0, outptr); + if (num_cols > 16) + vec_st(rgb1, 16, outptr); + if (num_cols > 32) + vec_st(rgb2, 32, outptr); +#if RGB_PIXELSIZE == 4 + if (num_cols > 48) + vec_st(rgb3, 48, outptr); +#endif + } + } + } + } +} diff --git a/simd/jdcolor-altivec.c b/simd/jdcolor-altivec.c new file mode 100644 index 00000000..e0892d80 --- /dev/null +++ b/simd/jdcolor-altivec.c @@ -0,0 +1,96 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2015, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* YCC --> RGB CONVERSION */ + +#include "jsimd_altivec.h" + + +#define F_0_344 22554 /* FIX(0.34414) */ +#define F_0_714 46802 /* FIX(0.71414) */ +#define F_1_402 91881 /* FIX(1.40200) */ +#define F_1_772 116130 /* FIX(1.77200) */ +#define F_0_402 (F_1_402 - 65536) /* FIX(1.40200) - FIX(1) */ +#define F_0_285 (65536 - F_0_714) /* FIX(1) - FIX(0.71414) */ +#define F_0_228 (131072 - F_1_772) /* FIX(2) - FIX(1.77200) */ + +#define SCALEBITS 16 +#define ONE_HALF (1 << (SCALEBITS - 1)) + +#define RGB_INDEX0 {0,1,8,2,3,10,4,5,12,6,7,14,16,17,24,18} +#define RGB_INDEX1 {3,10,4,5,12,6,7,14,16,17,24,18,19,26,20,21} +#define RGB_INDEX2 {12,6,7,14,16,17,24,18,19,26,20,21,28,22,23,30} +#include "jdcolext-altivec.c" +#undef RGB_PIXELSIZE + +#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE +#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extrgb_convert_altivec +#include "jdcolext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX0 +#undef RGB_INDEX1 +#undef RGB_INDEX2 +#undef jsimd_ycc_rgb_convert_altivec + +#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE +#define RGB_INDEX {0,1,8,9,2,3,10,11,4,5,12,13,6,7,14,15} +#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extrgbx_convert_altivec +#include "jdcolext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX +#undef jsimd_ycc_rgb_convert_altivec + +#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE +#define RGB_INDEX0 {8,1,0,10,3,2,12,5,4,14,7,6,24,17,16,26} +#define RGB_INDEX1 {3,2,12,5,4,14,7,6,24,17,16,26,19,18,28,21} +#define RGB_INDEX2 {4,14,7,6,24,17,16,26,19,18,28,21,20,30,23,22} +#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extbgr_convert_altivec +#include "jdcolext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX0 +#undef RGB_INDEX1 +#undef RGB_INDEX2 +#undef jsimd_ycc_rgb_convert_altivec + +#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE +#define RGB_INDEX {8,1,0,9,10,3,2,11,12,5,4,13,14,7,6,15} +#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extbgrx_convert_altivec +#include "jdcolext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX +#undef jsimd_ycc_rgb_convert_altivec + +#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE +#define RGB_INDEX {9,8,1,0,11,10,3,2,13,12,5,4,15,14,7,6} +#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extxbgr_convert_altivec +#include "jdcolext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX +#undef jsimd_ycc_rgb_convert_altivec + +#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE +#define RGB_INDEX {9,0,1,8,11,2,3,10,13,4,5,12,15,6,7,14} +#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extxrgb_convert_altivec +#include "jdcolext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX +#undef jsimd_ycc_rgb_convert_altivec diff --git a/simd/jsimd.h b/simd/jsimd.h index 905032ee..402f44b8 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -321,6 +321,28 @@ EXTERN(void) jsimd_ycc_extxrgb_convert_mips_dspr2 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); +EXTERN(void) jsimd_ycc_rgb_convert_altivec + (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); +EXTERN(void) jsimd_ycc_extrgb_convert_altivec + (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); +EXTERN(void) jsimd_ycc_extrgbx_convert_altivec + (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); +EXTERN(void) jsimd_ycc_extbgr_convert_altivec + (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); +EXTERN(void) jsimd_ycc_extbgrx_convert_altivec + (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); +EXTERN(void) jsimd_ycc_extxbgr_convert_altivec + (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); +EXTERN(void) jsimd_ycc_extxrgb_convert_altivec + (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); + /* NULL Colorspace Conversion */ EXTERN(void) jsimd_c_null_convert_mips_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, diff --git a/simd/jsimd_altivec.h b/simd/jsimd_altivec.h index 78705568..e8002060 100644 --- a/simd/jsimd_altivec.h +++ b/simd/jsimd_altivec.h @@ -74,3 +74,7 @@ col##6 = vec_mergeh(col67e, col67o); /* col6=(06 16 26 36 46 56 66 76) */ \ col##7 = vec_mergel(col67e, col67o); /* col7=(07 17 27 37 47 57 67 77) */ \ } + +#ifndef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#endif diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index a6bcb695..431510a6 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -80,6 +80,19 @@ jsimd_can_rgb_gray (void) GLOBAL(int) jsimd_can_ycc_rgb (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -170,6 +183,37 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows) { + void (*altivecfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int); + + switch(cinfo->out_color_space) { + case JCS_EXT_RGB: + altivecfct=jsimd_ycc_extrgb_convert_altivec; + break; + case JCS_EXT_RGBX: + case JCS_EXT_RGBA: + altivecfct=jsimd_ycc_extrgbx_convert_altivec; + break; + case JCS_EXT_BGR: + altivecfct=jsimd_ycc_extbgr_convert_altivec; + break; + case JCS_EXT_BGRX: + case JCS_EXT_BGRA: + altivecfct=jsimd_ycc_extbgrx_convert_altivec; + break; + case JCS_EXT_XBGR: + case JCS_EXT_ABGR: + altivecfct=jsimd_ycc_extxbgr_convert_altivec; + break; + case JCS_EXT_XRGB: + case JCS_EXT_ARGB: + altivecfct=jsimd_ycc_extxrgb_convert_altivec; + break; + default: + altivecfct=jsimd_ycc_rgb_convert_altivec; + break; + } + + altivecfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows); } GLOBAL(void) From f0abd46c3b3d43a5e3e1543ee2560e301015c5ce Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 11 Jan 2015 00:58:44 +0000 Subject: [PATCH 031/140] Bump copyright year git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1490 632fc199-4ca6-4c93-a231-07263d6284db --- jversion.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jversion.h b/jversion.h index 25c3cf0b..949b4f4d 100644 --- a/jversion.h +++ b/jversion.h @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. * libjpeg-turbo Modifications: - * Copyright (C) 2010, 2012-2014, D. R. Commander. + * Copyright (C) 2010, 2012-2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README file. * * This file contains software version identification. @@ -28,9 +28,9 @@ #define JCOPYRIGHT "Copyright (C) 1991-2012 Thomas G. Lane, Guido Vollbeding\n" \ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \ "Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \ - "Copyright (C) 2009-2014 D. R. Commander\n" \ + "Copyright (C) 2009-2015 D. R. Commander\n" \ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \ "Copyright (C) 2013 Linaro Limited" -#define JCOPYRIGHT_SHORT "Copyright (C) 1991-2014 The libjpeg-turbo Project and many others" +#define JCOPYRIGHT_SHORT "Copyright (C) 1991-2015 The libjpeg-turbo Project and many others" From d71a6e0c25f43f2eed4c503a4860e5f13cab7b73 Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 11 Jan 2015 06:34:47 +0000 Subject: [PATCH 032/140] Use intrinsics for loading aligned data in the IDCT functions. This has no effect on performance, but it makes it more obvious what that code is doing. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1491 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jidctfst-altivec.c | 18 +++++++++--------- simd/jidctint-altivec.c | 34 +++++++++++++++++----------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/simd/jidctfst-altivec.c b/simd/jidctfst-altivec.c index 282a97e0..aa25fe05 100644 --- a/simd/jidctfst-altivec.c +++ b/simd/jidctfst-altivec.c @@ -1,7 +1,7 @@ /* * AltiVec optimizations for libjpeg-turbo * - * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014-2015, D. R. Commander. * All rights reserved. * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -153,7 +153,7 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, tmp3 = vec_or(tmp3, col7); tmp1 = vec_or(tmp1, tmp3); - quant0 = *(__vector short *)&dct_table[0]; + quant0 = vec_ld(0, dct_table); col0 = vec_mladd(col0, quant0, zero); if (vec_all_eq(tmp1, zero)) { @@ -170,13 +170,13 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, } else { - quant1 = *(__vector short *)&dct_table[8]; - quant2 = *(__vector short *)&dct_table[16]; - quant3 = *(__vector short *)&dct_table[24]; - quant4 = *(__vector short *)&dct_table[32]; - quant5 = *(__vector short *)&dct_table[40]; - quant6 = *(__vector short *)&dct_table[48]; - quant7 = *(__vector short *)&dct_table[56]; + quant1 = vec_ld(16, dct_table); + quant2 = vec_ld(32, dct_table); + quant3 = vec_ld(48, dct_table); + quant4 = vec_ld(64, dct_table); + quant5 = vec_ld(80, dct_table); + quant6 = vec_ld(96, dct_table); + quant7 = vec_ld(112, dct_table); col1 = vec_mladd(col1, quant1, zero); col2 = vec_mladd(col2, quant2, zero); diff --git a/simd/jidctint-altivec.c b/simd/jidctint-altivec.c index c30c885d..37cae757 100644 --- a/simd/jidctint-altivec.c +++ b/simd/jidctint-altivec.c @@ -1,7 +1,7 @@ /* * AltiVec optimizations for libjpeg-turbo * - * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014-2015, D. R. Commander. * All rights reserved. * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -246,14 +246,14 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, /* Pass 1: process columns */ - col0 = *(__vector short *)&coef_block[0]; - col1 = *(__vector short *)&coef_block[8]; - col2 = *(__vector short *)&coef_block[16]; - col3 = *(__vector short *)&coef_block[24]; - col4 = *(__vector short *)&coef_block[32]; - col5 = *(__vector short *)&coef_block[40]; - col6 = *(__vector short *)&coef_block[48]; - col7 = *(__vector short *)&coef_block[56]; + col0 = vec_ld(0, coef_block); + col1 = vec_ld(16, coef_block); + col2 = vec_ld(32, coef_block); + col3 = vec_ld(48, coef_block); + col4 = vec_ld(64, coef_block); + col5 = vec_ld(80, coef_block); + col6 = vec_ld(96, coef_block); + col7 = vec_ld(112, coef_block); tmp1 = vec_or(col1, col2); tmp2 = vec_or(col3, col4); @@ -262,7 +262,7 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, tmp3 = vec_or(tmp3, col7); tmp1 = vec_or(tmp1, tmp3); - quant0 = *(__vector short *)&dct_table[0]; + quant0 = vec_ld(0, dct_table); col0 = vec_mladd(col0, quant0, zero16); if (vec_all_eq(tmp1, zero16)) { @@ -281,13 +281,13 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, } else { - quant1 = *(__vector short *)&dct_table[8]; - quant2 = *(__vector short *)&dct_table[16]; - quant3 = *(__vector short *)&dct_table[24]; - quant4 = *(__vector short *)&dct_table[32]; - quant5 = *(__vector short *)&dct_table[40]; - quant6 = *(__vector short *)&dct_table[48]; - quant7 = *(__vector short *)&dct_table[56]; + quant1 = vec_ld(16, dct_table); + quant2 = vec_ld(32, dct_table); + quant3 = vec_ld(48, dct_table); + quant4 = vec_ld(64, dct_table); + quant5 = vec_ld(80, dct_table); + quant6 = vec_ld(96, dct_table); + quant7 = vec_ld(112, dct_table); col1 = vec_mladd(col1, quant1, zero16); col2 = vec_mladd(col2, quant2, zero16); From 51eba06011c519396c5e1bab6f383c63ef748240 Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 11 Jan 2015 07:38:35 +0000 Subject: [PATCH 033/140] Minor code readability tweak git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1492 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jdcolext-altivec.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/simd/jdcolext-altivec.c b/simd/jdcolext-altivec.c index 80dc94c7..17c2e205 100644 --- a/simd/jdcolext-altivec.c +++ b/simd/jdcolext-altivec.c @@ -132,12 +132,8 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, * descaling the 32-bit results (right-shifting by 16 bits) and then * packing them. */ - gl = (__vector short)vec_perm((__vector unsigned short)g0, - (__vector unsigned short)g1, - shift_pack_index); - gh = (__vector short)vec_perm((__vector unsigned short)g2, - (__vector unsigned short)g3, - shift_pack_index); + gl = vec_perm((__vector short)g0, (__vector short)g1, shift_pack_index); + gh = vec_perm((__vector short)g2, (__vector short)g3, shift_pack_index); gl = vec_sub(gl, crl); gh = vec_sub(gh, crh); gl = vec_add(gl, yl); From 52a4ec6c8a6dd7d0a17b34547a59f8491f138451 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 13 Jan 2015 09:02:29 +0000 Subject: [PATCH 034/140] AltiVec SIMD implementation of H2V1 and H2V2 fancy upsampling git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1495 632fc199-4ca6-4c93-a231-07263d6284db --- simd/Makefile.am | 2 +- simd/jdsample-altivec.c | 272 ++++++++++++++++++++++++++++++++++++++++ simd/jsimd.h | 9 +- simd/jsimd_powerpc.c | 30 ++++- 4 files changed, 310 insertions(+), 3 deletions(-) create mode 100644 simd/jdsample-altivec.c diff --git a/simd/Makefile.am b/simd/Makefile.am index c4474f54..82a3dd39 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -74,7 +74,7 @@ if SIMD_POWERPC libsimd_la_SOURCES = jsimd_powerpc.c \ jccolor-altivec.c jcgray-altivec.c jcsample-altivec.c \ - jdcolor-altivec.c \ + jdcolor-altivec.c jdsample-altivec.c \ jfdctfst-altivec.c jfdctint-altivec.c \ jidctfst-altivec.c jidctint-altivec.c \ jquanti-altivec.c diff --git a/simd/jdsample-altivec.c b/simd/jdsample-altivec.c new file mode 100644 index 00000000..be3bbe06 --- /dev/null +++ b/simd/jdsample-altivec.c @@ -0,0 +1,272 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2015, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* CHROMA UPSAMPLING */ + +#include "jsimd_altivec.h" + + +void +jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, + JDIMENSION downsampled_width, + JSAMPARRAY input_data, + JSAMPARRAY *output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + JSAMPROW inptr, outptr; + int inrow, col; + + __vector unsigned char block, last, next, lastblock, nextblock = {0}, out; + __vector short blocke, blocko, blockl, blockh, lastl, lasth, nextl, nexth, + outle, outhe, outlo, outho; + + /* Constants */ + __vector unsigned char pb_three = { __16X(3) }, pb_zero = { __16X(0) }, + last_index_col0 = {0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14}, + last_index = {15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30}, + next_index = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}, + next_index_lastcol = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15}, + merge_pack_index = {1,17,3,19,5,21,7,23,9,25,11,27,13,29,15,31}; + __vector short pw_one = { __8X(1) }, pw_two = { __8X(2) }; + + for (inrow = 0; inrow < max_v_samp_factor; inrow++) { + inptr = input_data[inrow]; + outptr = output_data[inrow]; + + block = vec_ld(0, inptr); + last = vec_perm(block, block, last_index_col0); + lastblock = block; + + for (col = 0; col < downsampled_width; + col += 16, inptr += 16, outptr += 32) { + + if (col > 0) { + last = vec_perm(lastblock, block, last_index); + lastblock = block; + } + + if (downsampled_width - col <= 16) + next = vec_perm(block, block, next_index_lastcol); + else { + nextblock = vec_ld(16, inptr); + next = vec_perm(block, nextblock, next_index); + } + + blocke = (__vector short)vec_mule(block, pb_three); + blocko = (__vector short)vec_mulo(block, pb_three); + blockl = vec_mergeh(blocke, blocko); + blockh = vec_mergel(blocke, blocko); + + lastl = (__vector short)vec_mergeh(pb_zero, last); + lasth = (__vector short)vec_mergel(pb_zero, last); + lastl = vec_add(lastl, pw_one); + lasth = vec_add(lasth, pw_one); + + nextl = (__vector short)vec_mergeh(pb_zero, next); + nexth = (__vector short)vec_mergel(pb_zero, next); + nextl = vec_add(nextl, pw_two); + nexth = vec_add(nexth, pw_two); + + outle = vec_add(blockl, lastl); + outhe = vec_add(blockh, lasth); + outlo = vec_add(blockl, nextl); + outho = vec_add(blockh, nexth); + outle = vec_sr(outle, (__vector unsigned short)pw_two); + outhe = vec_sr(outhe, (__vector unsigned short)pw_two); + outlo = vec_sr(outlo, (__vector unsigned short)pw_two); + outho = vec_sr(outho, (__vector unsigned short)pw_two); + + out = vec_perm((__vector unsigned char)outle, + (__vector unsigned char)outlo, merge_pack_index); + vec_st(out, 0, outptr); + out = vec_perm((__vector unsigned char)outhe, + (__vector unsigned char)outho, merge_pack_index); + vec_st(out, 16, outptr); + + block = nextblock; + } + } +} + + +void +jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, + JDIMENSION downsampled_width, + JSAMPARRAY input_data, + JSAMPARRAY *output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + JSAMPROW inptr_1, inptr0, inptr1, outptr0, outptr1; + int inrow, outrow, col; + + __vector unsigned char block_1, block0, block1, out; + __vector short block_1l, block_1h, block0l, block0h, block1l, block1h, + lastcolsum_1h, lastcolsum1h, + p_lastcolsum_1l, p_lastcolsum_1h, p_lastcolsum1l, p_lastcolsum1h, + thiscolsum_1l, thiscolsum_1h, thiscolsum1l, thiscolsum1h, + nextcolsum_1l = {0}, nextcolsum_1h = {0}, + nextcolsum1l = {0}, nextcolsum1h = {0}, + p_nextcolsum_1l, p_nextcolsum_1h, p_nextcolsum1l, p_nextcolsum1h, + tmpl, tmph, outle, outhe, outlo, outho; + + /* Constants */ + __vector unsigned char pb_zero = { __16X(0) }, + last_index_col0 = {0,1,0,1,2,3,4,5,6,7,8,9,10,11,12,13}, + last_index={14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}, + next_index = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}, + next_index_lastcol = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,15}, + merge_pack_index = {1,17,3,19,5,21,7,23,9,25,11,27,13,29,15,31}; + __vector short pw_zero = { __8X(0) }, pw_three = { __8X(3) }, + pw_seven = { __8X(7) }, pw_eight = { __8X(8) }; + __vector unsigned short pw_four = { __8X(4) }; + + for (inrow = 0, outrow = 0; outrow < max_v_samp_factor; inrow++) { + + inptr_1 = input_data[inrow - 1]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow + 1]; + outptr0 = output_data[outrow++]; + outptr1 = output_data[outrow++]; + + block0 = vec_ld(0, inptr0); + block0l = (__vector short)vec_mergeh(pb_zero, block0); + block0h = (__vector short)vec_mergel(pb_zero, block0); + block0l = vec_mladd(block0l, pw_three, pw_zero); + block0h = vec_mladd(block0h, pw_three, pw_zero); + + block_1 = vec_ld(0, inptr_1); + block_1l = (__vector short)vec_mergeh(pb_zero, block_1); + block_1h = (__vector short)vec_mergel(pb_zero, block_1); + thiscolsum_1l = vec_add(block0l, block_1l); + thiscolsum_1h = vec_add(block0h, block_1h); + lastcolsum_1h = thiscolsum_1h; + p_lastcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1l, last_index_col0); + p_lastcolsum_1h = vec_perm(thiscolsum_1l, thiscolsum_1h, last_index); + + block1 = vec_ld(0, inptr1); + block1l = (__vector short)vec_mergeh(pb_zero, block1); + block1h = (__vector short)vec_mergel(pb_zero, block1); + thiscolsum1l = vec_add(block0l, block1l); + thiscolsum1h = vec_add(block0h, block1h); + lastcolsum1h = thiscolsum1h; + p_lastcolsum1l = vec_perm(thiscolsum1l, thiscolsum1l, last_index_col0); + p_lastcolsum1h = vec_perm(thiscolsum1l, thiscolsum1h, last_index); + + for (col = 0; col < downsampled_width; + col += 16, inptr_1 += 16, inptr0 += 16, inptr1 += 16, + outptr0 += 32, outptr1 += 32) { + + if (col > 0) { + p_lastcolsum_1l = vec_perm(lastcolsum_1h, thiscolsum_1l, last_index); + p_lastcolsum_1h = vec_perm(thiscolsum_1l, thiscolsum_1h, last_index); + p_lastcolsum1l = vec_perm(lastcolsum1h, thiscolsum1l, last_index); + p_lastcolsum1h = vec_perm(thiscolsum1l, thiscolsum1h, last_index); + lastcolsum_1h = thiscolsum_1h; lastcolsum1h = thiscolsum1h; + } + + if (downsampled_width - col <= 16) { + p_nextcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1h, next_index); + p_nextcolsum_1h = vec_perm(thiscolsum_1h, thiscolsum_1h, + next_index_lastcol); + p_nextcolsum1l = vec_perm(thiscolsum1l, thiscolsum1h, next_index); + p_nextcolsum1h = vec_perm(thiscolsum1h, thiscolsum1h, + next_index_lastcol); + } else { + block0 = vec_ld(16, inptr0); + block0l = (__vector short)vec_mergeh(pb_zero, block0); + block0h = (__vector short)vec_mergel(pb_zero, block0); + block0l = vec_mladd(block0l, pw_three, pw_zero); + block0h = vec_mladd(block0h, pw_three, pw_zero); + + block_1 = vec_ld(16, inptr_1); + block_1l = (__vector short)vec_mergeh(pb_zero, block_1); + block_1h = (__vector short)vec_mergel(pb_zero, block_1); + nextcolsum_1l = vec_add(block0l, block_1l); + nextcolsum_1h = vec_add(block0h, block_1h); + p_nextcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1h, next_index); + p_nextcolsum_1h = vec_perm(thiscolsum_1h, nextcolsum_1l, next_index); + + block1 = vec_ld(16, inptr1); + block1l = (__vector short)vec_mergeh(pb_zero, block1); + block1h = (__vector short)vec_mergel(pb_zero, block1); + nextcolsum1l = vec_add(block0l, block1l); + nextcolsum1h = vec_add(block0h, block1h); + p_nextcolsum1l = vec_perm(thiscolsum1l, thiscolsum1h, next_index); + p_nextcolsum1h = vec_perm(thiscolsum1h, nextcolsum1l, next_index); + } + + /* Process the upper row */ + + tmpl = vec_mladd(thiscolsum_1l, pw_three, pw_zero); + tmph = vec_mladd(thiscolsum_1h, pw_three, pw_zero); + outle = vec_add(tmpl, p_lastcolsum_1l); + outhe = vec_add(tmph, p_lastcolsum_1h); + outle = vec_add(outle, pw_eight); + outhe = vec_add(outhe, pw_eight); + outle = vec_sr(outle, pw_four); + outhe = vec_sr(outhe, pw_four); + + outlo = vec_add(tmpl, p_nextcolsum_1l); + outho = vec_add(tmph, p_nextcolsum_1h); + outlo = vec_add(outlo, pw_seven); + outho = vec_add(outho, pw_seven); + outlo = vec_sr(outlo, pw_four); + outho = vec_sr(outho, pw_four); + + out = vec_perm((__vector unsigned char)outle, + (__vector unsigned char)outlo, merge_pack_index); + vec_st(out, 0, outptr0); + + out = vec_perm((__vector unsigned char)outhe, + (__vector unsigned char)outho, merge_pack_index); + vec_st(out, 16, outptr0); + + /* Process the lower row */ + + tmpl = vec_mladd(thiscolsum1l, pw_three, pw_zero); + tmph = vec_mladd(thiscolsum1h, pw_three, pw_zero); + outle = vec_add(tmpl, p_lastcolsum1l); + outhe = vec_add(tmph, p_lastcolsum1h); + outle = vec_add(outle, pw_eight); + outhe = vec_add(outhe, pw_eight); + outle = vec_sr(outle, pw_four); + outhe = vec_sr(outhe, pw_four); + + outlo = vec_add(tmpl, p_nextcolsum1l); + outho = vec_add(tmph, p_nextcolsum1h); + outlo = vec_add(outlo, pw_seven); + outho = vec_add(outho, pw_seven); + outlo = vec_sr(outlo, pw_four); + outho = vec_sr(outho, pw_four); + + out = vec_perm((__vector unsigned char)outle, + (__vector unsigned char)outlo, merge_pack_index); + vec_st(out, 0, outptr1); + out = vec_perm((__vector unsigned char)outhe, + (__vector unsigned char)outho, merge_pack_index); + vec_st(out, 16, outptr1); + + thiscolsum_1l = nextcolsum_1l; thiscolsum_1h = nextcolsum_1h; + thiscolsum1l = nextcolsum1l; thiscolsum1h = nextcolsum1h; + } + } +} diff --git a/simd/jsimd.h b/simd/jsimd.h index 402f44b8..3522903b 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -2,7 +2,7 @@ * simd/jsimd.h * * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright (C) 2011, 2014 D. R. Commander + * Copyright (C) 2011, 2014-2015 D. R. Commander * Copyright (C) 2013-2014, MIPS Technologies, Inc., California * Copyright (C) 2014 Linaro Limited * @@ -453,6 +453,13 @@ EXTERN(void) jsimd_h2v2_fancy_upsample_mips_dspr2 (int max_v_samp_factor, JDIMENSION downsampled_width, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); +EXTERN(void) jsimd_h2v1_fancy_upsample_altivec + (int max_v_samp_factor, JDIMENSION downsampled_width, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); +EXTERN(void) jsimd_h2v2_fancy_upsample_altivec + (int max_v_samp_factor, JDIMENSION downsampled_width, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + /* Merged Upsampling */ EXTERN(void) jsimd_h2v1_merged_upsample_mmx (JDIMENSION output_width, JSAMPIMAGE input_buf, diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index 431510a6..6f9d4937 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -2,7 +2,7 @@ * jsimd_powerpc.c * * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright 2009-2011, 2014 D. R. Commander + * Copyright 2009-2011, 2014-2015 D. R. Commander * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -308,12 +308,34 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_fancy_upsample (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } GLOBAL(int) jsimd_can_h2v1_fancy_upsample (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -323,6 +345,9 @@ jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { + jsimd_h2v2_fancy_upsample_altivec(cinfo->max_v_samp_factor, + compptr->downsampled_width, input_data, + output_data_ptr); } GLOBAL(void) @@ -331,6 +356,9 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { + jsimd_h2v1_fancy_upsample_altivec(cinfo->max_v_samp_factor, + compptr->downsampled_width, input_data, + output_data_ptr); } GLOBAL(int) From a6a24c270e16c04c2a53fe380d8516d6bef3db98 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 13 Jan 2015 10:00:12 +0000 Subject: [PATCH 035/140] Make the formatting and naming of variables and constants more consistent git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1496 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jccolext-altivec.c | 50 ++++++++-------- simd/jcgryext-altivec.c | 30 +++++----- simd/jcsample-altivec.c | 102 +++++++++++++++++---------------- simd/jdcolext-altivec.c | 35 ++++++------ simd/jdsample-altivec.c | 123 ++++++++++++++++++++-------------------- simd/jfdctfst-altivec.c | 8 +-- simd/jidctfst-altivec.c | 31 +++++----- simd/jidctint-altivec.c | 41 +++++++------- simd/jquanti-altivec.c | 34 +++++------ 9 files changed, 229 insertions(+), 225 deletions(-) diff --git a/simd/jccolext-altivec.c b/simd/jccolext-altivec.c index 0d50e558..84d314db 100644 --- a/simd/jccolext-altivec.c +++ b/simd/jccolext-altivec.c @@ -38,7 +38,7 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, __vector unsigned char rgb4 = {0}; #endif __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3; - __vector unsigned short y01, y23, cr01, cr23, cb01, cb23; + __vector unsigned short yl, yh, crl, crh, cbl, cbh; __vector int y0, y1, y2, y3, cr0, cr1, cr2, cr3, cb0, cb1, cb2, cb3; /* Constants */ @@ -49,7 +49,7 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, __vector unsigned short pw_f050_f000 = { __4X2(F_0_500, 0) }; __vector int pd_onehalf = { __4X(ONE_HALF) }, pd_onehalfm1_cj = { __4X(ONE_HALF - 1 + (CENTERJSAMPLE << SCALEBITS)) }; - __vector unsigned char zero = { __16X(0) }, + __vector unsigned char pb_zero = { __16X(0) }, shift_pack_index = { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29}; @@ -168,14 +168,14 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, * NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't * support unsigned vectors. */ - rg0 = (__vector signed short)vec_mergeh(zero, rgbg0); - bg0 = (__vector signed short)vec_mergel(zero, rgbg0); - rg1 = (__vector signed short)vec_mergeh(zero, rgbg1); - bg1 = (__vector signed short)vec_mergel(zero, rgbg1); - rg2 = (__vector signed short)vec_mergeh(zero, rgbg2); - bg2 = (__vector signed short)vec_mergel(zero, rgbg2); - rg3 = (__vector signed short)vec_mergeh(zero, rgbg3); - bg3 = (__vector signed short)vec_mergel(zero, rgbg3); + rg0 = (__vector signed short)vec_mergeh(pb_zero, rgbg0); + bg0 = (__vector signed short)vec_mergel(pb_zero, rgbg0); + rg1 = (__vector signed short)vec_mergeh(pb_zero, rgbg1); + bg1 = (__vector signed short)vec_mergel(pb_zero, rgbg1); + rg2 = (__vector signed short)vec_mergeh(pb_zero, rgbg2); + bg2 = (__vector signed short)vec_mergel(pb_zero, rgbg2); + rg3 = (__vector signed short)vec_mergeh(pb_zero, rgbg3); + bg3 = (__vector signed short)vec_mergel(pb_zero, rgbg3); /* (Original) * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B @@ -203,11 +203,11 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, * descaling the 32-bit results (right-shifting by 16 bits) and then * packing them. */ - y01 = vec_perm((__vector unsigned short)y0, (__vector unsigned short)y1, - shift_pack_index); - y23 = vec_perm((__vector unsigned short)y2, (__vector unsigned short)y3, - shift_pack_index); - y = vec_pack(y01, y23); + yl = vec_perm((__vector unsigned short)y0, (__vector unsigned short)y1, + shift_pack_index); + yh = vec_perm((__vector unsigned short)y2, (__vector unsigned short)y3, + shift_pack_index); + y = vec_pack(yl, yh); vec_st(y, 0, outptr0); /* Calculate Cb values */ @@ -223,11 +223,11 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, (__vector unsigned int)cb2); cb3 = (__vector int)vec_msum((__vector unsigned short)bg3, pw_f050_f000, (__vector unsigned int)cb3); - cb01 = vec_perm((__vector unsigned short)cb0, - (__vector unsigned short)cb1, shift_pack_index); - cb23 = vec_perm((__vector unsigned short)cb2, - (__vector unsigned short)cb3, shift_pack_index); - cb = vec_pack(cb01, cb23); + cbl = vec_perm((__vector unsigned short)cb0, + (__vector unsigned short)cb1, shift_pack_index); + cbh = vec_perm((__vector unsigned short)cb2, + (__vector unsigned short)cb3, shift_pack_index); + cb = vec_pack(cbl, cbh); vec_st(cb, 0, outptr1); /* Calculate Cr values */ @@ -243,11 +243,11 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, (__vector unsigned int)cr2); cr3 = (__vector int)vec_msum((__vector unsigned short)rg3, pw_f050_f000, (__vector unsigned int)cr3); - cr01 = vec_perm((__vector unsigned short)cr0, - (__vector unsigned short)cr1, shift_pack_index); - cr23 = vec_perm((__vector unsigned short)cr2, - (__vector unsigned short)cr3, shift_pack_index); - cr = vec_pack(cr01, cr23); + crl = vec_perm((__vector unsigned short)cr0, + (__vector unsigned short)cr1, shift_pack_index); + crh = vec_perm((__vector unsigned short)cr2, + (__vector unsigned short)cr3, shift_pack_index); + cr = vec_pack(crl, crh); vec_st(cr, 0, outptr2); } } diff --git a/simd/jcgryext-altivec.c b/simd/jcgryext-altivec.c index f198e006..46f5b739 100644 --- a/simd/jcgryext-altivec.c +++ b/simd/jcgryext-altivec.c @@ -39,14 +39,14 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, __vector unsigned char rgb4 = {0}; #endif __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3; - __vector unsigned short y01, y23; + __vector unsigned short yl, yh; __vector int y0, y1, y2, y3; /* Constants */ __vector short pw_f0299_f0337 = { __4X2(F_0_299, F_0_337) }, pw_f0114_f0250 = { __4X2(F_0_114, F_0_250) }; __vector int pd_onehalf = { __4X(ONE_HALF) }; - __vector unsigned char zero = { __16X(0) }, + __vector unsigned char pb_zero = { __16X(0) }, shift_pack_index = { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29}; @@ -163,14 +163,14 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, * NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't * support unsigned vectors. */ - rg0 = (__vector signed short)vec_mergeh(zero, rgbg0); - bg0 = (__vector signed short)vec_mergel(zero, rgbg0); - rg1 = (__vector signed short)vec_mergeh(zero, rgbg1); - bg1 = (__vector signed short)vec_mergel(zero, rgbg1); - rg2 = (__vector signed short)vec_mergeh(zero, rgbg2); - bg2 = (__vector signed short)vec_mergel(zero, rgbg2); - rg3 = (__vector signed short)vec_mergeh(zero, rgbg3); - bg3 = (__vector signed short)vec_mergel(zero, rgbg3); + rg0 = (__vector signed short)vec_mergeh(pb_zero, rgbg0); + bg0 = (__vector signed short)vec_mergel(pb_zero, rgbg0); + rg1 = (__vector signed short)vec_mergeh(pb_zero, rgbg1); + bg1 = (__vector signed short)vec_mergel(pb_zero, rgbg1); + rg2 = (__vector signed short)vec_mergeh(pb_zero, rgbg2); + bg2 = (__vector signed short)vec_mergel(pb_zero, rgbg2); + rg3 = (__vector signed short)vec_mergeh(pb_zero, rgbg3); + bg3 = (__vector signed short)vec_mergel(pb_zero, rgbg3); /* (Original) * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B @@ -194,11 +194,11 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, * descaling the 32-bit results (right-shifting by 16 bits) and then * packing them. */ - y01 = vec_perm((__vector unsigned short)y0, (__vector unsigned short)y1, - shift_pack_index); - y23 = vec_perm((__vector unsigned short)y2, (__vector unsigned short)y3, - shift_pack_index); - y = vec_pack(y01, y23); + yl = vec_perm((__vector unsigned short)y0, (__vector unsigned short)y1, + shift_pack_index); + yh = vec_perm((__vector unsigned short)y2, (__vector unsigned short)y3, + shift_pack_index); + y = vec_pack(yl, yh); vec_st(y, 0, outptr); } } diff --git a/simd/jcsample-altivec.c b/simd/jcsample-altivec.c index f3128703..62f72be1 100644 --- a/simd/jcsample-altivec.c +++ b/simd/jcsample-altivec.c @@ -35,15 +35,16 @@ jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, int outrow, outcol; JDIMENSION output_cols = width_blocks * DCTSIZE; JSAMPROW inptr, outptr; - __vector unsigned char tmpa, tmpb, out; - __vector unsigned short tmpae, tmpao, tmpbe, tmpbo, outl, outh; + + __vector unsigned char this0, next0, out; + __vector unsigned short this0e, this0o, next0e, next0o, outl, outh; /* Constants */ - __vector unsigned short bias = { __4X2(0, 1) }, - one = { __8X(1) }; + __vector unsigned short pw_bias = { __4X2(0, 1) }, + pw_one = { __8X(1) }; __vector unsigned char even_odd_index = { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15 }, - zero = { __16X(0) }; + pb_zero = { __16X(0) }; expand_right_edge(input_data, max_v_samp_factor, image_width, output_cols * 2); @@ -55,22 +56,22 @@ jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, for (outcol = output_cols; outcol > 0; outcol -= 16, inptr += 32, outptr += 16) { - tmpa = vec_ld(0, inptr); - tmpa = vec_perm(tmpa, tmpa, even_odd_index); - tmpae = (__vector unsigned short)vec_mergeh(zero, tmpa); - tmpao = (__vector unsigned short)vec_mergel(zero, tmpa); - outl = vec_add(tmpae, tmpao); - outl = vec_add(outl, bias); - outl = vec_sr(outl, one); + this0 = vec_ld(0, inptr); + this0 = vec_perm(this0, this0, even_odd_index); + this0e = (__vector unsigned short)vec_mergeh(pb_zero, this0); + this0o = (__vector unsigned short)vec_mergel(pb_zero, this0); + outl = vec_add(this0e, this0o); + outl = vec_add(outl, pw_bias); + outl = vec_sr(outl, pw_one); if (outcol > 16) { - tmpb = vec_ld(16, inptr); - tmpb = vec_perm(tmpb, tmpb, even_odd_index); - tmpbe = (__vector unsigned short)vec_mergeh(zero, tmpb); - tmpbo = (__vector unsigned short)vec_mergel(zero, tmpb); - outh = vec_add(tmpbe, tmpbo); - outh = vec_add(outh, bias); - outh = vec_sr(outh, one); + next0 = vec_ld(16, inptr); + next0 = vec_perm(next0, next0, even_odd_index); + next0e = (__vector unsigned short)vec_mergeh(pb_zero, next0); + next0o = (__vector unsigned short)vec_mergel(pb_zero, next0); + outh = vec_add(next0e, next0o); + outh = vec_add(outh, pw_bias); + outh = vec_sr(outh, pw_one); } else outh = vec_splat_u16(0); @@ -90,16 +91,17 @@ jsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, int inrow, outrow, outcol; JDIMENSION output_cols = width_blocks * DCTSIZE; JSAMPROW inptr0, inptr1, outptr; - __vector unsigned char tmp0a, tmp0b, tmp1a, tmp1b, out; - __vector unsigned short tmp0ae, tmp0ao, tmp0be, tmp0bo, tmp1ae, tmp1ao, - tmp1be, tmp1bo, out0l, out0h, out1l, out1h, outl, outh; + + __vector unsigned char this0, next0, this1, next1, out; + __vector unsigned short this0e, this0o, next0e, next0o, this1e, this1o, + next1e, next1o, out0l, out0h, out1l, out1h, outl, outh; /* Constants */ - __vector unsigned short bias = { __4X2(1, 2) }, - two = { __8X(2) }; + __vector unsigned short pw_bias = { __4X2(1, 2) }, + pw_two = { __8X(2) }; __vector unsigned char even_odd_index = { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15 }, - zero = { __16X(0) }; + pb_zero = { __16X(0) }; expand_right_edge(input_data, max_v_samp_factor, image_width, output_cols * 2); @@ -107,45 +109,45 @@ jsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, for (inrow = 0, outrow = 0; outrow < v_samp_factor; inrow += 2, outrow++) { - outptr = output_data[outrow]; inptr0 = input_data[inrow]; inptr1 = input_data[inrow + 1]; + outptr = output_data[outrow]; for (outcol = output_cols; outcol > 0; outcol -= 16, inptr0 += 32, inptr1 += 32, outptr += 16) { - tmp0a = vec_ld(0, inptr0); - tmp0a = vec_perm(tmp0a, tmp0a, even_odd_index); - tmp0ae = (__vector unsigned short)vec_mergeh(zero, tmp0a); - tmp0ao = (__vector unsigned short)vec_mergel(zero, tmp0a); - out0l = vec_add(tmp0ae, tmp0ao); + this0 = vec_ld(0, inptr0); + this0 = vec_perm(this0, this0, even_odd_index); + this0e = (__vector unsigned short)vec_mergeh(pb_zero, this0); + this0o = (__vector unsigned short)vec_mergel(pb_zero, this0); + out0l = vec_add(this0e, this0o); - tmp1a = vec_ld(0, inptr1); - tmp1a = vec_perm(tmp1a, tmp1a, even_odd_index); - tmp1ae = (__vector unsigned short)vec_mergeh(zero, tmp1a); - tmp1ao = (__vector unsigned short)vec_mergel(zero, tmp1a); - out1l = vec_add(tmp1ae, tmp1ao); + this1 = vec_ld(0, inptr1); + this1 = vec_perm(this1, this1, even_odd_index); + this1e = (__vector unsigned short)vec_mergeh(pb_zero, this1); + this1o = (__vector unsigned short)vec_mergel(pb_zero, this1); + out1l = vec_add(this1e, this1o); outl = vec_add(out0l, out1l); - outl = vec_add(outl, bias); - outl = vec_sr(outl, two); + outl = vec_add(outl, pw_bias); + outl = vec_sr(outl, pw_two); if (outcol > 16) { - tmp0b = vec_ld(16, inptr0); - tmp0b = vec_perm(tmp0b, tmp0b, even_odd_index); - tmp0be = (__vector unsigned short)vec_mergeh(zero, tmp0b); - tmp0bo = (__vector unsigned short)vec_mergel(zero, tmp0b); - out0h = vec_add(tmp0be, tmp0bo); + next0 = vec_ld(16, inptr0); + next0 = vec_perm(next0, next0, even_odd_index); + next0e = (__vector unsigned short)vec_mergeh(pb_zero, next0); + next0o = (__vector unsigned short)vec_mergel(pb_zero, next0); + out0h = vec_add(next0e, next0o); - tmp1b = vec_ld(16, inptr1); - tmp1b = vec_perm(tmp1b, tmp1b, even_odd_index); - tmp1be = (__vector unsigned short)vec_mergeh(zero, tmp1b); - tmp1bo = (__vector unsigned short)vec_mergel(zero, tmp1b); - out1h = vec_add(tmp1be, tmp1bo); + next1 = vec_ld(16, inptr1); + next1 = vec_perm(next1, next1, even_odd_index); + next1e = (__vector unsigned short)vec_mergeh(pb_zero, next1); + next1o = (__vector unsigned short)vec_mergel(pb_zero, next1); + out1h = vec_add(next1e, next1o); outh = vec_add(out0h, out1h); - outh = vec_add(outh, bias); - outh = vec_sr(outh, two); + outh = vec_add(outh, pw_bias); + outh = vec_sr(outh, pw_two); } else outh = vec_splat_u16(0); diff --git a/simd/jdcolext-altivec.c b/simd/jdcolext-altivec.c index 17c2e205..9cdcd02f 100644 --- a/simd/jdcolext-altivec.c +++ b/simd/jdcolext-altivec.c @@ -37,7 +37,7 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, __vector unsigned char rgb3, out4; #endif __vector short rg0, rg1, rg2, rg3, bx0, bx1, bx2, bx3, yl, yh, cbl, cbh, - crl, crh, rl, rh, gl, gh, bl, bh, g0s, g1s, g2s, g3s; + crl, crh, rl, rh, gl, gh, bl, bh, g0w, g1w, g2w, g3w; __vector int g0, g1, g2, g3; /* Constants @@ -47,11 +47,10 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, __vector short pw_f0402 = { __8X(F_0_402 >> 1) }, pw_mf0228 = { __8X(-F_0_228 >> 1) }, pw_mf0344_f0285 = { __4X2(-F_0_344, F_0_285) }, - pw_one = { __8X(1) }, - pw_255 = { __8X(255) }, + pw_one = { __8X(1) }, pw_255 = { __8X(255) }, pw_cj = { __8X(CENTERJSAMPLE) }; __vector int pd_onehalf = { __4X(ONE_HALF) }; - __vector unsigned char zero = { __16X(0) }, + __vector unsigned char pb_zero = { __16X(0) }, shift_pack_index = { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29}; @@ -70,18 +69,18 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, /* NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't * support unsigned vectors. */ - yl = (__vector signed short)vec_mergeh(zero, y); - yh = (__vector signed short)vec_mergel(zero, y); + yl = (__vector signed short)vec_mergeh(pb_zero, y); + yh = (__vector signed short)vec_mergel(pb_zero, y); cb = vec_ld(0, inptr1); - cbl = (__vector signed short)vec_mergeh(zero, cb); - cbh = (__vector signed short)vec_mergel(zero, cb); + cbl = (__vector signed short)vec_mergeh(pb_zero, cb); + cbh = (__vector signed short)vec_mergel(pb_zero, cb); cbl = vec_sub(cbl, pw_cj); cbh = vec_sub(cbh, pw_cj); cr = vec_ld(0, inptr2); - crl = (__vector signed short)vec_mergeh(zero, cr); - crh = (__vector signed short)vec_mergel(zero, cr); + crl = (__vector signed short)vec_mergeh(pb_zero, cr); + crh = (__vector signed short)vec_mergel(pb_zero, cr); crl = vec_sub(crl, pw_cj); crh = vec_sub(crh, pw_cj); @@ -119,14 +118,14 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, rl = vec_add(rl, yl); rh = vec_add(rh, yh); - g0s = vec_mergeh(cbl, crl); - g1s = vec_mergel(cbl, crl); - g0 = vec_msums(g0s, pw_mf0344_f0285, pd_onehalf); - g1 = vec_msums(g1s, pw_mf0344_f0285, pd_onehalf); - g2s = vec_mergeh(cbh, crh); - g3s = vec_mergel(cbh, crh); - g2 = vec_msums(g2s, pw_mf0344_f0285, pd_onehalf); - g3 = vec_msums(g3s, pw_mf0344_f0285, pd_onehalf); + g0w = vec_mergeh(cbl, crl); + g1w = vec_mergel(cbl, crl); + g0 = vec_msums(g0w, pw_mf0344_f0285, pd_onehalf); + g1 = vec_msums(g1w, pw_mf0344_f0285, pd_onehalf); + g2w = vec_mergeh(cbh, crh); + g3w = vec_mergel(cbh, crh); + g2 = vec_msums(g2w, pw_mf0344_f0285, pd_onehalf); + g3 = vec_msums(g3w, pw_mf0344_f0285, pd_onehalf); /* Clever way to avoid 4 shifts + 2 packs. This packs the high word from * each dword into a new 16-bit vector, which is the equivalent of * descaling the 32-bit results (right-shifting by 16 bits) and then diff --git a/simd/jdsample-altivec.c b/simd/jdsample-altivec.c index be3bbe06..6b8cecf7 100644 --- a/simd/jdsample-altivec.c +++ b/simd/jdsample-altivec.c @@ -35,12 +35,13 @@ jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, JSAMPROW inptr, outptr; int inrow, col; - __vector unsigned char block, last, next, lastblock, nextblock = {0}, out; - __vector short blocke, blocko, blockl, blockh, lastl, lasth, nextl, nexth, - outle, outhe, outlo, outho; + __vector unsigned char this0, last0, p_last0, next0 = {0}, p_next0, + out; + __vector short this0e, this0o, this0l, this0h, last0l, last0h, + next0l, next0h, outle, outhe, outlo, outho; /* Constants */ - __vector unsigned char pb_three = { __16X(3) }, pb_zero = { __16X(0) }, + __vector unsigned char pb_zero = { __16X(0) }, pb_three = { __16X(3) }, last_index_col0 = {0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14}, last_index = {15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30}, next_index = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}, @@ -52,44 +53,44 @@ jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, inptr = input_data[inrow]; outptr = output_data[inrow]; - block = vec_ld(0, inptr); - last = vec_perm(block, block, last_index_col0); - lastblock = block; + this0 = vec_ld(0, inptr); + p_last0 = vec_perm(this0, this0, last_index_col0); + last0 = this0; for (col = 0; col < downsampled_width; col += 16, inptr += 16, outptr += 32) { if (col > 0) { - last = vec_perm(lastblock, block, last_index); - lastblock = block; + p_last0 = vec_perm(last0, this0, last_index); + last0 = this0; } if (downsampled_width - col <= 16) - next = vec_perm(block, block, next_index_lastcol); + p_next0 = vec_perm(this0, this0, next_index_lastcol); else { - nextblock = vec_ld(16, inptr); - next = vec_perm(block, nextblock, next_index); + next0 = vec_ld(16, inptr); + p_next0 = vec_perm(this0, next0, next_index); } - blocke = (__vector short)vec_mule(block, pb_three); - blocko = (__vector short)vec_mulo(block, pb_three); - blockl = vec_mergeh(blocke, blocko); - blockh = vec_mergel(blocke, blocko); + this0e = (__vector short)vec_mule(this0, pb_three); + this0o = (__vector short)vec_mulo(this0, pb_three); + this0l = vec_mergeh(this0e, this0o); + this0h = vec_mergel(this0e, this0o); - lastl = (__vector short)vec_mergeh(pb_zero, last); - lasth = (__vector short)vec_mergel(pb_zero, last); - lastl = vec_add(lastl, pw_one); - lasth = vec_add(lasth, pw_one); + last0l = (__vector short)vec_mergeh(pb_zero, p_last0); + last0h = (__vector short)vec_mergel(pb_zero, p_last0); + last0l = vec_add(last0l, pw_one); + last0h = vec_add(last0h, pw_one); - nextl = (__vector short)vec_mergeh(pb_zero, next); - nexth = (__vector short)vec_mergel(pb_zero, next); - nextl = vec_add(nextl, pw_two); - nexth = vec_add(nexth, pw_two); + next0l = (__vector short)vec_mergeh(pb_zero, p_next0); + next0h = (__vector short)vec_mergel(pb_zero, p_next0); + next0l = vec_add(next0l, pw_two); + next0h = vec_add(next0h, pw_two); - outle = vec_add(blockl, lastl); - outhe = vec_add(blockh, lasth); - outlo = vec_add(blockl, nextl); - outho = vec_add(blockh, nexth); + outle = vec_add(this0l, last0l); + outhe = vec_add(this0h, last0h); + outlo = vec_add(this0l, next0l); + outho = vec_add(this0h, next0h); outle = vec_sr(outle, (__vector unsigned short)pw_two); outhe = vec_sr(outhe, (__vector unsigned short)pw_two); outlo = vec_sr(outlo, (__vector unsigned short)pw_two); @@ -102,7 +103,7 @@ jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, (__vector unsigned char)outho, merge_pack_index); vec_st(out, 16, outptr); - block = nextblock; + this0 = next0; } } } @@ -118,8 +119,8 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, JSAMPROW inptr_1, inptr0, inptr1, outptr0, outptr1; int inrow, outrow, col; - __vector unsigned char block_1, block0, block1, out; - __vector short block_1l, block_1h, block0l, block0h, block1l, block1h, + __vector unsigned char this_1, this0, this1, out; + __vector short this_1l, this_1h, this0l, this0h, this1l, this1h, lastcolsum_1h, lastcolsum1h, p_lastcolsum_1l, p_lastcolsum_1h, p_lastcolsum1l, p_lastcolsum1h, thiscolsum_1l, thiscolsum_1h, thiscolsum1l, thiscolsum1h, @@ -147,26 +148,26 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, outptr0 = output_data[outrow++]; outptr1 = output_data[outrow++]; - block0 = vec_ld(0, inptr0); - block0l = (__vector short)vec_mergeh(pb_zero, block0); - block0h = (__vector short)vec_mergel(pb_zero, block0); - block0l = vec_mladd(block0l, pw_three, pw_zero); - block0h = vec_mladd(block0h, pw_three, pw_zero); + this0 = vec_ld(0, inptr0); + this0l = (__vector short)vec_mergeh(pb_zero, this0); + this0h = (__vector short)vec_mergel(pb_zero, this0); + this0l = vec_mladd(this0l, pw_three, pw_zero); + this0h = vec_mladd(this0h, pw_three, pw_zero); - block_1 = vec_ld(0, inptr_1); - block_1l = (__vector short)vec_mergeh(pb_zero, block_1); - block_1h = (__vector short)vec_mergel(pb_zero, block_1); - thiscolsum_1l = vec_add(block0l, block_1l); - thiscolsum_1h = vec_add(block0h, block_1h); + this_1 = vec_ld(0, inptr_1); + this_1l = (__vector short)vec_mergeh(pb_zero, this_1); + this_1h = (__vector short)vec_mergel(pb_zero, this_1); + thiscolsum_1l = vec_add(this0l, this_1l); + thiscolsum_1h = vec_add(this0h, this_1h); lastcolsum_1h = thiscolsum_1h; p_lastcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1l, last_index_col0); p_lastcolsum_1h = vec_perm(thiscolsum_1l, thiscolsum_1h, last_index); - block1 = vec_ld(0, inptr1); - block1l = (__vector short)vec_mergeh(pb_zero, block1); - block1h = (__vector short)vec_mergel(pb_zero, block1); - thiscolsum1l = vec_add(block0l, block1l); - thiscolsum1h = vec_add(block0h, block1h); + this1 = vec_ld(0, inptr1); + this1l = (__vector short)vec_mergeh(pb_zero, this1); + this1h = (__vector short)vec_mergel(pb_zero, this1); + thiscolsum1l = vec_add(this0l, this1l); + thiscolsum1h = vec_add(this0h, this1h); lastcolsum1h = thiscolsum1h; p_lastcolsum1l = vec_perm(thiscolsum1l, thiscolsum1l, last_index_col0); p_lastcolsum1h = vec_perm(thiscolsum1l, thiscolsum1h, last_index); @@ -191,25 +192,25 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, p_nextcolsum1h = vec_perm(thiscolsum1h, thiscolsum1h, next_index_lastcol); } else { - block0 = vec_ld(16, inptr0); - block0l = (__vector short)vec_mergeh(pb_zero, block0); - block0h = (__vector short)vec_mergel(pb_zero, block0); - block0l = vec_mladd(block0l, pw_three, pw_zero); - block0h = vec_mladd(block0h, pw_three, pw_zero); + this0 = vec_ld(16, inptr0); + this0l = (__vector short)vec_mergeh(pb_zero, this0); + this0h = (__vector short)vec_mergel(pb_zero, this0); + this0l = vec_mladd(this0l, pw_three, pw_zero); + this0h = vec_mladd(this0h, pw_three, pw_zero); - block_1 = vec_ld(16, inptr_1); - block_1l = (__vector short)vec_mergeh(pb_zero, block_1); - block_1h = (__vector short)vec_mergel(pb_zero, block_1); - nextcolsum_1l = vec_add(block0l, block_1l); - nextcolsum_1h = vec_add(block0h, block_1h); + this_1 = vec_ld(16, inptr_1); + this_1l = (__vector short)vec_mergeh(pb_zero, this_1); + this_1h = (__vector short)vec_mergel(pb_zero, this_1); + nextcolsum_1l = vec_add(this0l, this_1l); + nextcolsum_1h = vec_add(this0h, this_1h); p_nextcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1h, next_index); p_nextcolsum_1h = vec_perm(thiscolsum_1h, nextcolsum_1l, next_index); - block1 = vec_ld(16, inptr1); - block1l = (__vector short)vec_mergeh(pb_zero, block1); - block1h = (__vector short)vec_mergel(pb_zero, block1); - nextcolsum1l = vec_add(block0l, block1l); - nextcolsum1h = vec_add(block0h, block1h); + this1 = vec_ld(16, inptr1); + this1l = (__vector short)vec_mergeh(pb_zero, this1); + this1h = (__vector short)vec_mergel(pb_zero, this1); + nextcolsum1l = vec_add(this0l, this1l); + nextcolsum1h = vec_add(this0h, this1h); p_nextcolsum1l = vec_perm(thiscolsum1l, thiscolsum1h, next_index); p_nextcolsum1h = vec_perm(thiscolsum1h, nextcolsum1l, next_index); } diff --git a/simd/jfdctfst-altivec.c b/simd/jfdctfst-altivec.c index 16a52df6..c4cc26e7 100644 --- a/simd/jfdctfst-altivec.c +++ b/simd/jfdctfst-altivec.c @@ -56,7 +56,7 @@ \ z1 = vec_add(tmp12, tmp13); \ z1 = vec_sl(z1, pre_multiply_scale_bits); \ - z1 = vec_madds(z1, pw_0707, zero); \ + z1 = vec_madds(z1, pw_0707, pw_zero); \ \ out2 = vec_add(tmp13, z1); \ out6 = vec_sub(tmp13, z1); \ @@ -70,13 +70,13 @@ tmp10 = vec_sl(tmp10, pre_multiply_scale_bits); \ tmp12 = vec_sl(tmp12, pre_multiply_scale_bits); \ z5 = vec_sub(tmp10, tmp12); \ - z5 = vec_madds(z5, pw_0382, zero); \ + z5 = vec_madds(z5, pw_0382, pw_zero); \ \ z2 = vec_madds(tmp10, pw_0541, z5); \ z4 = vec_madds(tmp12, pw_1306, z5); \ \ tmp11 = vec_sl(tmp11, pre_multiply_scale_bits); \ - z3 = vec_madds(tmp11, pw_0707, zero); \ + z3 = vec_madds(tmp11, pw_0707, pw_zero); \ \ z11 = vec_add(tmp7, z3); \ z13 = vec_sub(tmp7, z3); \ @@ -98,7 +98,7 @@ jsimd_fdct_ifast_altivec (DCTELEM *data) out0, out1, out2, out3, out4, out5, out6, out7; /* Constants */ - __vector short zero = vec_splat_s16(0), + __vector short pw_zero = { __8X(0) }, pw_0382 = { __8X(F_0_382 << CONST_SHIFT) }, pw_0541 = { __8X(F_0_541 << CONST_SHIFT) }, pw_0707 = { __8X(F_0_707 << CONST_SHIFT) }, diff --git a/simd/jidctfst-altivec.c b/simd/jidctfst-altivec.c index aa25fe05..fd7a2a34 100644 --- a/simd/jidctfst-altivec.c +++ b/simd/jidctfst-altivec.c @@ -54,7 +54,7 @@ \ tmp12 = vec_sub(in##2, in##6); \ tmp12 = vec_sl(tmp12, pre_multiply_scale_bits); \ - tmp12 = vec_madds(tmp12, pw_F1414, zero); \ + tmp12 = vec_madds(tmp12, pw_F1414, pw_zero); \ tmp12 = vec_sub(tmp12, tmp13); \ \ tmp0 = vec_add(tmp10, tmp13); \ @@ -73,7 +73,7 @@ \ tmp11 = vec_sub(z11, z13); \ tmp11 = vec_sl(tmp11, pre_multiply_scale_bits); \ - tmp11 = vec_madds(tmp11, pw_F1414, zero); \ + tmp11 = vec_madds(tmp11, pw_F1414, pw_zero); \ \ tmp7 = vec_add(z11, z13); \ \ @@ -88,9 +88,9 @@ */ \ \ z5 = vec_add(z10s, z12s); \ - z5 = vec_madds(z5, pw_F1847, zero); \ + z5 = vec_madds(z5, pw_F1847, pw_zero); \ \ - tmp10 = vec_madds(z12s, pw_F1082, zero); \ + tmp10 = vec_madds(z12s, pw_F1082, pw_zero); \ tmp10 = vec_sub(tmp10, z5); \ tmp12 = vec_madds(z10s, pw_MF1613, z5); \ tmp12 = vec_sub(tmp12, z10); \ @@ -115,6 +115,8 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { short *dct_table = (short *)dct_table_; + int *outptr; + __vector short row0, row1, row2, row3, row4, row5, row6, row7, col0, col1, col2, col3, col4, col5, col6, col7, quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, @@ -122,10 +124,9 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, z5, z10, z10s, z11, z12s, z13, out0, out1, out2, out3, out4, out5, out6, out7; __vector signed char outb; - int *outptr; /* Constants */ - __vector short zero = { __8X(0) }, + __vector short pw_zero = { __8X(0) }, pw_F1414 = { __8X(F_1_414 << CONST_SHIFT) }, pw_F1847 = { __8X(F_1_847 << CONST_SHIFT) }, pw_MF1613 = { __8X(-F_1_613 << CONST_SHIFT) }, @@ -154,9 +155,9 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, tmp1 = vec_or(tmp1, tmp3); quant0 = vec_ld(0, dct_table); - col0 = vec_mladd(col0, quant0, zero); + col0 = vec_mladd(col0, quant0, pw_zero); - if (vec_all_eq(tmp1, zero)) { + if (vec_all_eq(tmp1, pw_zero)) { /* AC terms all zero */ row0 = vec_splat(col0, 0); @@ -178,13 +179,13 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, quant6 = vec_ld(96, dct_table); quant7 = vec_ld(112, dct_table); - col1 = vec_mladd(col1, quant1, zero); - col2 = vec_mladd(col2, quant2, zero); - col3 = vec_mladd(col3, quant3, zero); - col4 = vec_mladd(col4, quant4, zero); - col5 = vec_mladd(col5, quant5, zero); - col6 = vec_mladd(col6, quant6, zero); - col7 = vec_mladd(col7, quant7, zero); + col1 = vec_mladd(col1, quant1, pw_zero); + col2 = vec_mladd(col2, quant2, pw_zero); + col3 = vec_mladd(col3, quant3, pw_zero); + col4 = vec_mladd(col4, quant4, pw_zero); + col5 = vec_mladd(col5, quant5, pw_zero); + col6 = vec_mladd(col6, quant6, pw_zero); + col7 = vec_mladd(col7, quant7, pw_zero); DO_IDCT(col); diff --git a/simd/jidctint-altivec.c b/simd/jidctint-altivec.c index 37cae757..7f0f8d0d 100644 --- a/simd/jidctint-altivec.c +++ b/simd/jidctint-altivec.c @@ -61,10 +61,10 @@ in##26l = vec_mergeh(in##2, in##6); \ in##26h = vec_mergel(in##2, in##6); \ \ - tmp3l = vec_msums(in##26l, pw_f130_f054, zero32); \ - tmp3h = vec_msums(in##26h, pw_f130_f054, zero32); \ - tmp2l = vec_msums(in##26l, pw_f054_mf130, zero32); \ - tmp2h = vec_msums(in##26h, pw_f054_mf130, zero32); \ + tmp3l = vec_msums(in##26l, pw_f130_f054, pd_zero); \ + tmp3h = vec_msums(in##26h, pw_f130_f054, pd_zero); \ + tmp2l = vec_msums(in##26l, pw_f054_mf130, pd_zero); \ + tmp2h = vec_msums(in##26h, pw_f054_mf130, pd_zero); \ \ tmp0 = vec_add(in##0, in##4); \ tmp1 = vec_sub(in##0, in##4); \ @@ -111,10 +111,10 @@ z34l = vec_mergeh(z3, z4); \ z34h = vec_mergel(z3, z4); \ \ - z3l = vec_msums(z34l, pw_mf078_f117, zero32); \ - z3h = vec_msums(z34h, pw_mf078_f117, zero32); \ - z4l = vec_msums(z34l, pw_f117_f078, zero32); \ - z4h = vec_msums(z34h, pw_f117_f078, zero32); \ + z3l = vec_msums(z34l, pw_mf078_f117, pd_zero); \ + z3h = vec_msums(z34h, pw_mf078_f117, pd_zero); \ + z4l = vec_msums(z34l, pw_f117_f078, pd_zero); \ + z4h = vec_msums(z34h, pw_f117_f078, pd_zero); \ \ /* (Original) \ * z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; \ @@ -210,6 +210,8 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { short *dct_table = (short *)dct_table_; + int *outptr; + __vector short row0, row1, row2, row3, row4, row5, row6, row7, col0, col1, col2, col3, col4, col5, col6, col7, quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, @@ -223,10 +225,9 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, out0l, out0h, out1l, out1h, out2l, out2h, out3l, out3h, out4l, out4h, out5l, out5h, out6l, out6h, out7l, out7h; __vector signed char outb; - int *outptr; /* Constants */ - __vector short zero16 = { __8X(0) }, + __vector short pw_zero = { __8X(0) }, pw_f130_f054 = { __4X2(F_0_541 + F_0_765, F_0_541) }, pw_f054_mf130 = { __4X2(F_0_541, F_0_541 - F_1_847) }, pw_mf078_f117 = { __4X2(F_1_175 - F_1_961, F_1_175) }, @@ -236,7 +237,7 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, pw_mf050_mf256 = { __4X2(F_2_053 - F_2_562, -F_2_562) }, pw_mf256_f050 = { __4X2(-F_2_562, F_3_072 - F_2_562) }; __vector unsigned short pass1_bits = { __8X(PASS1_BITS) }; - __vector int zero32 = { __4X(0) }, + __vector int pd_zero = { __4X(0) }, pd_descale_p1 = { __4X(1 << (DESCALE_P1 - 1)) }, pd_descale_p2 = { __4X(1 << (DESCALE_P2 - 1)) }; __vector unsigned int descale_p1 = { __4X(DESCALE_P1) }, @@ -263,9 +264,9 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, tmp1 = vec_or(tmp1, tmp3); quant0 = vec_ld(0, dct_table); - col0 = vec_mladd(col0, quant0, zero16); + col0 = vec_mladd(col0, quant0, pw_zero); - if (vec_all_eq(tmp1, zero16)) { + if (vec_all_eq(tmp1, pw_zero)) { /* AC terms all zero */ col0 = vec_sl(col0, pass1_bits); @@ -289,13 +290,13 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, quant6 = vec_ld(96, dct_table); quant7 = vec_ld(112, dct_table); - col1 = vec_mladd(col1, quant1, zero16); - col2 = vec_mladd(col2, quant2, zero16); - col3 = vec_mladd(col3, quant3, zero16); - col4 = vec_mladd(col4, quant4, zero16); - col5 = vec_mladd(col5, quant5, zero16); - col6 = vec_mladd(col6, quant6, zero16); - col7 = vec_mladd(col7, quant7, zero16); + col1 = vec_mladd(col1, quant1, pw_zero); + col2 = vec_mladd(col2, quant2, pw_zero); + col3 = vec_mladd(col3, quant3, pw_zero); + col4 = vec_mladd(col4, quant4, pw_zero); + col5 = vec_mladd(col5, quant5, pw_zero); + col6 = vec_mladd(col6, quant6, pw_zero); + col7 = vec_mladd(col7, quant7, pw_zero); DO_IDCT(col, 1); diff --git a/simd/jquanti-altivec.c b/simd/jquanti-altivec.c index 12c97eef..2ac01a2d 100644 --- a/simd/jquanti-altivec.c +++ b/simd/jquanti-altivec.c @@ -42,12 +42,13 @@ jsimd_convsamp_altivec (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace) { JSAMPROW elemptr; + __vector unsigned char in0, in1, in2, in3, in4, in5, in6, in7; __vector short out0, out1, out2, out3, out4, out5, out6, out7; /* Constants */ __vector short pw_centerjsamp = { __8X(CENTERJSAMPLE) }; - __vector unsigned char zero = { __16X(0) }; + __vector unsigned char pb_zero = { __16X(0) }; LOAD_ROW(0); LOAD_ROW(1); @@ -58,14 +59,14 @@ jsimd_convsamp_altivec (JSAMPARRAY sample_data, JDIMENSION start_col, LOAD_ROW(6); LOAD_ROW(7); - out0 = (__vector short)vec_mergeh(zero, in0); - out1 = (__vector short)vec_mergeh(zero, in1); - out2 = (__vector short)vec_mergeh(zero, in2); - out3 = (__vector short)vec_mergeh(zero, in3); - out4 = (__vector short)vec_mergeh(zero, in4); - out5 = (__vector short)vec_mergeh(zero, in5); - out6 = (__vector short)vec_mergeh(zero, in6); - out7 = (__vector short)vec_mergeh(zero, in7); + out0 = (__vector short)vec_mergeh(pb_zero, in0); + out1 = (__vector short)vec_mergeh(pb_zero, in1); + out2 = (__vector short)vec_mergeh(pb_zero, in2); + out3 = (__vector short)vec_mergeh(pb_zero, in3); + out4 = (__vector short)vec_mergeh(pb_zero, in4); + out5 = (__vector short)vec_mergeh(pb_zero, in5); + out6 = (__vector short)vec_mergeh(pb_zero, in6); + out7 = (__vector short)vec_mergeh(pb_zero, in7); out0 = vec_sub(out0, pw_centerjsamp); out1 = vec_sub(out1, pw_centerjsamp); @@ -89,7 +90,8 @@ jsimd_convsamp_altivec (JSAMPARRAY sample_data, JDIMENSION start_col, #define WORD_BIT 16 -/* There is no AltiVec unsigned multiply instruction, hence this. */ +/* There is no AltiVec 16-bit unsigned multiply instruction, hence this. + We basically need an unsigned equivalent of vec_madds(). */ #define MULTIPLY(vs0, vs1, out) { \ tmpe = vec_mule((__vector unsigned short)vs0, \ @@ -105,13 +107,11 @@ void jsimd_quantize_altivec (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace) { - __vector short row0, row1, row2, row3, row4, row5, row6, row7; - __vector short row0s, row1s, row2s, row3s, row4s, row5s, row6s, row7s; - __vector short corr0, corr1, corr2, corr3, corr4, corr5, corr6, corr7; - __vector short recip0, recip1, recip2, recip3, recip4, recip5, recip6, - recip7; - __vector short scale0, scale1, scale2, scale3, scale4, scale5, scale6, - scale7; + __vector short row0, row1, row2, row3, row4, row5, row6, row7, + row0s, row1s, row2s, row3s, row4s, row5s, row6s, row7s, + corr0, corr1, corr2, corr3, corr4, corr5, corr6, corr7, + recip0, recip1, recip2, recip3, recip4, recip5, recip6, recip7, + scale0, scale1, scale2, scale3, scale4, scale5, scale6, scale7; __vector unsigned int tmpe, tmpo; /* Constants */ From 406bb01ca279dde77f5e1c91b0d4bc496c08ca32 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 13 Jan 2015 11:47:20 +0000 Subject: [PATCH 036/140] Make the formatting and naming of variables and constants more consistent git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1497 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jccolext-altivec.c | 3 +-- simd/jcgryext-altivec.c | 3 +-- simd/jdcolext-altivec.c | 3 +-- simd/jquanti-altivec.c | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/simd/jccolext-altivec.c b/simd/jccolext-altivec.c index 84d314db..39177bb4 100644 --- a/simd/jccolext-altivec.c +++ b/simd/jccolext-altivec.c @@ -50,8 +50,7 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, __vector int pd_onehalf = { __4X(ONE_HALF) }, pd_onehalfm1_cj = { __4X(ONE_HALF - 1 + (CENTERJSAMPLE << SCALEBITS)) }; __vector unsigned char pb_zero = { __16X(0) }, - shift_pack_index = - { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29}; + shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29}; while (--num_rows >= 0) { inptr = *input_buf++; diff --git a/simd/jcgryext-altivec.c b/simd/jcgryext-altivec.c index 46f5b739..c2bedd66 100644 --- a/simd/jcgryext-altivec.c +++ b/simd/jcgryext-altivec.c @@ -47,8 +47,7 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, pw_f0114_f0250 = { __4X2(F_0_114, F_0_250) }; __vector int pd_onehalf = { __4X(ONE_HALF) }; __vector unsigned char pb_zero = { __16X(0) }, - shift_pack_index = - { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29}; + shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29}; while (--num_rows >= 0) { inptr = *input_buf++; diff --git a/simd/jdcolext-altivec.c b/simd/jdcolext-altivec.c index 9cdcd02f..2c52dd78 100644 --- a/simd/jdcolext-altivec.c +++ b/simd/jdcolext-altivec.c @@ -51,8 +51,7 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, pw_cj = { __8X(CENTERJSAMPLE) }; __vector int pd_onehalf = { __4X(ONE_HALF) }; __vector unsigned char pb_zero = { __16X(0) }, - shift_pack_index = - { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29}; + shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29}; while (--num_rows >= 0) { inptr0 = input_buf[0][input_row]; diff --git a/simd/jquanti-altivec.c b/simd/jquanti-altivec.c index 2ac01a2d..d57d691e 100644 --- a/simd/jquanti-altivec.c +++ b/simd/jquanti-altivec.c @@ -117,7 +117,7 @@ jsimd_quantize_altivec (JCOEFPTR coef_block, DCTELEM * divisors, /* Constants */ __vector unsigned short pw_word_bit_m1 = { __8X(WORD_BIT - 1) }; __vector unsigned char shift_pack_index = - { 0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29}; + {0,1,16,17,4,5,20,21,8,9,24,25,12,13,28,29}; row0 = vec_ld(0, workspace); row1 = vec_ld(16, workspace); From ada430bb3de2e5c55aa85acfba38cb775117cffc Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 13 Jan 2015 11:49:15 +0000 Subject: [PATCH 037/140] Make the formatting and naming of variables and constants more consistent git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1498 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jcsample-altivec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simd/jcsample-altivec.c b/simd/jcsample-altivec.c index 62f72be1..58ae4496 100644 --- a/simd/jcsample-altivec.c +++ b/simd/jcsample-altivec.c @@ -43,7 +43,7 @@ jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, __vector unsigned short pw_bias = { __4X2(0, 1) }, pw_one = { __8X(1) }; __vector unsigned char even_odd_index = - { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15 }, + {0,2,4,6,8,10,12,14,1,3,5,7,9,11,13,15}, pb_zero = { __16X(0) }; expand_right_edge(input_data, max_v_samp_factor, image_width, From cbcb53617b71bb86d7c48a61571ab1bafe0d2c1a Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Jan 2015 08:31:54 +0000 Subject: [PATCH 038/140] Fix a bug in the AltiVec downsampling routines uncovered during additional testing with small image sizes. Since the output width is half the input width, the downsampler should only read a second 16-byte chunk if there are more than 8 output columns left. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1499 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jcsample-altivec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simd/jcsample-altivec.c b/simd/jcsample-altivec.c index 58ae4496..517e2bed 100644 --- a/simd/jcsample-altivec.c +++ b/simd/jcsample-altivec.c @@ -64,7 +64,7 @@ jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, outl = vec_add(outl, pw_bias); outl = vec_sr(outl, pw_one); - if (outcol > 16) { + if (outcol > 8) { next0 = vec_ld(16, inptr); next0 = vec_perm(next0, next0, even_odd_index); next0e = (__vector unsigned short)vec_mergeh(pb_zero, next0); @@ -132,7 +132,7 @@ jsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, outl = vec_add(outl, pw_bias); outl = vec_sr(outl, pw_two); - if (outcol > 16) { + if (outcol > 8) { next0 = vec_ld(16, inptr0); next0 = vec_perm(next0, next0, even_odd_index); next0e = (__vector unsigned short)vec_mergeh(pb_zero, next0); From 9ab2c1071b54f963742d393a4e3c6f8d17232f01 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Jan 2015 08:42:29 +0000 Subject: [PATCH 039/140] In the process of developing the AltiVec extensions, it was discovered that the normal regression tests aren't sufficient to test the behavior of the library with very small image sizes and when compressing from/decompressing to a subregion of a larger image buffer. Thus, an additional regression test was added that takes advantage of the tiled compression/decompression feature in tjbench. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1500 632fc199-4ca6-4c93-a231-07263d6284db --- Makefile.am | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 8d6ee49e..8cf817fb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -263,7 +263,7 @@ MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d endif .PHONY: test -test: tjquicktest bittest +test: tjquicktest tjbittest bittest tjquicktest: testclean all @@ -281,6 +281,64 @@ endif ./tjunittest -yuv ./tjunittest -yuv -alloc ./tjunittest -yuv -noyuvpad +endif + echo GREAT SUCCESS! + +tjbittest: testclean all + +if WITH_TURBOJPEG + +MD5_PPM_GRAY_TILE = 89d3ca21213d9d864b50b4e4e7de4ca6 +MD5_PPM_420_8x8_TILE = 847fceab15c5b7b911cb986cf0f71de3 +MD5_PPM_420_16x16_TILE = ca45552a93687e078f7137cc4126a7b0 +MD5_PPM_420_32x32_TILE = d8676f1d6b68df358353bba9844f4a00 +MD5_PPM_420_64x64_TILE = 4e4c1a3d7ea4bace4f868bcbe83b7050 +MD5_PPM_420_128x128_TILE = f24c3429c52265832beab9df72a0ceae +MD5_PPM_420M_8x8_TILE = bc25320e1f4c31ce2e610e43e9fd173c +MD5_PPM_420M_TILE = 75ffdf14602258c5c189522af57fa605 +MD5_PPM_422_8x8_TILE = d83dacd9fc73b0a6f10c09acad64eb1e +MD5_PPM_422_16x16_TILE = 35077fb610d72dd743b1eb0cbcfe10fb +MD5_PPM_422_32x32_TILE = e6902ed8a449ecc0f0d6f2bf945f65f7 +MD5_PPM_422_64x64_TILE = 2b4502a8f316cedbde1da7bce3d2231e +MD5_PPM_422_128x128_TILE = f0b5617d578f5e13c8eee215d64d4877 +MD5_PPM_422M_8x8_TILE = 828941d7f41cd6283abd6beffb7fd51d +MD5_PPM_422M_TILE = e877ae1324c4a280b95376f7f018172f +MD5_PPM_444_TILE = 7964e41e67cfb8d0a587c0aa4798f9c3 + +# Test compressing from/decompressing to an arbitrary subregion of a larger +# image buffer + cp $(srcdir)/testimages/testorig.ppm testout_tile.ppm + ./tjbench testout_tile.ppm 95 -rgb -quiet -tile -benchtime 0.01 >/dev/null 2>&1 + for i in 8 16 32 64 128; do \ + md5/md5cmp $(MD5_PPM_GRAY_TILE) testout_tile_GRAY_Q95_$$i\x$$i.ppm; \ + done + md5/md5cmp $(MD5_PPM_420_8x8_TILE) testout_tile_420_Q95_8x8.ppm + md5/md5cmp $(MD5_PPM_420_16x16_TILE) testout_tile_420_Q95_16x16.ppm + md5/md5cmp $(MD5_PPM_420_32x32_TILE) testout_tile_420_Q95_32x32.ppm + md5/md5cmp $(MD5_PPM_420_64x64_TILE) testout_tile_420_Q95_64x64.ppm + md5/md5cmp $(MD5_PPM_420_128x128_TILE) testout_tile_420_Q95_128x128.ppm + md5/md5cmp $(MD5_PPM_422_8x8_TILE) testout_tile_422_Q95_8x8.ppm + md5/md5cmp $(MD5_PPM_422_16x16_TILE) testout_tile_422_Q95_16x16.ppm + md5/md5cmp $(MD5_PPM_422_32x32_TILE) testout_tile_422_Q95_32x32.ppm + md5/md5cmp $(MD5_PPM_422_64x64_TILE) testout_tile_422_Q95_64x64.ppm + md5/md5cmp $(MD5_PPM_422_128x128_TILE) testout_tile_422_Q95_128x128.ppm + for i in 8 16 32 64 128; do \ + md5/md5cmp $(MD5_PPM_444_TILE) testout_tile_444_Q95_$$i\x$$i.ppm; \ + done + rm testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* + + ./tjbench testout_tile.ppm 95 -rgb -fastupsample -quiet -tile -benchtime 0.01 >/dev/null 2>&1 + md5/md5cmp $(MD5_PPM_420M_8x8_TILE) testout_tile_420_Q95_8x8.ppm + for i in 16 32 64 128; do \ + md5/md5cmp $(MD5_PPM_420M_TILE) testout_tile_420_Q95_$$i\x$$i.ppm; \ + done + md5/md5cmp $(MD5_PPM_422M_8x8_TILE) testout_tile_422_Q95_8x8.ppm + for i in 16 32 64 128; do \ + md5/md5cmp $(MD5_PPM_422M_TILE) testout_tile_422_Q95_$$i\x$$i.ppm; \ + done + rm testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* testout_tile.ppm + echo GREAT SUCCESS! + endif bittest: testclean all @@ -481,6 +539,7 @@ endif ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_JPEG_CROP) testout_crop.jpg rm testout_crop.jpg + echo GREAT SUCCESS! testclean: From 2517ef72ed705e84e2d9b758783e8c97ed1eef7a Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Jan 2015 10:45:31 +0000 Subject: [PATCH 040/140] Fix bugs in the AltiVec fancy upsampling routines uncovered during additional testing with small image sizes. Since the input width is half the output width, the upsampler should only write a second 16-byte chuck if there are more than 8 input columns left. Additionally, if the width is < 16, then we need to insert a dummy sample (the SSE2 code does this as well, but I neglected to port that portion of the code for some reason.) git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1501 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jdsample-altivec.c | 101 ++++++++++++++++++++++++---------------- 1 file changed, 62 insertions(+), 39 deletions(-) diff --git a/simd/jdsample-altivec.c b/simd/jdsample-altivec.c index 6b8cecf7..f49e4039 100644 --- a/simd/jdsample-altivec.c +++ b/simd/jdsample-altivec.c @@ -33,7 +33,7 @@ jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, { JSAMPARRAY output_data = *output_data_ptr; JSAMPROW inptr, outptr; - int inrow, col; + int inrow, incol; __vector unsigned char this0, last0, p_last0, next0 = {0}, p_next0, out; @@ -53,19 +53,22 @@ jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, inptr = input_data[inrow]; outptr = output_data[inrow]; + if (downsampled_width & 15) + inptr[downsampled_width] = inptr[downsampled_width - 1]; + this0 = vec_ld(0, inptr); p_last0 = vec_perm(this0, this0, last_index_col0); last0 = this0; - for (col = 0; col < downsampled_width; - col += 16, inptr += 16, outptr += 32) { + for (incol = downsampled_width; incol > 0; + incol -= 16, inptr += 16, outptr += 32) { - if (col > 0) { + if (downsampled_width - incol > 0) { p_last0 = vec_perm(last0, this0, last_index); last0 = this0; } - if (downsampled_width - col <= 16) + if (incol <= 16) p_next0 = vec_perm(this0, this0, next_index_lastcol); else { next0 = vec_ld(16, inptr); @@ -80,28 +83,33 @@ jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, last0l = (__vector short)vec_mergeh(pb_zero, p_last0); last0h = (__vector short)vec_mergel(pb_zero, p_last0); last0l = vec_add(last0l, pw_one); - last0h = vec_add(last0h, pw_one); next0l = (__vector short)vec_mergeh(pb_zero, p_next0); next0h = (__vector short)vec_mergel(pb_zero, p_next0); next0l = vec_add(next0l, pw_two); - next0h = vec_add(next0h, pw_two); outle = vec_add(this0l, last0l); - outhe = vec_add(this0h, last0h); outlo = vec_add(this0l, next0l); - outho = vec_add(this0h, next0h); outle = vec_sr(outle, (__vector unsigned short)pw_two); - outhe = vec_sr(outhe, (__vector unsigned short)pw_two); outlo = vec_sr(outlo, (__vector unsigned short)pw_two); - outho = vec_sr(outho, (__vector unsigned short)pw_two); out = vec_perm((__vector unsigned char)outle, (__vector unsigned char)outlo, merge_pack_index); vec_st(out, 0, outptr); - out = vec_perm((__vector unsigned char)outhe, - (__vector unsigned char)outho, merge_pack_index); - vec_st(out, 16, outptr); + + if (incol > 8) { + last0h = vec_add(last0h, pw_one); + next0h = vec_add(next0h, pw_two); + + outhe = vec_add(this0h, last0h); + outho = vec_add(this0h, next0h); + outhe = vec_sr(outhe, (__vector unsigned short)pw_two); + outho = vec_sr(outho, (__vector unsigned short)pw_two); + + out = vec_perm((__vector unsigned char)outhe, + (__vector unsigned char)outho, merge_pack_index); + vec_st(out, 16, outptr); + } this0 = next0; } @@ -117,7 +125,7 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, { JSAMPARRAY output_data = *output_data_ptr; JSAMPROW inptr_1, inptr0, inptr1, outptr0, outptr1; - int inrow, outrow, col; + int inrow, outrow, incol; __vector unsigned char this_1, this0, this1, out; __vector short this_1l, this_1h, this0l, this0h, this1l, this1h, @@ -148,6 +156,12 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, outptr0 = output_data[outrow++]; outptr1 = output_data[outrow++]; + if (downsampled_width & 15) { + inptr_1[downsampled_width] = inptr_1[downsampled_width - 1]; + inptr0[downsampled_width] = inptr0[downsampled_width - 1]; + inptr1[downsampled_width] = inptr1[downsampled_width - 1]; + } + this0 = vec_ld(0, inptr0); this0l = (__vector short)vec_mergeh(pb_zero, this0); this0h = (__vector short)vec_mergel(pb_zero, this0); @@ -172,11 +186,11 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, p_lastcolsum1l = vec_perm(thiscolsum1l, thiscolsum1l, last_index_col0); p_lastcolsum1h = vec_perm(thiscolsum1l, thiscolsum1h, last_index); - for (col = 0; col < downsampled_width; - col += 16, inptr_1 += 16, inptr0 += 16, inptr1 += 16, + for (incol = downsampled_width; incol > 0; + incol -= 16, inptr_1 += 16, inptr0 += 16, inptr1 += 16, outptr0 += 32, outptr1 += 32) { - if (col > 0) { + if (downsampled_width - incol > 0) { p_lastcolsum_1l = vec_perm(lastcolsum_1h, thiscolsum_1l, last_index); p_lastcolsum_1h = vec_perm(thiscolsum_1l, thiscolsum_1h, last_index); p_lastcolsum1l = vec_perm(lastcolsum1h, thiscolsum1l, last_index); @@ -184,7 +198,7 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, lastcolsum_1h = thiscolsum_1h; lastcolsum1h = thiscolsum1h; } - if (downsampled_width - col <= 16) { + if (incol <= 16) { p_nextcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1h, next_index); p_nextcolsum_1h = vec_perm(thiscolsum_1h, thiscolsum_1h, next_index_lastcol); @@ -218,53 +232,62 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, /* Process the upper row */ tmpl = vec_mladd(thiscolsum_1l, pw_three, pw_zero); - tmph = vec_mladd(thiscolsum_1h, pw_three, pw_zero); outle = vec_add(tmpl, p_lastcolsum_1l); - outhe = vec_add(tmph, p_lastcolsum_1h); outle = vec_add(outle, pw_eight); - outhe = vec_add(outhe, pw_eight); outle = vec_sr(outle, pw_four); - outhe = vec_sr(outhe, pw_four); outlo = vec_add(tmpl, p_nextcolsum_1l); - outho = vec_add(tmph, p_nextcolsum_1h); outlo = vec_add(outlo, pw_seven); - outho = vec_add(outho, pw_seven); outlo = vec_sr(outlo, pw_four); - outho = vec_sr(outho, pw_four); out = vec_perm((__vector unsigned char)outle, (__vector unsigned char)outlo, merge_pack_index); vec_st(out, 0, outptr0); - out = vec_perm((__vector unsigned char)outhe, - (__vector unsigned char)outho, merge_pack_index); - vec_st(out, 16, outptr0); + if (incol > 8) { + tmph = vec_mladd(thiscolsum_1h, pw_three, pw_zero); + outhe = vec_add(tmph, p_lastcolsum_1h); + outhe = vec_add(outhe, pw_eight); + outhe = vec_sr(outhe, pw_four); + + outho = vec_add(tmph, p_nextcolsum_1h); + outho = vec_add(outho, pw_seven); + outho = vec_sr(outho, pw_four); + + out = vec_perm((__vector unsigned char)outhe, + (__vector unsigned char)outho, merge_pack_index); + vec_st(out, 16, outptr0); + } /* Process the lower row */ tmpl = vec_mladd(thiscolsum1l, pw_three, pw_zero); - tmph = vec_mladd(thiscolsum1h, pw_three, pw_zero); outle = vec_add(tmpl, p_lastcolsum1l); - outhe = vec_add(tmph, p_lastcolsum1h); outle = vec_add(outle, pw_eight); - outhe = vec_add(outhe, pw_eight); outle = vec_sr(outle, pw_four); - outhe = vec_sr(outhe, pw_four); outlo = vec_add(tmpl, p_nextcolsum1l); - outho = vec_add(tmph, p_nextcolsum1h); outlo = vec_add(outlo, pw_seven); - outho = vec_add(outho, pw_seven); outlo = vec_sr(outlo, pw_four); - outho = vec_sr(outho, pw_four); out = vec_perm((__vector unsigned char)outle, (__vector unsigned char)outlo, merge_pack_index); vec_st(out, 0, outptr1); - out = vec_perm((__vector unsigned char)outhe, - (__vector unsigned char)outho, merge_pack_index); - vec_st(out, 16, outptr1); + + if (incol > 8) { + tmph = vec_mladd(thiscolsum1h, pw_three, pw_zero); + outhe = vec_add(tmph, p_lastcolsum1h); + outhe = vec_add(outhe, pw_eight); + outhe = vec_sr(outhe, pw_four); + + outho = vec_add(tmph, p_nextcolsum1h); + outho = vec_add(outho, pw_seven); + outho = vec_sr(outho, pw_four); + + out = vec_perm((__vector unsigned char)outhe, + (__vector unsigned char)outho, merge_pack_index); + vec_st(out, 16, outptr1); + } thiscolsum_1l = nextcolsum_1l; thiscolsum_1h = nextcolsum_1h; thiscolsum1l = nextcolsum1l; thiscolsum1h = nextcolsum1h; From 11c4010c3c22544e775228d6a9653be2b3f2e77c Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Jan 2015 13:07:06 +0000 Subject: [PATCH 041/140] Fix an overread detected by valgrind git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1502 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jdcolext-altivec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simd/jdcolext-altivec.c b/simd/jdcolext-altivec.c index 2c52dd78..1b8311d3 100644 --- a/simd/jdcolext-altivec.c +++ b/simd/jdcolext-altivec.c @@ -205,7 +205,7 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, /* Fast path */ unaligned_shift_index = vec_lvsl(0, outptr); edgel = vec_ld(0, outptr); - edgeh = vec_ld(min(num_cols, RGB_PIXELSIZE * 16) + offset, outptr); + edgeh = vec_ld(min(num_cols - 1, RGB_PIXELSIZE * 16), outptr); edges = vec_perm(edgeh, edgel, unaligned_shift_index); unaligned_shift_index = vec_lvsr(0, outptr); out0 = vec_perm(edges, rgb0, unaligned_shift_index); From 86af36aebcc0bbc73faf47b89a57fe77f8c22732 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Jan 2015 13:27:32 +0000 Subject: [PATCH 042/140] AltiVec SIMD implementation of H2V1 and H2V2 merged upsampling git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1503 632fc199-4ca6-4c93-a231-07263d6284db --- simd/Makefile.am | 2 +- simd/jdmerge-altivec.c | 108 ++++++++++++++ simd/jdmrgext-altivec.c | 304 ++++++++++++++++++++++++++++++++++++++++ simd/jsimd.h | 44 ++++++ simd/jsimd_powerpc.c | 84 +++++++++++ 5 files changed, 541 insertions(+), 1 deletion(-) create mode 100644 simd/jdmerge-altivec.c create mode 100644 simd/jdmrgext-altivec.c diff --git a/simd/Makefile.am b/simd/Makefile.am index 82a3dd39..fd11011d 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -74,7 +74,7 @@ if SIMD_POWERPC libsimd_la_SOURCES = jsimd_powerpc.c \ jccolor-altivec.c jcgray-altivec.c jcsample-altivec.c \ - jdcolor-altivec.c jdsample-altivec.c \ + jdcolor-altivec.c jdmerge-altivec.c jdsample-altivec.c \ jfdctfst-altivec.c jfdctint-altivec.c \ jidctfst-altivec.c jidctint-altivec.c \ jquanti-altivec.c diff --git a/simd/jdmerge-altivec.c b/simd/jdmerge-altivec.c new file mode 100644 index 00000000..cc8d3d91 --- /dev/null +++ b/simd/jdmerge-altivec.c @@ -0,0 +1,108 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2015, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* MERGED YCC --> RGB CONVERSION AND UPSAMPLING */ + +#include "jsimd_altivec.h" + + +#define F_0_344 22554 /* FIX(0.34414) */ +#define F_0_714 46802 /* FIX(0.71414) */ +#define F_1_402 91881 /* FIX(1.40200) */ +#define F_1_772 116130 /* FIX(1.77200) */ +#define F_0_402 (F_1_402 - 65536) /* FIX(1.40200) - FIX(1) */ +#define F_0_285 (65536 - F_0_714) /* FIX(1) - FIX(0.71414) */ +#define F_0_228 (131072 - F_1_772) /* FIX(2) - FIX(1.77200) */ + +#define SCALEBITS 16 +#define ONE_HALF (1 << (SCALEBITS - 1)) + +#define RGB_INDEX0 {0,1,8,2,3,10,4,5,12,6,7,14,16,17,24,18} +#define RGB_INDEX1 {3,10,4,5,12,6,7,14,16,17,24,18,19,26,20,21} +#define RGB_INDEX2 {12,6,7,14,16,17,24,18,19,26,20,21,28,22,23,30} +#include "jdmrgext-altivec.c" +#undef RGB_PIXELSIZE + +#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE +#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extrgb_merged_upsample_altivec +#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extrgb_merged_upsample_altivec +#include "jdmrgext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX0 +#undef RGB_INDEX1 +#undef RGB_INDEX2 +#undef jsimd_h2v1_merged_upsample_altivec +#undef jsimd_h2v2_merged_upsample_altivec + +#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE +#define RGB_INDEX {0,1,8,9,2,3,10,11,4,5,12,13,6,7,14,15} +#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extrgbx_merged_upsample_altivec +#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extrgbx_merged_upsample_altivec +#include "jdmrgext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX +#undef jsimd_h2v1_merged_upsample_altivec +#undef jsimd_h2v2_merged_upsample_altivec + +#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE +#define RGB_INDEX0 {8,1,0,10,3,2,12,5,4,14,7,6,24,17,16,26} +#define RGB_INDEX1 {3,2,12,5,4,14,7,6,24,17,16,26,19,18,28,21} +#define RGB_INDEX2 {4,14,7,6,24,17,16,26,19,18,28,21,20,30,23,22} +#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extbgr_merged_upsample_altivec +#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extbgr_merged_upsample_altivec +#include "jdmrgext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX0 +#undef RGB_INDEX1 +#undef RGB_INDEX2 +#undef jsimd_h2v1_merged_upsample_altivec +#undef jsimd_h2v2_merged_upsample_altivec + +#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE +#define RGB_INDEX {8,1,0,9,10,3,2,11,12,5,4,13,14,7,6,15} +#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extbgrx_merged_upsample_altivec +#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extbgrx_merged_upsample_altivec +#include "jdmrgext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX +#undef jsimd_h2v1_merged_upsample_altivec +#undef jsimd_h2v2_merged_upsample_altivec + +#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE +#define RGB_INDEX {9,8,1,0,11,10,3,2,13,12,5,4,15,14,7,6} +#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extxbgr_merged_upsample_altivec +#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extxbgr_merged_upsample_altivec +#include "jdmrgext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX +#undef jsimd_h2v1_merged_upsample_altivec +#undef jsimd_h2v2_merged_upsample_altivec + +#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE +#define RGB_INDEX {9,0,1,8,11,2,3,10,13,4,5,12,15,6,7,14} +#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extxrgb_merged_upsample_altivec +#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extxrgb_merged_upsample_altivec +#include "jdmrgext-altivec.c" +#undef RGB_PIXELSIZE +#undef RGB_INDEX +#undef jsimd_h2v1_merged_upsample_altivec +#undef jsimd_h2v2_merged_upsample_altivec diff --git a/simd/jdmrgext-altivec.c b/simd/jdmrgext-altivec.c new file mode 100644 index 00000000..0b92e7ed --- /dev/null +++ b/simd/jdmrgext-altivec.c @@ -0,0 +1,304 @@ +/* + * AltiVec optimizations for libjpeg-turbo + * + * Copyright (C) 2015, D. R. Commander. + * All rights reserved. + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +/* This file is included by jdmerge-altivec.c */ + + +void jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width, + JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + JSAMPROW outptr, inptr0, inptr1, inptr2; + int pitch = output_width * RGB_PIXELSIZE, offset, num_cols, yloop; + unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; + + __vector unsigned char rgb0, rgb1, rgb2, rgbx0, rgbx1, rgbx2, rgbx3, + y, cb, cr, edgel, edgeh, edges, out0, out1, out2, out3; +#if RGB_PIXELSIZE == 4 + __vector unsigned char rgb3, out4; +#endif + __vector short rg0, rg1, rg2, rg3, bx0, bx1, bx2, bx3, ye, yo, cbl, cbh, + crl, crh, r_yl, r_yh, g_yl, g_yh, b_yl, b_yh, g_y0w, g_y1w, g_y2w, g_y3w, + rl, rh, gl, gh, bl, bh, re, ro, ge, go, be, bo; + __vector int g_y0, g_y1, g_y2, g_y3; + + /* Constants + * NOTE: The >> 1 is to compensate for the fact that vec_madds() returns 17 + * high-order bits, not 16. + */ + __vector short pw_f0402 = { __8X(F_0_402 >> 1) }, + pw_mf0228 = { __8X(-F_0_228 >> 1) }, + pw_mf0344_f0285 = { __4X2(-F_0_344, F_0_285) }, + pw_one = { __8X(1) }, pw_255 = { __8X(255) }, + pw_cj = { __8X(CENTERJSAMPLE) }; + __vector int pd_onehalf = { __4X(ONE_HALF) }; + __vector unsigned char pb_zero = { __16X(0) }, + shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29}, + even_index = {0,16,0,18,0,20,0,22,0,24,0,26,0,28,0,30}, + odd_index = {0,17,0,19,0,21,0,23,0,25,0,27,0,29,0,31}; + + inptr0 = input_buf[0][in_row_group_ctr]; + inptr1 = input_buf[1][in_row_group_ctr]; + inptr2 = input_buf[2][in_row_group_ctr]; + outptr = output_buf[0]; + + for (num_cols = pitch; num_cols > 0; inptr1 += 16, inptr2 += 16) { + + cb = vec_ld(0, inptr1); + /* NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't + * support unsigned vectors. + */ + cbl = (__vector signed short)vec_mergeh(pb_zero, cb); + cbh = (__vector signed short)vec_mergel(pb_zero, cb); + cbl = vec_sub(cbl, pw_cj); + cbh = vec_sub(cbh, pw_cj); + + cr = vec_ld(0, inptr2); + crl = (__vector signed short)vec_mergeh(pb_zero, cr); + crh = (__vector signed short)vec_mergel(pb_zero, cr); + crl = vec_sub(crl, pw_cj); + crh = vec_sub(crh, pw_cj); + + /* (Original) + * R = Y + 1.40200 * Cr + * G = Y - 0.34414 * Cb - 0.71414 * Cr + * B = Y + 1.77200 * Cb + * + * (This implementation) + * R = Y + 0.40200 * Cr + Cr + * G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr + * B = Y - 0.22800 * Cb + Cb + Cb + */ + b_yl = vec_add(cbl, cbl); + b_yh = vec_add(cbh, cbh); + b_yl = vec_madds(b_yl, pw_mf0228, pw_one); + b_yh = vec_madds(b_yh, pw_mf0228, pw_one); + b_yl = vec_sra(b_yl, (__vector unsigned short)pw_one); + b_yh = vec_sra(b_yh, (__vector unsigned short)pw_one); + b_yl = vec_add(b_yl, cbl); + b_yh = vec_add(b_yh, cbh); + b_yl = vec_add(b_yl, cbl); + b_yh = vec_add(b_yh, cbh); + + r_yl = vec_add(crl, crl); + r_yh = vec_add(crh, crh); + r_yl = vec_madds(r_yl, pw_f0402, pw_one); + r_yh = vec_madds(r_yh, pw_f0402, pw_one); + r_yl = vec_sra(r_yl, (__vector unsigned short)pw_one); + r_yh = vec_sra(r_yh, (__vector unsigned short)pw_one); + r_yl = vec_add(r_yl, crl); + r_yh = vec_add(r_yh, crh); + + g_y0w = vec_mergeh(cbl, crl); + g_y1w = vec_mergel(cbl, crl); + g_y0 = vec_msums(g_y0w, pw_mf0344_f0285, pd_onehalf); + g_y1 = vec_msums(g_y1w, pw_mf0344_f0285, pd_onehalf); + g_y2w = vec_mergeh(cbh, crh); + g_y3w = vec_mergel(cbh, crh); + g_y2 = vec_msums(g_y2w, pw_mf0344_f0285, pd_onehalf); + g_y3 = vec_msums(g_y3w, pw_mf0344_f0285, pd_onehalf); + /* Clever way to avoid 4 shifts + 2 packs. This packs the high word from + * each dword into a new 16-bit vector, which is the equivalent of + * descaling the 32-bit results (right-shifting by 16 bits) and then + * packing them. + */ + g_yl = vec_perm((__vector short)g_y0, (__vector short)g_y1, + shift_pack_index); + g_yh = vec_perm((__vector short)g_y2, (__vector short)g_y3, + shift_pack_index); + g_yl = vec_sub(g_yl, crl); + g_yh = vec_sub(g_yh, crh); + + for (yloop = 0; yloop < 2 && num_cols > 0; yloop++, + num_cols -= RGB_PIXELSIZE * 16, + outptr += RGB_PIXELSIZE * 16, inptr0 += 16) { + + y = vec_ld(0, inptr0); + ye = (__vector signed short)vec_perm(pb_zero, y, even_index); + yo = (__vector signed short)vec_perm(pb_zero, y, odd_index); + + if (yloop == 0) { + be = vec_add(b_yl, ye); + bo = vec_add(b_yl, yo); + re = vec_add(r_yl, ye); + ro = vec_add(r_yl, yo); + ge = vec_add(g_yl, ye); + go = vec_add(g_yl, yo); + } else { + be = vec_add(b_yh, ye); + bo = vec_add(b_yh, yo); + re = vec_add(r_yh, ye); + ro = vec_add(r_yh, yo); + ge = vec_add(g_yh, ye); + go = vec_add(g_yh, yo); + } + + rl = vec_mergeh(re, ro); + rh = vec_mergel(re, ro); + gl = vec_mergeh(ge, go); + gh = vec_mergel(ge, go); + bl = vec_mergeh(be, bo); + bh = vec_mergel(be, bo); + + rg0 = vec_mergeh(rl, gl); + bx0 = vec_mergeh(bl, pw_255); + rg1 = vec_mergel(rl, gl); + bx1 = vec_mergel(bl, pw_255); + rg2 = vec_mergeh(rh, gh); + bx2 = vec_mergeh(bh, pw_255); + rg3 = vec_mergel(rh, gh); + bx3 = vec_mergel(bh, pw_255); + + rgbx0 = vec_packsu(rg0, bx0); + rgbx1 = vec_packsu(rg1, bx1); + rgbx2 = vec_packsu(rg2, bx2); + rgbx3 = vec_packsu(rg3, bx3); + +#if RGB_PIXELSIZE == 3 + /* rgbx0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 X0 B1 X1 B2 X2 B3 X3 + * rgbx1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 X4 B5 X5 B6 X6 B7 X7 + * rgbx2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 X8 B9 X9 Ba Xa Bb Xb + * rgbx3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Xc Bd Xd Be Xe Bf Xf + * + * rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 + * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga + * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf + */ + rgb0 = vec_perm(rgbx0, rgbx1, (__vector unsigned char)RGB_INDEX0); + rgb1 = vec_perm(rgbx1, rgbx2, (__vector unsigned char)RGB_INDEX1); + rgb2 = vec_perm(rgbx2, rgbx3, (__vector unsigned char)RGB_INDEX2); +#else + /* rgbx0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 X0 B1 X1 B2 X2 B3 X3 + * rgbx1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 X4 B5 X5 B6 X6 B7 X7 + * rgbx2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 X8 B9 X9 Ba Xa Bb Xb + * rgbx3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Xc Bd Xd Be Xe Bf Xf + * + * rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3 + * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7 + * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb + * rgb3 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf + */ + rgb0 = vec_perm(rgbx0, rgbx0, (__vector unsigned char)RGB_INDEX); + rgb1 = vec_perm(rgbx1, rgbx1, (__vector unsigned char)RGB_INDEX); + rgb2 = vec_perm(rgbx2, rgbx2, (__vector unsigned char)RGB_INDEX); + rgb3 = vec_perm(rgbx3, rgbx3, (__vector unsigned char)RGB_INDEX); +#endif + + offset = (size_t)outptr & 15; + if (offset) { + __vector unsigned char unaligned_shift_index; + int bytes = num_cols + offset; + + if (bytes < (RGB_PIXELSIZE + 1) * 16 && (bytes & 15)) { + /* Slow path to prevent buffer overwrite. Since there is no way to + * write a partial AltiVec register, overwrite would occur on the + * last chunk of the last image row if the right edge is not on a + * 16-byte boundary. It could also occur on other rows if the bytes + * per row is low enough. Since we can't determine whether we're on + * the last image row, we have to assume every row is the last. + */ + vec_st(rgb0, 0, tmpbuf); + vec_st(rgb1, 16, tmpbuf); + vec_st(rgb2, 32, tmpbuf); +#if RGB_PIXELSIZE == 4 + vec_st(rgb3, 48, tmpbuf); +#endif + memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); + } else { + /* Fast path */ + unaligned_shift_index = vec_lvsl(0, outptr); + edgel = vec_ld(0, outptr); + edgeh = vec_ld(min(num_cols - 1, RGB_PIXELSIZE * 16), outptr); + edges = vec_perm(edgeh, edgel, unaligned_shift_index); + unaligned_shift_index = vec_lvsr(0, outptr); + out0 = vec_perm(edges, rgb0, unaligned_shift_index); + out1 = vec_perm(rgb0, rgb1, unaligned_shift_index); + out2 = vec_perm(rgb1, rgb2, unaligned_shift_index); +#if RGB_PIXELSIZE == 4 + out3 = vec_perm(rgb2, rgb3, unaligned_shift_index); + out4 = vec_perm(rgb3, edges, unaligned_shift_index); +#else + out3 = vec_perm(rgb2, edges, unaligned_shift_index); +#endif + vec_st(out0, 0, outptr); + if (bytes > 16) + vec_st(out1, 16, outptr); + if (bytes > 32) + vec_st(out2, 32, outptr); + if (bytes > 48) + vec_st(out3, 48, outptr); +#if RGB_PIXELSIZE == 4 + if (bytes > 64) + vec_st(out4, 64, outptr); +#endif + } + } else { + if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) { + /* Slow path */ + vec_st(rgb0, 0, tmpbuf); + vec_st(rgb1, 16, tmpbuf); + vec_st(rgb2, 32, tmpbuf); +#if RGB_PIXELSIZE == 4 + vec_st(rgb3, 48, tmpbuf); +#endif + memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); + } else { + /* Fast path */ + vec_st(rgb0, 0, outptr); + if (num_cols > 16) + vec_st(rgb1, 16, outptr); + if (num_cols > 32) + vec_st(rgb2, 32, outptr); +#if RGB_PIXELSIZE == 4 + if (num_cols > 48) + vec_st(rgb3, 48, outptr); +#endif + } + } + } + } +} + + +void jsimd_h2v2_merged_upsample_altivec (JDIMENSION output_width, + JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + JSAMPROW inptr, outptr; + + inptr = input_buf[0][in_row_group_ctr]; + outptr = output_buf[0]; + + input_buf[0][in_row_group_ctr] = input_buf[0][in_row_group_ctr * 2]; + jsimd_h2v1_merged_upsample_altivec(output_width, input_buf, in_row_group_ctr, + output_buf); + + input_buf[0][in_row_group_ctr] = input_buf[0][in_row_group_ctr * 2 + 1]; + output_buf[0] = output_buf[1]; + jsimd_h2v1_merged_upsample_altivec(output_width, input_buf, in_row_group_ctr, + output_buf); + + input_buf[0][in_row_group_ctr] = inptr; + output_buf[0] = outptr; +} diff --git a/simd/jsimd.h b/simd/jsimd.h index 3522903b..4e6e8d7b 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -594,6 +594,50 @@ EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mips_dspr2 (JDIMENSION output_width, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range); +EXTERN(void) jsimd_h2v1_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v1_extrgb_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v1_extbgr_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); + +EXTERN(void) jsimd_h2v2_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v2_extrgb_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v2_extbgr_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); +EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_altivec + (JDIMENSION output_width, JSAMPIMAGE input_buf, + JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); + /* Sample Conversion */ EXTERN(void) jsimd_convsamp_mmx (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace); diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index 6f9d4937..1da406e7 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -364,12 +364,34 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_merged_upsample (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } GLOBAL(int) jsimd_can_h2v1_merged_upsample (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -379,6 +401,37 @@ jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf) { + void (*altivecfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); + + switch(cinfo->out_color_space) { + case JCS_EXT_RGB: + altivecfct=jsimd_h2v2_extrgb_merged_upsample_altivec; + break; + case JCS_EXT_RGBX: + case JCS_EXT_RGBA: + altivecfct=jsimd_h2v2_extrgbx_merged_upsample_altivec; + break; + case JCS_EXT_BGR: + altivecfct=jsimd_h2v2_extbgr_merged_upsample_altivec; + break; + case JCS_EXT_BGRX: + case JCS_EXT_BGRA: + altivecfct=jsimd_h2v2_extbgrx_merged_upsample_altivec; + break; + case JCS_EXT_XBGR: + case JCS_EXT_ABGR: + altivecfct=jsimd_h2v2_extxbgr_merged_upsample_altivec; + break; + case JCS_EXT_XRGB: + case JCS_EXT_ARGB: + altivecfct=jsimd_h2v2_extxrgb_merged_upsample_altivec; + break; + default: + altivecfct=jsimd_h2v2_merged_upsample_altivec; + break; + } + + altivecfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf); } GLOBAL(void) @@ -387,6 +440,37 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf) { + void (*altivecfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY); + + switch(cinfo->out_color_space) { + case JCS_EXT_RGB: + altivecfct=jsimd_h2v1_extrgb_merged_upsample_altivec; + break; + case JCS_EXT_RGBX: + case JCS_EXT_RGBA: + altivecfct=jsimd_h2v1_extrgbx_merged_upsample_altivec; + break; + case JCS_EXT_BGR: + altivecfct=jsimd_h2v1_extbgr_merged_upsample_altivec; + break; + case JCS_EXT_BGRX: + case JCS_EXT_BGRA: + altivecfct=jsimd_h2v1_extbgrx_merged_upsample_altivec; + break; + case JCS_EXT_XBGR: + case JCS_EXT_ABGR: + altivecfct=jsimd_h2v1_extxbgr_merged_upsample_altivec; + break; + case JCS_EXT_XRGB: + case JCS_EXT_ARGB: + altivecfct=jsimd_h2v1_extxrgb_merged_upsample_altivec; + break; + default: + altivecfct=jsimd_h2v1_merged_upsample_altivec; + break; + } + + altivecfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf); } GLOBAL(int) From c641cddb80871395e81164d586faec7e056336c1 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Jan 2015 15:41:11 +0000 Subject: [PATCH 043/140] AltiVec SIMD implementation of H2V1 and H2V2 plain upsampling (used only when decompressing YCCK images with fast upsampling enabled.) git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1504 632fc199-4ca6-4c93-a231-07263d6284db --- ChangeLog.txt | 11 ++++++ simd/jdsample-altivec.c | 88 +++++++++++++++++++++++++++++++++++++++++ simd/jsimd.h | 6 +++ simd/jsimd_powerpc.c | 26 ++++++++++++ 4 files changed, 131 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 88664551..b61ab2b4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,14 @@ +1.5 pre-beta +============ + +[1] Added full SIMD acceleration for PowerPC platforms using AltiVec VMX +(128-bit SIMD) instructions. Although the performance of libjpeg-turbo on +PowerPC was already good, due to the increased number of registers available +to the compiler vs. x86, it was still possible to speed up compression by about +3-4x and decompression by about 2-2.5x (relative to libjpeg v6b) through the +use of AltiVec instructions. + + 1.4.0 ===== diff --git a/simd/jdsample-altivec.c b/simd/jdsample-altivec.c index f49e4039..f73b185f 100644 --- a/simd/jdsample-altivec.c +++ b/simd/jdsample-altivec.c @@ -294,3 +294,91 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, } } } + + +/* These are rarely used (mainly just for decompressing YCCK images) */ + +void +jsimd_h2v1_upsample_altivec (int max_v_samp_factor, + JDIMENSION output_width, + JSAMPARRAY input_data, + JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + JSAMPROW inptr, outptr; + int inrow, incol; + + __vector unsigned char in, inl, inh; + + for (inrow = 0; inrow < max_v_samp_factor; inrow++) { + inptr = input_data[inrow]; + outptr = output_data[inrow]; + + for (incol = (output_width + 31) & (~31); incol > 0; + incol -= 64, inptr += 32, outptr += 64) { + + in = vec_ld(0, inptr); + inl = vec_mergeh(in, in); + inh = vec_mergel(in, in); + + vec_st(inl, 0, outptr); + vec_st(inh, 16, outptr); + + if (incol > 32) { + in = vec_ld(16, inptr); + inl = vec_mergeh(in, in); + inh = vec_mergel(in, in); + + vec_st(inl, 32, outptr); + vec_st(inh, 48, outptr); + } + } + } +} + + +void +jsimd_h2v2_upsample_altivec (int max_v_samp_factor, + JDIMENSION output_width, + JSAMPARRAY input_data, + JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + JSAMPROW inptr, outptr0, outptr1; + int inrow, outrow, incol; + + __vector unsigned char in, inl, inh; + + for (inrow = 0, outrow = 0; outrow < max_v_samp_factor; inrow++) { + + inptr = input_data[inrow]; + outptr0 = output_data[outrow++]; + outptr1 = output_data[outrow++]; + + for (incol = (output_width + 31) & (~31); incol > 0; + incol -= 64, inptr += 32, outptr0 += 64, outptr1 += 64) { + + in = vec_ld(0, inptr); + inl = vec_mergeh(in, in); + inh = vec_mergel(in, in); + + vec_st(inl, 0, outptr0); + vec_st(inl, 0, outptr1); + + vec_st(inh, 16, outptr0); + vec_st(inh, 16, outptr1); + + if (incol > 32) { + in = vec_ld(16, inptr); + inl = vec_mergeh(in, in); + inh = vec_mergel(in, in); + + vec_st(inl, 32, outptr0); + vec_st(inl, 32, outptr1); + + vec_st(inh, 48, outptr0); + vec_st(inh, 48, outptr1); + } + } + } +} diff --git a/simd/jsimd.h b/simd/jsimd.h index 4e6e8d7b..c0de7e7a 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -425,6 +425,12 @@ EXTERN(void) jsimd_int_upsample_mips_dspr2 JSAMPARRAY * output_data_ptr, JDIMENSION output_width, int max_v_samp_factor); +EXTERN(void) jsimd_h2v1_upsample_altivec + (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, + JSAMPARRAY * output_data_ptr); +EXTERN(void) jsimd_h2v2_upsample_altivec + (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, + JSAMPARRAY * output_data_ptr); /* Fancy Upsampling */ EXTERN(void) jsimd_h2v1_fancy_upsample_mmx diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index 1da406e7..2fc68142 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -280,12 +280,34 @@ jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, GLOBAL(int) jsimd_can_h2v2_upsample (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } GLOBAL(int) jsimd_can_h2v1_upsample (void) { + init_simd(); + + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ALTIVEC) + return 1; + return 0; } @@ -295,6 +317,8 @@ jsimd_h2v2_upsample (j_decompress_ptr cinfo, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { + jsimd_h2v2_upsample_altivec(cinfo->max_v_samp_factor, cinfo->output_width, + input_data, output_data_ptr); } GLOBAL(void) @@ -303,6 +327,8 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { + jsimd_h2v1_upsample_altivec(cinfo->max_v_samp_factor, cinfo->output_width, + input_data, output_data_ptr); } GLOBAL(int) From 2ab5ea6c48f0ab5eb9b77212f0ca2407a57215ac Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Jan 2015 19:39:01 +0000 Subject: [PATCH 044/140] Add the ability to benchmark YCCK JPEG compression/decompression. This is particularly useful since that is the only way to test the performance of the "plain" upsampling routines, which are accelerated on some platforms. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1505 632fc199-4ca6-4c93-a231-07263d6284db --- bmp.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++-------- tjbench.c | 21 ++++++++++---- 2 files changed, 87 insertions(+), 16 deletions(-) diff --git a/bmp.c b/bmp.c index 4986055c..9fcf7bbd 100644 --- a/bmp.c +++ b/bmp.c @@ -1,5 +1,5 @@ /* - * Copyright (C)2011 D. R. Commander. All Rights Reserved. + * Copyright (C)2011, 2015 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -75,24 +75,84 @@ static void my_output_message(j_common_ptr cinfo) static void pixelconvert(unsigned char *srcbuf, int srcpf, int srcbottomup, unsigned char *dstbuf, int dstpf, int dstbottomup, int w, int h) { - unsigned char *srcptr=srcbuf, *srcptr2; + unsigned char *srcrowptr=srcbuf, *srccolptr; int srcps=tjPixelSize[srcpf]; int srcstride=srcbottomup? -w*srcps:w*srcps; - unsigned char *dstptr=dstbuf, *dstptr2; + unsigned char *dstrowptr=dstbuf, *dstcolptr; int dstps=tjPixelSize[dstpf]; int dststride=dstbottomup? -w*dstps:w*dstps; int row, col; - if(srcbottomup) srcptr=&srcbuf[w*srcps*(h-1)]; - if(dstbottomup) dstptr=&dstbuf[w*dstps*(h-1)]; - for(row=0; rowRGB conversion routines are for testing + purposes only. Properly converting between CMYK and RGB requires a color + management system. */ + + if(dstpf==TJPF_CMYK) { - for(col=0, srcptr2=srcptr, dstptr2=dstptr; col1.0) c=1.0; if(c<0.) c=0.; + if(m>1.0) m=1.0; if(m<0.) m=0.; + if(y>1.0) y=1.0; if(y<0.) y=0.; + if(k>1.0) k=1.0; if(k<0.) k=0.; + *dstcolptr++=(unsigned char)(255.0-c*255.0+0.5); + *dstcolptr++=(unsigned char)(255.0-m*255.0+0.5); + *dstcolptr++=(unsigned char)(255.0-y*255.0+0.5); + *dstcolptr++=(unsigned char)(255.0-k*255.0+0.5); + } + } + } + else if(srcpf==TJPF_CMYK) + { + for(row=0; row255.0) r=255.0; if(r<0.) r=0.; + if(g>255.0) g=255.0; if(g<0.) g=0.; + if(b>255.0) b=255.0; if(b<0.) b=0.; + dstcolptr[tjRedOffset[dstpf]]=(unsigned char)(r+0.5); + dstcolptr[tjGreenOffset[dstpf]]=(unsigned char)(g+0.5); + dstcolptr[tjBlueOffset[dstpf]]=(unsigned char)(b+0.5); + } + } + } + else + { + for(row=0; row=minqual; i--) - fullTest(srcbuf, w, h, TJSAMP_GRAY, i, argv[1]); - printf("\n"); + if(pf!=TJPF_CMYK) + { + for(i=maxqual; i>=minqual; i--) + fullTest(srcbuf, w, h, TJSAMP_GRAY, i, argv[1]); + printf("\n"); + } for(i=maxqual; i>=minqual; i--) fullTest(srcbuf, w, h, TJSAMP_420, i, argv[1]); printf("\n"); From c4e3c361d712ca85f878ee4384fd6316fa91817d Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 15 Jan 2015 08:51:31 +0000 Subject: [PATCH 045/140] De-confusify the variable names a bit -- "out" represents the output of the IDCT kernel, so use "final" to represent the packed data that will be stored to memory. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1506 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jidctfst-altivec.c | 69 +++++++++++++++++++++-------------------- simd/jidctint-altivec.c | 69 +++++++++++++++++++++-------------------- 2 files changed, 70 insertions(+), 68 deletions(-) diff --git a/simd/jidctfst-altivec.c b/simd/jidctfst-altivec.c index fd7a2a34..9779a6ac 100644 --- a/simd/jidctfst-altivec.c +++ b/simd/jidctfst-altivec.c @@ -119,11 +119,12 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, __vector short row0, row1, row2, row3, row4, row5, row6, row7, col0, col1, col2, col3, col4, col5, col6, col7, + final0, final1, final2, final3, final4, final5, final6, final7, quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, z5, z10, z10s, z11, z12s, z13, out0, out1, out2, out3, out4, out5, out6, out7; - __vector signed char outb; + __vector signed char final; /* Constants */ __vector short pw_zero = { __8X(0) }, @@ -205,53 +206,53 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, out6 = vec_sra(out6, pass1_bits3); out7 = vec_sra(out7, pass1_bits3); - TRANSPOSE(out, col); + TRANSPOSE(out, final); - outb = vec_packs(col0, col0); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final0, final0); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[0] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col1, col1); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final1, final1); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[1] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col2, col2); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final2, final2); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[2] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col3, col3); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final3, final3); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[3] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col4, col4); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final4, final4); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[4] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col5, col5); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final5, final5); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[5] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col6, col6); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final6, final6); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[6] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col7, col7); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final7, final7); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[7] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); } diff --git a/simd/jidctint-altivec.c b/simd/jidctint-altivec.c index 7f0f8d0d..a7b6f00e 100644 --- a/simd/jidctint-altivec.c +++ b/simd/jidctint-altivec.c @@ -214,6 +214,7 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, __vector short row0, row1, row2, row3, row4, row5, row6, row7, col0, col1, col2, col3, col4, col5, col6, col7, + final0, final1, final2, final3, final4, final5, final6, final7, quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, tmp0, tmp1, tmp2, tmp3, z3, z4, z34l, z34h, col71l, col71h, col26l, col26h, col53l, col53h, @@ -224,7 +225,7 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, z3l, z3h, z4l, z4h, out0l, out0h, out1l, out1h, out2l, out2h, out3l, out3h, out4l, out4h, out5l, out5h, out6l, out6h, out7l, out7h; - __vector signed char outb; + __vector signed char final; /* Constants */ __vector short pw_zero = { __8X(0) }, @@ -307,53 +308,53 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, DO_IDCT(row, 2); - TRANSPOSE(out, col); + TRANSPOSE(out, final); - outb = vec_packs(col0, col0); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final0, final0); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[0] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col1, col1); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final1, final1); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[1] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col2, col2); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final2, final2); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[2] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col3, col3); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final3, final3); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[3] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col4, col4); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final4, final4); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[4] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col5, col5); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final5, final5); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[5] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col6, col6); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final6, final6); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[6] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); - outb = vec_packs(col7, col7); - outb = vec_add(outb, pb_centerjsamp); + final = vec_packs(final7, final7); + final = vec_add(final, pb_centerjsamp); outptr = (int *)(output_buf[7] + output_col); - vec_ste((__vector int)outb, 0, outptr); - vec_ste((__vector int)outb, 4, outptr); + vec_ste((__vector int)final, 0, outptr); + vec_ste((__vector int)final, 4, outptr); } From 246b01bb0a9a787312e0675636e966eeacd4b1ea Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 16 Jan 2015 03:13:16 +0000 Subject: [PATCH 046/140] Revert r1506 (we actually are generating columns with the IDCT, so the naming makes sense in retrospect); further de-confusification in the forward DCT git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1507 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jfdctint-altivec.c | 8 ++--- simd/jidctfst-altivec.c | 69 ++++++++++++++++++++--------------------- simd/jidctint-altivec.c | 69 ++++++++++++++++++++--------------------- 3 files changed, 72 insertions(+), 74 deletions(-) diff --git a/simd/jfdctint-altivec.c b/simd/jfdctint-altivec.c index 1ddf2619..c13850a8 100644 --- a/simd/jfdctint-altivec.c +++ b/simd/jfdctint-altivec.c @@ -145,7 +145,7 @@ out3 = vec_pack(out3l, out3h); \ } -#define DO_FDCT_ROWS() \ +#define DO_FDCT_PASS1() \ { \ /* Even part */ \ \ @@ -162,7 +162,7 @@ DO_FDCT_COMMON(1); \ } -#define DO_FDCT_COLS() \ +#define DO_FDCT_PASS2() \ { \ /* Even part */ \ \ @@ -234,7 +234,7 @@ jsimd_fdct_islow_altivec (DCTELEM *data) tmp3 = vec_add(col3, col4); tmp4 = vec_sub(col3, col4); - DO_FDCT_ROWS(); + DO_FDCT_PASS1(); /* Pass 2: process columns */ @@ -249,7 +249,7 @@ jsimd_fdct_islow_altivec (DCTELEM *data) tmp3 = vec_add(row3, row4); tmp4 = vec_sub(row3, row4); - DO_FDCT_COLS(); + DO_FDCT_PASS2(); vec_st(out0, 0, data); vec_st(out1, 16, data); diff --git a/simd/jidctfst-altivec.c b/simd/jidctfst-altivec.c index 9779a6ac..fd7a2a34 100644 --- a/simd/jidctfst-altivec.c +++ b/simd/jidctfst-altivec.c @@ -119,12 +119,11 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, __vector short row0, row1, row2, row3, row4, row5, row6, row7, col0, col1, col2, col3, col4, col5, col6, col7, - final0, final1, final2, final3, final4, final5, final6, final7, quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13, z5, z10, z10s, z11, z12s, z13, out0, out1, out2, out3, out4, out5, out6, out7; - __vector signed char final; + __vector signed char outb; /* Constants */ __vector short pw_zero = { __8X(0) }, @@ -206,53 +205,53 @@ jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, out6 = vec_sra(out6, pass1_bits3); out7 = vec_sra(out7, pass1_bits3); - TRANSPOSE(out, final); + TRANSPOSE(out, col); - final = vec_packs(final0, final0); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col0, col0); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[0] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final1, final1); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col1, col1); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[1] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final2, final2); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col2, col2); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[2] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final3, final3); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col3, col3); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[3] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final4, final4); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col4, col4); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[4] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final5, final5); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col5, col5); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[5] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final6, final6); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col6, col6); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[6] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final7, final7); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col7, col7); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[7] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); } diff --git a/simd/jidctint-altivec.c b/simd/jidctint-altivec.c index a7b6f00e..7f0f8d0d 100644 --- a/simd/jidctint-altivec.c +++ b/simd/jidctint-altivec.c @@ -214,7 +214,6 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, __vector short row0, row1, row2, row3, row4, row5, row6, row7, col0, col1, col2, col3, col4, col5, col6, col7, - final0, final1, final2, final3, final4, final5, final6, final7, quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7, tmp0, tmp1, tmp2, tmp3, z3, z4, z34l, z34h, col71l, col71h, col26l, col26h, col53l, col53h, @@ -225,7 +224,7 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, z3l, z3h, z4l, z4h, out0l, out0h, out1l, out1h, out2l, out2h, out3l, out3h, out4l, out4h, out5l, out5h, out6l, out6h, out7l, out7h; - __vector signed char final; + __vector signed char outb; /* Constants */ __vector short pw_zero = { __8X(0) }, @@ -308,53 +307,53 @@ jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, DO_IDCT(row, 2); - TRANSPOSE(out, final); + TRANSPOSE(out, col); - final = vec_packs(final0, final0); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col0, col0); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[0] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final1, final1); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col1, col1); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[1] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final2, final2); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col2, col2); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[2] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final3, final3); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col3, col3); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[3] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final4, final4); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col4, col4); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[4] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final5, final5); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col5, col5); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[5] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final6, final6); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col6, col6); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[6] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); - final = vec_packs(final7, final7); - final = vec_add(final, pb_centerjsamp); + outb = vec_packs(col7, col7); + outb = vec_add(outb, pb_centerjsamp); outptr = (int *)(output_buf[7] + output_col); - vec_ste((__vector int)final, 0, outptr); - vec_ste((__vector int)final, 4, outptr); + vec_ste((__vector int)outb, 0, outptr); + vec_ste((__vector int)outb, 4, outptr); } From 2e2ea8e02c4ebf28decb4944227f8d40ebfe1835 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 16 Jan 2015 03:21:05 +0000 Subject: [PATCH 047/140] Document AltiVec extensions git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1508 632fc199-4ca6-4c93-a231-07263d6284db --- README-turbo.txt | 12 ++++++------ release/ReadMe.txt | 2 +- release/deb-control.tmpl | 10 +++++----- release/libjpeg-turbo.spec.in | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README-turbo.txt b/README-turbo.txt index f5cd613c..3fa254af 100755 --- a/README-turbo.txt +++ b/README-turbo.txt @@ -3,12 +3,12 @@ ******************************************************************************* libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, -NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, -and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as -libjpeg, all else being equal. On other types of systems, libjpeg-turbo can -still outperform libjpeg by a significant amount, by virtue of its -highly-optimized Huffman coding routines. In many cases, the performance of -libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. +NEON, AltiVec) to accelerate baseline JPEG compression and decompression on +x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is +generally 2-4x as fast as libjpeg, all else being equal. On other types of +systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by +virtue of its highly-optimized Huffman coding routines. In many cases, the +performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. libjpeg-turbo implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API. libjpeg-turbo also features diff --git a/release/ReadMe.txt b/release/ReadMe.txt index b9f6ca57..2f00e8ae 100644 --- a/release/ReadMe.txt +++ b/release/ReadMe.txt @@ -1,4 +1,4 @@ -libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as libjpeg, all else being equal. On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. +libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is generally 2-4x as fast as libjpeg, all else being equal. On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. libjpeg-turbo implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API. libjpeg-turbo also features colorspace extensions that allow it to compress from/decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java interface. diff --git a/release/deb-control.tmpl b/release/deb-control.tmpl index 510b1d66..1a6242b2 100644 --- a/release/deb-control.tmpl +++ b/release/deb-control.tmpl @@ -9,11 +9,11 @@ Homepage: http://www.libjpeg-turbo.org Installed-Size: {__SIZE} Description: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, - NEON) to accelerate baseline JPEG compression and decompression on x86, - x86-64, and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as - fast as libjpeg, all else being equal. On other types of systems, - libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue - of its highly-optimized Huffman coding routines. In many cases, the + NEON, AltiVec) to accelerate baseline JPEG compression and decompression on + x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is + generally 2-4x as fast as libjpeg, all else being equal. On other types of + systems, libjpeg-turbo can still outperform libjpeg by a significant amount, + by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. . diff --git a/release/libjpeg-turbo.spec.in b/release/libjpeg-turbo.spec.in index 23793cf5..03d75d16 100644 --- a/release/libjpeg-turbo.spec.in +++ b/release/libjpeg-turbo.spec.in @@ -44,12 +44,12 @@ Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release %description libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, -NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, -and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as -libjpeg, all else being equal. On other types of systems, libjpeg-turbo can -still outperform libjpeg by a significant amount, by virtue of its -highly-optimized Huffman coding routines. In many cases, the performance of -libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. +NEON, AltiVec) to accelerate baseline JPEG compression and decompression on +x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is +generally 2-4x as fast as libjpeg, all else being equal. On other types of +systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by +virtue of its highly-optimized Huffman coding routines. In many cases, the +performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. libjpeg-turbo implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API. libjpeg-turbo also features From 771ab19437ec56548ddae46ff1bebc533a533a83 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 20 Feb 2015 19:57:21 +0000 Subject: [PATCH 048/140] Extend the AltiVec VMX SIMD routines to support little endian PowerPC platforms. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1529 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jccolext-altivec.c | 54 ++++++++++++++++++++++++++--------------- simd/jcgryext-altivec.c | 47 ++++++++++++++++++++++++++--------- simd/jcsample-altivec.c | 24 +++++++++--------- simd/jdcolext-altivec.c | 51 +++++++++++++++++++++++++------------- simd/jdmrgext-altivec.c | 49 +++++++++++++++++++++++++------------ simd/jdsample-altivec.c | 40 ++++++++++++++++++------------ simd/jquanti-altivec.c | 34 +++++++++++++++++++------- simd/jsimd_altivec.h | 21 +++++++++++++++- 8 files changed, 218 insertions(+), 102 deletions(-) diff --git a/simd/jccolext-altivec.c b/simd/jccolext-altivec.c index 39177bb4..403aa964 100644 --- a/simd/jccolext-altivec.c +++ b/simd/jccolext-altivec.c @@ -1,7 +1,7 @@ /* * AltiVec optimizations for libjpeg-turbo * - * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014-2015, D. R. Commander. * Copyright (C) 2014, Jay Foad. * All rights reserved. * This software is provided 'as-is', without any express or implied @@ -29,12 +29,18 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, JDIMENSION output_row, int num_rows) { JSAMPROW inptr, outptr0, outptr1, outptr2; - int pitch = img_width * RGB_PIXELSIZE, offset, num_cols; + int pitch = img_width * RGB_PIXELSIZE, num_cols; +#if __BIG_ENDIAN__ + int offset; +#endif unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; - __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgb3 = {0}, + __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgbg0, rgbg1, rgbg2, rgbg3, y, cb, cr; -#if RGB_PIXELSIZE == 4 +#if __BIG_ENDIAN__ || RGB_PIXELSIZE == 4 + __vector unsigned char rgb3 = {0}; +#endif +#if __BIG_ENDIAN__ && RGB_PIXELSIZE == 4 __vector unsigned char rgb4 = {0}; #endif __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3; @@ -50,7 +56,11 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, __vector int pd_onehalf = { __4X(ONE_HALF) }, pd_onehalfm1_cj = { __4X(ONE_HALF - 1 + (CENTERJSAMPLE << SCALEBITS)) }; __vector unsigned char pb_zero = { __16X(0) }, +#if __BIG_ENDIAN__ shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29}; +#else + shift_pack_index = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31}; +#endif while (--num_rows >= 0) { inptr = *input_buf++; @@ -63,6 +73,7 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, num_cols -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16, outptr0 += 16, outptr1 += 16, outptr2 += 16) { +#if __BIG_ENDIAN__ /* Load 16 pixels == 48 or 64 bytes */ offset = (size_t)inptr & 15; if (offset) { @@ -106,28 +117,31 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, #endif } } else { +#endif /* __BIG_ENDIAN__ */ if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) { /* Slow path */ memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16)); - rgb0 = vec_ld(0, tmpbuf); - rgb1 = vec_ld(16, tmpbuf); - rgb2 = vec_ld(32, tmpbuf); + rgb0 = VEC_LD(0, tmpbuf); + rgb1 = VEC_LD(16, tmpbuf); + rgb2 = VEC_LD(32, tmpbuf); #if RGB_PIXELSIZE == 4 - rgb3 = vec_ld(48, tmpbuf); + rgb3 = VEC_LD(48, tmpbuf); #endif } else { /* Fast path */ - rgb0 = vec_ld(0, inptr); + rgb0 = VEC_LD(0, inptr); if (num_cols > 16) - rgb1 = vec_ld(16, inptr); + rgb1 = VEC_LD(16, inptr); if (num_cols > 32) - rgb2 = vec_ld(32, inptr); + rgb2 = VEC_LD(32, inptr); #if RGB_PIXELSIZE == 4 if (num_cols > 48) - rgb3 = vec_ld(48, inptr); + rgb3 = VEC_LD(48, inptr); #endif } +#if __BIG_ENDIAN__ } +#endif #if RGB_PIXELSIZE == 3 /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 @@ -167,14 +181,14 @@ void jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf, * NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't * support unsigned vectors. */ - rg0 = (__vector signed short)vec_mergeh(pb_zero, rgbg0); - bg0 = (__vector signed short)vec_mergel(pb_zero, rgbg0); - rg1 = (__vector signed short)vec_mergeh(pb_zero, rgbg1); - bg1 = (__vector signed short)vec_mergel(pb_zero, rgbg1); - rg2 = (__vector signed short)vec_mergeh(pb_zero, rgbg2); - bg2 = (__vector signed short)vec_mergel(pb_zero, rgbg2); - rg3 = (__vector signed short)vec_mergeh(pb_zero, rgbg3); - bg3 = (__vector signed short)vec_mergel(pb_zero, rgbg3); + rg0 = (__vector signed short)VEC_UNPACKHU(rgbg0); + bg0 = (__vector signed short)VEC_UNPACKLU(rgbg0); + rg1 = (__vector signed short)VEC_UNPACKHU(rgbg1); + bg1 = (__vector signed short)VEC_UNPACKLU(rgbg1); + rg2 = (__vector signed short)VEC_UNPACKHU(rgbg2); + bg2 = (__vector signed short)VEC_UNPACKLU(rgbg2); + rg3 = (__vector signed short)VEC_UNPACKHU(rgbg3); + bg3 = (__vector signed short)VEC_UNPACKLU(rgbg3); /* (Original) * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B diff --git a/simd/jcgryext-altivec.c b/simd/jcgryext-altivec.c index c2bedd66..c171615d 100644 --- a/simd/jcgryext-altivec.c +++ b/simd/jcgryext-altivec.c @@ -1,7 +1,7 @@ /* * AltiVec optimizations for libjpeg-turbo * - * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014-2015, D. R. Commander. * Copyright (C) 2014, Jay Foad. * All rights reserved. * This software is provided 'as-is', without any express or implied @@ -30,12 +30,18 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, JDIMENSION output_row, int num_rows) { JSAMPROW inptr, outptr; - int pitch = img_width * RGB_PIXELSIZE, offset, num_cols; + int pitch = img_width * RGB_PIXELSIZE, num_cols; +#if __BIG_ENDIAN__ + int offset; unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; +#endif - __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgb3 = {0}, + __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0}, rgbg0, rgbg1, rgbg2, rgbg3, y; -#if RGB_PIXELSIZE == 4 +#if __BIG_ENDIAN__ || RGB_PIXELSIZE == 4 + __vector unsigned char rgb3 = {0}; +#endif +#if __BIG_ENDIAN__ && RGB_PIXELSIZE == 4 __vector unsigned char rgb4 = {0}; #endif __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3; @@ -47,7 +53,11 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, pw_f0114_f0250 = { __4X2(F_0_114, F_0_250) }; __vector int pd_onehalf = { __4X(ONE_HALF) }; __vector unsigned char pb_zero = { __16X(0) }, +#if __BIG_ENDIAN__ shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29}; +#else + shift_pack_index = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31}; +#endif while (--num_rows >= 0) { inptr = *input_buf++; @@ -58,6 +68,7 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, num_cols -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16, outptr += 16) { +#if __BIG_ENDIAN__ /* Load 16 pixels == 48 or 64 bytes */ offset = (size_t)inptr & 15; if (offset) { @@ -123,6 +134,18 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, #endif } } +#else + /* Little endian */ + rgb0 = vec_vsx_ld(0, inptr); + if (num_cols > 16) + rgb1 = vec_vsx_ld(16, inptr); + if (num_cols > 32) + rgb2 = vec_vsx_ld(32, inptr); +#if RGB_PIXELSIZE == 4 + if (num_cols > 48) + rgb3 = vec_vsx_ld(48, inptr); +#endif +#endif #if RGB_PIXELSIZE == 3 /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5 @@ -162,14 +185,14 @@ void jsimd_rgb_gray_convert_altivec (JDIMENSION img_width, * NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't * support unsigned vectors. */ - rg0 = (__vector signed short)vec_mergeh(pb_zero, rgbg0); - bg0 = (__vector signed short)vec_mergel(pb_zero, rgbg0); - rg1 = (__vector signed short)vec_mergeh(pb_zero, rgbg1); - bg1 = (__vector signed short)vec_mergel(pb_zero, rgbg1); - rg2 = (__vector signed short)vec_mergeh(pb_zero, rgbg2); - bg2 = (__vector signed short)vec_mergel(pb_zero, rgbg2); - rg3 = (__vector signed short)vec_mergeh(pb_zero, rgbg3); - bg3 = (__vector signed short)vec_mergel(pb_zero, rgbg3); + rg0 = (__vector signed short)VEC_UNPACKHU(rgbg0); + bg0 = (__vector signed short)VEC_UNPACKLU(rgbg0); + rg1 = (__vector signed short)VEC_UNPACKHU(rgbg1); + bg1 = (__vector signed short)VEC_UNPACKLU(rgbg1); + rg2 = (__vector signed short)VEC_UNPACKHU(rgbg2); + bg2 = (__vector signed short)VEC_UNPACKLU(rgbg2); + rg3 = (__vector signed short)VEC_UNPACKHU(rgbg3); + bg3 = (__vector signed short)VEC_UNPACKLU(rgbg3); /* (Original) * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B diff --git a/simd/jcsample-altivec.c b/simd/jcsample-altivec.c index 517e2bed..603492db 100644 --- a/simd/jcsample-altivec.c +++ b/simd/jcsample-altivec.c @@ -58,8 +58,8 @@ jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, this0 = vec_ld(0, inptr); this0 = vec_perm(this0, this0, even_odd_index); - this0e = (__vector unsigned short)vec_mergeh(pb_zero, this0); - this0o = (__vector unsigned short)vec_mergel(pb_zero, this0); + this0e = (__vector unsigned short)VEC_UNPACKHU(this0); + this0o = (__vector unsigned short)VEC_UNPACKLU(this0); outl = vec_add(this0e, this0o); outl = vec_add(outl, pw_bias); outl = vec_sr(outl, pw_one); @@ -67,8 +67,8 @@ jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, if (outcol > 8) { next0 = vec_ld(16, inptr); next0 = vec_perm(next0, next0, even_odd_index); - next0e = (__vector unsigned short)vec_mergeh(pb_zero, next0); - next0o = (__vector unsigned short)vec_mergel(pb_zero, next0); + next0e = (__vector unsigned short)VEC_UNPACKHU(next0); + next0o = (__vector unsigned short)VEC_UNPACKLU(next0); outh = vec_add(next0e, next0o); outh = vec_add(outh, pw_bias); outh = vec_sr(outh, pw_one); @@ -118,14 +118,14 @@ jsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, this0 = vec_ld(0, inptr0); this0 = vec_perm(this0, this0, even_odd_index); - this0e = (__vector unsigned short)vec_mergeh(pb_zero, this0); - this0o = (__vector unsigned short)vec_mergel(pb_zero, this0); + this0e = (__vector unsigned short)VEC_UNPACKHU(this0); + this0o = (__vector unsigned short)VEC_UNPACKLU(this0); out0l = vec_add(this0e, this0o); this1 = vec_ld(0, inptr1); this1 = vec_perm(this1, this1, even_odd_index); - this1e = (__vector unsigned short)vec_mergeh(pb_zero, this1); - this1o = (__vector unsigned short)vec_mergel(pb_zero, this1); + this1e = (__vector unsigned short)VEC_UNPACKHU(this1); + this1o = (__vector unsigned short)VEC_UNPACKLU(this1); out1l = vec_add(this1e, this1o); outl = vec_add(out0l, out1l); @@ -135,14 +135,14 @@ jsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, if (outcol > 8) { next0 = vec_ld(16, inptr0); next0 = vec_perm(next0, next0, even_odd_index); - next0e = (__vector unsigned short)vec_mergeh(pb_zero, next0); - next0o = (__vector unsigned short)vec_mergel(pb_zero, next0); + next0e = (__vector unsigned short)VEC_UNPACKHU(next0); + next0o = (__vector unsigned short)VEC_UNPACKLU(next0); out0h = vec_add(next0e, next0o); next1 = vec_ld(16, inptr1); next1 = vec_perm(next1, next1, even_odd_index); - next1e = (__vector unsigned short)vec_mergeh(pb_zero, next1); - next1o = (__vector unsigned short)vec_mergel(pb_zero, next1); + next1e = (__vector unsigned short)VEC_UNPACKHU(next1); + next1o = (__vector unsigned short)VEC_UNPACKLU(next1); out1h = vec_add(next1e, next1o); outh = vec_add(out0h, out1h); diff --git a/simd/jdcolext-altivec.c b/simd/jdcolext-altivec.c index 1b8311d3..1ae91b9c 100644 --- a/simd/jdcolext-altivec.c +++ b/simd/jdcolext-altivec.c @@ -28,13 +28,22 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, JSAMPARRAY output_buf, int num_rows) { JSAMPROW outptr, inptr0, inptr1, inptr2; - int pitch = out_width * RGB_PIXELSIZE, offset, num_cols; + int pitch = out_width * RGB_PIXELSIZE, num_cols; +#if __BIG_ENDIAN__ + int offset; +#endif unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; __vector unsigned char rgb0, rgb1, rgb2, rgbx0, rgbx1, rgbx2, rgbx3, - y, cb, cr, edgel, edgeh, edges, out0, out1, out2, out3; + y, cb, cr; +#if __BIG_ENDIAN__ + __vector unsigned char edgel, edgeh, edges, out0, out1, out2, out3; #if RGB_PIXELSIZE == 4 - __vector unsigned char rgb3, out4; + __vector unsigned char out4; +#endif +#endif +#if RGB_PIXELSIZE == 4 + __vector unsigned char rgb3; #endif __vector short rg0, rg1, rg2, rg3, bx0, bx1, bx2, bx3, yl, yh, cbl, cbh, crl, crh, rl, rh, gl, gh, bl, bh, g0w, g1w, g2w, g3w; @@ -51,7 +60,11 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, pw_cj = { __8X(CENTERJSAMPLE) }; __vector int pd_onehalf = { __4X(ONE_HALF) }; __vector unsigned char pb_zero = { __16X(0) }, +#if __BIG_ENDIAN__ shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29}; +#else + shift_pack_index = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31}; +#endif while (--num_rows >= 0) { inptr0 = input_buf[0][input_row]; @@ -68,18 +81,18 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, /* NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't * support unsigned vectors. */ - yl = (__vector signed short)vec_mergeh(pb_zero, y); - yh = (__vector signed short)vec_mergel(pb_zero, y); + yl = (__vector signed short)VEC_UNPACKHU(y); + yh = (__vector signed short)VEC_UNPACKLU(y); cb = vec_ld(0, inptr1); - cbl = (__vector signed short)vec_mergeh(pb_zero, cb); - cbh = (__vector signed short)vec_mergel(pb_zero, cb); + cbl = (__vector signed short)VEC_UNPACKHU(cb); + cbh = (__vector signed short)VEC_UNPACKLU(cb); cbl = vec_sub(cbl, pw_cj); cbh = vec_sub(cbh, pw_cj); cr = vec_ld(0, inptr2); - crl = (__vector signed short)vec_mergeh(pb_zero, cr); - crh = (__vector signed short)vec_mergel(pb_zero, cr); + crl = (__vector signed short)VEC_UNPACKHU(cr); + crh = (__vector signed short)VEC_UNPACKLU(cr); crl = vec_sub(crl, pw_cj); crh = vec_sub(crh, pw_cj); @@ -181,6 +194,7 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, rgb3 = vec_perm(rgbx3, rgbx3, (__vector unsigned char)RGB_INDEX); #endif +#if __BIG_ENDIAN__ offset = (size_t)outptr & 15; if (offset) { __vector unsigned char unaligned_shift_index; @@ -230,28 +244,31 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, #endif } } else { +#endif /* __BIG_ENDIAN__ */ if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) { /* Slow path */ - vec_st(rgb0, 0, tmpbuf); - vec_st(rgb1, 16, tmpbuf); - vec_st(rgb2, 32, tmpbuf); + VEC_ST(rgb0, 0, tmpbuf); + VEC_ST(rgb1, 16, tmpbuf); + VEC_ST(rgb2, 32, tmpbuf); #if RGB_PIXELSIZE == 4 - vec_st(rgb3, 48, tmpbuf); + VEC_ST(rgb3, 48, tmpbuf); #endif memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); } else { /* Fast path */ - vec_st(rgb0, 0, outptr); + VEC_ST(rgb0, 0, outptr); if (num_cols > 16) - vec_st(rgb1, 16, outptr); + VEC_ST(rgb1, 16, outptr); if (num_cols > 32) - vec_st(rgb2, 32, outptr); + VEC_ST(rgb2, 32, outptr); #if RGB_PIXELSIZE == 4 if (num_cols > 48) - vec_st(rgb3, 48, outptr); + VEC_ST(rgb3, 48, outptr); #endif } +#if __BIG_ENDIAN__ } +#endif } } } diff --git a/simd/jdmrgext-altivec.c b/simd/jdmrgext-altivec.c index 0b92e7ed..3b6950d6 100644 --- a/simd/jdmrgext-altivec.c +++ b/simd/jdmrgext-altivec.c @@ -29,13 +29,22 @@ void jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width, JSAMPARRAY output_buf) { JSAMPROW outptr, inptr0, inptr1, inptr2; - int pitch = output_width * RGB_PIXELSIZE, offset, num_cols, yloop; + int pitch = output_width * RGB_PIXELSIZE, num_cols, yloop; +#if __BIG_ENDIAN__ + int offset; +#endif unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16]; __vector unsigned char rgb0, rgb1, rgb2, rgbx0, rgbx1, rgbx2, rgbx3, - y, cb, cr, edgel, edgeh, edges, out0, out1, out2, out3; + y, cb, cr; +#if __BIG_ENDIAN__ + __vector unsigned char edgel, edgeh, edges, out0, out1, out2, out3; #if RGB_PIXELSIZE == 4 - __vector unsigned char rgb3, out4; + __vector unsigned char out4; +#endif +#endif +#if RGB_PIXELSIZE == 4 + __vector unsigned char rgb3; #endif __vector short rg0, rg1, rg2, rg3, bx0, bx1, bx2, bx3, ye, yo, cbl, cbh, crl, crh, r_yl, r_yh, g_yl, g_yh, b_yl, b_yh, g_y0w, g_y1w, g_y2w, g_y3w, @@ -53,9 +62,15 @@ void jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width, pw_cj = { __8X(CENTERJSAMPLE) }; __vector int pd_onehalf = { __4X(ONE_HALF) }; __vector unsigned char pb_zero = { __16X(0) }, +#if __BIG_ENDIAN__ shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29}, even_index = {0,16,0,18,0,20,0,22,0,24,0,26,0,28,0,30}, odd_index = {0,17,0,19,0,21,0,23,0,25,0,27,0,29,0,31}; +#else + shift_pack_index = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31}, + even_index = {16,0,18,0,20,0,22,0,24,0,26,0,28,0,30,0}, + odd_index = {17,0,19,0,21,0,23,0,25,0,27,0,29,0,31,0}; +#endif inptr0 = input_buf[0][in_row_group_ctr]; inptr1 = input_buf[1][in_row_group_ctr]; @@ -68,14 +83,14 @@ void jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width, /* NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't * support unsigned vectors. */ - cbl = (__vector signed short)vec_mergeh(pb_zero, cb); - cbh = (__vector signed short)vec_mergel(pb_zero, cb); + cbl = (__vector signed short)VEC_UNPACKHU(cb); + cbh = (__vector signed short)VEC_UNPACKLU(cb); cbl = vec_sub(cbl, pw_cj); cbh = vec_sub(cbh, pw_cj); cr = vec_ld(0, inptr2); - crl = (__vector signed short)vec_mergeh(pb_zero, cr); - crh = (__vector signed short)vec_mergel(pb_zero, cr); + crl = (__vector signed short)VEC_UNPACKHU(cr); + crh = (__vector signed short)VEC_UNPACKLU(cr); crl = vec_sub(crl, pw_cj); crh = vec_sub(crh, pw_cj); @@ -204,6 +219,7 @@ void jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width, rgb3 = vec_perm(rgbx3, rgbx3, (__vector unsigned char)RGB_INDEX); #endif +#if __BIG_ENDIAN__ offset = (size_t)outptr & 15; if (offset) { __vector unsigned char unaligned_shift_index; @@ -253,28 +269,31 @@ void jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width, #endif } } else { +#endif /* __BIG_ENDIAN__ */ if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) { /* Slow path */ - vec_st(rgb0, 0, tmpbuf); - vec_st(rgb1, 16, tmpbuf); - vec_st(rgb2, 32, tmpbuf); + VEC_ST(rgb0, 0, tmpbuf); + VEC_ST(rgb1, 16, tmpbuf); + VEC_ST(rgb2, 32, tmpbuf); #if RGB_PIXELSIZE == 4 - vec_st(rgb3, 48, tmpbuf); + VEC_ST(rgb3, 48, tmpbuf); #endif memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16)); } else { /* Fast path */ - vec_st(rgb0, 0, outptr); + VEC_ST(rgb0, 0, outptr); if (num_cols > 16) - vec_st(rgb1, 16, outptr); + VEC_ST(rgb1, 16, outptr); if (num_cols > 32) - vec_st(rgb2, 32, outptr); + VEC_ST(rgb2, 32, outptr); #if RGB_PIXELSIZE == 4 if (num_cols > 48) - vec_st(rgb3, 48, outptr); + VEC_ST(rgb3, 48, outptr); #endif } +#if __BIG_ENDIAN__ } +#endif } } } diff --git a/simd/jdsample-altivec.c b/simd/jdsample-altivec.c index f73b185f..6b77d04c 100644 --- a/simd/jdsample-altivec.c +++ b/simd/jdsample-altivec.c @@ -46,7 +46,11 @@ jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, last_index = {15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30}, next_index = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}, next_index_lastcol = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15}, +#if __BIG_ENDIAN__ merge_pack_index = {1,17,3,19,5,21,7,23,9,25,11,27,13,29,15,31}; +#else + merge_pack_index = {0,16,2,18,4,20,6,22,8,24,10,26,12,28,14,30}; +#endif __vector short pw_one = { __8X(1) }, pw_two = { __8X(2) }; for (inrow = 0; inrow < max_v_samp_factor; inrow++) { @@ -80,12 +84,12 @@ jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, this0l = vec_mergeh(this0e, this0o); this0h = vec_mergel(this0e, this0o); - last0l = (__vector short)vec_mergeh(pb_zero, p_last0); - last0h = (__vector short)vec_mergel(pb_zero, p_last0); + last0l = (__vector short)VEC_UNPACKHU(p_last0); + last0h = (__vector short)VEC_UNPACKLU(p_last0); last0l = vec_add(last0l, pw_one); - next0l = (__vector short)vec_mergeh(pb_zero, p_next0); - next0h = (__vector short)vec_mergel(pb_zero, p_next0); + next0l = (__vector short)VEC_UNPACKHU(p_next0); + next0h = (__vector short)VEC_UNPACKLU(p_next0); next0l = vec_add(next0l, pw_two); outle = vec_add(this0l, last0l); @@ -143,7 +147,11 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, last_index={14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}, next_index = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}, next_index_lastcol = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,15}, +#if __BIG_ENDIAN__ merge_pack_index = {1,17,3,19,5,21,7,23,9,25,11,27,13,29,15,31}; +#else + merge_pack_index = {0,16,2,18,4,20,6,22,8,24,10,26,12,28,14,30}; +#endif __vector short pw_zero = { __8X(0) }, pw_three = { __8X(3) }, pw_seven = { __8X(7) }, pw_eight = { __8X(8) }; __vector unsigned short pw_four = { __8X(4) }; @@ -163,14 +171,14 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, } this0 = vec_ld(0, inptr0); - this0l = (__vector short)vec_mergeh(pb_zero, this0); - this0h = (__vector short)vec_mergel(pb_zero, this0); + this0l = (__vector short)VEC_UNPACKHU(this0); + this0h = (__vector short)VEC_UNPACKLU(this0); this0l = vec_mladd(this0l, pw_three, pw_zero); this0h = vec_mladd(this0h, pw_three, pw_zero); this_1 = vec_ld(0, inptr_1); - this_1l = (__vector short)vec_mergeh(pb_zero, this_1); - this_1h = (__vector short)vec_mergel(pb_zero, this_1); + this_1l = (__vector short)VEC_UNPACKHU(this_1); + this_1h = (__vector short)VEC_UNPACKLU(this_1); thiscolsum_1l = vec_add(this0l, this_1l); thiscolsum_1h = vec_add(this0h, this_1h); lastcolsum_1h = thiscolsum_1h; @@ -178,8 +186,8 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, p_lastcolsum_1h = vec_perm(thiscolsum_1l, thiscolsum_1h, last_index); this1 = vec_ld(0, inptr1); - this1l = (__vector short)vec_mergeh(pb_zero, this1); - this1h = (__vector short)vec_mergel(pb_zero, this1); + this1l = (__vector short)VEC_UNPACKHU(this1); + this1h = (__vector short)VEC_UNPACKLU(this1); thiscolsum1l = vec_add(this0l, this1l); thiscolsum1h = vec_add(this0h, this1h); lastcolsum1h = thiscolsum1h; @@ -207,22 +215,22 @@ jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, next_index_lastcol); } else { this0 = vec_ld(16, inptr0); - this0l = (__vector short)vec_mergeh(pb_zero, this0); - this0h = (__vector short)vec_mergel(pb_zero, this0); + this0l = (__vector short)VEC_UNPACKHU(this0); + this0h = (__vector short)VEC_UNPACKLU(this0); this0l = vec_mladd(this0l, pw_three, pw_zero); this0h = vec_mladd(this0h, pw_three, pw_zero); this_1 = vec_ld(16, inptr_1); - this_1l = (__vector short)vec_mergeh(pb_zero, this_1); - this_1h = (__vector short)vec_mergel(pb_zero, this_1); + this_1l = (__vector short)VEC_UNPACKHU(this_1); + this_1h = (__vector short)VEC_UNPACKLU(this_1); nextcolsum_1l = vec_add(this0l, this_1l); nextcolsum_1h = vec_add(this0h, this_1h); p_nextcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1h, next_index); p_nextcolsum_1h = vec_perm(thiscolsum_1h, nextcolsum_1l, next_index); this1 = vec_ld(16, inptr1); - this1l = (__vector short)vec_mergeh(pb_zero, this1); - this1h = (__vector short)vec_mergel(pb_zero, this1); + this1l = (__vector short)VEC_UNPACKHU(this1); + this1h = (__vector short)VEC_UNPACKLU(this1); nextcolsum1l = vec_add(this0l, this1l); nextcolsum1h = vec_add(this0h, this1h); p_nextcolsum1l = vec_perm(thiscolsum1l, thiscolsum1h, next_index); diff --git a/simd/jquanti-altivec.c b/simd/jquanti-altivec.c index d57d691e..2fbec2d5 100644 --- a/simd/jquanti-altivec.c +++ b/simd/jquanti-altivec.c @@ -1,7 +1,7 @@ /* * AltiVec optimizations for libjpeg-turbo * - * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014-2015, D. R. Commander. * All rights reserved. * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -29,6 +29,8 @@ * always get the data we want by using a single vector load (although we may * have to permute the result.) */ +#if __BIG_ENDIAN__ + #define LOAD_ROW(row) { \ elemptr = sample_data[row] + start_col; \ in##row = vec_ld(0, elemptr); \ @@ -36,6 +38,15 @@ in##row = vec_perm(in##row, in##row, vec_lvsl(0, elemptr)); \ } +#else + +#define LOAD_ROW(row) { \ + elemptr = sample_data[row] + start_col; \ + in##row = vec_vsx_ld(0, elemptr); \ +} + +#endif + void jsimd_convsamp_altivec (JSAMPARRAY sample_data, JDIMENSION start_col, @@ -59,14 +70,14 @@ jsimd_convsamp_altivec (JSAMPARRAY sample_data, JDIMENSION start_col, LOAD_ROW(6); LOAD_ROW(7); - out0 = (__vector short)vec_mergeh(pb_zero, in0); - out1 = (__vector short)vec_mergeh(pb_zero, in1); - out2 = (__vector short)vec_mergeh(pb_zero, in2); - out3 = (__vector short)vec_mergeh(pb_zero, in3); - out4 = (__vector short)vec_mergeh(pb_zero, in4); - out5 = (__vector short)vec_mergeh(pb_zero, in5); - out6 = (__vector short)vec_mergeh(pb_zero, in6); - out7 = (__vector short)vec_mergeh(pb_zero, in7); + out0 = (__vector short)VEC_UNPACKHU(in0); + out1 = (__vector short)VEC_UNPACKHU(in1); + out2 = (__vector short)VEC_UNPACKHU(in2); + out3 = (__vector short)VEC_UNPACKHU(in3); + out4 = (__vector short)VEC_UNPACKHU(in4); + out5 = (__vector short)VEC_UNPACKHU(in5); + out6 = (__vector short)VEC_UNPACKHU(in6); + out7 = (__vector short)VEC_UNPACKHU(in7); out0 = vec_sub(out0, pw_centerjsamp); out1 = vec_sub(out1, pw_centerjsamp); @@ -116,8 +127,13 @@ jsimd_quantize_altivec (JCOEFPTR coef_block, DCTELEM * divisors, /* Constants */ __vector unsigned short pw_word_bit_m1 = { __8X(WORD_BIT - 1) }; +#if __BIG_ENDIAN__ __vector unsigned char shift_pack_index = {0,1,16,17,4,5,20,21,8,9,24,25,12,13,28,29}; +#else + __vector unsigned char shift_pack_index = + {2,3,18,19,6,7,22,23,10,11,26,27,14,15,30,31}; +#endif row0 = vec_ld(0, workspace); row1 = vec_ld(16, workspace); diff --git a/simd/jsimd_altivec.h b/simd/jsimd_altivec.h index e8002060..26602192 100644 --- a/simd/jsimd_altivec.h +++ b/simd/jsimd_altivec.h @@ -1,7 +1,7 @@ /* * AltiVec optimizations for libjpeg-turbo * - * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014-2015, D. R. Commander. * All rights reserved. * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -78,3 +78,22 @@ #ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) #endif + + +/* Macros to abstract big/little endian bit twiddling */ + +#if __BIG_ENDIAN__ + +#define VEC_LD(a, b) vec_ld(a, b) +#define VEC_ST(a, b, c) vec_st(a, b, c) +#define VEC_UNPACKHU(a) vec_mergeh(pb_zero, a) +#define VEC_UNPACKLU(a) vec_mergel(pb_zero, a) + +#else + +#define VEC_LD(a, b) vec_vsx_ld(a, b) +#define VEC_ST(a, b, c) vec_vsx_st(a, b, c) +#define VEC_UNPACKHU(a) vec_mergeh(a, pb_zero) +#define VEC_UNPACKLU(a) vec_mergel(a, pb_zero) + +#endif From 54014d9c2a41905b7b766057af6728834da64b59 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 20 Jun 2015 16:27:51 +0000 Subject: [PATCH 049/140] The Linux build machine has been upgraded to autoconf 2.69, automake 1.15, m4 1.4.17, and libtool 2.4.6, so it is no longer necessary to recommend running autoreconf prior to building the source. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1573 632fc199-4ca6-4c93-a231-07263d6284db --- BUILDING.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/BUILDING.txt b/BUILDING.txt index c40fc7c4..485cfbe5 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -81,14 +81,10 @@ Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below for 64-bit build instructions.) cd {source_directory} - autoreconf -fiv cd {build_directory} sh {source_directory}/configure [additional configure flags] make -NOTE: Running autoreconf in the source directory is usually only necessary if -building libjpeg-turbo from the SVN repository. - This will generate the following files under .libs/ libjpeg.a @@ -422,12 +418,6 @@ the SDK. Once built, lipo can be used to combine the ARMv6, v7, v7s, and/or v8 variants into a universal library. -NOTE: If you are building libjpeg-turbo from the "official" project tarball, -then it is highly likely that you will need to run 'autoreconf -fiv' in the -source tree prior to building ARMv7, v7s, or v8 iOS binaries using the -techniques described above. Otherwise, you may get a libtool error such as -"unable to infer tagged configuration." - Building libjpeg-turbo for Android ---------------------------------- From 691cd9338302d3145f6e8254a17403ad0984383e Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 20 Jun 2015 16:36:32 +0000 Subject: [PATCH 050/140] Fix 'make dist' git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1574 632fc199-4ca6-4c93-a231-07263d6284db --- simd/Makefile.am | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/simd/Makefile.am b/simd/Makefile.am index ab544f75..ebb9ec6d 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -6,7 +6,8 @@ EXTRA_DIST = nasm_lt.sh CMakeLists.txt \ jccolext-mmx.asm jcgryext-mmx.asm jdcolext-mmx.asm jdmrgext-mmx.asm \ jccolext-sse2.asm jcgryext-sse2.asm jdcolext-sse2.asm jdmrgext-sse2.asm \ jccolext-sse2-64.asm jcgryext-sse2-64.asm jdcolext-sse2-64.asm \ - jdmrgext-sse2-64.asm + jdmrgext-sse2-64.asm jccolext-altivec.c jcgryext-altivec.c \ + jdcolext-altivec.c jdmrgext-altivec.c if SIMD_X86_64 @@ -72,7 +73,7 @@ endif if SIMD_POWERPC -libsimd_la_SOURCES = jsimd_powerpc.c \ +libsimd_la_SOURCES = jsimd_powerpc.c jsimd_altivec.h jcsample.h \ jccolor-altivec.c jcgray-altivec.c jcsample-altivec.c \ jdcolor-altivec.c jdmerge-altivec.c jdsample-altivec.c \ jfdctfst-altivec.c jfdctint-altivec.c \ @@ -82,6 +83,8 @@ libsimd_la_CFLAGS = -maltivec jccolor-altivec.lo: jccolext-altivec.c jcgray-altivec.lo: jcgryext-altivec.c +jdcolor-altivec.lo: jdcolext-altivec.c +jdmerge-altivec.lo: jdmrgext-altivec.c endif From eb32cc1e6ded5c46052918d69f8de09bf2730b17 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 25 Jun 2015 03:44:36 +0000 Subject: [PATCH 051/140] Add a new libjpeg API function (jpeg_skip_scanlines()) to allow for partially decoding a JPEG image. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1582 632fc199-4ca6-4c93-a231-07263d6284db --- ChangeLog.txt | 3 + djpeg.c | 64 +++++++++++-- jdapistd.c | 255 ++++++++++++++++++++++++++++++++++++++++++++++++-- jdarith.c | 12 ++- jdcoefct.c | 71 +------------- jdcoefct.h | 82 ++++++++++++++++ jdhuff.c | 19 ++-- jdmainct.c | 63 +------------ jdmainct.h | 71 ++++++++++++++ jdsample.c | 42 +-------- jdsample.h | 50 ++++++++++ jpegint.h | 10 +- jpeglib.h | 3 + libjpeg.txt | 46 ++++++++- 14 files changed, 588 insertions(+), 203 deletions(-) create mode 100644 jdcoefct.h create mode 100644 jdmainct.h create mode 100644 jdsample.h diff --git a/ChangeLog.txt b/ChangeLog.txt index 890720fe..d9df904c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -8,6 +8,9 @@ to the compiler vs. x86, it was still possible to speed up compression by about 3-4x and decompression by about 2-2.5x (relative to libjpeg v6b) through the use of AltiVec instructions. +[2] Added a new libjpeg API function (jpeg_skip_scanlines()) that can be used +to partially decode a JPEG image. See libjpeg.txt for more details. + 1.4.1 ===== diff --git a/djpeg.c b/djpeg.c index 8ddff96e..20821cec 100644 --- a/djpeg.c +++ b/djpeg.c @@ -4,7 +4,8 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2010-2011, 2013-2014, D. R. Commander. + * Copyright (C) 2010-2011, 2013-2015, D. R. Commander. + * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README file. * * This file contains a command-line user interface for the JPEG decompressor. @@ -88,6 +89,8 @@ static IMAGE_FORMATS requested_fmt; static const char * progname; /* program name for error messages */ static char * outfilename; /* for -outfile switch */ boolean memsrc; /* for -memsrc switch */ +boolean stripe; +JDIMENSION startY, endY; #define INPUT_BUF_SIZE 4096 @@ -164,6 +167,7 @@ usage (void) fprintf(stderr, " -memsrc Load input file into memory before decompressing\n"); #endif + fprintf(stderr, " -stripe Y0,Y1 Decode a horizontal stripe of the image [Y0, Y1)\n"); fprintf(stderr, " -verbose or -debug Emit debug output\n"); fprintf(stderr, " -version Print version information and exit\n"); exit(EXIT_FAILURE); @@ -189,6 +193,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, requested_fmt = DEFAULT_FMT; /* set default output file format */ outfilename = NULL; memsrc = FALSE; + stripe = FALSE; cinfo->err->trace_level = 0; /* Scan command line options, adjust parameters */ @@ -361,7 +366,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, /* RLE output format. */ requested_fmt = FMT_RLE; - } else if (keymatch(arg, "scale", 1)) { + } else if (keymatch(arg, "scale", 2)) { /* Scale the output image by a fraction M/N. */ if (++argn >= argc) /* advance to next argument */ usage(); @@ -369,6 +374,13 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, &cinfo->scale_num, &cinfo->scale_denom) != 2) usage(); + } else if (keymatch(arg, "stripe", 2)) { + if (++argn >= argc) + usage(); + if (sscanf(argv[argn], "%d,%d", &startY, &endY) != 2 || startY > endY) + usage(); + stripe = TRUE; + } else if (keymatch(arg, "targa", 1)) { /* Targa output format. */ requested_fmt = FMT_TARGA; @@ -634,14 +646,48 @@ main (int argc, char **argv) /* Start decompressor */ (void) jpeg_start_decompress(&cinfo); - /* Write output file header */ - (*dest_mgr->start_output) (&cinfo, dest_mgr); + /* Stripe decode */ + if (stripe) { + JDIMENSION tmp; - /* Process data */ - while (cinfo.output_scanline < cinfo.output_height) { - num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, - dest_mgr->buffer_height); - (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + /* Check for valid endY. We cannot check this value until after + * jpeg_start_decompress() is called. Note that we have already verified + * that startY <= endY. + */ + if (endY > cinfo.output_height) { + fprintf(stderr, "%s: stripe %d-%d exceeds image height %d\n", progname, + startY, endY, cinfo.output_height); + exit(EXIT_FAILURE); + } + + /* Write output file header. This is a hack to ensure that the destination + * manager creates an image of the proper size for the partial decode. + */ + tmp = cinfo.output_height; + cinfo.output_height = endY - startY; + (*dest_mgr->start_output) (&cinfo, dest_mgr); + cinfo.output_height = tmp; + + /* Process data */ + (void) jpeg_skip_scanlines(&cinfo, startY); + while (cinfo.output_scanline < endY) { + num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, + dest_mgr->buffer_height); + (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + } + (void) jpeg_skip_scanlines(&cinfo, cinfo.output_height - endY); + + /* Normal full image decode */ + } else { + /* Write output file header */ + (*dest_mgr->start_output) (&cinfo, dest_mgr); + + /* Process data */ + while (cinfo.output_scanline < cinfo.output_height) { + num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, + dest_mgr->buffer_height); + (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + } } #ifdef PROGRESS_REPORT diff --git a/jdapistd.c b/jdapistd.c index 3be527cb..51b7dc63 100644 --- a/jdapistd.c +++ b/jdapistd.c @@ -4,7 +4,8 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2010, D. R. Commander. + * Copyright (C) 2010, 2015, D. R. Commander. + * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README file. * * This file contains application interface code for the decompression half @@ -16,11 +17,10 @@ * whole decompression library into a transcoder. */ -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jpegcomp.h" - +#include "jdmainct.h" +#include "jdcoefct.h" +#include "jdsample.h" +#include "jmemsys.h" /* Forward declarations */ LOCAL(boolean) output_pass_setup (j_decompress_ptr cinfo); @@ -179,6 +179,242 @@ jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, } +/* Prepare temporary row buffer */ + +LOCAL(void) +dummy_buffer_setup (j_decompress_ptr cinfo) +{ + int nc; + + if (!cinfo->master || cinfo->master->dummy_row_buffer) + return; + + nc = (cinfo->out_color_space == JCS_RGB565) ? + 2 : cinfo->out_color_components; + cinfo->master->dummy_row_buffer = + jpeg_get_small((j_common_ptr) cinfo, + cinfo->output_width * nc * sizeof(JSAMPLE)); +} + + +/* + * Called by jpeg_skip_scanlines(). This partially skips a decompress block by + * incrementing the rowgroup counter. + */ + +LOCAL(void) +increment_simple_rowgroup_ctr (j_decompress_ptr cinfo, JDIMENSION rows) +{ + int i; + JDIMENSION rows_left; + my_main_ptr main_ptr = (my_main_ptr) cinfo->main; + + /* Increment the counter to the next row group after the skipped rows. */ + main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor; + + /* Partially skipping a row group would involve modifying the internal state + * of the upsampler, so read the remaining rows into a dummy buffer instead. + */ + rows_left = rows % cinfo->max_v_samp_factor; + cinfo->output_scanline += rows - rows_left; + + dummy_buffer_setup(cinfo); + for (i = 0; i < rows_left; i++) + jpeg_read_scanlines(cinfo, &(cinfo->master->dummy_row_buffer), 1); +} + + +/* + * Called by jpeg_skip_scanlines(). When we skip iMCU rows, we must update the + * iMCU row counter. + */ + +LOCAL(void) +increment_iMCU_ctr (j_decompress_ptr cinfo, JDIMENSION iMCU_rows) +{ + my_main_ptr main_ptr = (my_main_ptr) cinfo->main; + if (main_ptr->iMCU_row_ctr == 0 && iMCU_rows > 0) + set_wraparound_pointers(cinfo); + main_ptr->iMCU_row_ctr += iMCU_rows; +} + + +/* + * Skips some scanlines of data from the JPEG decompressor. + * + * The return value will be the number of lines actually skipped. If skipping + * num_lines would move beyond the end of the image, then the actual number of + * lines remaining in the image is returned. Otherwise, the return value will + * be equal to num_lines. + * + * Refer to libjpeg.txt for more information. + */ + +GLOBAL(JDIMENSION) +jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines) +{ + my_main_ptr main_ptr = (my_main_ptr) cinfo->main; + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int i, y, x; + JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row; + JDIMENSION lines_to_skip, lines_to_read; + + if (cinfo->global_state != DSTATE_SCANNING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Do not skip past the bottom of the image. */ + if (cinfo->output_scanline + num_lines >= cinfo->output_height) { + cinfo->output_scanline = cinfo->output_height; + return cinfo->output_height - cinfo->output_scanline; + } + + if (num_lines == 0) + return 0; + + lines_per_iMCU_row = cinfo->_min_DCT_scaled_size * cinfo->max_v_samp_factor; + lines_left_in_iMCU_row = + (lines_per_iMCU_row - (cinfo->output_scanline % lines_per_iMCU_row)) % + lines_per_iMCU_row; + lines_after_iMCU_row = num_lines - lines_left_in_iMCU_row; + + /* Skip the lines remaining in the current iMCU row. When upsampling + * requires context rows, we need the previous and next rows in order to read + * the current row. This adds some complexity. + */ + if (cinfo->upsample->need_context_rows) { + /* If the skipped lines would not move us past the current iMCU row, we + * read the lines and ignore them. There might be a faster way of doing + * this, but we are facing increasing complexity for diminishing returns. + * The increasing complexity would be a by-product of meddling with the + * state machine used to skip context rows. Near the end of an iMCU row, + * the next iMCU row may have already been entropy-decoded. In this unique + * case, we will read the next iMCU row if we cannot skip past it as well. + */ + if ((num_lines < lines_left_in_iMCU_row + 1) || + (lines_left_in_iMCU_row <= 1 && main_ptr->buffer_full && + lines_after_iMCU_row < lines_per_iMCU_row + 1)) { + dummy_buffer_setup(cinfo); + for (i = 0; i < num_lines; i++) + jpeg_read_scanlines(cinfo, &(cinfo->master->dummy_row_buffer), 1); + return num_lines; + } + + /* If the next iMCU row has already been entropy-decoded, make sure that + * we do not skip too far. + */ + if (lines_left_in_iMCU_row <= 1 && main_ptr->buffer_full) { + cinfo->output_scanline += lines_left_in_iMCU_row + lines_per_iMCU_row; + lines_after_iMCU_row -= lines_per_iMCU_row; + } else { + cinfo->output_scanline += lines_left_in_iMCU_row; + } + main_ptr->buffer_full = FALSE; + main_ptr->rowgroup_ctr = 0; + main_ptr->context_state = CTX_PREPARE_FOR_IMCU; + upsample->next_row_out = cinfo->max_v_samp_factor; + upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline; + } + + /* Skipping is much simpler when context rows are not required. */ + else { + if (num_lines < lines_left_in_iMCU_row) { + increment_simple_rowgroup_ctr(cinfo, num_lines); + return num_lines; + } else { + cinfo->output_scanline += lines_left_in_iMCU_row; + main_ptr->buffer_full = FALSE; + main_ptr->rowgroup_ctr = 0; + upsample->next_row_out = cinfo->max_v_samp_factor; + upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline; + } + } + + /* Calculate how many full iMCU rows we can skip. */ + if (cinfo->upsample->need_context_rows) + lines_to_skip = ((lines_after_iMCU_row - 1) / lines_per_iMCU_row) * + lines_per_iMCU_row; + else + lines_to_skip = (lines_after_iMCU_row / lines_per_iMCU_row) * + lines_per_iMCU_row; + /* Calculate the number of lines that remain to be skipped after skipping all + * of the full iMCU rows that we can. We will not read these lines unless we + * have to. + */ + lines_to_read = lines_after_iMCU_row - lines_to_skip; + + /* For images requiring multiple scans (progressive, non-interleaved, etc.), + * all of the entropy decoding occurs in jpeg_start_decompress(), assuming + * that the input data source is non-suspending. This makes skipping easy. + */ + if (cinfo->inputctl->has_multiple_scans) { + if (cinfo->upsample->need_context_rows) { + cinfo->output_scanline += lines_to_skip; + cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row; + increment_iMCU_ctr(cinfo, lines_after_iMCU_row / lines_per_iMCU_row); + /* It is complex to properly move to the middle of a context block, so + * read the remaining lines instead of skipping them. + */ + dummy_buffer_setup(cinfo); + for (i = 0; i < lines_to_read; i++) + jpeg_read_scanlines(cinfo, &(cinfo->master->dummy_row_buffer), 1); + } else { + cinfo->output_scanline += lines_to_skip; + cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row; + increment_simple_rowgroup_ctr(cinfo, lines_to_read); + } + upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline; + return num_lines; + } + + /* Skip the iMCU rows that we can safely skip. */ + for (i = 0; i < lines_to_skip; i += lines_per_iMCU_row) { + for (y = 0; y < coef->MCU_rows_per_iMCU_row; y++) { + for (x = 0; x < cinfo->MCUs_per_row; x++) { + /* Calling decode_mcu() with a NULL pointer causes it to discard the + * decoded coefficients. This is ~5% faster for large subsets, but + * it's tough to tell a difference for smaller images. Another + * advantage of discarding coefficients is that it allows us to avoid + * accessing the private field cinfo->coef->MCU_buffer (which would + * normally be a parameter to decode_mcu().) + */ + (*cinfo->entropy->decode_mcu) (cinfo, NULL); + } + } + cinfo->input_iMCU_row++; + cinfo->output_iMCU_row++; + if (cinfo->input_iMCU_row < cinfo->total_iMCU_rows) + start_iMCU_row(cinfo); + else + (*cinfo->inputctl->finish_input_pass) (cinfo); + } + cinfo->output_scanline += lines_to_skip; + + if (cinfo->upsample->need_context_rows) { + /* Context-based upsampling keeps track of iMCU rows. */ + increment_iMCU_ctr(cinfo, lines_to_skip / lines_per_iMCU_row); + + /* It is complex to properly move to the middle of a context block, so + * read the remaining lines instead of skipping them. + */ + dummy_buffer_setup(cinfo); + for (i = 0; i < lines_to_read; i++) + jpeg_read_scanlines(cinfo, &(cinfo->master->dummy_row_buffer), 1); + } else { + increment_simple_rowgroup_ctr(cinfo, lines_to_read); + } + + /* Since skipping lines involves skipping the upsampling step, the value of + * "rows_to_go" will become invalid unless we set it here. NOTE: This is a + * bit odd, since "rows_to_go" seems to be redundantly keeping track of + * output_scanline. + */ + upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline; + + /* Always skip the requested number of lines. */ + return num_lines; +} + /* * Alternate entry point to read raw data. * Processes exactly one iMCU row per call, unless suspended. @@ -271,6 +507,13 @@ jpeg_finish_output (j_decompress_ptr cinfo) if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) return FALSE; /* Suspend, come back later */ } + /* Clean up row buffer */ + if (cinfo->master->dummy_row_buffer) { + int nc = (cinfo->out_color_space == JCS_RGB565) ? + 2 : cinfo->out_color_components; + jpeg_free_small((j_common_ptr) cinfo, cinfo->master->dummy_row_buffer, + cinfo->output_width * nc * sizeof(JSAMPLE)); + } cinfo->global_state = DSTATE_BUFIMAGE; return TRUE; } diff --git a/jdarith.c b/jdarith.c index c6a1a99a..24e67fbe 100644 --- a/jdarith.c +++ b/jdarith.c @@ -3,8 +3,8 @@ * * This file was part of the Independent JPEG Group's software: * Developed 1997-2009 by Guido Vollbeding. - * It was modified by The libjpeg-turbo Project to include only code relevant - * to libjpeg-turbo. + * libjpeg-turbo Modifications: + * Copyright (C) 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README file. * * This file contains portable arithmetic entropy decoding routines for JPEG @@ -516,7 +516,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) /* Outer loop handles each block in the MCU */ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; + block = MCU_data ? MCU_data[blkn] : NULL; ci = cinfo->MCU_membership[blkn]; compptr = cinfo->cur_comp_info[ci]; @@ -563,7 +563,8 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) entropy->last_dc_val[ci] += v; } - (*block)[0] = (JCOEF) entropy->last_dc_val[ci]; + if (block) + (*block)[0] = (JCOEF) entropy->last_dc_val[ci]; /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */ @@ -607,7 +608,8 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) while (m >>= 1) if (arith_decode(cinfo, st)) v |= m; v += 1; if (sign) v = -v; - (*block)[jpeg_natural_order[k]] = (JCOEF) v; + if (block) + (*block)[jpeg_natural_order[k]] = (JCOEF) v; } } diff --git a/jdcoefct.c b/jdcoefct.c index 199a628b..17a97b1b 100644 --- a/jdcoefct.c +++ b/jdcoefct.c @@ -4,6 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1997, Thomas G. Lane. * libjpeg-turbo Modifications: + * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2010, D. R. Commander. * For conditions of distribution and use, see the accompanying README file. * @@ -16,53 +17,9 @@ * Also, the input side (only) is used when reading a file for transcoding. */ -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" +#include "jdcoefct.h" #include "jpegcomp.h" -/* Block smoothing is only applicable for progressive JPEG, so: */ -#ifndef D_PROGRESSIVE_SUPPORTED -#undef BLOCK_SMOOTHING_SUPPORTED -#endif - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_d_coef_controller pub; /* public fields */ - - /* These variables keep track of the current location of the input side. */ - /* cinfo->input_iMCU_row is also used for this. */ - JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ - int MCU_vert_offset; /* counts MCU rows within iMCU row */ - int MCU_rows_per_iMCU_row; /* number of such rows needed */ - - /* The output side's location is represented by cinfo->output_iMCU_row. */ - - /* In single-pass modes, it's sufficient to buffer just one MCU. - * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks, - * and let the entropy decoder write into that workspace each time. - * In multi-pass modes, this array points to the current MCU's blocks - * within the virtual arrays; it is used only by the input side. - */ - JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU]; - - /* Temporary workspace for one MCU */ - JCOEF * workspace; - -#ifdef D_MULTISCAN_FILES_SUPPORTED - /* In multi-pass modes, we need a virtual block array for each component. */ - jvirt_barray_ptr whole_image[MAX_COMPONENTS]; -#endif - -#ifdef BLOCK_SMOOTHING_SUPPORTED - /* When doing block smoothing, we latch coefficient Al values here */ - int * coef_bits_latch; -#define SAVED_COEFS 6 /* we save coef_bits[0..5] */ -#endif -} my_coef_controller; - -typedef my_coef_controller * my_coef_ptr; /* Forward declarations */ METHODDEF(int) decompress_onepass @@ -78,30 +35,6 @@ METHODDEF(int) decompress_smooth_data #endif -LOCAL(void) -start_iMCU_row (j_decompress_ptr cinfo) -/* Reset within-iMCU-row counters for a new row (input side) */ -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - - /* In an interleaved scan, an MCU row is the same as an iMCU row. - * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. - * But at the bottom of the image, process only what's left. - */ - if (cinfo->comps_in_scan > 1) { - coef->MCU_rows_per_iMCU_row = 1; - } else { - if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; - else - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; - } - - coef->MCU_ctr = 0; - coef->MCU_vert_offset = 0; -} - - /* * Initialize for an input processing pass. */ diff --git a/jdcoefct.h b/jdcoefct.h new file mode 100644 index 00000000..2f7bbe5e --- /dev/null +++ b/jdcoefct.h @@ -0,0 +1,82 @@ +/* + * jdcoefct.h + * + * This file was part of the Independent JPEG Group's software: + * Copyright (C) 1994-1997, Thomas G. Lane. + * libjpeg-turbo Modifications: + * Copyright 2009 Pierre Ossman for Cendio AB + * For conditions of distribution and use, see the accompanying README file. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Block smoothing is only applicable for progressive JPEG, so: */ +#ifndef D_PROGRESSIVE_SUPPORTED +#undef BLOCK_SMOOTHING_SUPPORTED +#endif + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_coef_controller pub; /* public fields */ + + /* These variables keep track of the current location of the input side. */ + /* cinfo->input_iMCU_row is also used for this. */ + JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* The output side's location is represented by cinfo->output_iMCU_row. */ + + /* In single-pass modes, it's sufficient to buffer just one MCU. + * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks, + * and let the entropy decoder write into that workspace each time. + * In multi-pass modes, this array points to the current MCU's blocks + * within the virtual arrays; it is used only by the input side. + */ + JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU]; + + /* Temporary workspace for one MCU */ + JCOEF * workspace; + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* In multi-pass modes, we need a virtual block array for each component. */ + jvirt_barray_ptr whole_image[MAX_COMPONENTS]; +#endif + +#ifdef BLOCK_SMOOTHING_SUPPORTED + /* When doing block smoothing, we latch coefficient Al values here */ + int * coef_bits_latch; +#define SAVED_COEFS 6 /* we save coef_bits[0..5] */ +#endif +} my_coef_controller; + +typedef my_coef_controller * my_coef_ptr; + + +LOCAL(void) +start_iMCU_row (j_decompress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row (input side) */ +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->MCU_ctr = 0; + coef->MCU_vert_offset = 0; +} diff --git a/jdhuff.c b/jdhuff.c index cbdce7d4..877ff10e 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2009-2011, D. R. Commander. + * Copyright (C) 2009-2011, 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README file. * * This file contains Huffman entropy decoding routines. @@ -562,7 +562,7 @@ decode_mcu_slow (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) ASSIGN_STATE(state, entropy->saved); for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - JBLOCKROW block = MCU_data[blkn]; + JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL; d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; register int s, k, r; @@ -582,11 +582,13 @@ decode_mcu_slow (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) int ci = cinfo->MCU_membership[blkn]; s += state.last_dc_val[ci]; state.last_dc_val[ci] = s; - /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */ - (*block)[0] = (JCOEF) s; + if (block) { + /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */ + (*block)[0] = (JCOEF) s; + } } - if (entropy->ac_needed[blkn]) { + if (entropy->ac_needed[blkn] && block) { /* Section F.2.2.2: decode the AC coefficients */ /* Since zeroes are skipped, output area must be cleared beforehand */ @@ -659,7 +661,7 @@ decode_mcu_fast (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) ASSIGN_STATE(state, entropy->saved); for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - JBLOCKROW block = MCU_data[blkn]; + JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL; d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; register int s, k, r, l; @@ -675,10 +677,11 @@ decode_mcu_fast (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) int ci = cinfo->MCU_membership[blkn]; s += state.last_dc_val[ci]; state.last_dc_val[ci] = s; - (*block)[0] = (JCOEF) s; + if (block) + (*block)[0] = (JCOEF) s; } - if (entropy->ac_needed[blkn]) { + if (entropy->ac_needed[blkn] && block) { for (k = 1; k < DCTSIZE2; k++) { HUFF_DECODE_FAST(s, l, actbl); diff --git a/jdmainct.c b/jdmainct.c index 7f7bd33e..e4ba1c4f 100644 --- a/jdmainct.c +++ b/jdmainct.c @@ -15,10 +15,7 @@ * supplies the equivalent of the main buffer in that case. */ -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jpegcomp.h" +#include "jdmainct.h" /* @@ -112,36 +109,6 @@ */ -/* Private buffer controller object */ - -typedef struct { - struct jpeg_d_main_controller pub; /* public fields */ - - /* Pointer to allocated workspace (M or M+2 row groups). */ - JSAMPARRAY buffer[MAX_COMPONENTS]; - - boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ - JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ - - /* Remaining fields are only used in the context case. */ - - /* These are the master pointers to the funny-order pointer lists. */ - JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ - - int whichptr; /* indicates which pointer set is now in use */ - int context_state; /* process_data state machine status */ - JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ - JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ -} my_main_controller; - -typedef my_main_controller * my_main_ptr; - -/* context_state values: */ -#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */ -#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */ -#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */ - - /* Forward declarations */ METHODDEF(void) process_data_simple_main (j_decompress_ptr cinfo, JSAMPARRAY output_buf, @@ -237,34 +204,6 @@ make_funny_pointers (j_decompress_ptr cinfo) } -LOCAL(void) -set_wraparound_pointers (j_decompress_ptr cinfo) -/* Set up the "wraparound" pointers at top and bottom of the pointer lists. - * This changes the pointer list state from top-of-image to the normal state. - */ -{ - my_main_ptr main_ptr = (my_main_ptr) cinfo->main; - int ci, i, rgroup; - int M = cinfo->_min_DCT_scaled_size; - jpeg_component_info *compptr; - JSAMPARRAY xbuf0, xbuf1; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) / - cinfo->_min_DCT_scaled_size; /* height of a row group of component */ - xbuf0 = main_ptr->xbuffer[0][ci]; - xbuf1 = main_ptr->xbuffer[1][ci]; - for (i = 0; i < rgroup; i++) { - xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i]; - xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i]; - xbuf0[rgroup*(M+2) + i] = xbuf0[i]; - xbuf1[rgroup*(M+2) + i] = xbuf1[i]; - } - } -} - - LOCAL(void) set_bottom_pointers (j_decompress_ptr cinfo) /* Change the pointer lists to duplicate the last sample row at the bottom diff --git a/jdmainct.h b/jdmainct.h new file mode 100644 index 00000000..37ab27d9 --- /dev/null +++ b/jdmainct.h @@ -0,0 +1,71 @@ +/* + * jdmainct.h + * + * This file was part of the Independent JPEG Group's software: + * Copyright (C) 1994-1996, Thomas G. Lane. + * For conditions of distribution and use, see the accompanying README file. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jpegcomp.h" + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_main_controller pub; /* public fields */ + + /* Pointer to allocated workspace (M or M+2 row groups). */ + JSAMPARRAY buffer[MAX_COMPONENTS]; + + boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ + JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ + + /* Remaining fields are only used in the context case. */ + + /* These are the master pointers to the funny-order pointer lists. */ + JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ + + int whichptr; /* indicates which pointer set is now in use */ + int context_state; /* process_data state machine status */ + JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ + JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ +} my_main_controller; + +typedef my_main_controller * my_main_ptr; + + +/* context_state values: */ +#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */ +#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */ +#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */ + + +LOCAL(void) +set_wraparound_pointers (j_decompress_ptr cinfo) +/* Set up the "wraparound" pointers at top and bottom of the pointer lists. + * This changes the pointer list state from top-of-image to the normal state. + */ +{ + my_main_ptr main_ptr = (my_main_ptr) cinfo->main; + int ci, i, rgroup; + int M = cinfo->_min_DCT_scaled_size; + jpeg_component_info *compptr; + JSAMPARRAY xbuf0, xbuf1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) / + cinfo->_min_DCT_scaled_size; /* height of a row group of component */ + xbuf0 = main_ptr->xbuffer[0][ci]; + xbuf1 = main_ptr->xbuffer[1][ci]; + for (i = 0; i < rgroup; i++) { + xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i]; + xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i]; + xbuf0[rgroup*(M+2) + i] = xbuf0[i]; + xbuf1[rgroup*(M+2) + i] = xbuf1[i]; + } + } +} diff --git a/jdsample.c b/jdsample.c index 27529667..5738c2fd 100644 --- a/jdsample.c +++ b/jdsample.c @@ -22,51 +22,11 @@ * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. */ -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" +#include "jdsample.h" #include "jsimd.h" #include "jpegcomp.h" -/* Pointer to routine to upsample a single component */ -typedef void (*upsample1_ptr) (j_decompress_ptr cinfo, - jpeg_component_info * compptr, - JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); - -/* Private subobject */ - -typedef struct { - struct jpeg_upsampler pub; /* public fields */ - - /* Color conversion buffer. When using separate upsampling and color - * conversion steps, this buffer holds one upsampled row group until it - * has been color converted and output. - * Note: we do not allocate any storage for component(s) which are full-size, - * ie do not need rescaling. The corresponding entry of color_buf[] is - * simply set to point to the input data array, thereby avoiding copying. - */ - JSAMPARRAY color_buf[MAX_COMPONENTS]; - - /* Per-component upsampling method pointers */ - upsample1_ptr methods[MAX_COMPONENTS]; - - int next_row_out; /* counts rows emitted from color_buf */ - JDIMENSION rows_to_go; /* counts rows remaining in image */ - - /* Height of an input row group for each component. */ - int rowgroup_height[MAX_COMPONENTS]; - - /* These arrays save pixel expansion factors so that int_expand need not - * recompute them each time. They are unused for other upsampling methods. - */ - UINT8 h_expand[MAX_COMPONENTS]; - UINT8 v_expand[MAX_COMPONENTS]; -} my_upsampler; - -typedef my_upsampler * my_upsample_ptr; - /* * Initialize for an upsampling pass. diff --git a/jdsample.h b/jdsample.h new file mode 100644 index 00000000..5226f268 --- /dev/null +++ b/jdsample.h @@ -0,0 +1,50 @@ +/* + * jdsample.h + * + * This file was part of the Independent JPEG Group's software: + * Copyright (C) 1991-1996, Thomas G. Lane. + * For conditions of distribution and use, see the accompanying README file. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Pointer to routine to upsample a single component */ +typedef void (*upsample1_ptr) (j_decompress_ptr cinfo, + jpeg_component_info * compptr, + JSAMPARRAY input_data, + JSAMPARRAY * output_data_ptr); + +/* Private subobject */ + +typedef struct { + struct jpeg_upsampler pub; /* public fields */ + + /* Color conversion buffer. When using separate upsampling and color + * conversion steps, this buffer holds one upsampled row group until it + * has been color converted and output. + * Note: we do not allocate any storage for component(s) which are full-size, + * ie do not need rescaling. The corresponding entry of color_buf[] is + * simply set to point to the input data array, thereby avoiding copying. + */ + JSAMPARRAY color_buf[MAX_COMPONENTS]; + + /* Per-component upsampling method pointers */ + upsample1_ptr methods[MAX_COMPONENTS]; + + int next_row_out; /* counts rows emitted from color_buf */ + JDIMENSION rows_to_go; /* counts rows remaining in image */ + + /* Height of an input row group for each component. */ + int rowgroup_height[MAX_COMPONENTS]; + + /* These arrays save pixel expansion factors so that int_expand need not + * recompute them each time. They are unused for other upsampling methods. + */ + UINT8 h_expand[MAX_COMPONENTS]; + UINT8 v_expand[MAX_COMPONENTS]; +} my_upsampler; + +typedef my_upsampler * my_upsample_ptr; diff --git a/jpegint.h b/jpegint.h index 025accd9..0e4dafe0 100644 --- a/jpegint.h +++ b/jpegint.h @@ -4,8 +4,8 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 1997-2009 by Guido Vollbeding. - * It was modified by The libjpeg-turbo Project to include only code relevant - * to libjpeg-turbo. + * libjpeg-turbo Modifications: + * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README file. * * This file provides common declarations for the various JPEG modules. @@ -137,6 +137,12 @@ struct jpeg_decomp_master { /* State variables made visible to other modules */ boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ + + /* Buffer large enough to store an output row. This is used when + * jpeg_skip_scanlines() chooses to "skip" a row by reading it into this + * dummy buffer. + */ + JSAMPROW dummy_row_buffer; }; /* Input control module */ diff --git a/jpeglib.h b/jpeglib.h index 9615c5d0..a41bec44 100644 --- a/jpeglib.h +++ b/jpeglib.h @@ -6,6 +6,7 @@ * Modified 2002-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2009-2011, 2013-2014, D. R. Commander. + * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README file. * * This file defines the application interface for the JPEG library. @@ -990,6 +991,8 @@ EXTERN(boolean) jpeg_start_decompress (j_decompress_ptr cinfo); EXTERN(JDIMENSION) jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION max_lines); +EXTERN(JDIMENSION) jpeg_skip_scanlines (j_decompress_ptr cinfo, + JDIMENSION num_lines); EXTERN(boolean) jpeg_finish_decompress (j_decompress_ptr cinfo); /* Replaces jpeg_read_scanlines when reading raw downsampled data. */ diff --git a/libjpeg.txt b/libjpeg.txt index 7dbb3542..52b6d8b8 100644 --- a/libjpeg.txt +++ b/libjpeg.txt @@ -3,7 +3,8 @@ USING THE IJG JPEG LIBRARY This file was part of the Independent JPEG Group's software: Copyright (C) 1994-2011, Thomas G. Lane, Guido Vollbeding. libjpeg-turbo Modifications: -Copyright (C) 2010, 2014, D. R. Commander. +Copyright (C) 2010, 2014, 2015, D. R. Commander. +Copyright (C) 2015, Google, Inc. For conditions of distribution and use, see the accompanying README file. @@ -729,6 +730,49 @@ jpeg_abort_decompress() or jpeg_abort() if you want to reuse the object. The previous discussion of aborting compression cycles applies here too. +Skipping rows when decompressing +-------------------------------- + +jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines); + +This function provides application programmers with the ability to skip over +multiple rows in the JPEG image, thus decoding only a subset of the image data. +This is convenient for performance-critical applications that wish to view only +a portion of a large JPEG image without decompressing the whole thing. It it +also useful in memory-constrained environments (such as on mobile devices.) + +Suspending data sources are not supported by this function. Calling +jpeg_skip_scanlines() with a suspending data source will result in undefined +behavior. + +jpeg_skip_scanlines() will not allow skipping past the bottom of the image. If +the value of num_lines is large enough to skip past the bottom of the image, +then the function will skip to the end of the image instead. + +If the value of num_lines is valid, then jpeg_skip_scanlines() will always +skip all of the input rows requested. There is no need to inspect the return +value of the function in that case. + +Best results will be achieved by calling jpeg_skip_scanlines() for large chunks +of rows. The function should be viewed as a way to quickly jump to a +particular vertical offset in the JPEG image in order to decode a subset of the +image. Used in this manner, it will provide significant performance +improvements. + +Calling jpeg_skip_scanlines() for small values of num_lines has several +potential drawbacks: + 1) JPEG decompression occurs in blocks, so if jpeg_skip_scanlines() is + called from the middle of a decompression block, then it is likely that + much of the decompression work has already been done for the first + couple of rows that need to be skipped. + 2) When this function returns, it must leave the decompressor in a state + such that it is ready to read the next line. This may involve + decompressing a block that must be partially skipped. +These issues are especially tricky for cases in which upsampling requires +context rows. In the worst case, jpeg_skip_scanlines() will perform similarly +to jpeg_read_scanlines() (since it will actually call jpeg_read_scanlines().) + + Mechanics of usage: include files, linking, etc ----------------------------------------------- From 07afe8a50fd9099d2be03515071e6973eae8bc2a Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 25 Jun 2015 03:44:37 +0000 Subject: [PATCH 052/140] Add a -skip option to djpeg, which opens up further regression testing options. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1583 632fc199-4ca6-4c93-a231-07263d6284db --- djpeg.c | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/djpeg.c b/djpeg.c index 20821cec..6e3a0b99 100644 --- a/djpeg.c +++ b/djpeg.c @@ -89,7 +89,7 @@ static IMAGE_FORMATS requested_fmt; static const char * progname; /* program name for error messages */ static char * outfilename; /* for -outfile switch */ boolean memsrc; /* for -memsrc switch */ -boolean stripe; +boolean stripe, skip; JDIMENSION startY, endY; #define INPUT_BUF_SIZE 4096 @@ -167,7 +167,8 @@ usage (void) fprintf(stderr, " -memsrc Load input file into memory before decompressing\n"); #endif - fprintf(stderr, " -stripe Y0,Y1 Decode a horizontal stripe of the image [Y0, Y1)\n"); + fprintf(stderr, " -skip Y0,Y1 Skip decoding a horizontal stripe of the image [Y0, Y1)\n"); + fprintf(stderr, " -stripe Y0,Y1 Decode only a horizontal stripe of the image [Y0, Y1)\n"); fprintf(stderr, " -verbose or -debug Emit debug output\n"); fprintf(stderr, " -version Print version information and exit\n"); exit(EXIT_FAILURE); @@ -194,6 +195,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, outfilename = NULL; memsrc = FALSE; stripe = FALSE; + skip = FALSE; cinfo->err->trace_level = 0; /* Scan command line options, adjust parameters */ @@ -381,6 +383,14 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, usage(); stripe = TRUE; + + } else if (keymatch(arg, "skip", 2)) { + if (++argn >= argc) + usage(); + if (sscanf(argv[argn], "%d,%d", &startY, &endY) != 2 || startY > endY) + usage(); + skip = TRUE; + } else if (keymatch(arg, "targa", 1)) { /* Targa output format. */ requested_fmt = FMT_TARGA; @@ -647,7 +657,7 @@ main (int argc, char **argv) (void) jpeg_start_decompress(&cinfo); /* Stripe decode */ - if (stripe) { + if (stripe || skip) { JDIMENSION tmp; /* Check for valid endY. We cannot check this value until after @@ -665,17 +675,33 @@ main (int argc, char **argv) */ tmp = cinfo.output_height; cinfo.output_height = endY - startY; + if (skip) + cinfo.output_height = tmp - cinfo.output_height; (*dest_mgr->start_output) (&cinfo, dest_mgr); cinfo.output_height = tmp; /* Process data */ - (void) jpeg_skip_scanlines(&cinfo, startY); - while (cinfo.output_scanline < endY) { - num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, - dest_mgr->buffer_height); - (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + if (skip) { + while (cinfo.output_scanline < startY) { + num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, + dest_mgr->buffer_height); + (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + } + jpeg_skip_scanlines(&cinfo, endY - startY); + while (cinfo.output_scanline < cinfo.output_height) { + num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, + dest_mgr->buffer_height); + (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + } + } else { + jpeg_skip_scanlines(&cinfo, startY); + while (cinfo.output_scanline < endY) { + num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, + dest_mgr->buffer_height); + (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + } + jpeg_skip_scanlines(&cinfo, cinfo.output_height - endY); } - (void) jpeg_skip_scanlines(&cinfo, cinfo.output_height - endY); /* Normal full image decode */ } else { From ac09954b1d8fbbb2dbdcac1d4c7bdf588d6834ed Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 27 Jun 2015 08:10:30 +0000 Subject: [PATCH 053/140] Fix a couple of seg faults discovered when testing the new jpeg_skip_scanlines() function + remove comment that is no longer relevant. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1586 632fc199-4ca6-4c93-a231-07263d6284db --- jdapistd.c | 30 ++++++++---------------------- jdmaster.c | 4 +++- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/jdapistd.c b/jdapistd.c index 51b7dc63..413cb82b 100644 --- a/jdapistd.c +++ b/jdapistd.c @@ -223,22 +223,6 @@ increment_simple_rowgroup_ctr (j_decompress_ptr cinfo, JDIMENSION rows) jpeg_read_scanlines(cinfo, &(cinfo->master->dummy_row_buffer), 1); } - -/* - * Called by jpeg_skip_scanlines(). When we skip iMCU rows, we must update the - * iMCU row counter. - */ - -LOCAL(void) -increment_iMCU_ctr (j_decompress_ptr cinfo, JDIMENSION iMCU_rows) -{ - my_main_ptr main_ptr = (my_main_ptr) cinfo->main; - if (main_ptr->iMCU_row_ctr == 0 && iMCU_rows > 0) - set_wraparound_pointers(cinfo); - main_ptr->iMCU_row_ctr += iMCU_rows; -} - - /* * Skips some scanlines of data from the JPEG decompressor. * @@ -309,6 +293,11 @@ jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines) } else { cinfo->output_scanline += lines_left_in_iMCU_row; } + + /* If we have just completed the first block, adjust the buffer pointers */ + if (main_ptr->iMCU_row_ctr == 0 || + (main_ptr->iMCU_row_ctr == 1 && lines_left_in_iMCU_row > 2)) + set_wraparound_pointers(cinfo); main_ptr->buffer_full = FALSE; main_ptr->rowgroup_ctr = 0; main_ptr->context_state = CTX_PREPARE_FOR_IMCU; @@ -351,7 +340,7 @@ jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines) if (cinfo->upsample->need_context_rows) { cinfo->output_scanline += lines_to_skip; cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row; - increment_iMCU_ctr(cinfo, lines_after_iMCU_row / lines_per_iMCU_row); + main_ptr->iMCU_row_ctr += lines_after_iMCU_row / lines_per_iMCU_row; /* It is complex to properly move to the middle of a context block, so * read the remaining lines instead of skipping them. */ @@ -373,10 +362,7 @@ jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines) for (x = 0; x < cinfo->MCUs_per_row; x++) { /* Calling decode_mcu() with a NULL pointer causes it to discard the * decoded coefficients. This is ~5% faster for large subsets, but - * it's tough to tell a difference for smaller images. Another - * advantage of discarding coefficients is that it allows us to avoid - * accessing the private field cinfo->coef->MCU_buffer (which would - * normally be a parameter to decode_mcu().) + * it's tough to tell a difference for smaller images. */ (*cinfo->entropy->decode_mcu) (cinfo, NULL); } @@ -392,7 +378,7 @@ jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines) if (cinfo->upsample->need_context_rows) { /* Context-based upsampling keeps track of iMCU rows. */ - increment_iMCU_ctr(cinfo, lines_to_skip / lines_per_iMCU_row); + main_ptr->iMCU_row_ctr += lines_to_skip / lines_per_iMCU_row; /* It is complex to properly move to the middle of a context block, so * read the remaining lines instead of skipping them. diff --git a/jdmaster.c b/jdmaster.c index 604e2916..2ef43fea 100644 --- a/jdmaster.c +++ b/jdmaster.c @@ -5,7 +5,7 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 2002-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: - * Copyright (C) 2009-2011, D. R. Commander. + * Copyright (C) 2009-2011, 2015 D. R. Commander. * Copyright (C) 2013, Linaro Limited. * For conditions of distribution and use, see the accompanying README file. * @@ -733,5 +733,7 @@ jinit_master_decompress (j_decompress_ptr cinfo) master->pub.is_dummy_pass = FALSE; + master->pub.dummy_row_buffer = NULL; + master_selection(cinfo); } From 7a7da9460aea0af2333fc1c9539ea966888e8e85 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 27 Jun 2015 08:10:31 +0000 Subject: [PATCH 054/140] Add regression tests for jpeg_skip_scanlines(); change "stripe" to "strip" in djpeg; document -strip and -skip parameters in djpeg git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1587 632fc199-4ca6-4c93-a231-07263d6284db --- CMakeLists.txt | 100 ++++++++++++++++++++++++++++++++++++++++++++++++- Makefile.am | 58 +++++++++++++++++++++++++++- djpeg.1 | 12 +++++- djpeg.c | 28 +++++++------- 4 files changed, 181 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ceb1099..df874e98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -356,6 +356,10 @@ if(WITH_12BIT) set(MD5_PPM_420M_ISLOW_3_8 343d19015531b7bbe746124127244fa8) set(MD5_PPM_420M_ISLOW_1_4 35fd59d866e44659edfa3c18db2a3edb) set(MD5_PPM_420M_ISLOW_1_8 ccaed48ac0aedefda5d4abe4013f4ad7) + set(MD5_PPM_420_ISLOW_SKIP15_31 86664cd9dc956536409e44e244d20a97) + set(MD5_PPM_420_ISLOW_PROG_STRIP71_132 a5c3706bb2e59bd01786b1181f67f97c) + set(MD5_PPM_444_ISLOW_SKIP1_6 ef63901f71ef7a75cd78253fc0914f84) + set(MD5_PPM_444_ISLOW_PROG_STRIP13_110 6d228f8d05381d8639f3d078b91b2ee0) set(MD5_JPEG_CROP cdb35ff4b4519392690ea040c56ea99c) else() set(TESTORIG testorig.jpg) @@ -405,6 +409,13 @@ else() set(MD5_BMP_420_ISLOW_565D 6bde71526acc44bcff76f696df8638d2) set(MD5_BMP_420M_ISLOW_565 8dc0185245353cfa32ad97027342216f) set(MD5_BMP_420M_ISLOW_565D d1be3a3339166255e76fa50a0d70d73e) + set(MD5_PPM_420_ISLOW_SKIP15_31 c4c65c1e43d7275cd50328a61e6534f0) + set(MD5_PPM_420_ISLOW_ARI_SKIP16_139 087c6b123db16ac00cb88c5b590bb74a) + set(MD5_PPM_420_ISLOW_PROG_STRIP71_132 a7f2ba6ea335f03549888bed66a89fae) + set(MD5_PPM_420_ISLOW_ARI_STRIP4_56 0e5e44a39b94817917a1bac72903246b) + set(MD5_PPM_444_ISLOW_SKIP1_6 5606f86874cf26b8fcee1117a0a436a6) + set(MD5_PPM_444_ISLOW_PROG_STRIP13_110 40b5d9742558dca6229d7332fc2dda07) + set(MD5_PPM_444_ISLOW_ARI_STRIP0_36 9aceb5b9449c900b892a1d2fe39351b4) set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d) endif() @@ -653,7 +664,7 @@ foreach(libtype ${TEST_LIBTYPES}) -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) # CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith add_test(cjpeg${suffix}-444-islow-progari - ${dir}cjpeg${suffix} -sample 1x1 -dct int -progressive -arithmetic + ${dir}cjpeg${suffix} -sample 1x1 -dct int -prog -arithmetic -outfile testout_444_islow_progari.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) add_test(cjpeg${suffix}-444-islow-progari-cmp @@ -757,6 +768,93 @@ foreach(libtype ${TEST_LIBTYPES}) -DFILE=testout_420m_islow_565D.bmp -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) endif() + + # Partial decode tests. These tests are designed to cover all of the + # possible code paths in jpeg_skip_scanlines(). + + # Context rows: Yes Intra-iMCU row: Yes iMCU row prefetch: No ENT: huff + add_test(djpeg${suffix}-420-islow-skip15_31 + ${dir}djpeg${suffix} -dct int -skip 15,31 -ppm + -outfile testout_420_islow_skip15,31.ppm + ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) + add_test(djpeg${suffix}-420-islow-skip15_31-cmp + ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_ISLOW_SKIP15_31} + -DFILE=testout_420_islow_skip15,31.ppm + -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: Yes ENT: arith + if(WITH_ARITH_DEC) + add_test(djpeg${suffix}-420-islow-ari-skip16_139 + ${dir}djpeg${suffix} -dct int -skip 16,139 -ppm + -outfile testout_420_islow_ari_skip16,139.ppm + ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) + add_test(djpeg${suffix}-420-islow-ari_skip16_139-cmp + ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_ISLOW_ARI_SKIP16_139} + -DFILE=testout_420_islow_ari_skip16,139.ppm + -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + endif() + # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff + add_test(cjpeg${suffix}-420-islow-prog + ${dir}cjpeg${suffix} -dct int -prog -outfile testout_420_islow_prog.jpg + ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + add_test(djpeg${suffix}-420-islow-prog-strip71_132 + ${dir}djpeg${suffix} -dct int -strip 71,132 -ppm + -outfile testout_420_islow_strip71,132.ppm testout_420_islow_prog.jpg) + add_test(djpeg${suffix}-420-islow-prog-strip71_132-cmp + ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_ISLOW_PROG_STRIP71_132} + -DFILE=testout_420_islow_strip71,132.ppm + -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith + if(WITH_ARITH_DEC) + add_test(djpeg${suffix}-420-islow-ari-strip4_56 + ${dir}djpeg${suffix} -dct int -strip 4,56 -ppm + -outfile testout_420_islow_ari_strip4,56.ppm + ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) + add_test(djpeg${suffix}-420-islow-ari-strip4_56-cmp + ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_ISLOW_ARI_STRIP4_56} + -DFILE=testout_420_islow_ari_strip4,56.ppm + -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + endif() + # Context rows: No Intra-iMCU row: Yes ENT: huff + add_test(cjpeg${suffix}-444-islow + ${dir}cjpeg${suffix} -dct int -sample 1x1 -outfile testout_444_islow.jpg + ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + add_test(djpeg${suffix}-444-islow-skip1_6 + ${dir}djpeg${suffix} -dct int -skip 1,6 -ppm + -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg) + add_test(djpeg${suffix}-444-islow-skip1_6-cmp + ${CMAKE_COMMAND} -DMD5=${MD5_PPM_444_ISLOW_SKIP1_6} + -DFILE=testout_444_islow_skip1,6.ppm + -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + # Context rows: No Intra-iMCU row: No ENT: prog huff + add_test(cjpeg${suffix}-444-islow-prog + ${dir}cjpeg${suffix} -dct int -prog -sample 1x1 + -outfile testout_444_islow_prog.jpg + ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + add_test(djpeg${suffix}-444-islow-prog-strip13_110 + ${dir}djpeg${suffix} -dct int -strip 13,110 -ppm + -outfile testout_444_islow_prog_strip13,110.ppm testout_444_islow_prog.jpg) + add_test(djpeg${suffix}-444-islow-prog_strip13_110-cmp + ${CMAKE_COMMAND} -DMD5=${MD5_PPM_444_ISLOW_PROG_STRIP13_110} + -DFILE=testout_444_islow_prog_strip13,110.ppm + -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + # Context rows: No Intra-iMCU row: No ENT: arith + if(WITH_ARITH_ENC) + add_test(cjpeg${suffix}-444-islow-ari + ${dir}cjpeg${suffix} -dct int -arithmetic -sample 1x1 + -outfile testout_444_islow_ari.jpg + ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + if(WITH_ARITH_DEC) + add_test(djpeg${suffix}-444-islow-ari-strip0_36 + ${dir}djpeg${suffix} -dct int -strip 0,36 -ppm + -outfile testout_444_islow_ari_strip0,36.ppm + testout_444_islow_ari.jpg) + add_test(djpeg${suffix}-444-islow-ari-strip0_36-cmp + ${CMAKE_COMMAND} -DMD5=${MD5_PPM_444_ISLOW_ARI_STRIP0_36} + -DFILE=testout_444_islow_ari_strip0,36.ppm + -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + endif() + endif() + add_test(jpegtran${suffix}-crop ${dir}jpegtran${suffix} -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) diff --git a/Makefile.am b/Makefile.am index fe5c3195..315ced33 100644 --- a/Makefile.am +++ b/Makefile.am @@ -210,6 +210,10 @@ MD5_PPM_420M_ISLOW_1_2 = b419124dd5568b085787234866102866 MD5_PPM_420M_ISLOW_3_8 = 343d19015531b7bbe746124127244fa8 MD5_PPM_420M_ISLOW_1_4 = 35fd59d866e44659edfa3c18db2a3edb MD5_PPM_420M_ISLOW_1_8 = ccaed48ac0aedefda5d4abe4013f4ad7 +MD5_PPM_420_ISLOW_SKIP15_31 = 86664cd9dc956536409e44e244d20a97 +MD5_PPM_420_ISLOW_PROG_STRIP71_132 = a5c3706bb2e59bd01786b1181f67f97c +MD5_PPM_444_ISLOW_SKIP1_6 = ef63901f71ef7a75cd78253fc0914f84 +MD5_PPM_444_ISLOW_PROG_STRIP13_110 = 6d228f8d05381d8639f3d078b91b2ee0 MD5_JPEG_CROP = cdb35ff4b4519392690ea040c56ea99c else @@ -262,6 +266,13 @@ MD5_BMP_420_ISLOW_565 = bf9d13e16c4923b92e1faa604d7922cb MD5_BMP_420_ISLOW_565D = 6bde71526acc44bcff76f696df8638d2 MD5_BMP_420M_ISLOW_565 = 8dc0185245353cfa32ad97027342216f MD5_BMP_420M_ISLOW_565D =d1be3a3339166255e76fa50a0d70d73e +MD5_PPM_420_ISLOW_SKIP15_31 = c4c65c1e43d7275cd50328a61e6534f0 +MD5_PPM_420_ISLOW_ARI_SKIP16_139 = 087c6b123db16ac00cb88c5b590bb74a +MD5_PPM_420_ISLOW_PROG_STRIP71_132 = a7f2ba6ea335f03549888bed66a89fae +MD5_PPM_420_ISLOW_ARI_STRIP4_56 = 0e5e44a39b94817917a1bac72903246b +MD5_PPM_444_ISLOW_SKIP1_6 = 5606f86874cf26b8fcee1117a0a436a6 +MD5_PPM_444_ISLOW_PROG_STRIP13_110 = 40b5d9742558dca6229d7332fc2dda07 +MD5_PPM_444_ISLOW_ARI_STRIP0_36 = 9aceb5b9449c900b892a1d2fe39351b4 MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d endif @@ -487,7 +498,7 @@ if WITH_ARITH_ENC md5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg rm testout_420_islow_ari.jpg # CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith - ./cjpeg -sample 1x1 -dct int -progressive -arithmetic -outfile testout_444_islow_progari.jpg $(srcdir)/testimages/testorig.ppm + ./cjpeg -sample 1x1 -dct int -prog -arithmetic -outfile testout_444_islow_progari.jpg $(srcdir)/testimages/testorig.ppm md5/md5cmp $(MD5_JPEG_444_ISLOW_PROGARI) testout_444_islow_progari.jpg rm testout_444_islow_progari.jpg endif @@ -573,6 +584,51 @@ else rm testout_420m_islow_565D.bmp endif +# Partial decode tests. These tests are designed to cover all of the possible +# code paths in jpeg_skip_scanlines(). + +# Context rows: Yes Intra-iMCU row: Yes iMCU row prefetch: No ENT: huff + ./djpeg -dct int -skip 15,31 -ppm -outfile testout_420_islow_skip15,31.ppm $(srcdir)/testimages/$(TESTORIG) + md5/md5cmp $(MD5_PPM_420_ISLOW_SKIP15_31) testout_420_islow_skip15,31.ppm + rm testout_420_islow_skip15,31.ppm +# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: Yes ENT: arith +if WITH_ARITH_DEC + ./djpeg -dct int -skip 16,139 -ppm -outfile testout_420_islow_ari_skip16,139.ppm $(srcdir)/testimages/testimgari.jpg + md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_SKIP16_139) testout_420_islow_ari_skip16,139.ppm + rm testout_420_islow_ari_skip16,139.ppm +endif +# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff + ./cjpeg -dct int -prog -outfile testout_420_islow_prog.jpg $(srcdir)/testimages/testorig.ppm + ./djpeg -dct int -strip 71,132 -ppm -outfile testout_420_islow_prog_strip71,132.ppm testout_420_islow_prog.jpg + md5/md5cmp $(MD5_PPM_420_ISLOW_PROG_STRIP71_132) testout_420_islow_prog_strip71,132.ppm + rm testout_420_islow_prog_strip71,132.ppm testout_420_islow_prog.jpg +# Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith +if WITH_ARITH_DEC + ./djpeg -dct int -strip 4,56 -ppm -outfile testout_420_islow_ari_strip4,56.ppm $(srcdir)/testimages/testimgari.jpg + md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_STRIP4_56) testout_420_islow_ari_strip4,56.ppm + rm testout_420_islow_ari_strip4,56.ppm +endif +# Context rows: No Intra-iMCU row: Yes ENT: huff + ./cjpeg -dct int -sample 1x1 -outfile testout_444_islow.jpg $(srcdir)/testimages/testorig.ppm + ./djpeg -dct int -skip 1,6 -ppm -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg + md5/md5cmp $(MD5_PPM_444_ISLOW_SKIP1_6) testout_444_islow_skip1,6.ppm + rm testout_444_islow_skip1,6.ppm testout_444_islow.jpg +# Context rows: No Intra-iMCU row: No ENT: prog huff + ./cjpeg -dct int -prog -sample 1x1 -outfile testout_444_islow_prog.jpg $(srcdir)/testimages/testorig.ppm + ./djpeg -dct int -strip 13,110 -ppm -outfile testout_444_islow_prog_strip13,110.ppm testout_444_islow_prog.jpg + md5/md5cmp $(MD5_PPM_444_ISLOW_PROG_STRIP13_110) testout_444_islow_prog_strip13,110.ppm + rm testout_444_islow_prog_strip13,110.ppm testout_444_islow_prog.jpg +# Context rows: No Intra-iMCU row: No ENT: arith +if WITH_ARITH_ENC + ./cjpeg -dct int -arithmetic -sample 1x1 -outfile testout_444_islow_ari.jpg $(srcdir)/testimages/testorig.ppm +if WITH_ARITH_DEC + ./djpeg -dct int -strip 0,36 -ppm -outfile testout_444_islow_ari_strip0,36.ppm testout_444_islow_ari.jpg + md5/md5cmp $(MD5_PPM_444_ISLOW_ARI_STRIP0_36) testout_444_islow_ari_strip0,36.ppm + rm testout_444_islow_ari_strip0,36.ppm +endif + rm testout_444_islow_ari.jpg +endif + ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_JPEG_CROP) testout_crop.jpg rm testout_crop.jpg diff --git a/djpeg.1 b/djpeg.1 index 73d05148..17296abd 100644 --- a/djpeg.1 +++ b/djpeg.1 @@ -1,4 +1,4 @@ -.TH DJPEG 1 "21 November 2014" +.TH DJPEG 1 "26 June 2015" .SH NAME djpeg \- decompress a JPEG file to an image file .SH SYNOPSIS @@ -194,6 +194,16 @@ Send output image to the named file, not to standard output. Load input file into memory before decompressing. This feature was implemented mainly as a way of testing the in-memory source manager (jpeg_mem_src().) .TP +.BI \-skip " Y0,Y1" +Decode all rows of the JPEG image except those between Y0 and Y1 (inclusive.) +Note that if decompression scaling is being used, Y0 and Y1 are relative to the +scaled image dimensions. +.TP +.BI \-strip " Y0,Y1" +Decode only the rows of the JPEG image between Y0 and Y1 (inclusive.) Note +that if decompression scaling is being used, Y0 and Y1 are relative to the +scaled image dimensions. +.TP .B \-verbose Enable debug printout. More .BR \-v 's diff --git a/djpeg.c b/djpeg.c index 6e3a0b99..d41f94f1 100644 --- a/djpeg.c +++ b/djpeg.c @@ -89,7 +89,7 @@ static IMAGE_FORMATS requested_fmt; static const char * progname; /* program name for error messages */ static char * outfilename; /* for -outfile switch */ boolean memsrc; /* for -memsrc switch */ -boolean stripe, skip; +boolean strip, skip; JDIMENSION startY, endY; #define INPUT_BUF_SIZE 4096 @@ -167,8 +167,8 @@ usage (void) fprintf(stderr, " -memsrc Load input file into memory before decompressing\n"); #endif - fprintf(stderr, " -skip Y0,Y1 Skip decoding a horizontal stripe of the image [Y0, Y1)\n"); - fprintf(stderr, " -stripe Y0,Y1 Decode only a horizontal stripe of the image [Y0, Y1)\n"); + fprintf(stderr, " -skip Y0,Y1 Decode all rows except those between Y0 and Y1 (inclusive)\n"); + fprintf(stderr, " -strip Y0,Y1 Decode only rows between Y0 and Y1 (inclusive)\n"); fprintf(stderr, " -verbose or -debug Emit debug output\n"); fprintf(stderr, " -version Print version information and exit\n"); exit(EXIT_FAILURE); @@ -194,7 +194,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, requested_fmt = DEFAULT_FMT; /* set default output file format */ outfilename = NULL; memsrc = FALSE; - stripe = FALSE; + strip = FALSE; skip = FALSE; cinfo->err->trace_level = 0; @@ -376,12 +376,12 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, &cinfo->scale_num, &cinfo->scale_denom) != 2) usage(); - } else if (keymatch(arg, "stripe", 2)) { + } else if (keymatch(arg, "strip", 2)) { if (++argn >= argc) usage(); if (sscanf(argv[argn], "%d,%d", &startY, &endY) != 2 || startY > endY) usage(); - stripe = TRUE; + strip = TRUE; } else if (keymatch(arg, "skip", 2)) { @@ -656,16 +656,16 @@ main (int argc, char **argv) /* Start decompressor */ (void) jpeg_start_decompress(&cinfo); - /* Stripe decode */ - if (stripe || skip) { + /* Strip decode */ + if (strip || skip) { JDIMENSION tmp; /* Check for valid endY. We cannot check this value until after * jpeg_start_decompress() is called. Note that we have already verified * that startY <= endY. */ - if (endY > cinfo.output_height) { - fprintf(stderr, "%s: stripe %d-%d exceeds image height %d\n", progname, + if (endY > cinfo.output_height - 1) { + fprintf(stderr, "%s: strip %d-%d exceeds image height %d\n", progname, startY, endY, cinfo.output_height); exit(EXIT_FAILURE); } @@ -674,7 +674,7 @@ main (int argc, char **argv) * manager creates an image of the proper size for the partial decode. */ tmp = cinfo.output_height; - cinfo.output_height = endY - startY; + cinfo.output_height = endY - startY + 1; if (skip) cinfo.output_height = tmp - cinfo.output_height; (*dest_mgr->start_output) (&cinfo, dest_mgr); @@ -687,7 +687,7 @@ main (int argc, char **argv) dest_mgr->buffer_height); (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); } - jpeg_skip_scanlines(&cinfo, endY - startY); + jpeg_skip_scanlines(&cinfo, endY - startY + 1); while (cinfo.output_scanline < cinfo.output_height) { num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, dest_mgr->buffer_height); @@ -695,12 +695,12 @@ main (int argc, char **argv) } } else { jpeg_skip_scanlines(&cinfo, startY); - while (cinfo.output_scanline < endY) { + while (cinfo.output_scanline <= endY) { num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, dest_mgr->buffer_height); (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); } - jpeg_skip_scanlines(&cinfo, cinfo.output_height - endY); + jpeg_skip_scanlines(&cinfo, cinfo.output_height - endY + 1); } /* Normal full image decode */ From 162c9985d6d4860d577c68be34f37a5c2c5a8717 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 27 Jun 2015 08:10:32 +0000 Subject: [PATCH 055/140] Fix compiler warnings in jpeg_skip_scanlines() when building under Visual Studio. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1588 632fc199-4ca6-4c93-a231-07263d6284db --- jdapistd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jdapistd.c b/jdapistd.c index 413cb82b..d34335f1 100644 --- a/jdapistd.c +++ b/jdapistd.c @@ -205,8 +205,7 @@ dummy_buffer_setup (j_decompress_ptr cinfo) LOCAL(void) increment_simple_rowgroup_ctr (j_decompress_ptr cinfo, JDIMENSION rows) { - int i; - JDIMENSION rows_left; + JDIMENSION i, rows_left; my_main_ptr main_ptr = (my_main_ptr) cinfo->main; /* Increment the counter to the next row group after the skipped rows. */ @@ -240,7 +239,8 @@ jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines) my_main_ptr main_ptr = (my_main_ptr) cinfo->main; my_coef_ptr coef = (my_coef_ptr) cinfo->coef; my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - int i, y, x; + JDIMENSION i, x; + int y; JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row; JDIMENSION lines_to_skip, lines_to_read; From 306e1d2d778cf5a4d2a22ac847a31722b9fc2845 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 27 Jun 2015 08:10:33 +0000 Subject: [PATCH 056/140] Add jpeg_skip_scanlines() to the Windows DLL export list. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1589 632fc199-4ca6-4c93-a231-07263d6284db --- win/jpeg62-memsrcdst.def | 1 + win/jpeg62.def | 1 + win/jpeg7.def | 1 + win/jpeg8.def | 1 + 4 files changed, 4 insertions(+) diff --git a/win/jpeg62-memsrcdst.def b/win/jpeg62-memsrcdst.def index 4511c8ef..949d2679 100755 --- a/win/jpeg62-memsrcdst.def +++ b/win/jpeg62-memsrcdst.def @@ -102,3 +102,4 @@ EXPORTS jzero_far @ 101 ; jpeg_mem_dest @ 102 ; jpeg_mem_src @ 103 ; + jpeg_skip_scanlines @ 104 ; diff --git a/win/jpeg62.def b/win/jpeg62.def index 3c33fbf2..c64df50a 100755 --- a/win/jpeg62.def +++ b/win/jpeg62.def @@ -100,3 +100,4 @@ EXPORTS jpeg_write_tables @ 99 ; jround_up @ 100 ; jzero_far @ 101 ; + jpeg_skip_scanlines @ 102 ; diff --git a/win/jpeg7.def b/win/jpeg7.def index 5ca227b8..8daa35f9 100644 --- a/win/jpeg7.def +++ b/win/jpeg7.def @@ -102,3 +102,4 @@ EXPORTS jpeg_write_tables @ 101 ; jround_up @ 102 ; jzero_far @ 103 ; + jpeg_skip_scanlines @ 104 ; diff --git a/win/jpeg8.def b/win/jpeg8.def index 3fa6111c..01deb69f 100644 --- a/win/jpeg8.def +++ b/win/jpeg8.def @@ -105,3 +105,4 @@ EXPORTS jpeg_write_tables @ 104 ; jround_up @ 105 ; jzero_far @ 106 ; + jpeg_skip_scanlines @ 107 ; From 6ed4d9d11085acd04dc7f2f899848693976dc010 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 27 Jun 2015 08:10:34 +0000 Subject: [PATCH 057/140] Increment SO_AGE to reflect the addition of a new interface to the libjpeg API git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1590 632fc199-4ca6-4c93-a231-07263d6284db --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index be9fcdf2..f5f84304 100644 --- a/configure.ac +++ b/configure.ac @@ -189,7 +189,7 @@ fi RPM_CONFIG_ARGS= # Memory source/destination managers -SO_AGE=0 +SO_AGE=1 MEM_SRCDST_FUNCTIONS= if test "x${with_jpeg8}" != "xyes"; then AC_MSG_CHECKING([whether to include in-memory source/destination managers]) @@ -200,7 +200,7 @@ if test "x${with_jpeg8}" != "xyes"; then AC_MSG_RESULT(yes) AC_DEFINE([MEM_SRCDST_SUPPORTED], [1], [Support in-memory source/destination managers]) - SO_AGE=1 + SO_AGE=2 MEM_SRCDST_FUNCTIONS="global: jpeg_mem_dest; jpeg_mem_src;"; else AC_MSG_RESULT(no) From 9cc597221ed76aae9d7a0d333aece9980947ba46 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 1 Jul 2015 16:56:44 +0000 Subject: [PATCH 058/140] Fix a memory leak in jpeg_skip_scanlines() git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1591 632fc199-4ca6-4c93-a231-07263d6284db --- jdapistd.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/jdapistd.c b/jdapistd.c index d34335f1..578d5cc4 100644 --- a/jdapistd.c +++ b/jdapistd.c @@ -192,8 +192,8 @@ dummy_buffer_setup (j_decompress_ptr cinfo) nc = (cinfo->out_color_space == JCS_RGB565) ? 2 : cinfo->out_color_components; cinfo->master->dummy_row_buffer = - jpeg_get_small((j_common_ptr) cinfo, - cinfo->output_width * nc * sizeof(JSAMPLE)); + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->output_width * nc * sizeof(JSAMPLE)); } @@ -493,13 +493,6 @@ jpeg_finish_output (j_decompress_ptr cinfo) if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) return FALSE; /* Suspend, come back later */ } - /* Clean up row buffer */ - if (cinfo->master->dummy_row_buffer) { - int nc = (cinfo->out_color_space == JCS_RGB565) ? - 2 : cinfo->out_color_components; - jpeg_free_small((j_common_ptr) cinfo, cinfo->master->dummy_row_buffer, - cinfo->output_width * nc * sizeof(JSAMPLE)); - } cinfo->global_state = DSTATE_BUFIMAGE; return TRUE; } From 1a4778f8f00a6af5a7738a323f6b6d05cbc98c6c Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 7 Jul 2015 16:39:03 +0000 Subject: [PATCH 059/140] Allow TJCompressor and TJDecompressor to be used with a try-with-resources statement in Java 7 and later. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1594 632fc199-4ca6-4c93-a231-07263d6284db --- ChangeLog.txt | 4 ++++ .../libjpegturbo/turbojpeg/TJCompressor.html | 18 ++++++++++++++---- .../libjpegturbo/turbojpeg/TJDecompressor.html | 18 ++++++++++++++---- .../libjpegturbo/turbojpeg/TJTransformer.html | 4 ++++ .../libjpegturbo/turbojpeg/package-tree.html | 4 ++-- java/doc/overview-tree.html | 4 ++-- .../libjpegturbo/turbojpeg/TJCompressor.java | 7 ++++--- .../libjpegturbo/turbojpeg/TJDecompressor.java | 7 ++++--- turbojpeg-jni.c | 11 +++++++++-- 9 files changed, 57 insertions(+), 20 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d9df904c..f0c804ef 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -11,6 +11,10 @@ use of AltiVec instructions. [2] Added a new libjpeg API function (jpeg_skip_scanlines()) that can be used to partially decode a JPEG image. See libjpeg.txt for more details. +[3] The TJCompressor and TJDecompressor classes in the TurboJPEG Java API now +implement the Closeable interface, so those classes can be used with a +try-with-resources statement. + 1.4.1 ===== diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html index b7fa3db4..88f56443 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html @@ -90,10 +90,15 @@
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Closeable, java.lang.AutoCloseable
    +


    public class TJCompressor
    -extends java.lang.Object
    +extends java.lang.Object +implements java.io.Closeable
    TurboJPEG compressor
@@ -828,10 +833,15 @@ public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,
  • close

    public void close()
    -           throws java.lang.Exception
    + throws java.io.IOException
    Free the native structures associated with this compressor instance.
    -
    Throws:
    -
    java.lang.Exception
    +
    +
    Specified by:
    +
    close in interface java.io.Closeable
    +
    Specified by:
    +
    close in interface java.lang.AutoCloseable
    +
    Throws:
    +
    java.io.IOException
  • diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html index dc1dcbdc..73859d57 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html @@ -91,13 +91,18 @@ @@ -1162,10 +1167,15 @@ public byte[] decompressToYUV(int flags)
  • close

    public void close()
    -           throws java.lang.Exception
    + throws java.io.IOException
    Free the native structures associated with this decompressor instance.
    -
    Throws:
    -
    java.lang.Exception
    +
    +
    Specified by:
    +
    close in interface java.io.Closeable
    +
    Specified by:
    +
    close in interface java.lang.AutoCloseable
    +
    Throws:
    +
    java.io.IOException
  • diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html index 32c92bb8..8366afda 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html @@ -95,6 +95,10 @@
    • +
      +
      All Implemented Interfaces:
      +
      java.io.Closeable, java.lang.AutoCloseable
      +


      public class TJTransformer
      diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-tree.html b/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
      index 1033ee56..cda68577 100644
      --- a/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
      +++ b/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
      @@ -80,8 +80,8 @@
       
  • org.libjpegturbo.turbojpeg.TJ
  • -
  • org.libjpegturbo.turbojpeg.TJCompressor
  • -
  • org.libjpegturbo.turbojpeg.TJDecompressor +
  • org.libjpegturbo.turbojpeg.TJCompressor (implements java.io.Closeable)
  • +
  • org.libjpegturbo.turbojpeg.TJDecompressor (implements java.io.Closeable) diff --git a/java/doc/overview-tree.html b/java/doc/overview-tree.html index eae18a13..c5a0ab9c 100644 --- a/java/doc/overview-tree.html +++ b/java/doc/overview-tree.html @@ -84,8 +84,8 @@
  • org.libjpegturbo.turbojpeg.TJ
  • -
  • org.libjpegturbo.turbojpeg.TJCompressor
  • -
  • org.libjpegturbo.turbojpeg.TJDecompressor +
  • org.libjpegturbo.turbojpeg.TJCompressor (implements java.io.Closeable)
  • +
  • org.libjpegturbo.turbojpeg.TJDecompressor (implements java.io.Closeable) diff --git a/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/java/org/libjpegturbo/turbojpeg/TJCompressor.java index 6ec581a5..37fd6047 100644 --- a/java/org/libjpegturbo/turbojpeg/TJCompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJCompressor.java @@ -30,11 +30,12 @@ package org.libjpegturbo.turbojpeg; import java.awt.image.*; import java.nio.*; +import java.io.*; /** * TurboJPEG compressor */ -public class TJCompressor { +public class TJCompressor implements Closeable { private static final String NO_ASSOC_ERROR = "No source image is associated with this instance"; @@ -567,7 +568,7 @@ public class TJCompressor { /** * Free the native structures associated with this compressor instance. */ - public void close() throws Exception { + public void close() throws IOException { if (handle != 0) destroy(); } @@ -583,7 +584,7 @@ public class TJCompressor { private native void init() throws Exception; - private native void destroy() throws Exception; + private native void destroy() throws IOException; // JPEG size in bytes is returned private native int compress(byte[] srcBuf, int width, int pitch, diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java index 7ec557f9..70022479 100644 --- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java @@ -30,11 +30,12 @@ package org.libjpegturbo.turbojpeg; import java.awt.image.*; import java.nio.*; +import java.io.*; /** * TurboJPEG decompressor */ -public class TJDecompressor { +public class TJDecompressor implements Closeable { private static final String NO_ASSOC_ERROR = "No JPEG image is associated with this instance"; @@ -833,7 +834,7 @@ public class TJDecompressor { /** * Free the native structures associated with this decompressor instance. */ - public void close() throws Exception { + public void close() throws IOException { if (handle != 0) destroy(); } @@ -849,7 +850,7 @@ public class TJDecompressor { private native void init() throws Exception; - private native void destroy() throws Exception; + private native void destroy() throws IOException; private native void decompressHeader(byte[] srcBuf, int size) throws Exception; diff --git a/turbojpeg-jni.c b/turbojpeg-jni.c index 1bf478f1..04e2dc3a 100644 --- a/turbojpeg-jni.c +++ b/turbojpeg-jni.c @@ -1,5 +1,5 @@ /* - * Copyright (C)2011-2014 D. R. Commander. All Rights Reserved. + * Copyright (C)2011-2015 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -46,6 +46,13 @@ goto bailout; \ } +#define _throwio(msg) { \ + jclass _exccls=(*env)->FindClass(env, "java/io/IOException"); \ + if(!_exccls) goto bailout; \ + (*env)->ThrowNew(env, _exccls, msg); \ + goto bailout; \ +} + #define bailif0(f) {if(!(f)) { \ char temps[80]; \ snprintf(temps, 80, "Unexpected NULL condition in line %d", __LINE__); \ @@ -531,7 +538,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy gethandle(); - if(tjDestroy(handle)==-1) _throw(tjGetErrorStr()); + if(tjDestroy(handle)==-1) _throwio(tjGetErrorStr()); (*env)->SetLongField(env, obj, _fid, 0); bailout: From b3817dab868883bdc77d3fd6f12df66ce0e24c2a Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 14 Jul 2015 20:42:52 +0000 Subject: [PATCH 060/140] Throw idiomatic unchecked exceptions from the Java classes and JNI wrapper if there is an unrecoverable error caused by incorrect API usage (such as illegal arguments, etc.), and throw Errors if there is an unrecoverable error at the C level (such as a failed malloc() call.) Change the behavior of the bailif0() macro in the JNI wrapper so that it doesn't throw an exception for an unexpected NULL condition. In fact, in all cases, the underlying JNI API function (such as GetFieldID(), etc.) will throw an Error on its own whenever it returns NULL, so our custom exceptions were never being thrown in that case anyhow. All we need to do is just detect the error and bail out of the C code. This also corrects a couple of formatting issues (semicolons aren't needed at the end of class definitions, and @Override should be specified for the methods we're overriding from super-classes, so the compiler can sanity-check that we're actually overriding a method and not declaring a new one.) git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1595 632fc199-4ca6-4c93-a231-07263d6284db --- ChangeLog.txt | 4 + java/doc/org/libjpegturbo/turbojpeg/TJ.html | 42 +--- .../libjpegturbo/turbojpeg/TJCompressor.html | 14 +- .../turbojpeg/TJDecompressor.html | 42 +--- .../turbojpeg/TJScalingFactor.html | 5 +- .../libjpegturbo/turbojpeg/TJTransformer.html | 7 +- .../org/libjpegturbo/turbojpeg/YUVImage.html | 56 ++--- java/org/libjpegturbo/turbojpeg/TJ.java | 43 ++-- .../libjpegturbo/turbojpeg/TJCompressor.java | 84 +++---- .../turbojpeg/TJDecompressor.java | 96 ++++---- .../libjpegturbo/turbojpeg/TJLoader.java.in | 2 +- .../libjpegturbo/turbojpeg/TJLoader.java.tmpl | 2 +- .../turbojpeg/TJScalingFactor.java | 10 +- .../libjpegturbo/turbojpeg/TJTransformer.java | 10 +- java/org/libjpegturbo/turbojpeg/YUVImage.java | 62 ++--- turbojpeg-jni.c | 211 +++++++++--------- 16 files changed, 315 insertions(+), 375 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f0c804ef..e1069f5e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -15,6 +15,10 @@ to partially decode a JPEG image. See libjpeg.txt for more details. implement the Closeable interface, so those classes can be used with a try-with-resources statement. +[4] The TurboJPEG Java classes now throw unchecked idiomatic exceptions +(IllegalArgumentException, IllegalStateException) for unrecoverable errors +caused by incorrect API usage. + 1.4.1 ===== diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJ.html b/java/doc/org/libjpegturbo/turbojpeg/TJ.html index f8342f24..3ff9b89d 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJ.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJ.html @@ -983,16 +983,13 @@ public static final int FLAG_FORCESSE3
    • getMCUWidth

      -
      public static int getMCUWidth(int subsamp)
      -                       throws java.lang.Exception
      +
      public static int getMCUWidth(int subsamp)
      Returns the MCU block width for the given level of chrominance subsampling.
      Parameters:
      subsamp - the level of chrominance subsampling (one of SAMP_*)
      Returns:
      the MCU block width for the given level of chrominance - subsampling.
      -
      Throws:
      -
      java.lang.Exception
      + subsampling.
    @@ -1001,16 +998,13 @@ public static final int FLAG_FORCESSE3
    • getMCUHeight

      -
      public static int getMCUHeight(int subsamp)
      -                        throws java.lang.Exception
      +
      public static int getMCUHeight(int subsamp)
      Returns the MCU block height for the given level of chrominance subsampling.
      Parameters:
      subsamp - the level of chrominance subsampling (one of SAMP_*)
      Returns:
      the MCU block height for the given level of chrominance - subsampling.
      -
      Throws:
      -
      java.lang.Exception
      + subsampling.
    @@ -1019,13 +1013,10 @@ public static final int FLAG_FORCESSE3
    • getPixelSize

      -
      public static int getPixelSize(int pixelFormat)
      -                        throws java.lang.Exception
      +
      public static int getPixelSize(int pixelFormat)
      Returns the pixel size (in bytes) for the given pixel format.
      Parameters:
      pixelFormat - the pixel format (one of PF_*)
      -
      Returns:
      the pixel size (in bytes) for the given pixel format.
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the pixel size (in bytes) for the given pixel format.
    @@ -1034,17 +1025,14 @@ public static final int FLAG_FORCESSE3
    • getRedOffset

      -
      public static int getRedOffset(int pixelFormat)
      -                        throws java.lang.Exception
      +
      public static int getRedOffset(int pixelFormat)
      For the given pixel format, returns the number of bytes that the red component is offset from the start of the pixel. For instance, if a pixel of format TJ.PF_BGRX is stored in char pixel[], then the red component will be pixel[TJ.getRedOffset(TJ.PF_BGRX)].
      Parameters:
      pixelFormat - the pixel format (one of PF_*)
      -
      Returns:
      the red offset for the given pixel format.
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the red offset for the given pixel format.
    @@ -1053,17 +1041,14 @@ public static final int FLAG_FORCESSE3
    • getGreenOffset

      -
      public static int getGreenOffset(int pixelFormat)
      -                          throws java.lang.Exception
      +
      public static int getGreenOffset(int pixelFormat)
      For the given pixel format, returns the number of bytes that the green component is offset from the start of the pixel. For instance, if a pixel of format TJ.PF_BGRX is stored in char pixel[], then the green component will be pixel[TJ.getGreenOffset(TJ.PF_BGRX)].
      Parameters:
      pixelFormat - the pixel format (one of PF_*)
      -
      Returns:
      the green offset for the given pixel format.
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the green offset for the given pixel format.
    @@ -1072,17 +1057,14 @@ public static final int FLAG_FORCESSE3
    • getBlueOffset

      -
      public static int getBlueOffset(int pixelFormat)
      -                         throws java.lang.Exception
      +
      public static int getBlueOffset(int pixelFormat)
      For the given pixel format, returns the number of bytes that the blue component is offset from the start of the pixel. For instance, if a pixel of format TJ.PF_BGRX is stored in char pixel[], then the blue component will be pixel[TJ.getBlueOffset(TJ.PF_BGRX)].
      Parameters:
      pixelFormat - the pixel format (one of PF_*)
      -
      Returns:
      the blue offset for the given pixel format.
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the blue offset for the given pixel format.
    diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html index 88f56443..9fe4f995 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html @@ -563,8 +563,7 @@ public void setSourceImage(byte[] srcImage, @@ -593,13 +590,10 @@ public void setSourceImage(byte[] srcImage,
    • setJPEGQuality

      -
      public void setJPEGQuality(int quality)
      -                    throws java.lang.Exception
      +
      public void setJPEGQuality(int quality)
      Set the JPEG image quality level for subsequent compress operations.
      Parameters:
      quality - the new JPEG image quality level (1 to 100, 1 = worst, - 100 = best)
      -
      Throws:
      -
      java.lang.Exception
      + 100 = best)
    diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html index 73859d57..6cec2cc2 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html @@ -653,14 +653,11 @@ public void setJPEGImage(byte[] jpegImage,
    • getWidth

      -
      public int getWidth()
      -             throws java.lang.Exception
      +
      public int getWidth()
      Returns the width of the source image (JPEG or YUV) associated with this decompressor instance.
      Returns:
      the width of the source image (JPEG or YUV) associated with this - decompressor instance.
      -
      Throws:
      -
      java.lang.Exception
      + decompressor instance.
    @@ -669,14 +666,11 @@ public void setJPEGImage(byte[] jpegImage,
    • getHeight

      -
      public int getHeight()
      -              throws java.lang.Exception
      +
      public int getHeight()
      Returns the height of the source image (JPEG or YUV) associated with this decompressor instance.
      Returns:
      the height of the source image (JPEG or YUV) associated with this - decompressor instance.
      -
      Throws:
      -
      java.lang.Exception
      + decompressor instance.
    @@ -685,15 +679,12 @@ public void setJPEGImage(byte[] jpegImage, @@ -702,15 +693,12 @@ public void setJPEGImage(byte[] jpegImage, @@ -719,12 +707,9 @@ public void setJPEGImage(byte[] jpegImage,
    • getJPEGBuf

      -
      public byte[] getJPEGBuf()
      -                  throws java.lang.Exception
      +
      public byte[] getJPEGBuf()
      Returns the JPEG image buffer associated with this decompressor instance.
      -
      Returns:
      the JPEG image buffer associated with this decompressor instance.
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the JPEG image buffer associated with this decompressor instance.
    @@ -733,14 +718,11 @@ public void setJPEGImage(byte[] jpegImage,
    • getJPEGSize

      -
      public int getJPEGSize()
      -                throws java.lang.Exception
      +
      public int getJPEGSize()
      Returns the size of the JPEG image (in bytes) associated with this decompressor instance.
      Returns:
      the size of the JPEG image (in bytes) associated with this - decompressor instance.
      -
      Throws:
      -
      java.lang.Exception
      + decompressor instance.
    diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html b/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html index c28c00c0..d6be7271 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html @@ -192,10 +192,7 @@ extends java.lang.Object
  • TJScalingFactor

    public TJScalingFactor(int num,
    -               int denom)
    -                throws java.lang.Exception
    -
    Throws:
    -
    java.lang.Exception
    + int denom)
  • diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html index 8366afda..4d3a030c 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html @@ -341,14 +341,11 @@ extends
  • getTransformedSizes

    -
    public int[] getTransformedSizes()
    -                          throws java.lang.Exception
    +
    public int[] getTransformedSizes()
    Returns an array containing the sizes of the transformed JPEG images generated by the most recent transform operation.
    Returns:
    an array containing the sizes of the transformed JPEG images - generated by the most recent transform operation.
    -
    Throws:
    -
    java.lang.Exception
    + generated by the most recent transform operation.
  • diff --git a/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html b/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html index 0a3e0a51..3efa218f 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html +++ b/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html @@ -610,12 +610,9 @@ extends java.lang.Object
    • getWidth

      -
      public int getWidth()
      -             throws java.lang.Exception
      +
      public int getWidth()
      Returns the width of the YUV image (or subregion.)
      -
      Returns:
      the width of the YUV image (or subregion)
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the width of the YUV image (or subregion)
    @@ -624,12 +621,9 @@ extends java.lang.Object
    • getHeight

      -
      public int getHeight()
      -              throws java.lang.Exception
      +
      public int getHeight()
      Returns the height of the YUV image (or subregion.)
      -
      Returns:
      the height of the YUV image (or subregion)
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the height of the YUV image (or subregion)
    @@ -638,13 +632,10 @@ extends java.lang.Object
    • getPad

      -
      public int getPad()
      -           throws java.lang.Exception
      +
      public int getPad()
      Returns the line padding used in the YUV image buffer (if this image is stored in a unified buffer rather than separate image planes.)
      -
      Returns:
      the line padding used in the YUV image buffer
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the line padding used in the YUV image buffer
    @@ -653,12 +644,9 @@ extends java.lang.Object
    • getStrides

      -
      public int[] getStrides()
      -                 throws java.lang.Exception
      +
      public int[] getStrides()
      Returns the number of bytes per line of each plane in the YUV image.
      -
      Returns:
      the number of bytes per line of each plane in the YUV image
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the number of bytes per line of each plane in the YUV image
    @@ -667,14 +655,11 @@ extends java.lang.Object
    • getOffsets

      -
      public int[] getOffsets()
      -                 throws java.lang.Exception
      +
      public int[] getOffsets()
      Returns the offsets (in bytes) of each plane within the planes of a larger YUV image.
      Returns:
      the offsets (in bytes) of each plane within the planes of a larger - YUV image
      -
      Throws:
      -
      java.lang.Exception
      + YUV image
    @@ -683,13 +668,10 @@ extends java.lang.Object @@ -698,13 +680,10 @@ extends java.lang.Object
    • getPlanes

      -
      public byte[][] getPlanes()
      -                   throws java.lang.Exception
      +
      public byte[][] getPlanes()
      Returns the YUV image planes. If the image is stored in a unified buffer, then all image planes will point to that buffer.
      -
      Returns:
      the YUV image planes
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the YUV image planes
    @@ -713,13 +692,10 @@ extends java.lang.Object
    • getBuf

      -
      public byte[] getBuf()
      -              throws java.lang.Exception
      +
      public byte[] getBuf()
      Returns the YUV image buffer (if this image is stored in a unified buffer rather than separate image planes.)
      -
      Returns:
      the YUV image buffer
      -
      Throws:
      -
      java.lang.Exception
      +
      Returns:
      the YUV image buffer
    diff --git a/java/org/libjpegturbo/turbojpeg/TJ.java b/java/org/libjpegturbo/turbojpeg/TJ.java index 644a1978..5d355700 100644 --- a/java/org/libjpegturbo/turbojpeg/TJ.java +++ b/java/org/libjpegturbo/turbojpeg/TJ.java @@ -87,9 +87,8 @@ public final class TJ { * @return the MCU block width for the given level of chrominance * subsampling. */ - public static int getMCUWidth(int subsamp) throws Exception { - if (subsamp < 0 || subsamp >= NUMSAMP) - throw new Exception("Invalid subsampling type"); + public static int getMCUWidth(int subsamp) { + checkSubsampling(subsamp); return mcuWidth[subsamp]; } @@ -108,9 +107,8 @@ public final class TJ { * @return the MCU block height for the given level of chrominance * subsampling. */ - public static int getMCUHeight(int subsamp) throws Exception { - if (subsamp < 0 || subsamp >= NUMSAMP) - throw new Exception("Invalid subsampling type"); + public static int getMCUHeight(int subsamp) { + checkSubsampling(subsamp); return mcuHeight[subsamp]; } @@ -217,9 +215,8 @@ public final class TJ { * * @return the pixel size (in bytes) for the given pixel format. */ - public static int getPixelSize(int pixelFormat) throws Exception { - if (pixelFormat < 0 || pixelFormat >= NUMPF) - throw new Exception("Invalid pixel format"); + public static int getPixelSize(int pixelFormat) { + checkPixelFormat(pixelFormat); return pixelSize[pixelFormat]; } @@ -239,9 +236,8 @@ public final class TJ { * * @return the red offset for the given pixel format. */ - public static int getRedOffset(int pixelFormat) throws Exception { - if (pixelFormat < 0 || pixelFormat >= NUMPF) - throw new Exception("Invalid pixel format"); + public static int getRedOffset(int pixelFormat) { + checkPixelFormat(pixelFormat); return redOffset[pixelFormat]; } @@ -261,9 +257,8 @@ public final class TJ { * * @return the green offset for the given pixel format. */ - public static int getGreenOffset(int pixelFormat) throws Exception { - if (pixelFormat < 0 || pixelFormat >= NUMPF) - throw new Exception("Invalid pixel format"); + public static int getGreenOffset(int pixelFormat) { + checkPixelFormat(pixelFormat); return greenOffset[pixelFormat]; } @@ -283,9 +278,8 @@ public final class TJ { * * @return the blue offset for the given pixel format. */ - public static int getBlueOffset(int pixelFormat) throws Exception { - if (pixelFormat < 0 || pixelFormat >= NUMPF) - throw new Exception("Invalid pixel format"); + public static int getBlueOffset(int pixelFormat) { + checkPixelFormat(pixelFormat); return blueOffset[pixelFormat]; } @@ -511,4 +505,15 @@ public final class TJ { static { TJLoader.load(); } -}; + + private static void checkPixelFormat(int pixelFormat) { + if (pixelFormat < 0 || pixelFormat >= NUMPF) + throw new IllegalArgumentException("Invalid pixel format"); + } + + private static void checkSubsampling(int subsamp) { + if (subsamp < 0 || subsamp >= NUMSAMP) + throw new IllegalArgumentException("Invalid subsampling type"); + } + +} diff --git a/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/java/org/libjpegturbo/turbojpeg/TJCompressor.java index 37fd6047..b7df7212 100644 --- a/java/org/libjpegturbo/turbojpeg/TJCompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJCompressor.java @@ -144,7 +144,7 @@ public class TJCompressor implements Closeable { if (handle == 0) init(); if (srcImage == null || x < 0 || y < 0 || width < 1 || height < 1 || pitch < 0 || pixelFormat < 0 || pixelFormat >= TJ.NUMPF) - throw new Exception("Invalid argument in setSourceImage()"); + throw new IllegalArgumentException("Invalid argument in setSourceImage()"); srcBuf = srcImage; srcWidth = width; if (pitch == 0) @@ -195,13 +195,13 @@ public class TJCompressor implements Closeable { int height) throws Exception { if (handle == 0) init(); if (srcImage == null || x < 0 || y < 0 || width < 0 || height < 0) - throw new Exception("Invalid argument in setSourceImage()"); + throw new IllegalArgumentException("Invalid argument in setSourceImage()"); srcX = x; srcY = y; srcWidth = (width == 0) ? srcImage.getWidth(): width; srcHeight = (height == 0) ? srcImage.getHeight() : height; if (x + width > srcImage.getWidth() || y + height > srcImage.getHeight()) - throw new Exception("Compression region exceeds the bounds of the source image"); + throw new IllegalArgumentException("Compression region exceeds the bounds of the source image"); int pixelFormat; boolean intPixels = false; @@ -230,7 +230,7 @@ public class TJCompressor implements Closeable { pixelFormat = TJ.PF_BGRX; intPixels = true; break; default: - throw new Exception("Unsupported BufferedImage format"); + throw new IllegalArgumentException("Unsupported BufferedImage format"); } srcPixelFormat = pixelFormat; @@ -247,7 +247,7 @@ public class TJCompressor implements Closeable { (ComponentSampleModel)srcImage.getSampleModel(); int pixelSize = sm.getPixelStride(); if (pixelSize != TJ.getPixelSize(pixelFormat)) - throw new Exception("Inconsistency between pixel format and pixel size in BufferedImage"); + throw new IllegalArgumentException("Inconsistency between pixel format and pixel size in BufferedImage"); srcPitch = sm.getScanlineStride(); DataBufferByte db = (DataBufferByte)wr.getDataBuffer(); srcBuf = db.getData(); @@ -266,7 +266,7 @@ public class TJCompressor implements Closeable { public void setSourceImage(YUVImage srcImage) throws Exception { if (handle == 0) init(); if (srcImage == null) - throw new Exception("Invalid argument in setSourceImage()"); + throw new IllegalArgumentException("Invalid argument in setSourceImage()"); srcYUVImage = srcImage; srcBuf = null; srcBufInt = null; @@ -293,9 +293,9 @@ public class TJCompressor implements Closeable { * subsequent compress/encode oeprations (one of * {@link TJ#SAMP_444 TJ.SAMP_*}) */ - public void setSubsamp(int newSubsamp) throws Exception { + public void setSubsamp(int newSubsamp) { if (newSubsamp < 0 || newSubsamp >= TJ.NUMSAMP) - throw new Exception("Invalid argument in setSubsamp()"); + throw new IllegalArgumentException("Invalid argument in setSubsamp()"); subsamp = newSubsamp; } @@ -305,9 +305,9 @@ public class TJCompressor implements Closeable { * @param quality the new JPEG image quality level (1 to 100, 1 = worst, * 100 = best) */ - public void setJPEGQuality(int quality) throws Exception { + public void setJPEGQuality(int quality) { if (quality < 1 || quality > 100) - throw new Exception("Invalid argument in setJPEGQuality()"); + throw new IllegalArgumentException("Invalid argument in setJPEGQuality()"); jpegQuality = quality; } @@ -325,13 +325,13 @@ public class TJCompressor implements Closeable { */ public void compress(byte[] dstBuf, int flags) throws Exception { if (dstBuf == null || flags < 0) - throw new Exception("Invalid argument in compress()"); + throw new IllegalArgumentException("Invalid argument in compress()"); if (srcBuf == null && srcBufInt == null && srcYUVImage == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (jpegQuality < 0) - throw new Exception("JPEG Quality not set"); + throw new IllegalStateException("JPEG Quality not set"); if (subsamp < 0 && srcYUVImage == null) - throw new Exception("Subsampling level not set"); + throw new IllegalStateException("Subsampling level not set"); if (srcYUVImage != null) compressedSize = compressFromYUV(srcYUVImage.getPlanes(), @@ -374,8 +374,7 @@ public class TJCompressor implements Closeable { * #getCompressedSize} to obtain the size of the JPEG image. */ public byte[] compress(int flags) throws Exception { - if (srcWidth < 1 || srcHeight < 1) - throw new Exception(NO_ASSOC_ERROR); + checkSourceImage(); byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)]; compress(buf, flags); return buf; @@ -420,15 +419,14 @@ public class TJCompressor implements Closeable { */ public void encodeYUV(YUVImage dstImage, int flags) throws Exception { if (dstImage == null || flags < 0) - throw new Exception("Invalid argument in encodeYUV()"); + throw new IllegalArgumentException("Invalid argument in encodeYUV()"); if (srcBuf == null && srcBufInt == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (srcYUVImage != null) - throw new Exception("Source image is not correct type"); - if (subsamp < 0) - throw new Exception("Subsampling level not set"); + throw new IllegalStateException("Source image is not correct type"); + checkSubsampling(); if (srcWidth != dstImage.getWidth() || srcHeight != dstImage.getHeight()) - throw new Exception("Destination image is the wrong size"); + throw new IllegalStateException("Destination image is the wrong size"); if (srcBufInt != null) { encodeYUV(srcBufInt, srcX, srcY, srcWidth, srcStride, srcHeight, @@ -448,11 +446,9 @@ public class TJCompressor implements Closeable { @Deprecated public void encodeYUV(byte[] dstBuf, int flags) throws Exception { if(dstBuf == null) - throw new Exception("Invalid argument in encodeYUV()"); - if (srcWidth < 1 || srcHeight < 1) - throw new Exception(NO_ASSOC_ERROR); - if (subsamp < 0) - throw new Exception("Subsampling level not set"); + throw new IllegalArgumentException("Invalid argument in encodeYUV()"); + checkSourceImage(); + checkSubsampling(); YUVImage yuvImage = new YUVImage(dstBuf, srcWidth, 4, srcHeight, subsamp); encodeYUV(yuvImage, flags); } @@ -475,12 +471,10 @@ public class TJCompressor implements Closeable { * @return a YUV planar image. */ public YUVImage encodeYUV(int pad, int flags) throws Exception { - if (srcWidth < 1 || srcHeight < 1) - throw new Exception(NO_ASSOC_ERROR); - if (subsamp < 0) - throw new Exception("Subsampling level not set"); + checkSourceImage(); + checkSubsampling(); if(pad < 1 || ((pad & (pad - 1)) != 0)) - throw new Exception("Invalid argument in encodeYUV()"); + throw new IllegalStateException("Invalid argument in encodeYUV()"); YUVImage yuvImage = new YUVImage(srcWidth, pad, srcHeight, subsamp); encodeYUV(yuvImage, flags); return yuvImage; @@ -508,10 +502,8 @@ public class TJCompressor implements Closeable { * @return a YUV planar image. */ public YUVImage encodeYUV(int[] strides, int flags) throws Exception { - if (srcWidth < 1 || srcHeight < 1) - throw new Exception(NO_ASSOC_ERROR); - if (subsamp < 0) - throw new Exception("Subsampling level not set"); + checkSourceImage(); + checkSubsampling(); YUVImage yuvImage = new YUVImage(srcWidth, strides, srcHeight, subsamp); encodeYUV(yuvImage, flags); return yuvImage; @@ -522,10 +514,8 @@ public class TJCompressor implements Closeable { */ @Deprecated public byte[] encodeYUV(int flags) throws Exception { - if (srcWidth < 1 || srcHeight < 1) - throw new Exception(NO_ASSOC_ERROR); - if (subsamp < 0) - throw new Exception("Subsampling level not set"); + checkSourceImage(); + checkSubsampling(); YUVImage yuvImage = new YUVImage(srcWidth, 4, srcHeight, subsamp); encodeYUV(yuvImage, flags); return yuvImage.getBuf(); @@ -568,11 +558,13 @@ public class TJCompressor implements Closeable { /** * Free the native structures associated with this compressor instance. */ + @Override public void close() throws IOException { if (handle != 0) destroy(); } + @Override protected void finalize() throws Throwable { try { close(); @@ -630,6 +622,16 @@ public class TJCompressor implements Closeable { TJLoader.load(); } + private void checkSourceImage() { + if (srcWidth < 1 || srcHeight < 1) + throw new IllegalStateException(NO_ASSOC_ERROR); + } + + private void checkSubsampling() { + if (subsamp < 0) + throw new IllegalStateException("Subsampling level not set"); + } + private long handle = 0; private byte[] srcBuf = null; private int[] srcBufInt = null; @@ -646,4 +648,4 @@ public class TJCompressor implements Closeable { private int compressedSize = 0; private int yuvPad = 4; private ByteOrder byteOrder = null; -}; +} diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java index 70022479..7ca656b3 100644 --- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java @@ -98,7 +98,7 @@ public class TJDecompressor implements Closeable { public void setSourceImage(byte[] jpegImage, int imageSize) throws Exception { if (jpegImage == null || imageSize < 1) - throw new Exception("Invalid argument in setSourceImage()"); + throw new IllegalArgumentException("Invalid argument in setSourceImage()"); jpegBuf = jpegImage; jpegBufSize = imageSize; decompressHeader(jpegBuf, jpegBufSize); @@ -123,7 +123,7 @@ public class TJDecompressor implements Closeable { */ public void setSourceImage(YUVImage srcImage) throws Exception { if (srcImage == null) - throw new Exception("Invalid argument in setSourceImage()"); + throw new IllegalArgumentException("Invalid argument in setSourceImage()"); yuvImage = srcImage; jpegBuf = null; jpegBufSize = 0; @@ -137,11 +137,11 @@ public class TJDecompressor implements Closeable { * @return the width of the source image (JPEG or YUV) associated with this * decompressor instance. */ - public int getWidth() throws Exception { + public int getWidth() { if (yuvImage != null) return yuvImage.getWidth(); if (jpegWidth < 1) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return jpegWidth; } @@ -152,11 +152,11 @@ public class TJDecompressor implements Closeable { * @return the height of the source image (JPEG or YUV) associated with this * decompressor instance. */ - public int getHeight() throws Exception { + public int getHeight() { if (yuvImage != null) return yuvImage.getHeight(); if (jpegHeight < 1) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return jpegHeight; } @@ -168,13 +168,13 @@ public class TJDecompressor implements Closeable { * @return the level of chrominance subsampling used in the source image * (JPEG or YUV) associated with this decompressor instance. */ - public int getSubsamp() throws Exception { + public int getSubsamp() { if (yuvImage != null) return yuvImage.getSubsamp(); if (jpegSubsamp < 0) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (jpegSubsamp >= TJ.NUMSAMP) - throw new Exception("JPEG header information is invalid"); + throw new IllegalStateException("JPEG header information is invalid"); return jpegSubsamp; } @@ -186,13 +186,13 @@ public class TJDecompressor implements Closeable { * @return the colorspace used in the source image (JPEG or YUV) associated * with this decompressor instance. */ - public int getColorspace() throws Exception { + public int getColorspace() { if (yuvImage != null) return TJ.CS_YCbCr; if (jpegColorspace < 0) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (jpegColorspace >= TJ.NUMCS) - throw new Exception("JPEG header information is invalid"); + throw new IllegalStateException("JPEG header information is invalid"); return jpegColorspace; } @@ -201,9 +201,9 @@ public class TJDecompressor implements Closeable { * * @return the JPEG image buffer associated with this decompressor instance. */ - public byte[] getJPEGBuf() throws Exception { + public byte[] getJPEGBuf() { if (jpegBuf == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return jpegBuf; } @@ -214,9 +214,9 @@ public class TJDecompressor implements Closeable { * @return the size of the JPEG image (in bytes) associated with this * decompressor instance. */ - public int getJPEGSize() throws Exception { + public int getJPEGSize() { if (jpegBufSize < 1) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return jpegBufSize; } @@ -242,9 +242,9 @@ public class TJDecompressor implements Closeable { public int getScaledWidth(int desiredWidth, int desiredHeight) throws Exception { if (jpegWidth < 1 || jpegHeight < 1) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (desiredWidth < 0 || desiredHeight < 0) - throw new Exception("Invalid argument in getScaledWidth()"); + throw new IllegalArgumentException("Invalid argument in getScaledWidth()"); TJScalingFactor[] sf = TJ.getScalingFactors(); if (desiredWidth == 0) desiredWidth = jpegWidth; @@ -258,7 +258,7 @@ public class TJDecompressor implements Closeable { break; } if (scaledWidth > desiredWidth || scaledHeight > desiredHeight) - throw new Exception("Could not scale down to desired image dimensions"); + throw new IllegalArgumentException("Could not scale down to desired image dimensions"); return scaledWidth; } @@ -284,9 +284,9 @@ public class TJDecompressor implements Closeable { public int getScaledHeight(int desiredWidth, int desiredHeight) throws Exception { if (jpegWidth < 1 || jpegHeight < 1) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (desiredWidth < 0 || desiredHeight < 0) - throw new Exception("Invalid argument in getScaledHeight()"); + throw new IllegalArgumentException("Invalid argument in getScaledHeight()"); TJScalingFactor[] sf = TJ.getScalingFactors(); if (desiredWidth == 0) desiredWidth = jpegWidth; @@ -300,7 +300,7 @@ public class TJDecompressor implements Closeable { break; } if (scaledWidth > desiredWidth || scaledHeight > desiredHeight) - throw new Exception("Could not scale down to desired image dimensions"); + throw new IllegalArgumentException("Could not scale down to desired image dimensions"); return scaledHeight; } @@ -372,11 +372,11 @@ public class TJDecompressor implements Closeable { int pitch, int desiredHeight, int pixelFormat, int flags) throws Exception { if (jpegBuf == null && yuvImage == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (dstBuf == null || x < 0 || y < 0 || pitch < 0 || (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) || pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0) - throw new Exception("Invalid argument in decompress()"); + throw new IllegalArgumentException("Invalid argument in decompress()"); if (yuvImage != null) decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(), yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y, @@ -433,7 +433,7 @@ public class TJDecompressor implements Closeable { if (pitch < 0 || (yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) || pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0) - throw new Exception("Invalid argument in decompress()"); + throw new IllegalArgumentException("Invalid argument in decompress()"); int pixelSize = TJ.getPixelSize(pixelFormat); int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); @@ -464,18 +464,18 @@ public class TJDecompressor implements Closeable { */ public void decompressToYUV(YUVImage dstImage, int flags) throws Exception { if (jpegBuf == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (dstImage == null || flags < 0) - throw new Exception("Invalid argument in decompressToYUV()"); + throw new IllegalArgumentException("Invalid argument in decompressToYUV()"); int scaledWidth = getScaledWidth(dstImage.getWidth(), dstImage.getHeight()); int scaledHeight = getScaledHeight(dstImage.getWidth(), dstImage.getHeight()); if (scaledWidth != dstImage.getWidth() || scaledHeight != dstImage.getHeight()) - throw new Exception("YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating."); + throw new IllegalArgumentException("YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating."); if (jpegSubsamp != dstImage.getSubsamp()) - throw new Exception("YUVImage subsampling level does not match that of the JPEG image"); + throw new IllegalArgumentException("YUVImage subsampling level does not match that of the JPEG image"); decompressToYUV(jpegBuf, jpegBufSize, dstImage.getPlanes(), dstImage.getOffsets(), dstImage.getWidth(), @@ -534,13 +534,13 @@ public class TJDecompressor implements Closeable { int desiredHeight, int flags) throws Exception { if (flags < 0) - throw new Exception("Invalid argument in decompressToYUV()"); + throw new IllegalArgumentException("Invalid argument in decompressToYUV()"); if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (jpegSubsamp >= TJ.NUMSAMP) - throw new Exception("JPEG header information is invalid"); + throw new IllegalStateException("JPEG header information is invalid"); if (yuvImage != null) - throw new Exception("Source image is the wrong type"); + throw new IllegalStateException("Source image is the wrong type"); int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); @@ -587,13 +587,13 @@ public class TJDecompressor implements Closeable { public YUVImage decompressToYUV(int desiredWidth, int pad, int desiredHeight, int flags) throws Exception { if (flags < 0) - throw new Exception("Invalid argument in decompressToYUV()"); + throw new IllegalArgumentException("Invalid argument in decompressToYUV()"); if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (jpegSubsamp >= TJ.NUMSAMP) - throw new Exception("JPEG header information is invalid"); + throw new IllegalStateException("JPEG header information is invalid"); if (yuvImage != null) - throw new Exception("Source image is the wrong type"); + throw new IllegalStateException("Source image is the wrong type"); int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); @@ -679,11 +679,11 @@ public class TJDecompressor implements Closeable { int stride, int desiredHeight, int pixelFormat, int flags) throws Exception { if (jpegBuf == null && yuvImage == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (dstBuf == null || x < 0 || y < 0 || stride < 0 || (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) || pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0) - throw new Exception("Invalid argument in decompress()"); + throw new IllegalArgumentException("Invalid argument in decompress()"); if (yuvImage != null) decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(), yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y, @@ -712,7 +712,7 @@ public class TJDecompressor implements Closeable { */ public void decompress(BufferedImage dstImage, int flags) throws Exception { if (dstImage == null || flags < 0) - throw new Exception("Invalid argument in decompress()"); + throw new IllegalArgumentException("Invalid argument in decompress()"); int desiredWidth = dstImage.getWidth(); int desiredHeight = dstImage.getHeight(); int scaledWidth, scaledHeight; @@ -720,14 +720,14 @@ public class TJDecompressor implements Closeable { if (yuvImage != null) { if (desiredWidth != yuvImage.getWidth() || desiredHeight != yuvImage.getHeight()) - throw new Exception("BufferedImage dimensions do not match the dimensions of the source image."); + throw new IllegalArgumentException("BufferedImage dimensions do not match the dimensions of the source image."); scaledWidth = yuvImage.getWidth(); scaledHeight = yuvImage.getHeight(); } else { scaledWidth = getScaledWidth(desiredWidth, desiredHeight); scaledHeight = getScaledHeight(desiredWidth, desiredHeight); if (scaledWidth != desiredWidth || scaledHeight != desiredHeight) - throw new Exception("BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating."); + throw new IllegalArgumentException("BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating."); } int pixelFormat; boolean intPixels = false; if (byteOrder == null) @@ -760,7 +760,7 @@ public class TJDecompressor implements Closeable { pixelFormat = TJ.PF_BGRA; intPixels = true; break; default: - throw new Exception("Unsupported BufferedImage format"); + throw new IllegalArgumentException("Unsupported BufferedImage format"); } WritableRaster wr = dstImage.getRaster(); if (intPixels) { @@ -776,7 +776,7 @@ public class TJDecompressor implements Closeable { pixelFormat, flags); else { if (jpegBuf == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); decompress(jpegBuf, jpegBufSize, buf, 0, 0, scaledWidth, stride, scaledHeight, pixelFormat, flags); } @@ -785,7 +785,7 @@ public class TJDecompressor implements Closeable { (ComponentSampleModel)dstImage.getSampleModel(); int pixelSize = sm.getPixelStride(); if (pixelSize != TJ.getPixelSize(pixelFormat)) - throw new Exception("Inconsistency between pixel format and pixel size in BufferedImage"); + throw new IllegalArgumentException("Inconsistency between pixel format and pixel size in BufferedImage"); int pitch = sm.getScanlineStride(); DataBufferByte db = (DataBufferByte)wr.getDataBuffer(); byte[] buf = db.getData(); @@ -822,7 +822,7 @@ public class TJDecompressor implements Closeable { throws Exception { if ((yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) || flags < 0) - throw new Exception("Invalid argument in decompress()"); + throw new IllegalArgumentException("Invalid argument in decompress()"); int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); BufferedImage img = new BufferedImage(scaledWidth, scaledHeight, @@ -834,11 +834,13 @@ public class TJDecompressor implements Closeable { /** * Free the native structures associated with this decompressor instance. */ + @Override public void close() throws IOException { if (handle != 0) destroy(); } + @Override protected void finalize() throws Throwable { try { close(); @@ -899,4 +901,4 @@ public class TJDecompressor implements Closeable { protected int jpegSubsamp = -1; protected int jpegColorspace = -1; private ByteOrder byteOrder = null; -}; +} diff --git a/java/org/libjpegturbo/turbojpeg/TJLoader.java.in b/java/org/libjpegturbo/turbojpeg/TJLoader.java.in index 22353a5d..83977806 100644 --- a/java/org/libjpegturbo/turbojpeg/TJLoader.java.in +++ b/java/org/libjpegturbo/turbojpeg/TJLoader.java.in @@ -32,4 +32,4 @@ final class TJLoader { static void load() { System.loadLibrary("@TURBOJPEG_DLL_NAME@"); } -}; +} diff --git a/java/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl b/java/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl index a4f1c876..5ef31182 100644 --- a/java/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl +++ b/java/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl @@ -56,4 +56,4 @@ final class TJLoader { } } } -}; +} diff --git a/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java b/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java index e00fdf7d..069d15a6 100644 --- a/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java +++ b/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java @@ -33,9 +33,9 @@ package org.libjpegturbo.turbojpeg; */ public class TJScalingFactor { - public TJScalingFactor(int num, int denom) throws Exception { + public TJScalingFactor(int num, int denom) { if (num < 1 || denom < 1) - throw new Exception("Numerator and denominator must be >= 1"); + throw new IllegalArgumentException("Numerator and denominator must be >= 1"); this.num = num; this.denom = denom; } @@ -77,7 +77,7 @@ public class TJScalingFactor { * other have the same numerator and denominator. */ public boolean equals(TJScalingFactor other) { - return (this.num == other.num && this.denom == other.denom); + return this.num == other.num && this.denom == other.denom; } /** @@ -88,7 +88,7 @@ public class TJScalingFactor { * 1/1. */ public boolean isOne() { - return (num == 1 && denom == 1); + return num == 1 && denom == 1; } /** @@ -100,4 +100,4 @@ public class TJScalingFactor { * Denominator */ private int denom = 1; -}; +} diff --git a/java/org/libjpegturbo/turbojpeg/TJTransformer.java b/java/org/libjpegturbo/turbojpeg/TJTransformer.java index 2e173445..6d3d81d3 100644 --- a/java/org/libjpegturbo/turbojpeg/TJTransformer.java +++ b/java/org/libjpegturbo/turbojpeg/TJTransformer.java @@ -96,7 +96,7 @@ public class TJTransformer extends TJDecompressor { public void transform(byte[][] dstBufs, TJTransform[] transforms, int flags) throws Exception { if (jpegBuf == null) - throw new Exception("JPEG buffer not initialized"); + throw new IllegalStateException("JPEG buffer not initialized"); transformedSizes = transform(jpegBuf, jpegBufSize, dstBufs, transforms, flags); } @@ -120,7 +120,7 @@ public class TJTransformer extends TJDecompressor { throws Exception { byte[][] dstBufs = new byte[transforms.length][]; if (jpegWidth < 1 || jpegHeight < 1) - throw new Exception("JPEG buffer not initialized"); + throw new IllegalStateException("JPEG buffer not initialized"); for (int i = 0; i < transforms.length; i++) { int w = jpegWidth, h = jpegHeight; if ((transforms[i].options & TJTransform.OPT_CROP) != 0) { @@ -143,9 +143,9 @@ public class TJTransformer extends TJDecompressor { * @return an array containing the sizes of the transformed JPEG images * generated by the most recent transform operation. */ - public int[] getTransformedSizes() throws Exception { + public int[] getTransformedSizes() { if (transformedSizes == null) - throw new Exception("No image has been transformed yet"); + throw new IllegalStateException("No image has been transformed yet"); return transformedSizes; } @@ -159,4 +159,4 @@ public class TJTransformer extends TJDecompressor { } private int[] transformedSizes = null; -}; +} diff --git a/java/org/libjpegturbo/turbojpeg/YUVImage.java b/java/org/libjpegturbo/turbojpeg/YUVImage.java index 2d790e93..44a81c70 100644 --- a/java/org/libjpegturbo/turbojpeg/YUVImage.java +++ b/java/org/libjpegturbo/turbojpeg/YUVImage.java @@ -218,12 +218,12 @@ public class YUVImage { int height, int subsamp, boolean alloc) throws Exception { if ((planes == null && !alloc) || width < 1 || height < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP) - throw new Exception("Invalid argument in YUVImage::setBuf()"); + throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()"); int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3); if (planes.length != nc || (offsets != null && offsets.length != nc) || (strides != null && strides.length != nc)) - throw new Exception("YUVImage::setBuf(): planes, offsets, or strides array is the wrong size"); + throw new IllegalArgumentException("YUVImage::setBuf(): planes, offsets, or strides array is the wrong size"); if (offsets == null) offsets = new int[nc]; @@ -239,15 +239,15 @@ public class YUVImage { strides[i] = pw; if (alloc) { if (strides[i] < pw) - throw new Exception("Stride must be >= plane width when allocating a new YUV image"); + throw new IllegalArgumentException("Stride must be >= plane width when allocating a new YUV image"); planes[i] = new byte[strides[i] * ph]; } if (planes[i] == null || offsets[i] < 0) - throw new Exception("Invalid argument in YUVImage::setBuf()"); + throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()"); if (strides[i] < 0 && offsets[i] - planeSize + pw < 0) - throw new Exception("Stride for plane " + i + " would cause memory to be accessed below plane boundary"); + throw new IllegalArgumentException("Stride for plane " + i + " would cause memory to be accessed below plane boundary"); if (planes[i].length < offsets[i] + planeSize) - throw new Exception("Image plane " + i + " is not large enough"); + throw new IllegalArgumentException("Image plane " + i + " is not large enough"); } yuvPlanes = planes; @@ -282,10 +282,10 @@ public class YUVImage { int subsamp) throws Exception { if (yuvImage == null || width < 1 || pad < 1 || ((pad & (pad - 1)) != 0) || height < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP) - throw new Exception("Invalid argument in YUVImage::setBuf()"); + throw new IllegalArgumentException("Invalid argument in YUVImage::setBuf()"); if (yuvImage.length < TJ.bufSizeYUV(width, pad, height, subsamp)) - throw new Exception("YUV image buffer is not large enough"); - + throw new IllegalArgumentException("YUV image buffer is not large enough"); + int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3); byte[][] planes = new byte[nc][]; int[] strides = new int[nc]; @@ -311,9 +311,9 @@ public class YUVImage { * * @return the width of the YUV image (or subregion) */ - public int getWidth() throws Exception { + public int getWidth() { if (yuvWidth < 1) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return yuvWidth; } @@ -322,9 +322,9 @@ public class YUVImage { * * @return the height of the YUV image (or subregion) */ - public int getHeight() throws Exception { + public int getHeight() { if (yuvHeight < 1) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return yuvHeight; } @@ -334,11 +334,11 @@ public class YUVImage { * * @return the line padding used in the YUV image buffer */ - public int getPad() throws Exception { + public int getPad() { if (yuvPlanes == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); if (yuvPad < 1 || ((yuvPad & (yuvPad - 1)) != 0)) - throw new Exception("Image is not stored in a unified buffer"); + throw new IllegalStateException("Image is not stored in a unified buffer"); return yuvPad; } @@ -347,9 +347,9 @@ public class YUVImage { * * @return the number of bytes per line of each plane in the YUV image */ - public int[] getStrides() throws Exception { + public int[] getStrides() { if (yuvStrides == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return yuvStrides; } @@ -360,9 +360,9 @@ public class YUVImage { * @return the offsets (in bytes) of each plane within the planes of a larger * YUV image */ - public int[] getOffsets() throws Exception { + public int[] getOffsets() { if (yuvOffsets == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return yuvOffsets; } @@ -372,9 +372,9 @@ public class YUVImage { * * @return the level of chrominance subsampling used in the YUV image */ - public int getSubsamp() throws Exception { + public int getSubsamp() { if (yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return yuvSubsamp; } @@ -384,9 +384,9 @@ public class YUVImage { * * @return the YUV image planes */ - public byte[][] getPlanes() throws Exception { + public byte[][] getPlanes() { if (yuvPlanes == null) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); return yuvPlanes; } @@ -396,13 +396,13 @@ public class YUVImage { * * @return the YUV image buffer */ - public byte[] getBuf() throws Exception { + public byte[] getBuf() { if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3); for (int i = 1; i < nc; i++) { if (yuvPlanes[i] != yuvPlanes[0]) - throw new Exception("Image is not stored in a unified buffer"); + throw new IllegalStateException("Image is not stored in a unified buffer"); } return yuvPlanes[0]; } @@ -415,13 +415,13 @@ public class YUVImage { */ public int getSize() throws Exception { if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP) - throw new Exception(NO_ASSOC_ERROR); + throw new IllegalStateException(NO_ASSOC_ERROR); int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3); if (yuvPad < 1) - throw new Exception("Image is not stored in a unified buffer"); + throw new IllegalStateException("Image is not stored in a unified buffer"); for (int i = 1; i < nc; i++) { if (yuvPlanes[i] != yuvPlanes[0]) - throw new Exception("Image is not stored in a unified buffer"); + throw new IllegalStateException("Image is not stored in a unified buffer"); } return TJ.bufSizeYUV(yuvWidth, yuvPad, yuvHeight, yuvSubsamp); } @@ -438,4 +438,4 @@ public class YUVImage { protected int yuvWidth = 0; protected int yuvHeight = 0; protected int yuvSubsamp = -1; -}; +} diff --git a/turbojpeg-jni.c b/turbojpeg-jni.c index 04e2dc3a..0d0b80c5 100644 --- a/turbojpeg-jni.c +++ b/turbojpeg-jni.c @@ -39,30 +39,29 @@ #define PAD(v, p) ((v+(p)-1)&(~((p)-1))) -#define _throw(msg) { \ - jclass _exccls=(*env)->FindClass(env, "java/lang/Exception"); \ - if(!_exccls) goto bailout; \ +#define _throw(msg, exceptionClass) { \ + jclass _exccls=(*env)->FindClass(env, exceptionClass); \ + if(!_exccls || (*env)->ExceptionCheck(env)) goto bailout; \ (*env)->ThrowNew(env, _exccls, msg); \ goto bailout; \ } -#define _throwio(msg) { \ - jclass _exccls=(*env)->FindClass(env, "java/io/IOException"); \ - if(!_exccls) goto bailout; \ - (*env)->ThrowNew(env, _exccls, msg); \ - goto bailout; \ -} +#define _throwio(msg) _throw(msg, "java/io/IOException") -#define bailif0(f) {if(!(f)) { \ - char temps[80]; \ - snprintf(temps, 80, "Unexpected NULL condition in line %d", __LINE__); \ - _throw(temps); \ +#define _throwtj() _throw(tjGetErrorStr(), "java/lang/Exception") + +#define _throwarg(msg) _throw(msg, "java/lang/IllegalArgumentException") + +#define _throwmem() _throw("Memory allocation failure", "java/lang/OutOfMemoryError"); + +#define bailif0(f) {if(!(f) || (*env)->ExceptionCheck(env)) { \ + goto bailout; \ }} #define gethandle() \ jclass _cls=(*env)->GetObjectClass(env, obj); \ jfieldID _fid; \ - if(!_cls) goto bailout; \ + if(!_cls || (*env)->ExceptionCheck(env)) goto bailout; \ bailif0(_fid=(*env)->GetFieldID(env, _cls, "handle", "J")); \ handle=(tjhandle)(size_t)(*env)->GetLongField(env, obj, _fid); \ @@ -108,7 +107,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSize (JNIEnv *env, jclass cls, jint width, jint height, jint jpegSubsamp) { jint retval=(jint)tjBufSize(width, height, jpegSubsamp); - if(retval==-1) _throw(tjGetErrorStr()); + if(retval==-1) _throwtj(); bailout: return retval; @@ -119,7 +118,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII (JNIEnv *env, jclass cls, jint width, jint pad, jint height, jint subsamp) { jint retval=(jint)tjBufSizeYUV2(width, pad, height, subsamp); - if(retval==-1) _throw(tjGetErrorStr()); + if(retval==-1) _throwtj(); bailout: return retval; @@ -140,7 +139,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII { jint retval=(jint)tjPlaneSizeYUV(componentID, width, stride, height, subsamp); - if(retval==-1) _throw(tjGetErrorStr()); + if(retval==-1) _throwtj(); bailout: return retval; @@ -151,7 +150,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeWidth__III (JNIEnv *env, jclass cls, jint componentID, jint width, jint subsamp) { jint retval=(jint)tjPlaneWidth(componentID, width, subsamp); - if(retval==-1) _throw(tjGetErrorStr()); + if(retval==-1) _throwtj(); bailout: return retval; @@ -162,7 +161,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeHeight__III (JNIEnv *env, jclass cls, jint componentID, jint height, jint subsamp) { jint retval=(jint)tjPlaneHeight(componentID, height, subsamp); - if(retval==-1) _throw(tjGetErrorStr()); + if(retval==-1) _throwtj(); bailout: return retval; @@ -177,7 +176,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_init tjhandle handle; if((handle=tjInitCompress())==NULL) - _throw(tjGetErrorStr()); + _throwtj(); bailif0(cls=(*env)->GetObjectClass(env, obj)); bailif0(fid=(*env)->GetFieldID(env, cls, "handle", "J")); @@ -201,17 +200,17 @@ static jint TJCompressor_compress if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1 || pitch<0) - _throw("Invalid argument in compress()"); + _throwarg("Invalid argument in compress()"); if(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF) - _throw("Mismatch between Java and C API"); + _throwarg("Mismatch between Java and C API"); actualPitch=(pitch==0)? width*tjPixelSize[pf]:pitch; arraySize=(y+height-1)*actualPitch + (x+width)*tjPixelSize[pf]; if((*env)->GetArrayLength(env, src)*srcElementSizeGetArrayLength(env, dst)<(jsize)jpegSize) - _throw("Destination buffer is not large enough"); + _throwarg("Destination buffer is not large enough"); bailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0)); bailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0)); @@ -221,7 +220,7 @@ static jint TJCompressor_compress if(tjCompress2(handle, &srcBuf[y*actualPitch + x*tjPixelSize[pf]], width, pitch, height, pf, &jpegBuf, &jpegSize, jpegSubsamp, jpegQual, flags|TJFLAG_NOREALLOC)==-1) - _throw(tjGetErrorStr()); + _throwtj(); bailout: if(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0); @@ -256,9 +255,9 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3 jint jpegQual, jint flags) { if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF) - _throw("Invalid argument in compress()"); + _throwarg("Invalid argument in compress()"); if(tjPixelSize[pf]!=sizeof(jint)) - _throw("Pixel format must be 32-bit when compressing from an integer buffer."); + _throwarg("Pixel format must be 32-bit when compressing from an integer buffer."); return TJCompressor_compress(env, obj, src, sizeof(jint), x, y, width, stride*sizeof(jint), height, pf, dst, jpegSubsamp, jpegQual, flags); @@ -274,9 +273,9 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3 jint flags) { if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF) - _throw("Invalid argument in compress()"); + _throwarg("Invalid argument in compress()"); if(tjPixelSize[pf]!=sizeof(jint)) - _throw("Pixel format must be 32-bit when compressing from an integer buffer."); + _throwarg("Pixel format must be 32-bit when compressing from an integer buffer."); return TJCompressor_compress(env, obj, src, sizeof(jint), 0, 0, width, stride*sizeof(jint), height, pf, dst, jpegSubsamp, jpegQual, flags); @@ -301,20 +300,20 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFrom gethandle(); if(subsamp<0 || subsamp>=org_libjpegturbo_turbojpeg_TJ_NUMSAMP) - _throw("Invalid argument in compressFromYUV()"); + _throwarg("Invalid argument in compressFromYUV()"); if(org_libjpegturbo_turbojpeg_TJ_NUMSAMP!=TJ_NUMSAMP) - _throw("Mismatch between Java and C API"); + _throwarg("Mismatch between Java and C API"); if((*env)->GetArrayLength(env, srcobjs)GetArrayLength(env, jSrcOffsets)GetArrayLength(env, jSrcStrides)GetArrayLength(env, dst)<(jsize)jpegSize) - _throw("Destination buffer is not large enough"); + _throwarg("Destination buffer is not large enough"); bailif0(srcOffsets=(*env)->GetPrimitiveArrayCritical(env, jSrcOffsets, 0)); bailif0(srcStrides=(*env)->GetPrimitiveArrayCritical(env, jSrcStrides, 0)); @@ -324,16 +323,16 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFrom int pw=tjPlaneWidth(i, width, subsamp); if(planeSize<0 || pw<0) - _throw(tjGetErrorStr()); + _throwtj(); if(srcOffsets[i]<0) - _throw("Invalid argument in compressFromYUV()"); + _throwarg("Invalid argument in compressFromYUV()"); if(srcStrides[i]<0 && srcOffsets[i]-planeSize+pw<0) - _throw("Negative plane stride would cause memory to be accessed below plane boundary"); + _throwarg("Negative plane stride would cause memory to be accessed below plane boundary"); bailif0(jSrcPlanes[i]=(*env)->GetObjectArrayElement(env, srcobjs, i)); if((*env)->GetArrayLength(env, jSrcPlanes[i])GetPrimitiveArrayCritical(env, jSrcPlanes[i], 0)); @@ -345,7 +344,7 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFrom if(tjCompressFromYUVPlanes(handle, srcPlanes, width, srcStrides, height, subsamp, &jpegBuf, &jpegSize, jpegQual, flags|TJFLAG_NOREALLOC)==-1) - _throw(tjGetErrorStr()); + _throwtj(); bailout: if(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0); @@ -378,22 +377,22 @@ static void TJCompressor_encodeYUV if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1 || pitch<0 || subsamp<0 || subsamp>=org_libjpegturbo_turbojpeg_TJ_NUMSAMP) - _throw("Invalid argument in encodeYUV()"); + _throwarg("Invalid argument in encodeYUV()"); if(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF || org_libjpegturbo_turbojpeg_TJ_NUMSAMP!=TJ_NUMSAMP) - _throw("Mismatch between Java and C API"); + _throwarg("Mismatch between Java and C API"); if((*env)->GetArrayLength(env, dstobjs)GetArrayLength(env, jDstOffsets)GetArrayLength(env, jDstStrides)GetArrayLength(env, src)*srcElementSizeGetPrimitiveArrayCritical(env, jDstOffsets, 0)); bailif0(dstStrides=(*env)->GetPrimitiveArrayCritical(env, jDstStrides, 0)); @@ -403,16 +402,16 @@ static void TJCompressor_encodeYUV int pw=tjPlaneWidth(i, width, subsamp); if(planeSize<0 || pw<0) - _throw(tjGetErrorStr()); + _throwtj(); if(dstOffsets[i]<0) - _throw("Invalid argument in encodeYUV()"); + _throwarg("Invalid argument in encodeYUV()"); if(dstStrides[i]<0 && dstOffsets[i]-planeSize+pw<0) - _throw("Negative plane stride would cause memory to be accessed below plane boundary"); + _throwarg("Negative plane stride would cause memory to be accessed below plane boundary"); bailif0(jDstPlanes[i]=(*env)->GetObjectArrayElement(env, dstobjs, i)); if((*env)->GetArrayLength(env, jDstPlanes[i])GetPrimitiveArrayCritical(env, jDstPlanes[i], 0)); @@ -422,7 +421,7 @@ static void TJCompressor_encodeYUV if(tjEncodeYUVPlanes(handle, &srcBuf[y*actualPitch + x*tjPixelSize[pf]], width, pitch, height, pf, dstPlanes, dstStrides, subsamp, flags)==-1) - _throw(tjGetErrorStr()); + _throwtj(); bailout: if(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0); @@ -456,9 +455,9 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___ jintArray jDstOffsets, jintArray jDstStrides, jint subsamp, jint flags) { if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF) - _throw("Invalid argument in encodeYUV()"); + _throwarg("Invalid argument in encodeYUV()"); if(tjPixelSize[pf]!=sizeof(jint)) - _throw("Pixel format must be 32-bit when encoding from an integer buffer."); + _throwarg("Pixel format must be 32-bit when encoding from an integer buffer."); TJCompressor_encodeYUV(env, obj, src, sizeof(jint), x, y, width, stride*sizeof(jint), height, pf, dstobjs, jDstOffsets, jDstStrides, @@ -480,23 +479,23 @@ JNIEXPORT void JNICALL TJCompressor_encodeYUV_12 if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1 || pitch<0) - _throw("Invalid argument in encodeYUV()"); + _throwarg("Invalid argument in encodeYUV()"); if(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF) - _throw("Mismatch between Java and C API"); + _throwarg("Mismatch between Java and C API"); arraySize=(pitch==0)? width*tjPixelSize[pf]*height:pitch*height; if((*env)->GetArrayLength(env, src)*srcElementSizeGetArrayLength(env, dst) <(jsize)tjBufSizeYUV(width, height, subsamp)) - _throw("Destination buffer is not large enough"); + _throwarg("Destination buffer is not large enough"); bailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0)); bailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0)); if(tjEncodeYUV2(handle, srcBuf, width, pitch, height, pf, dstBuf, subsamp, flags)==-1) - _throw(tjGetErrorStr()); + _throwtj(); bailout: if(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); @@ -519,9 +518,9 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___ jint height, jint pf, jbyteArray dst, jint subsamp, jint flags) { if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF) - _throw("Invalid argument in encodeYUV()"); + _throwarg("Invalid argument in encodeYUV()"); if(tjPixelSize[pf]!=sizeof(jint)) - _throw("Pixel format must be 32-bit when encoding from an integer buffer."); + _throwarg("Pixel format must be 32-bit when encoding from an integer buffer."); TJCompressor_encodeYUV_12(env, obj, src, sizeof(jint), width, stride*sizeof(jint), height, pf, dst, subsamp, flags); @@ -553,7 +552,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_init jfieldID fid; tjhandle handle; - if((handle=tjInitDecompress())==NULL) _throw(tjGetErrorStr()); + if((handle=tjInitDecompress())==NULL) _throwtj(); bailif0(cls=(*env)->GetObjectClass(env, obj)); bailif0(fid=(*env)->GetFieldID(env, cls, "handle", "J")); @@ -573,7 +572,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_libjpegturbo_turbojpeg_TJ_getScalingFact jobjectArray sfjava=NULL; if((sf=tjGetScalingFactors(&n))==NULL || n==0) - _throw(tjGetErrorStr()); + _throwtj(); bailif0(sfcls=(*env)->FindClass(env, "org/libjpegturbo/turbojpeg/TJScalingFactor")); bailif0(sfjava=(jobjectArray)(*env)->NewObjectArray(env, n, sfcls, 0)); @@ -603,13 +602,13 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress gethandle(); if((*env)->GetArrayLength(env, src)GetPrimitiveArrayCritical(env, src, 0)); if(tjDecompressHeader3(handle, jpegBuf, (unsigned long)jpegSize, &width, &height, &jpegSubsamp, &jpegColorspace)==-1) - _throw(tjGetErrorStr()); + _throwtj(); (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0); jpegBuf=NULL; @@ -641,16 +640,16 @@ static void TJDecompressor_decompress gethandle(); if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF) - _throw("Invalid argument in decompress()"); + _throwarg("Invalid argument in decompress()"); if(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF) - _throw("Mismatch between Java and C API"); + _throwarg("Mismatch between Java and C API"); if((*env)->GetArrayLength(env, src)GetArrayLength(env, dst)*dstElementSizeGetPrimitiveArrayCritical(env, src, 0)); bailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0)); @@ -658,7 +657,7 @@ static void TJDecompressor_decompress if(tjDecompress2(handle, jpegBuf, (unsigned long)jpegSize, &dstBuf[y*actualPitch + x*tjPixelSize[pf]], width, pitch, height, pf, flags)==-1) - _throw(tjGetErrorStr()); + _throwtj(); bailout: if(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); @@ -690,9 +689,9 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress jint x, jint y, jint width, jint stride, jint height, jint pf, jint flags) { if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF) - _throw("Invalid argument in decompress()"); + _throwarg("Invalid argument in decompress()"); if(tjPixelSize[pf]!=sizeof(jint)) - _throw("Pixel format must be 32-bit when decompressing to an integer buffer."); + _throwarg("Pixel format must be 32-bit when decompressing to an integer buffer."); TJDecompressor_decompress(env, obj, src, jpegSize, dst, sizeof(jint), x, y, width, stride*sizeof(jint), height, pf, flags); @@ -707,9 +706,9 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress jint width, jint stride, jint height, jint pf, jint flags) { if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF) - _throw("Invalid argument in decompress()"); + _throwarg("Invalid argument in decompress()"); if(tjPixelSize[pf]!=sizeof(jint)) - _throw("Pixel format must be 32-bit when decompressing to an integer buffer."); + _throwarg("Pixel format must be 32-bit when decompressing to an integer buffer."); TJDecompressor_decompress(env, obj, src, jpegSize, dst, sizeof(jint), 0, 0, width, stride*sizeof(jint), height, pf, flags); @@ -737,7 +736,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress gethandle(); if((*env)->GetArrayLength(env, src)GetFieldID(env, _cls, "jpegSubsamp", "I")); jpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid); bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegWidth", "I")); @@ -752,7 +751,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress if(height==0) height=jpegHeight; sf=tjGetScalingFactors(&nsf); if(!sf || nsf<1) - _throw(tjGetErrorStr()); + _throwtj(); for(i=0; iGetObjectArrayElement(env, dstobjs, i)); if((*env)->GetArrayLength(env, jDstPlanes[i])GetPrimitiveArrayCritical(env, jDstPlanes[i], 0)); @@ -789,7 +788,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress if(tjDecompressToYUVPlanes(handle, jpegBuf, (unsigned long)jpegSize, dstPlanes, desiredWidth, dstStrides, desiredHeight, flags)==-1) - _throw(tjGetErrorStr()); + _throwtj(); bailout: if(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0); @@ -818,7 +817,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress gethandle(); if((*env)->GetArrayLength(env, src)GetFieldID(env, _cls, "jpegSubsamp", "I")); jpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid); bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegWidth", "I")); @@ -827,14 +826,14 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress jpegHeight=(int)(*env)->GetIntField(env, obj, _fid); if((*env)->GetArrayLength(env, dst) <(jsize)tjBufSizeYUV(jpegWidth, jpegHeight, jpegSubsamp)) - _throw("Destination buffer is not large enough"); + _throwarg("Destination buffer is not large enough"); bailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0)); bailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0)); if(tjDecompressToYUV(handle, jpegBuf, (unsigned long)jpegSize, dstBuf, flags)==-1) - _throw(tjGetErrorStr()); + _throwtj(); bailout: if(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); @@ -858,22 +857,22 @@ static void TJDecompressor_decodeYUV if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || subsamp<0 || subsamp>=org_libjpegturbo_turbojpeg_TJ_NUMSAMP) - _throw("Invalid argument in decodeYUV()"); + _throwarg("Invalid argument in decodeYUV()"); if(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF || org_libjpegturbo_turbojpeg_TJ_NUMSAMP!=TJ_NUMSAMP) - _throw("Mismatch between Java and C API"); + _throwarg("Mismatch between Java and C API"); if((*env)->GetArrayLength(env, srcobjs)GetArrayLength(env, jSrcOffsets)GetArrayLength(env, jSrcStrides)GetArrayLength(env, dst)*dstElementSizeGetPrimitiveArrayCritical(env, jSrcOffsets, 0)); bailif0(srcStrides=(*env)->GetPrimitiveArrayCritical(env, jSrcStrides, 0)); @@ -883,16 +882,16 @@ static void TJDecompressor_decodeYUV int pw=tjPlaneWidth(i, width, subsamp); if(planeSize<0 || pw<0) - _throw(tjGetErrorStr()); + _throwtj(); if(srcOffsets[i]<0) - _throw("Invalid argument in decodeYUV()"); + _throwarg("Invalid argument in decodeYUV()"); if(srcStrides[i]<0 && srcOffsets[i]-planeSize+pw<0) - _throw("Negative plane stride would cause memory to be accessed below plane boundary"); + _throwarg("Negative plane stride would cause memory to be accessed below plane boundary"); bailif0(jSrcPlanes[i]=(*env)->GetObjectArrayElement(env, srcobjs, i)); if((*env)->GetArrayLength(env, jSrcPlanes[i])GetPrimitiveArrayCritical(env, jSrcPlanes[i], 0)); @@ -903,7 +902,7 @@ static void TJDecompressor_decodeYUV if(tjDecodeYUVPlanes(handle, srcPlanes, srcStrides, subsamp, &dstBuf[y*actualPitch + x*tjPixelSize[pf]], width, pitch, height, pf, flags)==-1) - _throw(tjGetErrorStr()); + _throwtj(); bailout: if(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0); @@ -937,9 +936,9 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV_ jint width, jint stride, jint height, jint pf, jint flags) { if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF) - _throw("Invalid argument in decodeYUV()"); + _throwarg("Invalid argument in decodeYUV()"); if(tjPixelSize[pf]!=sizeof(jint)) - _throw("Pixel format must be 32-bit when decoding to an integer buffer."); + _throwarg("Pixel format must be 32-bit when decoding to an integer buffer."); TJDecompressor_decodeYUV(env, obj, srcobjs, jSrcOffsets, jSrcStrides, subsamp, dst, sizeof(jint), x, y, width, stride*sizeof(jint), height, pf, @@ -957,7 +956,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_init jfieldID fid; tjhandle handle; - if((handle=tjInitTransform())==NULL) _throw(tjGetErrorStr()); + if((handle=tjInitTransform())==NULL) _throwtj(); bailif0(cls=(*env)->GetObjectClass(env, obj)); bailif0(fid=(*env)->GetFieldID(env, cls, "handle", "J")); @@ -1047,7 +1046,7 @@ JNIEXPORT jintArray JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_transf gethandle(); if((*env)->GetArrayLength(env, jsrcBuf)GetFieldID(env, _cls, "jpegWidth", "I")); jpegWidth=(int)(*env)->GetIntField(env, obj, _fid); bailif0(_fid=(*env)->GetFieldID(env, _cls, "jpegHeight", "I")); @@ -1057,19 +1056,19 @@ JNIEXPORT jintArray JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_transf n=(*env)->GetArrayLength(env, dstobjs); if(n!=(*env)->GetArrayLength(env, tobjs)) - _throw("Mismatch between size of transforms array and destination buffers array"); + _throwarg("Mismatch between size of transforms array and destination buffers array"); if((dstBufs=(unsigned char **)malloc(sizeof(unsigned char *)*n))==NULL) - _throw("Memory allocation failure"); + _throwmem(); if((jdstBufs=(jbyteArray *)malloc(sizeof(jbyteArray)*n))==NULL) - _throw("Memory allocation failure"); + _throwmem(); if((dstSizes=(unsigned long *)malloc(sizeof(unsigned long)*n))==NULL) - _throw("Memory allocation failure"); + _throwmem(); if((t=(tjtransform *)malloc(sizeof(tjtransform)*n))==NULL) - _throw("Memory allocation failure"); + _throwmem(); if((params=(JNICustomFilterParams *)malloc(sizeof(JNICustomFilterParams)*n)) ==NULL) - _throw("Memory allocation failure"); + _throwmem(); for(i=0; iGetObjectArrayElement(env, dstobjs, i)); if((unsigned long)(*env)->GetArrayLength(env, jdstBufs[i]) GetPrimitiveArrayCritical(env, jsrcBuf, 0)); for(i=0; i Date: Tue, 21 Jul 2015 09:34:02 -0500 Subject: [PATCH 061/140] Further exception cleanup Use a new checked exception type (TJException) when passing through errors from the underlying C library. This gives the application a choice of catching all exceptions or just those from TurboJPEG. Throw IllegalArgumentException at the JNI level when arguments to the JNI function are incorrect, and when one of the TurboJPEG "utility" functions returns an error (because, per the C API specification, those functions will only return an error if one of their arguments is out of range.) Remove "throws Exception" from the signature of any methods that no longer pass through an error from the TurboJPEG C library. Credit Viktor for the new code Code formatting tweaks --- ChangeLog.txt | 3 +- java/CMakeLists.txt | 1 + java/Makefile.am | 2 + java/TJExample.java | 4 +- java/doc/allclasses-frame.html | 1 + java/doc/allclasses-noframe.html | 1 + java/doc/index-all.html | 10 + java/doc/org/libjpegturbo/turbojpeg/TJ.html | 47 +-- .../libjpegturbo/turbojpeg/TJCompressor.html | 80 ++--- .../turbojpeg/TJCustomFilter.html | 4 +- .../turbojpeg/TJDecompressor.html | 97 +++--- .../libjpegturbo/turbojpeg/TJException.html | 287 ++++++++++++++++++ .../turbojpeg/TJScalingFactor.html | 4 +- .../libjpegturbo/turbojpeg/TJTransform.html | 14 +- .../libjpegturbo/turbojpeg/TJTransformer.html | 20 +- .../org/libjpegturbo/turbojpeg/YUVImage.html | 49 +-- .../libjpegturbo/turbojpeg/package-frame.html | 4 + .../turbojpeg/package-summary.html | 15 + .../libjpegturbo/turbojpeg/package-tree.html | 13 + java/doc/overview-tree.html | 13 + java/doc/serialized-form.html | 9 + java/org/libjpegturbo/turbojpeg/TJ.java | 22 +- .../libjpegturbo/turbojpeg/TJCompressor.java | 71 +++-- .../turbojpeg/TJCustomFilter.java | 2 +- .../turbojpeg/TJDecompressor.java | 75 ++--- .../libjpegturbo/turbojpeg/TJException.java | 53 ++++ .../turbojpeg/TJScalingFactor.java | 1 + .../libjpegturbo/turbojpeg/TJTransform.java | 4 +- .../libjpegturbo/turbojpeg/TJTransformer.java | 15 +- java/org/libjpegturbo/turbojpeg/YUVImage.java | 19 +- turbojpeg-jni.c | 28 +- 31 files changed, 663 insertions(+), 305 deletions(-) create mode 100644 java/doc/org/libjpegturbo/turbojpeg/TJException.html create mode 100644 java/org/libjpegturbo/turbojpeg/TJException.java diff --git a/ChangeLog.txt b/ChangeLog.txt index e1069f5e..65e64de0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -17,7 +17,8 @@ try-with-resources statement. [4] The TurboJPEG Java classes now throw unchecked idiomatic exceptions (IllegalArgumentException, IllegalStateException) for unrecoverable errors -caused by incorrect API usage. +caused by incorrect API usage, and those classes throw a new checked exception +type (TJException) for errors that are passed through from the C library. 1.4.1 diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index f9f9e572..0af8ae15 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -5,6 +5,7 @@ set(JAVA_CLASSNAMES org/libjpegturbo/turbojpeg/TJ org/libjpegturbo/turbojpeg/TJCompressor org/libjpegturbo/turbojpeg/TJCustomFilter org/libjpegturbo/turbojpeg/TJDecompressor + org/libjpegturbo/turbojpeg/TJException org/libjpegturbo/turbojpeg/TJScalingFactor org/libjpegturbo/turbojpeg/TJTransform org/libjpegturbo/turbojpeg/TJTransformer diff --git a/java/Makefile.am b/java/Makefile.am index 23e34129..475dd3fe 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -10,6 +10,7 @@ JAVASOURCES = org/libjpegturbo/turbojpeg/TJ.java \ org/libjpegturbo/turbojpeg/TJCompressor.java \ org/libjpegturbo/turbojpeg/TJCustomFilter.java \ org/libjpegturbo/turbojpeg/TJDecompressor.java \ + org/libjpegturbo/turbojpeg/TJException.java \ org/libjpegturbo/turbojpeg/TJScalingFactor.java \ org/libjpegturbo/turbojpeg/TJTransform.java \ org/libjpegturbo/turbojpeg/TJTransformer.java \ @@ -31,6 +32,7 @@ JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \ org/libjpegturbo/turbojpeg/TJCompressor.class \ org/libjpegturbo/turbojpeg/TJCustomFilter.class \ org/libjpegturbo/turbojpeg/TJDecompressor.class \ + org/libjpegturbo/turbojpeg/TJException.class \ org/libjpegturbo/turbojpeg/TJLoader.class \ org/libjpegturbo/turbojpeg/TJScalingFactor.class \ org/libjpegturbo/turbojpeg/TJTransform.class \ diff --git a/java/TJExample.java b/java/TJExample.java index 75621143..da098078 100644 --- a/java/TJExample.java +++ b/java/TJExample.java @@ -1,5 +1,5 @@ /* - * Copyright (C)2011-2012, 2014 D. R. Commander. All Rights Reserved. + * Copyright (C)2011-2012, 2014-2015 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -351,7 +351,7 @@ public class TJExample implements TJCustomFilter { public void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion, Rectangle planeRegion, int componentIndex, int transformIndex, TJTransform transform) - throws Exception { + throws TJException { for (int i = 0; i < bufferRegion.width * bufferRegion.height; i++) { coeffBuffer.put(i, (short)(-coeffBuffer.get(i))); } diff --git a/java/doc/allclasses-frame.html b/java/doc/allclasses-frame.html index 509ea508..fecac06d 100644 --- a/java/doc/allclasses-frame.html +++ b/java/doc/allclasses-frame.html @@ -13,6 +13,7 @@
  • TJCompressor
  • TJCustomFilter
  • TJDecompressor
  • +
  • TJException
  • TJScalingFactor
  • TJTransform
  • TJTransformer
  • diff --git a/java/doc/allclasses-noframe.html b/java/doc/allclasses-noframe.html index 3eac18fa..1f7fd3c6 100644 --- a/java/doc/allclasses-noframe.html +++ b/java/doc/allclasses-noframe.html @@ -13,6 +13,7 @@
  • TJCompressor
  • TJCustomFilter
  • TJDecompressor
  • +
  • TJException
  • TJScalingFactor
  • TJTransform
  • TJTransformer
  • diff --git a/java/doc/index-all.html b/java/doc/index-all.html index 1af78bed..a02d9c46 100644 --- a/java/doc/index-all.html +++ b/java/doc/index-all.html @@ -821,6 +821,16 @@ source image stored in yuvImage with the newly created instance.
    +
    TJException - Exception in org.libjpegturbo.turbojpeg
    +
     
    +
    TJException() - Constructor for exception org.libjpegturbo.turbojpeg.TJException
    +
     
    +
    TJException(String, Throwable) - Constructor for exception org.libjpegturbo.turbojpeg.TJException
    +
     
    +
    TJException(String) - Constructor for exception org.libjpegturbo.turbojpeg.TJException
    +
     
    +
    TJException(Throwable) - Constructor for exception org.libjpegturbo.turbojpeg.TJException
    +
     
    TJScalingFactor - Class in org.libjpegturbo.turbojpeg
    Fractional scaling factor
    diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJ.html b/java/doc/org/libjpegturbo/turbojpeg/TJ.html index 3ff9b89d..ffef6578 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJ.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJ.html @@ -1075,16 +1075,13 @@ public static final int FLAG_FORCESSE3

    bufSize

    public static int bufSize(int width,
               int height,
    -          int jpegSubsamp)
    -                   throws java.lang.Exception
    + int jpegSubsamp)
    Returns the maximum size of the buffer (in bytes) required to hold a JPEG image with the given width, height, and level of chrominance subsampling.
    Parameters:
    width - the width (in pixels) of the JPEG image
    height - the height (in pixels) of the JPEG image
    jpegSubsamp - the level of chrominance subsampling to be used when generating the JPEG image (one of TJ.SAMP_*)
    Returns:
    the maximum size of the buffer (in bytes) required to hold a JPEG - image with the given width, height, and level of chrominance subsampling.
    -
    Throws:
    -
    java.lang.Exception
    + image with the given width, height, and level of chrominance subsampling.
    @@ -1096,17 +1093,14 @@ public static final int FLAG_FORCESSE3
    public static int bufSizeYUV(int width,
                  int pad,
                  int height,
    -             int subsamp)
    -                      throws java.lang.Exception
    + int subsamp)
    Returns the size of the buffer (in bytes) required to hold a YUV planar image with the given width, height, and level of chrominance subsampling.
    Parameters:
    width - the width (in pixels) of the YUV image
    pad - the width of each line in each plane of the image is padded to the nearest multiple of this number of bytes (must be a power of 2.)
    height - the height (in pixels) of the YUV image
    subsamp - the level of chrominance subsampling used in the YUV image (one of TJ.SAMP_*)
    Returns:
    the size of the buffer (in bytes) required to hold a YUV planar - image with the given width, height, and level of chrominance subsampling.
    -
    Throws:
    -
    java.lang.Exception
    + image with the given width, height, and level of chrominance subsampling. @@ -1118,11 +1112,8 @@ public static final int FLAG_FORCESSE3
    @Deprecated
     public static int bufSizeYUV(int width,
                             int height,
    -                        int subsamp)
    -                      throws java.lang.Exception
    + int subsamp)
    -
    Throws:
    -
    java.lang.Exception
    @@ -1135,8 +1126,7 @@ public static int bufSizeYUV(int width, int width, int stride, int height, - int subsamp) - throws java.lang.Exception + int subsamp)
    Returns the size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.
    Parameters:
    componentID - ID number of the image plane (0 = Y, 1 = U/Cb, @@ -1145,9 +1135,7 @@ public static int bufSizeYUV(int width, height of the whole image, not the plane height.
    subsamp - the level of chrominance subsampling used in the YUV image (one of TJ.SAMP_*)
    Returns:
    the size of the buffer (in bytes) required to hold a YUV planar - image with the given parameters.
    -
    Throws:
    -
    java.lang.Exception
    + image with the given parameters. @@ -1158,16 +1146,13 @@ public static int bufSizeYUV(int width,

    planeWidth

    public static int planeWidth(int componentID,
                  int width,
    -             int subsamp)
    -                      throws java.lang.Exception
    + int subsamp)
    Parameters:
    componentID - ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)
    width - width (in pixels) of the YUV image
    subsamp - the level of chrominance subsampling used in the YUV image (one of TJ.SAMP_*)
    -
    Returns:
    the plane width of a YUV image plane with the given parameters.
    -
    Throws:
    -
    java.lang.Exception
    +
    Returns:
    the plane width of a YUV image plane with the given parameters.
    @@ -1178,16 +1163,13 @@ public static int bufSizeYUV(int width,

    planeHeight

    public static int planeHeight(int componentID,
                   int height,
    -              int subsamp)
    -                       throws java.lang.Exception
    + int subsamp)
    Parameters:
    componentID - ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)
    height - height (in pixels) of the YUV image
    subsamp - the level of chrominance subsampling used in the YUV image (one of TJ.SAMP_*)
    -
    Returns:
    the plane height of a YUV image plane with the given parameters.
    -
    Throws:
    -
    java.lang.Exception
    +
    Returns:
    the plane height of a YUV image plane with the given parameters.
    @@ -1196,14 +1178,11 @@ public static int bufSizeYUV(int width,
    • getScalingFactors

      -
      public static TJScalingFactor[] getScalingFactors()
      -                                           throws java.lang.Exception
      +
      public static TJScalingFactor[] getScalingFactors()
      Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports.
      Returns:
      a list of fractional scaling factors that the JPEG decompressor in - this implementation of TurboJPEG supports.
      -
      Throws:
      -
      java.lang.Exception
      + this implementation of TurboJPEG supports.
    diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html index 9fe4f995..29f12b79 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html @@ -381,10 +381,10 @@ implements java.io.Closeable
  • TJCompressor

    public TJCompressor()
    -             throws java.lang.Exception
    + throws TJException
    Create a TurboJPEG compressor instance.
    Throws:
    -
    java.lang.Exception
    +
    TJException
  • @@ -400,14 +400,14 @@ implements java.io.Closeable int pitch, int height, int pixelFormat) - throws java.lang.Exception + throws TJException
    Create a TurboJPEG compressor instance and associate the uncompressed source image stored in srcImage with the newly created instance.
    Parameters:
    srcImage - see setSourceImage(byte[], int, int, int, int, int, int) for description
    x - see setSourceImage(byte[], int, int, int, int, int, int) for description
    y - see setSourceImage(byte[], int, int, int, int, int, int) for description
    width - see setSourceImage(byte[], int, int, int, int, int, int) for description
    pitch - see setSourceImage(byte[], int, int, int, int, int, int) for description
    height - see setSourceImage(byte[], int, int, int, int, int, int) for description
    pixelFormat - pixel format of the source image (one of TJ.PF_*)
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -422,11 +422,11 @@ public TJCompressor(byte[] srcImage, int pitch, int height, int pixelFormat) - throws java.lang.Exception + throws TJException
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -440,7 +440,7 @@ public TJCompressor(byte[] srcImage, int y, int width, int height) - throws java.lang.Exception + throws TJException
    Create a TurboJPEG compressor instance and associate the uncompressed source image stored in srcImage with the newly created instance.
    @@ -451,7 +451,7 @@ public TJCompressor(byte[] srcImage, setSourceImage(BufferedImage, int, int, int, int) for description
    height - see setSourceImage(BufferedImage, int, int, int, int) for description
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -475,7 +475,7 @@ public TJCompressor(byte[] srcImage, int pitch, int height, int pixelFormat) - throws java.lang.Exception + throws TJException
    Associate an uncompressed RGB, grayscale, or CMYK source image with this compressor instance.
    Parameters:
    srcImage - image buffer containing RGB, grayscale, or CMYK pixels to @@ -493,7 +493,7 @@ public TJCompressor(byte[] srcImage, which the JPEG or YUV image should be compressed/encoded
    pixelFormat - pixel format of the source image (one of TJ.PF_*)
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -508,11 +508,11 @@ public void setSourceImage(byte[] srcImage, int pitch, int height, int pixelFormat) - throws java.lang.Exception + throws TJException
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -526,7 +526,7 @@ public void setSourceImage(byte[] srcImage, int y, int width, int height) - throws java.lang.Exception + throws TJException
    Associate an uncompressed RGB or grayscale source image with this compressor instance.
    Parameters:
    srcImage - a BufferedImage instance containing RGB or @@ -538,7 +538,7 @@ public void setSourceImage(byte[] srcImage, which the JPEG or YUV image should be compressed/encoded (0 = use the height of the source image)
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -548,13 +548,13 @@ public void setSourceImage(byte[] srcImage,
  • setSourceImage

    public void setSourceImage(YUVImage srcImage)
    -                    throws java.lang.Exception
    + throws TJException
    Associate an uncompressed YUV planar source image with this compressor instance.
    Parameters:
    srcImage - YUV planar image to be compressed. This image is not modified.
    Throws:
    -
    java.lang.Exception
    +
    TJException
  • @@ -604,7 +604,7 @@ public void setSourceImage(byte[] srcImage,

    compress

    public void compress(byte[] dstBuf,
                 int flags)
    -              throws java.lang.Exception
    + throws
    TJException
    Compress the uncompressed source image associated with this compressor instance and output a JPEG image to the given destination buffer.
    Parameters:
    dstBuf - buffer that will receive the JPEG image. Use @@ -613,7 +613,7 @@ public void setSourceImage(byte[] srcImage, subsampling.
    flags - the bitwise OR of one or more of TJ.FLAG_*
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -623,7 +623,7 @@ public void setSourceImage(byte[] srcImage,
  • compress

    public byte[] compress(int flags)
    -                throws java.lang.Exception
    + throws
    TJException
    Compress the uncompressed source image associated with this compressor instance and return a buffer containing a JPEG image.
    Parameters:
    flags - the bitwise OR of one or more of @@ -631,7 +631,7 @@ public void setSourceImage(byte[] srcImage,
    Returns:
    a buffer containing a JPEG image. The length of this buffer will not be equal to the size of the JPEG image. Use getCompressedSize() to obtain the size of the JPEG image.
    Throws:
    -
    java.lang.Exception
    +
    TJException
  • @@ -644,12 +644,12 @@ public void setSourceImage(byte[] srcImage, public void compress(java.awt.image.BufferedImage srcImage, byte[] dstBuf, int flags) - throws java.lang.Exception + throws TJException
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -661,12 +661,12 @@ public void compress(java.awt.image.BufferedImage srcImage,
    @Deprecated
     public byte[] compress(java.awt.image.BufferedImage srcImage,
                              int flags)
    -                throws java.lang.Exception
    + throws
    TJException
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -677,7 +677,7 @@ public byte[] compress(java.awt.image.BufferedImage srcImage,

    encodeYUV

    public void encodeYUV(YUVImage dstImage,
                  int flags)
    -               throws java.lang.Exception
    + throws TJException
    Encode the uncompressed source image associated with this compressor instance into a YUV planar image and store it in the given YUVImage instance. This method uses the accelerated color @@ -688,7 +688,7 @@ public byte[] compress(java.awt.image.BufferedImage srcImage, image
    flags - the bitwise OR of one or more of TJ.FLAG_*
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -700,10 +700,10 @@ public byte[] compress(java.awt.image.BufferedImage srcImage,
    @Deprecated
     public void encodeYUV(byte[] dstBuf,
                             int flags)
    -               throws java.lang.Exception
    + throws
    TJException
    Deprecated. Use encodeYUV(YUVImage, int) instead.
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -714,7 +714,7 @@ public void encodeYUV(byte[] dstBuf,

    encodeYUV

    public YUVImage encodeYUV(int pad,
                      int flags)
    -                   throws java.lang.Exception
    + throws TJException
    Encode the uncompressed source image associated with this compressor instance into a unified YUV planar image buffer and return a YUVImage instance containing the encoded image. This method @@ -727,7 +727,7 @@ public void encodeYUV(byte[] dstBuf, TJ.FLAG_*
    Returns:
    a YUV planar image.
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -738,7 +738,7 @@ public void encodeYUV(byte[] dstBuf,

    encodeYUV

    public YUVImage encodeYUV(int[] strides,
                      int flags)
    -                   throws java.lang.Exception
    + throws TJException
    Encode the uncompressed source image associated with this compressor instance into separate Y, U (Cb), and V (Cr) image planes and return a YUVImage instance containing the encoded image planes. This @@ -755,7 +755,7 @@ public void encodeYUV(byte[] dstBuf, TJ.FLAG_*
    Returns:
    a YUV planar image.
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -766,10 +766,10 @@ public void encodeYUV(byte[] dstBuf,

    encodeYUV

    @Deprecated
     public byte[] encodeYUV(int flags)
    -                 throws java.lang.Exception
    + throws
    TJException
    Deprecated. Use encodeYUV(int, int) instead.
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -782,12 +782,12 @@ public byte[] encodeYUV(int flags) public void encodeYUV(java.awt.image.BufferedImage srcImage, byte[] dstBuf, int flags) - throws java.lang.Exception + throws TJException
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -799,12 +799,12 @@ public void encodeYUV(java.awt.image.BufferedImage srcImage,
    @Deprecated
     public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,
                               int flags)
    -                 throws java.lang.Exception
    + throws
    TJException
    Throws:
    -
    java.lang.Exception
    +
    TJException
    @@ -827,7 +827,7 @@ public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,
  • close

    public void close()
    -           throws java.io.IOException
    + throws
    TJException
    Free the native structures associated with this compressor instance.
    Specified by:
    @@ -835,7 +835,7 @@ public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,
    Specified by:
    close in interface java.lang.AutoCloseable
    Throws:
    -
    java.io.IOException
    +
    TJException
  • diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html b/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html index c2b6e613..6bd6fd27 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html @@ -144,7 +144,7 @@ int componentID, int transformID, TJTransform transform) - throws java.lang.Exception + throws TJException
    A callback function that can be used to modify the DCT coefficients after they are losslessly transformed but before they are transcoded to a new JPEG image. This allows for custom filters or other transformations to be @@ -165,7 +165,7 @@ transform in the transforms array that was passed to TJTransformer.transform().
    transform - a TJTransform instance that specifies the parameters and/or cropping region for this transform
    Throws:
    -
    java.lang.Exception
    +
    TJException
    diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html index 6cec2cc2..a914de9e 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html @@ -33,7 +33,7 @@
    -

    This option will cause tjTransform() to discard any partial MCU blocks that cannot be transformed.

    +

    This option will cause tjTransform() to discard any partial MCU blocks that cannot be transformed.

    @@ -761,7 +761,7 @@ Variables
    -

    Transform operations for tjTransform()

    +

    Transform operations for tjTransform()

    Allocate an image buffer for use with TurboJPEG.

    -

    You should always use this function to allocate the JPEG destination buffer(s) for tjCompress2() and tjTransform() unless you are disabling automatic buffer (re)allocation (by setting TJFLAG_NOREALLOC.)

    +

    You should always use this function to allocate the JPEG destination buffer(s) for tjCompress2() and tjTransform() unless you are disabling automatic buffer (re)allocation (by setting TJFLAG_NOREALLOC.)

    Parameters
    Enumerator
    TJXOP_NONE 

    Do not transform the position of the image pixels.

    @@ -812,7 +812,7 @@ Variables
    @@ -918,7 +918,7 @@ Variables - +
    bytesthe number of bytes to allocate
    @@ -931,7 +931,7 @@ Variables - + @@ -1000,7 +1000,7 @@ Variables
    Parameters
    unsigned char * const unsigned char *  srcBuf,
    - + @@ -1022,7 +1022,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG compressor or transformer instance
    srcBufpointer to an image buffer containing RGB, grayscale, or CMYK pixels to be compressed. This buffer is not modified.
    srcBufpointer to an image buffer containing RGB, grayscale, or CMYK pixels to be compressed
    widthwidth (in pixels) of the source image
    pitchbytes per line in the source image. Normally, this should be width * tjPixelSize[pixelFormat] if the image is unpadded, or TJPAD(width * tjPixelSize[pixelFormat]) if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to width * tjPixelSize[pixelFormat].
    heightheight (in pixels) of the source image
    @@ -1035,7 +1035,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1098,7 +1098,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char * const unsigned char *  srcBuf,
    - + @@ -1119,7 +1119,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG compressor or transformer instance
    srcBufpointer to an image buffer containing a YUV planar image to be compressed. The size of this buffer should match the value returned by tjBufSizeYUV2() for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to YUV Image Format Notes.) This buffer is not modified.
    srcBufpointer to an image buffer containing a YUV planar image to be compressed. The size of this buffer should match the value returned by tjBufSizeYUV2() for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to YUV Image Format Notes.)
    widthwidth (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see tjMCUWidth), then an intermediate buffer copy will be performed within TurboJPEG.
    padthe line padding used in the source image. For instance, if each line in each plane of the YUV image is padded to the nearest multiple of 4 bytes, then pad should be set to 4.
    heightheight (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see tjMCUHeight), then an intermediate buffer copy will be performed within TurboJPEG.
    @@ -1132,7 +1132,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1144,7 +1144,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1195,7 +1195,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char ** const unsigned char **  srcPlanes,
    int * const int *  strides,
    - + @@ -1216,7 +1216,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG compressor or transformer instance
    srcPlanesan array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV image to be compressed. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by tjPlaneSizeYUV() for the given image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. These image planes are not modified.
    srcPlanesan array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV image to be compressed. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by tjPlaneSizeYUV() for the given image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details.
    widthwidth (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see tjMCUWidth), then an intermediate buffer copy will be performed within TurboJPEG.
    stridesan array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see YUV Image Format Notes.) If strides is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to create a JPEG image from a subregion of a larger YUV planar image.
    heightheight (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see tjMCUHeight), then an intermediate buffer copy will be performed within TurboJPEG.
    @@ -1229,7 +1229,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1293,7 +1293,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char * const unsigned char *  srcBuf,
    - + @@ -1309,7 +1309,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG decompressor or transformer instance
    srcBufpointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by tjBufSizeYUV2() for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to YUV Image Format Notes.) This buffer is not modified.
    srcBufpointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by tjBufSizeYUV2() for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to YUV Image Format Notes.)
    padUse this parameter to specify that the width of each line in each plane of the YUV source image is padded to the nearest multiple of this number of bytes (must be a power of 2.)
    subsampthe level of chrominance subsampling used in the YUV source image (see Chrominance subsampling options.)
    dstBufpointer to an image buffer that will receive the decoded image. This buffer should normally be pitch * height bytes in size, but the dstBuf pointer can also be used to decode into a specific region of a larger buffer.
    @@ -1322,13 +1322,13 @@ If you choose option 1, *jpegSize should be set to the size of your - + - + @@ -1386,7 +1386,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char ** const unsigned char **  srcPlanes,
    int * const int *  strides,
    - + @@ -1402,7 +1402,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG decompressor or transformer instance
    srcPlanesan array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by tjPlaneSizeYUV() for the given image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. These image planes are not modified.
    srcPlanesan array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by tjPlaneSizeYUV() for the given image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details.
    stridesan array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see YUV Image Format Notes.) If strides is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to decode a subregion of a larger YUV planar image.
    subsampthe level of chrominance subsampling used in the YUV source image (see Chrominance subsampling options.)
    dstBufpointer to an image buffer that will receive the decoded image. This buffer should normally be pitch * height bytes in size, but the dstBuf pointer can also be used to decode into a specific region of a larger buffer.
    @@ -1415,7 +1415,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1472,7 +1472,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char * const unsigned char *  jpegBuf,
    - + @@ -1487,7 +1487,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG decompressor or transformer instance
    jpegBufpointer to a buffer containing the JPEG image to decompress. This buffer is not modified.
    jpegBufpointer to a buffer containing the JPEG image to decompress
    jpegSizesize of the JPEG image (in bytes)
    dstBufpointer to an image buffer that will receive the decompressed image. This buffer should normally be pitch * scaledHeight bytes in size, where scaledHeight can be determined by calling TJSCALED() with the JPEG image height and one of the scaling factors returned by tjGetScalingFactors(). The dstBuf pointer may also be used to decompress into a specific region of a larger buffer.
    widthdesired width (in pixels) of the destination image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If width is set to 0, then only the height will be considered when determining the scaled image size.
    @@ -1500,7 +1500,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1545,7 +1545,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char * const unsigned char *  jpegBuf,
    - + @@ -1558,7 +1558,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG decompressor or transformer instance
    jpegBufpointer to a buffer containing a JPEG image. This buffer is not modified.
    jpegBufpointer to a buffer containing a JPEG image
    jpegSizesize of the JPEG image (in bytes)
    widthpointer to an integer variable that will receive the width (in pixels) of the JPEG image
    heightpointer to an integer variable that will receive the height (in pixels) of the JPEG image
    @@ -1571,7 +1571,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1623,7 +1623,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char * const unsigned char *  jpegBuf,
    - + @@ -1637,7 +1637,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG decompressor or transformer instance
    jpegBufpointer to a buffer containing the JPEG image to decompress. This buffer is not modified.
    jpegBufpointer to a buffer containing the JPEG image to decompress
    jpegSizesize of the JPEG image (in bytes)
    dstBufpointer to an image buffer that will receive the YUV image. Use tjBufSizeYUV2() to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to YUV Image Format Notes.)
    widthdesired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If width is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see tjMCUWidth), then an intermediate buffer copy will be performed within TurboJPEG.
    @@ -1650,7 +1650,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1702,7 +1702,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char * const unsigned char *  jpegBuf,
    - + @@ -1741,7 +1741,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG decompressor or transformer instance
    jpegBufpointer to a buffer containing the JPEG image to decompress. This buffer is not modified.
    jpegBufpointer to a buffer containing the JPEG image to decompress
    jpegSizesize of the JPEG image (in bytes)
    dstPlanesan array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the YUV image. These planes can be contiguous or non-contiguous in memory. Use tjPlaneSizeYUV() to determine the appropriate size for each plane based on the scaled image width, scaled image height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details.
    widthdesired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If width is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see tjMCUWidth), then an intermediate buffer copy will be performed within TurboJPEG.
    @@ -1754,7 +1754,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1818,7 +1818,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char * const unsigned char *  srcBuf,
    - + @@ -1834,7 +1834,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    handlea handle to a TurboJPEG compressor or transformer instance
    srcBufpointer to an image buffer containing RGB or grayscale pixels to be encoded. This buffer is not modified.
    srcBufpointer to an image buffer containing RGB or grayscale pixels to be encoded
    widthwidth (in pixels) of the source image
    pitchbytes per line in the source image. Normally, this should be width * tjPixelSize[pixelFormat] if the image is unpadded, or TJPAD(width * tjPixelSize[pixelFormat]) if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to width * tjPixelSize[pixelFormat].
    heightheight (in pixels) of the source image
    @@ -1847,7 +1847,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -1911,7 +1911,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char * const unsigned char *  srcBuf,
    - + @@ -1942,7 +1942,7 @@ If you choose option 1, *jpegSize should be set to the size of your

    Free an image buffer previously allocated by TurboJPEG.

    -

    You should always use this function to free JPEG destination buffer(s) that were automatically (re)allocated by tjCompress2() or tjTransform() or that were manually allocated using tjAlloc().

    +

    You should always use this function to free JPEG destination buffer(s) that were automatically (re)allocated by tjCompress2() or tjTransform() or that were manually allocated using tjAlloc().

    Parameters
    handlea handle to a TurboJPEG compressor or transformer instance
    srcBufpointer to an image buffer containing RGB or grayscale pixels to be encoded. This buffer is not modified.
    srcBufpointer to an image buffer containing RGB or grayscale pixels to be encoded
    widthwidth (in pixels) of the source image
    pitchbytes per line in the source image. Normally, this should be width * tjPixelSize[pixelFormat] if the image is unpadded, or TJPAD(width * tjPixelSize[pixelFormat]) if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to width * tjPixelSize[pixelFormat].
    heightheight (in pixels) of the source image
    @@ -2199,7 +2199,7 @@ If you choose option 1, *jpegSize should be set to the size of your - +
    bufferaddress of the buffer to free
    @@ -2212,7 +2212,7 @@ If you choose option 1, *jpegSize should be set to the size of your - + @@ -2264,7 +2264,7 @@ If you choose option 1, *jpegSize should be set to the size of your
    Parameters
    unsigned char * const unsigned char *  jpegBuf,
    - + - +
    handlea handle to a TurboJPEG transformer instance
    jpegBufpointer to a buffer containing the JPEG source image to transform. This buffer is not modified.
    jpegBufpointer to a buffer containing the JPEG source image to transform
    jpegSizesize of the JPEG source image (in bytes)
    nthe number of transformed JPEG images to generate
    dstBufspointer to an array of n image buffers. dstBufs[i] will receive a JPEG image that has been transformed using the parameters in transforms[i]. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:
      diff --git a/doc/html/search/all_74.js b/doc/html/search/all_74.js index 5b46106f..444aaef2 100644 --- a/doc/html/search/all_74.js +++ b/doc/html/search/all_74.js @@ -8,24 +8,24 @@ var searchData= ['tjblueoffset',['tjBlueOffset',['../group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea',1,'turbojpeg.h']]], ['tjbufsize',['tjBufSize',['../group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b',1,'turbojpeg.h']]], ['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]], - ['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]], - ['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]], - ['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6',1,'turbojpeg.h']]], + ['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e',1,'turbojpeg.h']]], + ['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga6f6de375d6ec0020faba627e37e5a060',1,'turbojpeg.h']]], + ['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#ga0b84c682d8accf097d7a743c965d3464',1,'turbojpeg.h']]], ['tjcs',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]], ['tjcs_5fcmyk',['TJCS_CMYK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53',1,'turbojpeg.h']]], ['tjcs_5fgray',['TJCS_GRAY',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a',1,'turbojpeg.h']]], ['tjcs_5frgb',['TJCS_RGB',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555',1,'turbojpeg.h']]], ['tjcs_5fycbcr',['TJCS_YCbCr',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75',1,'turbojpeg.h']]], ['tjcs_5fycck',['TJCS_YCCK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e',1,'turbojpeg.h']]], - ['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]], - ['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d',1,'turbojpeg.h']]], - ['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]], - ['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]], - ['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]], - ['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga0828a38ae29631ac28b6857cefb0eebf',1,'turbojpeg.h']]], + ['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga077c61027b875afecd5a1613bf18b3c1',1,'turbojpeg.h']]], + ['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaf42f19b7a496eb18bdc84fe61ee6d3e2',1,'turbojpeg.h']]], + ['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gad8026a417e16a76313bc0a6c9e8b2ba2',1,'turbojpeg.h']]], + ['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#ga3fced455e504e8ff4fbad28ba94a3020',1,'turbojpeg.h']]], + ['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga39e08906528db5a764670ea48d344b09',1,'turbojpeg.h']]], + ['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga38d0ef90692663b3ffb5b16da2541512',1,'turbojpeg.h']]], ['tjdestroy',['tjDestroy',['../group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540',1,'turbojpeg.h']]], - ['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360',1,'turbojpeg.h']]], - ['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaa791db8598853ddcad24e42897ef1269',1,'turbojpeg.h']]], + ['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#gaabe05acd734990053ad1294b5ef239aa',1,'turbojpeg.h']]], + ['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga8a65ed3bd12df57c219d46afbc9008f1',1,'turbojpeg.h']]], ['tjflag_5faccuratedct',['TJFLAG_ACCURATEDCT',['../group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0',1,'turbojpeg.h']]], ['tjflag_5fbottomup',['TJFLAG_BOTTOMUP',['../group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec',1,'turbojpeg.h']]], ['tjflag_5ffastdct',['TJFLAG_FASTDCT',['../group___turbo_j_p_e_g.html#gaabce235db80d3f698b27f36cbd453da2',1,'turbojpeg.h']]], @@ -70,7 +70,7 @@ var searchData= ['tjsamp_5fgray',['TJSAMP_GRAY',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248',1,'turbojpeg.h']]], ['tjscaled',['TJSCALED',['../group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df',1,'turbojpeg.h']]], ['tjscalingfactor',['tjscalingfactor',['../structtjscalingfactor.html',1,'']]], - ['tjtransform',['tjtransform',['../structtjtransform.html',1,'tjtransform'],['../group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616',1,'tjTransform(tjhandle handle, unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, int flags): turbojpeg.h'],['../group___turbo_j_p_e_g.html#gaa29f3189c41be12ec5dee7caec318a31',1,'tjtransform(): turbojpeg.h']]], + ['tjtransform',['tjtransform',['../structtjtransform.html',1,'tjtransform'],['../group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a',1,'tjTransform(tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, int flags): turbojpeg.h'],['../group___turbo_j_p_e_g.html#gaa29f3189c41be12ec5dee7caec318a31',1,'tjtransform(): turbojpeg.h']]], ['tjxop',['TJXOP',['../group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866',1,'turbojpeg.h']]], ['tjxop_5fhflip',['TJXOP_HFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce',1,'turbojpeg.h']]], ['tjxop_5fnone',['TJXOP_NONE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27',1,'turbojpeg.h']]], diff --git a/doc/html/search/functions_74.js b/doc/html/search/functions_74.js index 73b7ee98..69410b05 100644 --- a/doc/html/search/functions_74.js +++ b/doc/html/search/functions_74.js @@ -3,18 +3,18 @@ var searchData= ['tjalloc',['tjAlloc',['../group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff',1,'turbojpeg.h']]], ['tjbufsize',['tjBufSize',['../group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b',1,'turbojpeg.h']]], ['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]], - ['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]], - ['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]], - ['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6',1,'turbojpeg.h']]], - ['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]], - ['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d',1,'turbojpeg.h']]], - ['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]], - ['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]], - ['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]], - ['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga0828a38ae29631ac28b6857cefb0eebf',1,'turbojpeg.h']]], + ['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e',1,'turbojpeg.h']]], + ['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga6f6de375d6ec0020faba627e37e5a060',1,'turbojpeg.h']]], + ['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#ga0b84c682d8accf097d7a743c965d3464',1,'turbojpeg.h']]], + ['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga077c61027b875afecd5a1613bf18b3c1',1,'turbojpeg.h']]], + ['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaf42f19b7a496eb18bdc84fe61ee6d3e2',1,'turbojpeg.h']]], + ['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gad8026a417e16a76313bc0a6c9e8b2ba2',1,'turbojpeg.h']]], + ['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#ga3fced455e504e8ff4fbad28ba94a3020',1,'turbojpeg.h']]], + ['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga39e08906528db5a764670ea48d344b09',1,'turbojpeg.h']]], + ['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga38d0ef90692663b3ffb5b16da2541512',1,'turbojpeg.h']]], ['tjdestroy',['tjDestroy',['../group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540',1,'turbojpeg.h']]], - ['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360',1,'turbojpeg.h']]], - ['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaa791db8598853ddcad24e42897ef1269',1,'turbojpeg.h']]], + ['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#gaabe05acd734990053ad1294b5ef239aa',1,'turbojpeg.h']]], + ['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga8a65ed3bd12df57c219d46afbc9008f1',1,'turbojpeg.h']]], ['tjfree',['tjFree',['../group___turbo_j_p_e_g.html#ga8c4a1231dc06a450514c835f6471f137',1,'turbojpeg.h']]], ['tjgeterrorstr',['tjGetErrorStr',['../group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf',1,'turbojpeg.h']]], ['tjgetscalingfactors',['tjGetScalingFactors',['../group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8',1,'turbojpeg.h']]], @@ -24,5 +24,5 @@ var searchData= ['tjplaneheight',['tjPlaneHeight',['../group___turbo_j_p_e_g.html#ga1a209696c6a80748f20e134b3c64789f',1,'turbojpeg.h']]], ['tjplanesizeyuv',['tjPlaneSizeYUV',['../group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2',1,'turbojpeg.h']]], ['tjplanewidth',['tjPlaneWidth',['../group___turbo_j_p_e_g.html#ga63fb66bb1e36c74008c4634360becbb1',1,'turbojpeg.h']]], - ['tjtransform',['tjTransform',['../group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616',1,'turbojpeg.h']]] + ['tjtransform',['tjTransform',['../group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a',1,'turbojpeg.h']]] ]; diff --git a/doc/html/structtjtransform.html b/doc/html/structtjtransform.html index 7a07c2aa..3bfd1291 100644 --- a/doc/html/structtjtransform.html +++ b/doc/html/structtjtransform.html @@ -133,7 +133,7 @@ Data Fields
    arrayRegiontjregion structure containing the width and height of the array pointed to by coeffs as well as its offset relative to the component plane. TurboJPEG implementations may choose to split each component plane into multiple DCT coefficient arrays and call the callback function once for each array.
    planeRegiontjregion structure containing the width and height of the component plane to which coeffs belongs
    componentIDID number of the component plane to which coeffs belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1, and 2 in typical JPEG images.)
    transformIDID number of the transformed image to which coeffs belongs. This is the same as the index of the transform in the transforms array that was passed to tjTransform().
    transformIDID number of the transformed image to which coeffs belongs. This is the same as the index of the transform in the transforms array that was passed to tjTransform().
    transforma pointer to a tjtransform structure that specifies the parameters and/or cropping region for this transform
    diff --git a/jdatasrc-tj.c b/jdatasrc-tj.c index 09f95960..87e84b1d 100644 --- a/jdatasrc-tj.c +++ b/jdatasrc-tj.c @@ -157,7 +157,7 @@ term_source (j_decompress_ptr cinfo) GLOBAL(void) jpeg_mem_src_tj (j_decompress_ptr cinfo, - unsigned char * inbuffer, unsigned long insize) + const unsigned char * inbuffer, unsigned long insize) { struct jpeg_source_mgr * src; @@ -181,5 +181,5 @@ jpeg_mem_src_tj (j_decompress_ptr cinfo, src->resync_to_restart = jpeg_resync_to_restart; /* use default method */ src->term_source = term_source; src->bytes_in_buffer = (size_t) insize; - src->next_input_byte = (JOCTET *) inbuffer; + src->next_input_byte = (const JOCTET *) inbuffer; } diff --git a/turbojpeg-jni.c b/turbojpeg-jni.c index b3e99fbc..4d9900c9 100644 --- a/turbojpeg-jni.c +++ b/turbojpeg-jni.c @@ -291,7 +291,8 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFrom tjhandle handle=0; unsigned long jpegSize=0; jbyteArray jSrcPlanes[3]={NULL, NULL, NULL}; - unsigned char *srcPlanes[3], *jpegBuf=NULL; + const unsigned char *srcPlanes[3]; + unsigned char *jpegBuf=NULL; int *srcOffsets=NULL, *srcStrides=NULL; int nc=(subsamp==org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY? 1:3), i; @@ -349,8 +350,8 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFrom for(i=0; iReleasePrimitiveArrayCritical(env, jSrcPlanes[i], srcPlanes[i], - 0); + (*env)->ReleasePrimitiveArrayCritical(env, jSrcPlanes[i], + (unsigned char *)srcPlanes[i], 0); } if(srcStrides) (*env)->ReleasePrimitiveArrayCritical(env, jSrcStrides, srcStrides, 0); @@ -449,7 +450,7 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___ /* TurboJPEG 1.4.x: TJCompressor::encodeYUV() int source */ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III (JNIEnv *env, jobject obj, jintArray src, jint x, jint y, jint width, - jint stride, jint height, jint pf, jobjectArray dstobjs, + jint stride, jint height, jint pf, jobjectArray dstobjs, jintArray jDstOffsets, jintArray jDstStrides, jint subsamp, jint flags) { if(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF) @@ -847,7 +848,8 @@ static void TJDecompressor_decodeYUV tjhandle handle=0; jsize arraySize=0, actualPitch; jbyteArray jSrcPlanes[3]={NULL, NULL, NULL}; - unsigned char *srcPlanes[3], *dstBuf=NULL; + const unsigned char *srcPlanes[3]; + unsigned char *dstBuf=NULL; int *srcOffsets=NULL, *srcStrides=NULL; int nc=(subsamp==org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY? 1:3), i; @@ -907,8 +909,8 @@ static void TJDecompressor_decodeYUV for(i=0; iReleasePrimitiveArrayCritical(env, jSrcPlanes[i], srcPlanes[i], - 0); + (*env)->ReleasePrimitiveArrayCritical(env, jSrcPlanes[i], + (unsigned char *)srcPlanes[i], 0); } if(srcStrides) (*env)->ReleasePrimitiveArrayCritical(env, jSrcStrides, srcStrides, 0); diff --git a/turbojpeg.c b/turbojpeg.c index 5ba9a19b..cd9bfd73 100644 --- a/turbojpeg.c +++ b/turbojpeg.c @@ -44,7 +44,8 @@ extern void jpeg_mem_dest_tj(j_compress_ptr, unsigned char **, unsigned long *, boolean); -extern void jpeg_mem_src_tj(j_decompress_ptr, unsigned char *, unsigned long); +extern void jpeg_mem_src_tj(j_decompress_ptr, const unsigned char *, + unsigned long); #define PAD(v, p) ((v+(p)-1)&(~((p)-1))) #define isPow2(x) (((x)&(x-1))==0) @@ -728,7 +729,7 @@ DLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV(int componentID, int width, } -DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf, +DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags) { @@ -785,8 +786,9 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf, _throw("tjCompress2(): Memory allocation failure"); for(i=0; inext_scanlineimage_height) { @@ -827,9 +829,10 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle handle, unsigned char *srcBuf, } -DLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle, unsigned char *srcBuf, - int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes, - int *strides, int subsamp, int flags) +DLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle, + const unsigned char *srcBuf, int width, int pitch, int height, + int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp, + int flags) { int i, retval=0; JSAMPROW *row_pointer=NULL; JSAMPLE *_tmpbuf[MAX_COMPONENTS], *_tmpbuf2[MAX_COMPONENTS]; @@ -910,8 +913,9 @@ DLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle, unsigned char *srcBuf, _throw("tjEncodeYUVPlanes(): Memory allocation failure"); for(i=0; iv_samp_factor/dinfo->max_v_samp_factor; inbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph[i]); if(!inbuf[i]) _throw("tjDecodeYUVPlanes(): Memory allocation failure"); - ptr=srcPlanes[i]; + ptr=(JSAMPLE *)srcPlanes[i]; for(row=0; row=NUMSUBOPT @@ -1698,8 +1704,8 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf, } DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle, - unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes, - int width, int *strides, int height, int flags) + const unsigned char *jpegBuf, unsigned long jpegSize, + unsigned char **dstPlanes, int width, int *strides, int height, int flags) { int i, sfi, row, retval=0; JSAMPROW *outbuf[MAX_COMPONENTS]; int jpegwidth, jpegheight, jpegSubsamp, scaledw, scaledh; @@ -1872,7 +1878,7 @@ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle, } DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle, - unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, + const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags) { unsigned char *dstPlanes[3]; @@ -1959,9 +1965,9 @@ DLLEXPORT tjhandle DLLCALL tjInitTransform(void) } -DLLEXPORT int DLLCALL tjTransform(tjhandle handle, unsigned char *jpegBuf, - unsigned long jpegSize, int n, unsigned char **dstBufs, - unsigned long *dstSizes, tjtransform *t, int flags) +DLLEXPORT int DLLCALL tjTransform(tjhandle handle, + const unsigned char *jpegBuf, unsigned long jpegSize, int n, + unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *t, int flags) { jpeg_transform_info *xinfo=NULL; jvirt_barray_ptr *srccoefs, *dstcoefs; diff --git a/turbojpeg.h b/turbojpeg.h index d5c624e1..583029fa 100644 --- a/turbojpeg.h +++ b/turbojpeg.h @@ -619,7 +619,7 @@ DLLEXPORT tjhandle DLLCALL tjInitCompress(void); * @param handle a handle to a TurboJPEG compressor or transformer instance * * @param srcBuf pointer to an image buffer containing RGB, grayscale, or - * CMYK pixels to be compressed. This buffer is not modified. + * CMYK pixels to be compressed * * @param width width (in pixels) of the source image * @@ -672,7 +672,7 @@ DLLEXPORT tjhandle DLLCALL tjInitCompress(void); * * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ -DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf, +DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags); @@ -687,7 +687,7 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf, * #tjBufSizeYUV2() for the given image width, height, padding, and level of * chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be * stored sequentially in the source buffer (refer to @ref YUVnotes - * "YUV Image Format Notes".) This buffer is not modified. + * "YUV Image Format Notes".) * * @param width width (in pixels) of the source image. If the width is not an * even multiple of the MCU block width (see #tjMCUWidth), then an intermediate @@ -736,9 +736,9 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf, * * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ -DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf, - int width, int pad, int height, int subsamp, unsigned char **jpegBuf, - unsigned long *jpegSize, int jpegQual, int flags); +DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, + const unsigned char *srcBuf, int width, int pad, int height, int subsamp, + unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags); /** @@ -752,7 +752,7 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf, * memory. The size of each plane should match the value returned by * #tjPlaneSizeYUV() for the given image width, height, strides, and level of * chrominance subsampling. Refer to @ref YUVnotes "YUV Image Format Notes" - * for more details. These image planes are not modified. + * for more details. * * @param width width (in pixels) of the source image. If the width is not an * even multiple of the MCU block width (see #tjMCUWidth), then an intermediate @@ -807,8 +807,9 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf, * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ DLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle, - unsigned char **srcPlanes, int width, int *strides, int height, int subsamp, - unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags); + const unsigned char **srcPlanes, int width, const int *strides, int height, + int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, + int flags); /** @@ -926,7 +927,7 @@ DLLEXPORT int tjPlaneHeight(int componentID, int height, int subsamp); * @param handle a handle to a TurboJPEG compressor or transformer instance * * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels - * to be encoded. This buffer is not modified. + * to be encoded * * @param width width (in pixels) of the source image * @@ -966,8 +967,8 @@ DLLEXPORT int tjPlaneHeight(int componentID, int height, int subsamp); * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, - unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, - unsigned char *dstBuf, int pad, int subsamp, int flags); + const unsigned char *srcBuf, int width, int pitch, int height, + int pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags); /** @@ -979,7 +980,7 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, * @param handle a handle to a TurboJPEG compressor or transformer instance * * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels - * to be encoded. This buffer is not modified. + * to be encoded * * @param width width (in pixels) of the source image * @@ -1024,8 +1025,9 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ DLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle, - unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, - unsigned char **dstPlanes, int *strides, int subsamp, int flags); + const unsigned char *srcBuf, int width, int pitch, int height, + int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp, + int flags); /** @@ -1042,8 +1044,7 @@ DLLEXPORT tjhandle DLLCALL tjInitDecompress(void); * * @param handle a handle to a TurboJPEG decompressor or transformer instance * - * @param jpegBuf pointer to a buffer containing a JPEG image. This buffer is - * not modified. + * @param jpegBuf pointer to a buffer containing a JPEG image * * @param jpegSize size of the JPEG image (in bytes) * @@ -1064,8 +1065,8 @@ DLLEXPORT tjhandle DLLCALL tjInitDecompress(void); * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ DLLEXPORT int DLLCALL tjDecompressHeader3(tjhandle handle, - unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height, - int *jpegSubsamp, int *jpegColorspace); + const unsigned char *jpegBuf, unsigned long jpegSize, int *width, + int *height, int *jpegSubsamp, int *jpegColorspace); /** @@ -1086,8 +1087,7 @@ DLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors); * * @param handle a handle to a TurboJPEG decompressor or transformer instance * - * @param jpegBuf pointer to a buffer containing the JPEG image to decompress. - * This buffer is not modified. + * @param jpegBuf pointer to a buffer containing the JPEG image to decompress * * @param jpegSize size of the JPEG image (in bytes) * @@ -1132,7 +1132,7 @@ DLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors); * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle, - unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, + const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags); @@ -1143,8 +1143,7 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle, * * @param handle a handle to a TurboJPEG decompressor or transformer instance * - * @param jpegBuf pointer to a buffer containing the JPEG image to decompress. - * This buffer is not modified. + * @param jpegBuf pointer to a buffer containing the JPEG image to decompress * * @param jpegSize size of the JPEG image (in bytes) * @@ -1183,7 +1182,7 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle, * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle, - unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, + const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags); @@ -1194,8 +1193,7 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle, * * @param handle a handle to a TurboJPEG decompressor or transformer instance * - * @param jpegBuf pointer to a buffer containing the JPEG image to decompress. - * This buffer is not modified. + * @param jpegBuf pointer to a buffer containing the JPEG image to decompress * * @param jpegSize size of the JPEG image (in bytes) * @@ -1240,8 +1238,8 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle, * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle, - unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes, - int width, int *strides, int height, int flags); + const unsigned char *jpegBuf, unsigned long jpegSize, + unsigned char **dstPlanes, int width, int *strides, int height, int flags); /** @@ -1257,7 +1255,7 @@ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle, * #tjBufSizeYUV2() for the given image width, height, padding, and level of * chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be * stored sequentially in the source buffer (refer to @ref YUVnotes - * "YUV Image Format Notes".) This buffer is not modified. + * "YUV Image Format Notes".) * * @param pad Use this parameter to specify that the width of each line in each * plane of the YUV source image is padded to the nearest multiple of this @@ -1291,7 +1289,7 @@ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle, * * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ -DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf, +DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, const unsigned char *srcBuf, int pad, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags); @@ -1310,7 +1308,7 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf, * The size of each plane should match the value returned by #tjPlaneSizeYUV() * for the given image width, height, strides, and level of chrominance * subsampling. Refer to @ref YUVnotes "YUV Image Format Notes" for more - * details. These image planes are not modified. + * details. * * @param strides an array of integers, each specifying the number of bytes per * line in the corresponding plane of the YUV source image. Setting the stride @@ -1349,8 +1347,9 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf, * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ DLLEXPORT int DLLCALL tjDecodeYUVPlanes(tjhandle handle, - unsigned char **srcPlanes, int *strides, int subsamp, unsigned char *dstBuf, - int width, int pitch, int height, int pixelFormat, int flags); + const unsigned char **srcPlanes, const int *strides, int subsamp, + unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, + int flags); /** @@ -1378,7 +1377,7 @@ DLLEXPORT tjhandle DLLCALL tjInitTransform(void); * @param handle a handle to a TurboJPEG transformer instance * * @param jpegBuf pointer to a buffer containing the JPEG source image to - * transform. This buffer is not modified. + * transform * * @param jpegSize size of the JPEG source image (in bytes) * @@ -1417,9 +1416,10 @@ DLLEXPORT tjhandle DLLCALL tjInitTransform(void); * * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().) */ -DLLEXPORT int DLLCALL tjTransform(tjhandle handle, unsigned char *jpegBuf, - unsigned long jpegSize, int n, unsigned char **dstBufs, - unsigned long *dstSizes, tjtransform *transforms, int flags); +DLLEXPORT int DLLCALL tjTransform(tjhandle handle, + const unsigned char *jpegBuf, unsigned long jpegSize, int n, + unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, + int flags); /** From 333f3cf7565d588b483a3ac82193bd8ba0a93bec Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 15 Aug 2015 17:04:58 -0500 Subject: [PATCH 067/140] Fix 'make dist' --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 315ced33..18bd2d2a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -168,7 +168,7 @@ dist_example_DATA = example.c EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \ sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \ doxygen-extra.css jccolext.c jdcolext.c jdcol565.c jdmrgext.c jdmrg565.c \ - jstdhuff.c + jstdhuff.c jdcoefct.h jdmainct.h jdsample.h dist-hook: rm -rf `find $(distdir) -name .svn` From f62dbccf5f64d25c402a3d2863fb8fb3e0d65809 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Sat, 15 Aug 2015 13:30:14 +0100 Subject: [PATCH 068/140] Fix build error when compiling MIPS SIMD w/ -mfpxx When compiled with -mfpxx (which is now the default on Debian), there are some restrictions on the use of odd-numbered FP registers. More details about FPXX can be found here: https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking This commit simply changes all uses of FP registers to an even-numbered equivalent like this: f0 -> f0 f1 -> f2 f2 -> f4 ... f8 -> f16 This commit should have no observable effect except that the MIPS assembly will now compile with -mfpxx. Closes #11 --- ChangeLog.txt | 3 + simd/jsimd_mips_dspr2.S | 392 ++++++++++++++++++++-------------------- 2 files changed, 199 insertions(+), 196 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f901e520..626bdcee 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -31,6 +31,9 @@ This facilitates passing read-only buffers to those functions and ensures the caller that the source buffer will not be modified. This should not create any backward API or ABI incompatibilities with prior libjpeg-turbo releases. +[7] The MIPS DSPr2 SIMD code can now be compiled to support either FR=0 or FR=1 +FPUs. + 1.4.1 ===== diff --git a/simd/jsimd_mips_dspr2.S b/simd/jsimd_mips_dspr2.S index c5990965..78625bda 100644 --- a/simd/jsimd_mips_dspr2.S +++ b/simd/jsimd_mips_dspr2.S @@ -2842,54 +2842,54 @@ LEAF_MIPS_DSPR2(jsimd_quantize_float_mips_dspr2) mtc1 t1, f0 li t0, 63 0: - lwc1 f1, 0(a2) - lwc1 f5, 0(a1) - lwc1 f2, 4(a2) - lwc1 f6, 4(a1) - lwc1 f3, 8(a2) - lwc1 f7, 8(a1) - lwc1 f4, 12(a2) - lwc1 f8, 12(a1) - madd.s f1, f0, f1, f5 - madd.s f2, f0, f2, f6 - madd.s f3, f0, f3, f7 - madd.s f4, f0, f4, f8 - lwc1 f5, 16(a1) - lwc1 f6, 20(a1) - trunc.w.s f1, f1 + lwc1 f2, 0(a2) + lwc1 f10, 0(a1) + lwc1 f4, 4(a2) + lwc1 f12, 4(a1) + lwc1 f6, 8(a2) + lwc1 f14, 8(a1) + lwc1 f8, 12(a2) + lwc1 f16, 12(a1) + madd.s f2, f0, f2, f10 + madd.s f4, f0, f4, f12 + madd.s f6, f0, f6, f14 + madd.s f8, f0, f8, f16 + lwc1 f10, 16(a1) + lwc1 f12, 20(a1) trunc.w.s f2, f2 - trunc.w.s f3, f3 trunc.w.s f4, f4 - lwc1 f7, 24(a1) - lwc1 f8, 28(a1) - mfc1 t1, f1 - mfc1 t2, f2 - mfc1 t3, f3 - mfc1 t4, f4 - lwc1 f1, 16(a2) - lwc1 f2, 20(a2) - lwc1 f3, 24(a2) - lwc1 f4, 28(a2) - madd.s f1, f0, f1, f5 - madd.s f2, f0, f2, f6 - madd.s f3, f0, f3, f7 - madd.s f4, f0, f4, f8 + trunc.w.s f6, f6 + trunc.w.s f8, f8 + lwc1 f14, 24(a1) + lwc1 f16, 28(a1) + mfc1 t1, f2 + mfc1 t2, f4 + mfc1 t3, f6 + mfc1 t4, f8 + lwc1 f2, 16(a2) + lwc1 f4, 20(a2) + lwc1 f6, 24(a2) + lwc1 f8, 28(a2) + madd.s f2, f0, f2, f10 + madd.s f4, f0, f4, f12 + madd.s f6, f0, f6, f14 + madd.s f8, f0, f8, f16 addiu t1, t1, -16384 addiu t2, t2, -16384 addiu t3, t3, -16384 addiu t4, t4, -16384 - trunc.w.s f1, f1 trunc.w.s f2, f2 - trunc.w.s f3, f3 trunc.w.s f4, f4 + trunc.w.s f6, f6 + trunc.w.s f8, f8 sh t1, 0(a0) sh t2, 2(a0) sh t3, 4(a0) sh t4, 6(a0) - mfc1 t1, f1 - mfc1 t2, f2 - mfc1 t3, f3 - mfc1 t4, f4 + mfc1 t1, f2 + mfc1 t2, f4 + mfc1 t3, f6 + mfc1 t4, f8 addiu t0, t0, -8 addiu a2, a2, 32 addiu a1, a1, 32 @@ -4152,32 +4152,32 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) addiu t6, t6, -128 addiu t7, t7, -128 addiu t8, t8, -128 - mtc1 t1, f1 - mtc1 t2, f2 - mtc1 t3, f3 - mtc1 t4, f4 - mtc1 t5, f5 - mtc1 t6, f6 - mtc1 t7, f7 - mtc1 t8, f8 - cvt.s.w f1, f1 + mtc1 t1, f2 + mtc1 t2, f4 + mtc1 t3, f6 + mtc1 t4, f8 + mtc1 t5, f10 + mtc1 t6, f12 + mtc1 t7, f14 + mtc1 t8, f16 cvt.s.w f2, f2 - cvt.s.w f3, f3 cvt.s.w f4, f4 - cvt.s.w f5, f5 cvt.s.w f6, f6 - cvt.s.w f7, f7 cvt.s.w f8, f8 + cvt.s.w f10, f10 + cvt.s.w f12, f12 + cvt.s.w f14, f14 + cvt.s.w f16, f16 lw t0, 4(a0) - swc1 f1, 0(a2) - swc1 f2, 4(a2) - swc1 f3, 8(a2) + swc1 f2, 0(a2) + swc1 f4, 4(a2) + swc1 f6, 8(a2) addu t0, t0, a1 - swc1 f4, 12(a2) - swc1 f5, 16(a2) - swc1 f6, 20(a2) - swc1 f7, 24(a2) - swc1 f8, 28(a2) + swc1 f8, 12(a2) + swc1 f10, 16(a2) + swc1 f12, 20(a2) + swc1 f14, 24(a2) + swc1 f16, 28(a2) //elemr 1 lbu t1, 0(t0) lbu t2, 1(t0) @@ -4195,32 +4195,32 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) addiu t6, t6, -128 addiu t7, t7, -128 addiu t8, t8, -128 - mtc1 t1, f1 - mtc1 t2, f2 - mtc1 t3, f3 - mtc1 t4, f4 - mtc1 t5, f5 - mtc1 t6, f6 - mtc1 t7, f7 - mtc1 t8, f8 - cvt.s.w f1, f1 + mtc1 t1, f2 + mtc1 t2, f4 + mtc1 t3, f6 + mtc1 t4, f8 + mtc1 t5, f10 + mtc1 t6, f12 + mtc1 t7, f14 + mtc1 t8, f16 cvt.s.w f2, f2 - cvt.s.w f3, f3 cvt.s.w f4, f4 - cvt.s.w f5, f5 cvt.s.w f6, f6 - cvt.s.w f7, f7 cvt.s.w f8, f8 + cvt.s.w f10, f10 + cvt.s.w f12, f12 + cvt.s.w f14, f14 + cvt.s.w f16, f16 lw t0, 8(a0) - swc1 f1, 32(a2) - swc1 f2, 36(a2) - swc1 f3, 40(a2) + swc1 f2, 32(a2) + swc1 f4, 36(a2) + swc1 f6, 40(a2) addu t0, t0, a1 - swc1 f4, 44(a2) - swc1 f5, 48(a2) - swc1 f6, 52(a2) - swc1 f7, 56(a2) - swc1 f8, 60(a2) + swc1 f8, 44(a2) + swc1 f10, 48(a2) + swc1 f12, 52(a2) + swc1 f14, 56(a2) + swc1 f16, 60(a2) //elemr 2 lbu t1, 0(t0) lbu t2, 1(t0) @@ -4238,32 +4238,32 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) addiu t6, t6, -128 addiu t7, t7, -128 addiu t8, t8, -128 - mtc1 t1, f1 - mtc1 t2, f2 - mtc1 t3, f3 - mtc1 t4, f4 - mtc1 t5, f5 - mtc1 t6, f6 - mtc1 t7, f7 - mtc1 t8, f8 - cvt.s.w f1, f1 + mtc1 t1, f2 + mtc1 t2, f4 + mtc1 t3, f6 + mtc1 t4, f8 + mtc1 t5, f10 + mtc1 t6, f12 + mtc1 t7, f14 + mtc1 t8, f16 cvt.s.w f2, f2 - cvt.s.w f3, f3 cvt.s.w f4, f4 - cvt.s.w f5, f5 cvt.s.w f6, f6 - cvt.s.w f7, f7 cvt.s.w f8, f8 + cvt.s.w f10, f10 + cvt.s.w f12, f12 + cvt.s.w f14, f14 + cvt.s.w f16, f16 lw t0, 12(a0) - swc1 f1, 64(a2) - swc1 f2, 68(a2) - swc1 f3, 72(a2) + swc1 f2, 64(a2) + swc1 f4, 68(a2) + swc1 f6, 72(a2) addu t0, t0, a1 - swc1 f4, 76(a2) - swc1 f5, 80(a2) - swc1 f6, 84(a2) - swc1 f7, 88(a2) - swc1 f8, 92(a2) + swc1 f8, 76(a2) + swc1 f10, 80(a2) + swc1 f12, 84(a2) + swc1 f14, 88(a2) + swc1 f16, 92(a2) //elemr 3 lbu t1, 0(t0) lbu t2, 1(t0) @@ -4281,32 +4281,32 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) addiu t6, t6, -128 addiu t7, t7, -128 addiu t8, t8, -128 - mtc1 t1, f1 - mtc1 t2, f2 - mtc1 t3, f3 - mtc1 t4, f4 - mtc1 t5, f5 - mtc1 t6, f6 - mtc1 t7, f7 - mtc1 t8, f8 - cvt.s.w f1, f1 + mtc1 t1, f2 + mtc1 t2, f4 + mtc1 t3, f6 + mtc1 t4, f8 + mtc1 t5, f10 + mtc1 t6, f12 + mtc1 t7, f14 + mtc1 t8, f16 cvt.s.w f2, f2 - cvt.s.w f3, f3 cvt.s.w f4, f4 - cvt.s.w f5, f5 cvt.s.w f6, f6 - cvt.s.w f7, f7 cvt.s.w f8, f8 + cvt.s.w f10, f10 + cvt.s.w f12, f12 + cvt.s.w f14, f14 + cvt.s.w f16, f16 lw t0, 16(a0) - swc1 f1, 96(a2) - swc1 f2, 100(a2) - swc1 f3, 104(a2) + swc1 f2, 96(a2) + swc1 f4, 100(a2) + swc1 f6, 104(a2) addu t0, t0, a1 - swc1 f4, 108(a2) - swc1 f5, 112(a2) - swc1 f6, 116(a2) - swc1 f7, 120(a2) - swc1 f8, 124(a2) + swc1 f8, 108(a2) + swc1 f10, 112(a2) + swc1 f12, 116(a2) + swc1 f14, 120(a2) + swc1 f16, 124(a2) //elemr 4 lbu t1, 0(t0) lbu t2, 1(t0) @@ -4324,32 +4324,32 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) addiu t6, t6, -128 addiu t7, t7, -128 addiu t8, t8, -128 - mtc1 t1, f1 - mtc1 t2, f2 - mtc1 t3, f3 - mtc1 t4, f4 - mtc1 t5, f5 - mtc1 t6, f6 - mtc1 t7, f7 - mtc1 t8, f8 - cvt.s.w f1, f1 + mtc1 t1, f2 + mtc1 t2, f4 + mtc1 t3, f6 + mtc1 t4, f8 + mtc1 t5, f10 + mtc1 t6, f12 + mtc1 t7, f14 + mtc1 t8, f16 cvt.s.w f2, f2 - cvt.s.w f3, f3 cvt.s.w f4, f4 - cvt.s.w f5, f5 cvt.s.w f6, f6 - cvt.s.w f7, f7 cvt.s.w f8, f8 + cvt.s.w f10, f10 + cvt.s.w f12, f12 + cvt.s.w f14, f14 + cvt.s.w f16, f16 lw t0, 20(a0) - swc1 f1, 128(a2) - swc1 f2, 132(a2) - swc1 f3, 136(a2) + swc1 f2, 128(a2) + swc1 f4, 132(a2) + swc1 f6, 136(a2) addu t0, t0, a1 - swc1 f4, 140(a2) - swc1 f5, 144(a2) - swc1 f6, 148(a2) - swc1 f7, 152(a2) - swc1 f8, 156(a2) + swc1 f8, 140(a2) + swc1 f10, 144(a2) + swc1 f12, 148(a2) + swc1 f14, 152(a2) + swc1 f16, 156(a2) //elemr 5 lbu t1, 0(t0) lbu t2, 1(t0) @@ -4367,32 +4367,32 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) addiu t6, t6, -128 addiu t7, t7, -128 addiu t8, t8, -128 - mtc1 t1, f1 - mtc1 t2, f2 - mtc1 t3, f3 - mtc1 t4, f4 - mtc1 t5, f5 - mtc1 t6, f6 - mtc1 t7, f7 - mtc1 t8, f8 - cvt.s.w f1, f1 + mtc1 t1, f2 + mtc1 t2, f4 + mtc1 t3, f6 + mtc1 t4, f8 + mtc1 t5, f10 + mtc1 t6, f12 + mtc1 t7, f14 + mtc1 t8, f16 cvt.s.w f2, f2 - cvt.s.w f3, f3 cvt.s.w f4, f4 - cvt.s.w f5, f5 cvt.s.w f6, f6 - cvt.s.w f7, f7 cvt.s.w f8, f8 + cvt.s.w f10, f10 + cvt.s.w f12, f12 + cvt.s.w f14, f14 + cvt.s.w f16, f16 lw t0, 24(a0) - swc1 f1, 160(a2) - swc1 f2, 164(a2) - swc1 f3, 168(a2) + swc1 f2, 160(a2) + swc1 f4, 164(a2) + swc1 f6, 168(a2) addu t0, t0, a1 - swc1 f4, 172(a2) - swc1 f5, 176(a2) - swc1 f6, 180(a2) - swc1 f7, 184(a2) - swc1 f8, 188(a2) + swc1 f8, 172(a2) + swc1 f10, 176(a2) + swc1 f12, 180(a2) + swc1 f14, 184(a2) + swc1 f16, 188(a2) //elemr 6 lbu t1, 0(t0) lbu t2, 1(t0) @@ -4410,32 +4410,32 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) addiu t6, t6, -128 addiu t7, t7, -128 addiu t8, t8, -128 - mtc1 t1, f1 - mtc1 t2, f2 - mtc1 t3, f3 - mtc1 t4, f4 - mtc1 t5, f5 - mtc1 t6, f6 - mtc1 t7, f7 - mtc1 t8, f8 - cvt.s.w f1, f1 + mtc1 t1, f2 + mtc1 t2, f4 + mtc1 t3, f6 + mtc1 t4, f8 + mtc1 t5, f10 + mtc1 t6, f12 + mtc1 t7, f14 + mtc1 t8, f16 cvt.s.w f2, f2 - cvt.s.w f3, f3 cvt.s.w f4, f4 - cvt.s.w f5, f5 cvt.s.w f6, f6 - cvt.s.w f7, f7 cvt.s.w f8, f8 + cvt.s.w f10, f10 + cvt.s.w f12, f12 + cvt.s.w f14, f14 + cvt.s.w f16, f16 lw t0, 28(a0) - swc1 f1, 192(a2) - swc1 f2, 196(a2) - swc1 f3, 200(a2) + swc1 f2, 192(a2) + swc1 f4, 196(a2) + swc1 f6, 200(a2) addu t0, t0, a1 - swc1 f4, 204(a2) - swc1 f5, 208(a2) - swc1 f6, 212(a2) - swc1 f7, 216(a2) - swc1 f8, 220(a2) + swc1 f8, 204(a2) + swc1 f10, 208(a2) + swc1 f12, 212(a2) + swc1 f14, 216(a2) + swc1 f16, 220(a2) //elemr 7 lbu t1, 0(t0) lbu t2, 1(t0) @@ -4453,30 +4453,30 @@ LEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2) addiu t6, t6, -128 addiu t7, t7, -128 addiu t8, t8, -128 - mtc1 t1, f1 - mtc1 t2, f2 - mtc1 t3, f3 - mtc1 t4, f4 - mtc1 t5, f5 - mtc1 t6, f6 - mtc1 t7, f7 - mtc1 t8, f8 - cvt.s.w f1, f1 + mtc1 t1, f2 + mtc1 t2, f4 + mtc1 t3, f6 + mtc1 t4, f8 + mtc1 t5, f10 + mtc1 t6, f12 + mtc1 t7, f14 + mtc1 t8, f16 cvt.s.w f2, f2 - cvt.s.w f3, f3 cvt.s.w f4, f4 - cvt.s.w f5, f5 cvt.s.w f6, f6 - cvt.s.w f7, f7 cvt.s.w f8, f8 - swc1 f1, 224(a2) - swc1 f2, 228(a2) - swc1 f3, 232(a2) - swc1 f4, 236(a2) - swc1 f5, 240(a2) - swc1 f6, 244(a2) - swc1 f7, 248(a2) - swc1 f8, 252(a2) + cvt.s.w f10, f10 + cvt.s.w f12, f12 + cvt.s.w f14, f14 + cvt.s.w f16, f16 + swc1 f2, 224(a2) + swc1 f4, 228(a2) + swc1 f6, 232(a2) + swc1 f8, 236(a2) + swc1 f10, 240(a2) + swc1 f12, 244(a2) + swc1 f14, 248(a2) + swc1 f16, 252(a2) j ra nop From 870b4f28b41609221cebad08d50298a5d447d307 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 16 Sep 2015 23:26:13 -0500 Subject: [PATCH 069/140] Fix ChangeLog numbering biffed by previous merge --- ChangeLog.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d99d4df1..31aa6c07 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -39,7 +39,7 @@ incorrectly encode certain JPEG images when quality=100 and the fast integer forward DCT were used. This was known to cause 'make test' to fail when the library was built with '-march=haswell' on x86 systems. -[3] Fixed an issue whereby libjpeg-turbo would crash when built with the latest +[9] Fixed an issue whereby libjpeg-turbo would crash when built with the latest & greatest development version of the Clang/LLVM compiler. This was caused by an x86-64 ABI conformance issue in some of libjpeg-turbo's 64-bit SSE2 SIMD routines. Those routines were incorrectly using a 64-bit mov instruction to @@ -49,7 +49,7 @@ Clang/LLVM optimizer uses load combining to transfer multiple adjacent 32-bit structure members into a single 64-bit register, and this exposed the ABI conformance issue. -[4] Fixed a bug in the MIPS DSPr2 4:2:0 "plain" (non-fancy and non-merged) +[10] Fixed a bug in the MIPS DSPr2 4:2:0 "plain" (non-fancy and non-merged) upsampling routine that caused a buffer overflow (and subsequent segfault) when decompressing a 4:2:0 JPEG image whose scaled output width was less than 16 pixels. The "plain" upsampling routines are normally only used when From 7e3acc0e0a35cbbcb6091ec640f1842e7deebe1a Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 10 Oct 2015 10:25:46 -0500 Subject: [PATCH 070/140] Rename README, LICENSE, BUILDING text files The IJG README file has been renamed to README.ijg, in order to avoid confusion (many people were assuming that that was our project's README file and weren't reading README-turbo.txt) and to lay the groundwork for markdown versions of the libjpeg-turbo README and build instructions. --- BUILDING.txt => BUILDING.md | 0 CMakeLists.txt | 2 +- ChangeLog.txt | 4 ++-- LICENSE.txt => LICENSE.md | 0 Makefile.am | 4 ++-- README => README.ijg | 2 +- README-turbo.txt => README.md | 0 cderror.h | 3 ++- cdjpeg.c | 3 ++- cdjpeg.h | 3 ++- cjpeg.c | 3 ++- coderules.txt | 2 +- djpeg.c | 3 ++- jaricom.c | 3 ++- jcapimin.c | 3 ++- jcapistd.c | 3 ++- jcarith.c | 3 ++- jccoefct.c | 3 ++- jccolext.c | 3 ++- jccolor.c | 3 ++- jcdctmgr.c | 3 ++- jchuff.c | 3 ++- jchuff.h | 3 ++- jcinit.c | 3 ++- jcmainct.c | 3 ++- jcmarker.c | 3 ++- jcmaster.c | 3 ++- jcomapi.c | 3 ++- jconfig.txt | 3 ++- jcparam.c | 3 ++- jcphuff.c | 3 ++- jcprepct.c | 3 ++- jcsample.c | 3 ++- jctrans.c | 3 ++- jdapimin.c | 3 ++- jdapistd.c | 3 ++- jdarith.c | 3 ++- jdatadst-tj.c | 3 ++- jdatadst.c | 3 ++- jdatasrc-tj.c | 3 ++- jdatasrc.c | 3 ++- jdcoefct.c | 3 ++- jdcoefct.h | 3 ++- jdcol565.c | 3 ++- jdcolext.c | 3 ++- jdcolor.c | 3 ++- jdct.h | 3 ++- jddctmgr.c | 3 ++- jdhuff.c | 3 ++- jdhuff.h | 3 ++- jdinput.c | 3 ++- jdmainct.c | 3 ++- jdmainct.h | 3 ++- jdmarker.c | 3 ++- jdmaster.c | 3 ++- jdmerge.c | 3 ++- jdmrg565.c | 3 ++- jdmrgext.c | 3 ++- jdphuff.c | 3 ++- jdpostct.c | 3 ++- jdsample.c | 3 ++- jdsample.h | 3 ++- jdtrans.c | 3 ++- jerror.c | 3 ++- jerror.h | 3 ++- jfdctflt.c | 7 ++++--- jfdctfst.c | 7 ++++--- jfdctint.c | 3 ++- jidctflt.c | 7 ++++--- jidctfst.c | 7 ++++--- jidctint.c | 3 ++- jidctred.c | 3 ++- jinclude.h | 3 ++- jmemmgr.c | 3 ++- jmemnobs.c | 3 ++- jmemsys.h | 3 ++- jmorecfg.h | 3 ++- jpegcomp.h | 3 ++- jpegint.h | 3 ++- jpeglib.h | 3 ++- jpegtran.c | 3 ++- jquant1.c | 3 ++- jquant2.c | 3 ++- jstdhuff.c | 3 ++- jutils.c | 3 ++- jversion.h | 3 ++- libjpeg.txt | 6 +++--- rdbmp.c | 3 ++- rdcolmap.c | 3 ++- rdgif.c | 3 ++- rdjpgcom.c | 3 ++- rdppm.c | 3 ++- rdrle.c | 3 ++- rdswitch.c | 3 ++- rdtarga.c | 3 ++- release/libjpeg-turbo.nsi.in | 8 ++++---- simd/jcsample.h | 3 ++- structure.txt | 4 ++-- transupp.c | 3 ++- transupp.h | 3 ++- wrbmp.c | 3 ++- wrgif.c | 3 ++- wrjpgcom.c | 3 ++- wrppm.c | 3 ++- wrrle.c | 3 ++- wrtarga.c | 3 ++- 106 files changed, 214 insertions(+), 119 deletions(-) rename BUILDING.txt => BUILDING.md (100%) rename LICENSE.txt => LICENSE.md (100%) rename README => README.ijg (99%) rename README-turbo.txt => README.md (100%) diff --git a/BUILDING.txt b/BUILDING.md similarity index 100% rename from BUILDING.txt rename to BUILDING.md diff --git a/CMakeLists.txt b/CMakeLists.txt index df874e98..308754da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -944,7 +944,7 @@ endif() install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION bin) -install(FILES ${CMAKE_SOURCE_DIR}/README ${CMAKE_SOURCE_DIR}/README-turbo.txt +install(FILES ${CMAKE_SOURCE_DIR}/README.ijg ${CMAKE_SOURCE_DIR}/README.md ${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt ${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt ${CMAKE_SOURCE_DIR}/wizard.txt diff --git a/ChangeLog.txt b/ChangeLog.txt index 5ae9431b..9ebbfa93 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -441,7 +441,7 @@ ABI. The "age number" of the libjpeg-turbo library on Un*x systems has been incremented by 1 to reflect this. You can disable this feature with a configure/CMake switch in order to retain strict API/ABI compatibility with the libjpeg v6b or v7 API/ABI (or with previous versions of libjpeg-turbo.) See -README-turbo.txt for more details. +README.md for more details. [13] Added ARMv7s architecture to libjpeg.a and libturbojpeg.a in the official libjpeg-turbo binary package for OS X, so that those libraries can be used to @@ -677,7 +677,7 @@ tjDecompressToYUV(), to replace the somewhat hackish TJ_YUV flag. ================== [1] Added emulation of the libjpeg v7 and v8 APIs and ABIs. See -README-turbo.txt for more details. This feature was sponsored by CamTrace SAS. +README.md for more details. This feature was sponsored by CamTrace SAS. [2] Created a new CMake-based build system for the Visual C++ and MinGW builds. diff --git a/LICENSE.txt b/LICENSE.md similarity index 100% rename from LICENSE.txt rename to LICENSE.md diff --git a/Makefile.am b/Makefile.am index 18bd2d2a..e70ae698 100644 --- a/Makefile.am +++ b/Makefile.am @@ -158,7 +158,7 @@ dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 DOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.txt \ ChangeLog.txt -dist_doc_DATA = README README-turbo.txt libjpeg.txt structure.txt usage.txt \ +dist_doc_DATA = README.ijg README.md libjpeg.txt structure.txt usage.txt \ wizard.txt exampledir = $(docdir) @@ -237,7 +237,7 @@ MD5_PPM_GRAY_ISLOW_RGB = 116424ac07b79e5e801f00508eab48ec MD5_BMP_GRAY_ISLOW_565 = 12f78118e56a2f48b966f792fedf23cc MD5_BMP_GRAY_ISLOW_565D = bdbbd616441a24354c98553df5dc82db MD5_JPEG_420S_IFAST_OPT = 388708217ac46273ca33086b22827ed8 -# See README-turbo.txt for more details on why this next bit is necessary. +# See README.md for more details on why this next bit is necessary. MD5_JPEG_3x2_FLOAT_PROG_SSE = 343e3f8caf8af5986ebaf0bdc13b5c71 MD5_PPM_3x2_FLOAT_SSE = 1a75f36e5904d6fc3a85a43da9ad89bb MD5_JPEG_3x2_FLOAT_PROG_32BIT = 9bca803d2042bd1eb03819e2bf92b3e5 diff --git a/README b/README.ijg similarity index 99% rename from README rename to README.ijg index e82a095b..3a007634 100644 --- a/README +++ b/README.ijg @@ -1,7 +1,7 @@ libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project to include only information relevant to libjpeg-turbo, to wordsmith certain sections, and to remove impolitic language that existed in the libjpeg v8 -README. It is included only for reference. Please see README-turbo.txt for +README. It is included only for reference. Please see README.md for information specific to libjpeg-turbo. diff --git a/README-turbo.txt b/README.md similarity index 100% rename from README-turbo.txt rename to README.md diff --git a/cderror.h b/cderror.h index 6569aef2..63de498f 100644 --- a/cderror.h +++ b/cderror.h @@ -4,7 +4,8 @@ * Copyright (C) 1994-1997, Thomas G. Lane. * Modified 2009 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file defines the error and message codes for the cjpeg/djpeg * applications. These strings are not needed as part of the JPEG library diff --git a/cdjpeg.c b/cdjpeg.c index 7cc0d6e8..fe99de86 100644 --- a/cdjpeg.c +++ b/cdjpeg.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains common support routines used by the IJG application * programs (cjpeg, djpeg, jpegtran). diff --git a/cdjpeg.h b/cdjpeg.h index 8461ee33..8fc337df 100644 --- a/cdjpeg.h +++ b/cdjpeg.h @@ -5,7 +5,8 @@ * Copyright (C) 1994-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains common declarations for the sample applications * cjpeg and djpeg. It is NOT used by the core JPEG library. diff --git a/cjpeg.c b/cjpeg.c index 92e2824f..7aa061e6 100644 --- a/cjpeg.c +++ b/cjpeg.c @@ -6,7 +6,8 @@ * Modified 2003-2011 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2010, 2013-2014, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a command-line user interface for the JPEG compressor. * It should work on any system with Unix- or MS-DOS-style command lines. diff --git a/coderules.txt b/coderules.txt index 8683e9a6..a2f593ad 100644 --- a/coderules.txt +++ b/coderules.txt @@ -4,7 +4,7 @@ This file was part of the Independent JPEG Group's software: Copyright (C) 1991-1996, Thomas G. Lane. It was modified by The libjpeg-turbo Project to include only information relevant to libjpeg-turbo. -For conditions of distribution and use, see the accompanying README file. +For conditions of distribution and use, see the accompanying README.ijg file. Since numerous people will be contributing code and bug fixes, it's important diff --git a/djpeg.c b/djpeg.c index d41f94f1..8b516a6d 100644 --- a/djpeg.c +++ b/djpeg.c @@ -6,7 +6,8 @@ * libjpeg-turbo Modifications: * Copyright (C) 2010-2011, 2013-2015, D. R. Commander. * Copyright (C) 2015, Google, Inc. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a command-line user interface for the JPEG decompressor. * It should work on any system with Unix- or MS-DOS-style command lines. diff --git a/jaricom.c b/jaricom.c index f43e2ea7..1c807d12 100644 --- a/jaricom.c +++ b/jaricom.c @@ -3,7 +3,8 @@ * * Developed 1997-2009 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains probability estimation tables for common use in * arithmetic entropy encoding and decoding routines. diff --git a/jcapimin.c b/jcapimin.c index 3b005d3f..3e68ce32 100644 --- a/jcapimin.c +++ b/jcapimin.c @@ -6,7 +6,8 @@ * Modified 2003-2010 by Guido Vollbeding. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains application interface code for the compression half * of the JPEG library. These are the "minimum" API routines that may be diff --git a/jcapistd.c b/jcapistd.c index 167f0205..5c6d0be2 100644 --- a/jcapistd.c +++ b/jcapistd.c @@ -3,7 +3,8 @@ * * Copyright (C) 1994-1996, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains application interface code for the compression half * of the JPEG library. These are the "standard" API routines that are diff --git a/jcarith.c b/jcarith.c index 71a84ddb..a66da3e2 100644 --- a/jcarith.c +++ b/jcarith.c @@ -5,7 +5,8 @@ * Developed 1997-2009 by Guido Vollbeding. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains portable arithmetic entropy encoding routines for JPEG * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81). diff --git a/jccoefct.c b/jccoefct.c index a4acce5c..c583d7d6 100644 --- a/jccoefct.c +++ b/jccoefct.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code and * information relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains the coefficient buffer controller for compression. * This controller is the top level of the JPEG compressor proper. diff --git a/jccolext.c b/jccolext.c index 2c6b7acf..77a218d5 100644 --- a/jccolext.c +++ b/jccolext.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2009-2012, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains input colorspace conversion routines. */ diff --git a/jccolor.c b/jccolor.c index 34ea23b8..27af306a 100644 --- a/jccolor.c +++ b/jccolor.c @@ -7,7 +7,8 @@ * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2009-2012, 2015 D. R. Commander. * Copyright (C) 2014, MIPS Technologies, Inc., California - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains input colorspace conversion routines. */ diff --git a/jcdctmgr.c b/jcdctmgr.c index 4cac6664..73f3ea42 100644 --- a/jcdctmgr.c +++ b/jcdctmgr.c @@ -7,7 +7,8 @@ * Copyright (C) 1999-2006, MIYASAKA Masaru. * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2011, 2014-2015 D. R. Commander - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains the forward-DCT management logic. * This code selects a particular DCT implementation to be used, diff --git a/jchuff.c b/jchuff.c index 4ecc18d6..2ca80b2e 100644 --- a/jchuff.c +++ b/jchuff.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2009-2011, 2014-2015 D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains Huffman entropy encoding routines. * diff --git a/jchuff.h b/jchuff.h index d49a992b..6a8fc9fe 100644 --- a/jchuff.h +++ b/jchuff.h @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains declarations for Huffman entropy encoding routines * that are shared between the sequential encoder (jchuff.c) and the diff --git a/jcinit.c b/jcinit.c index 347cf6da..463bd8c6 100644 --- a/jcinit.c +++ b/jcinit.c @@ -3,7 +3,8 @@ * * Copyright (C) 1991-1997, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains initialization logic for the JPEG compressor. * This routine is in charge of selecting the modules to be executed and diff --git a/jcmainct.c b/jcmainct.c index 6ca3768f..5efc7ebd 100644 --- a/jcmainct.c +++ b/jcmainct.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains the main buffer controller for compression. * The main buffer lies between the pre-processor and the JPEG diff --git a/jcmarker.c b/jcmarker.c index aac7dbd8..748244fa 100644 --- a/jcmarker.c +++ b/jcmarker.c @@ -6,7 +6,8 @@ * Modified 2003-2010 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2010, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to write JPEG datastream markers. */ diff --git a/jcmaster.c b/jcmaster.c index ea13d0d5..25b6712e 100644 --- a/jcmaster.c +++ b/jcmaster.c @@ -6,7 +6,8 @@ * Modified 2003-2010 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2010, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains master control logic for the JPEG compressor. * These routines are concerned with parameter validation, initial setup, diff --git a/jcomapi.c b/jcomapi.c index d8f396d1..46ad5dc3 100644 --- a/jcomapi.c +++ b/jcomapi.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1997, Thomas G. Lane.0 * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains application interface routines that are used for both * compression and decompression. diff --git a/jconfig.txt b/jconfig.txt index 8acd8dd8..808f87fc 100644 --- a/jconfig.txt +++ b/jconfig.txt @@ -5,7 +5,8 @@ * Copyright (C) 1991-1994, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file documents the configuration options that are required to * customize the JPEG software for a particular system. diff --git a/jcparam.c b/jcparam.c index 3194c9df..dc7838f2 100644 --- a/jcparam.c +++ b/jcparam.c @@ -6,7 +6,8 @@ * Modified 2003-2008 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2009-2011, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains optional default-setting code for the JPEG compressor. * Applications do not have to use this file, but those that don't use it diff --git a/jcphuff.c b/jcphuff.c index 5ce12b57..a75285c4 100644 --- a/jcphuff.c +++ b/jcphuff.c @@ -5,7 +5,8 @@ * Copyright (C) 1995-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains Huffman entropy encoding routines for progressive JPEG. * diff --git a/jcprepct.c b/jcprepct.c index 3470de08..87d1c35d 100644 --- a/jcprepct.c +++ b/jcprepct.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains the compression preprocessing controller. * This controller manages the color conversion, downsampling, diff --git a/jcsample.c b/jcsample.c index 24d31ae1..f6846e5e 100644 --- a/jcsample.c +++ b/jcsample.c @@ -6,7 +6,8 @@ * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2014, MIPS Technologies, Inc., California - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains downsampling routines. * diff --git a/jctrans.c b/jctrans.c index ccd7b34b..28cd26d7 100644 --- a/jctrans.c +++ b/jctrans.c @@ -6,7 +6,8 @@ * Modified 2000-2009 by Guido Vollbeding. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains library routines for transcoding compression, * that is, writing raw DCT coefficient arrays to an output JPEG file. diff --git a/jdapimin.c b/jdapimin.c index fc8898f8..7cb3949d 100644 --- a/jdapimin.c +++ b/jdapimin.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1998, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains application interface code for the decompression half * of the JPEG library. These are the "minimum" API routines that may be diff --git a/jdapistd.c b/jdapistd.c index 18f9f6ce..d134242b 100644 --- a/jdapistd.c +++ b/jdapistd.c @@ -6,7 +6,8 @@ * libjpeg-turbo Modifications: * Copyright (C) 2010, 2015, D. R. Commander. * Copyright (C) 2015, Google, Inc. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains application interface code for the decompression half * of the JPEG library. These are the "standard" API routines that are diff --git a/jdarith.c b/jdarith.c index 0f9d9126..f92b034e 100644 --- a/jdarith.c +++ b/jdarith.c @@ -5,7 +5,8 @@ * Developed 1997-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2015, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains portable arithmetic entropy decoding routines for JPEG * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81). diff --git a/jdatadst-tj.c b/jdatadst-tj.c index 1f6f3a5e..8d12018c 100644 --- a/jdatadst-tj.c +++ b/jdatadst-tj.c @@ -6,7 +6,8 @@ * Modified 2009-2012 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2011, 2014 D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains compression data destination routines for the case of * emitting JPEG data to memory or to a file (or any stdio stream). diff --git a/jdatadst.c b/jdatadst.c index 7a40e4f3..f078b7d1 100644 --- a/jdatadst.c +++ b/jdatadst.c @@ -6,7 +6,8 @@ * Modified 2009-2012 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2013, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains compression data destination routines for the case of * emitting JPEG data to memory or to a file (or any stdio stream). diff --git a/jdatasrc-tj.c b/jdatasrc-tj.c index 87e84b1d..6624fd35 100644 --- a/jdatasrc-tj.c +++ b/jdatasrc-tj.c @@ -6,7 +6,8 @@ * Modified 2009-2011 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2011, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains decompression data source routines for the case of * reading JPEG data from memory or from a file (or any stdio stream). diff --git a/jdatasrc.c b/jdatasrc.c index 22a09c87..1f46a962 100644 --- a/jdatasrc.c +++ b/jdatasrc.c @@ -6,7 +6,8 @@ * Modified 2009-2011 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2013, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains decompression data source routines for the case of * reading JPEG data from memory or from a file (or any stdio stream). diff --git a/jdcoefct.c b/jdcoefct.c index 17a97b1b..79c662e9 100644 --- a/jdcoefct.c +++ b/jdcoefct.c @@ -6,7 +6,8 @@ * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2010, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains the coefficient buffer controller for decompression. * This controller is the top level of the JPEG decompressor proper. diff --git a/jdcoefct.h b/jdcoefct.h index 2f7bbe5e..55b877a0 100644 --- a/jdcoefct.h +++ b/jdcoefct.h @@ -5,7 +5,8 @@ * Copyright (C) 1994-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman for Cendio AB - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. */ #define JPEG_INTERNALS diff --git a/jdcol565.c b/jdcol565.c index 695f2621..2641abe5 100644 --- a/jdcol565.c +++ b/jdcol565.c @@ -6,7 +6,8 @@ * Modifications: * Copyright (C) 2013, Linaro Limited. * Copyright (C) 2014, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains output colorspace conversion routines. */ diff --git a/jdcolext.c b/jdcolext.c index f72cab0c..e2ebcddb 100644 --- a/jdcolext.c +++ b/jdcolext.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2009, 2011, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains output colorspace conversion routines. */ diff --git a/jdcolor.c b/jdcolor.c index 38db90f2..ac96b233 100644 --- a/jdcolor.c +++ b/jdcolor.c @@ -8,7 +8,8 @@ * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2009, 2011-2012, 2014-2015, D. R. Commander. * Copyright (C) 2013, Linaro Limited. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains output colorspace conversion routines. */ diff --git a/jdct.h b/jdct.h index 6f8b1591..b770f2ca 100644 --- a/jdct.h +++ b/jdct.h @@ -5,7 +5,8 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This include file contains common declarations for the forward and * inverse DCT modules. These declarations are private to the DCT managers diff --git a/jddctmgr.c b/jddctmgr.c index 6cc3310e..de7266f9 100644 --- a/jddctmgr.c +++ b/jddctmgr.c @@ -8,7 +8,8 @@ * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2010, D. R. Commander. * Copyright (C) 2013, MIPS Technologies, Inc., California - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains the inverse-DCT management logic. * This code selects a particular IDCT implementation to be used, diff --git a/jdhuff.c b/jdhuff.c index e6bb0816..ea0ece98 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2009-2011, 2015, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains Huffman entropy decoding routines. * diff --git a/jdhuff.h b/jdhuff.h index c7f3d500..3cc93403 100644 --- a/jdhuff.h +++ b/jdhuff.h @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2010-2011, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains declarations for Huffman entropy decoding routines * that are shared between the sequential decoder (jdhuff.c) and the diff --git a/jdinput.c b/jdinput.c index 6f4ea7ba..0e0a18bf 100644 --- a/jdinput.c +++ b/jdinput.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2010, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains input control logic for the JPEG decompressor. * These routines are concerned with controlling the decompressor's input diff --git a/jdmainct.c b/jdmainct.c index e4ba1c4f..d656b683 100644 --- a/jdmainct.c +++ b/jdmainct.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2010, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains the main buffer controller for decompression. * The main buffer lies between the JPEG decompressor proper and the diff --git a/jdmainct.h b/jdmainct.h index 37ab27d9..3e23aa83 100644 --- a/jdmainct.h +++ b/jdmainct.h @@ -3,7 +3,8 @@ * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. */ #define JPEG_INTERNALS diff --git a/jdmarker.c b/jdmarker.c index d1357af4..383ba10f 100644 --- a/jdmarker.c +++ b/jdmarker.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1998, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2012, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to decode JPEG datastream markers. * Most of the complexity arises from our desire to support input diff --git a/jdmaster.c b/jdmaster.c index 604e2916..42c71bab 100644 --- a/jdmaster.c +++ b/jdmaster.c @@ -7,7 +7,8 @@ * libjpeg-turbo Modifications: * Copyright (C) 2009-2011, D. R. Commander. * Copyright (C) 2013, Linaro Limited. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains master control logic for the JPEG decompressor. * These routines are concerned with selecting the modules to be executed diff --git a/jdmerge.c b/jdmerge.c index e13adb9f..22d76233 100644 --- a/jdmerge.c +++ b/jdmerge.c @@ -7,7 +7,8 @@ * libjpeg-turbo Modifications: * Copyright (C) 2009, 2011, 2014 D. R. Commander. * Copyright (C) 2013, Linaro Limited. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains code for merged upsampling/color conversion. * diff --git a/jdmrg565.c b/jdmrg565.c index 0a10bccb..43c73772 100644 --- a/jdmrg565.c +++ b/jdmrg565.c @@ -6,7 +6,8 @@ * libjpeg-turbo Modifications: * Copyright (C) 2013, Linaro Limited. * Copyright (C) 2014, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains code for merged upsampling/color conversion. */ diff --git a/jdmrgext.c b/jdmrgext.c index 1f0a5507..3792c4f6 100644 --- a/jdmrgext.c +++ b/jdmrgext.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2011, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains code for merged upsampling/color conversion. */ diff --git a/jdphuff.c b/jdphuff.c index 7ef8e7b2..eb52258e 100644 --- a/jdphuff.c +++ b/jdphuff.c @@ -5,7 +5,8 @@ * Copyright (C) 1995-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2015, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains Huffman entropy decoding routines for progressive JPEG. * diff --git a/jdpostct.c b/jdpostct.c index 9eef9ee0..d8597533 100644 --- a/jdpostct.c +++ b/jdpostct.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains the decompression postprocessing controller. * This controller manages the upsampling, color conversion, and color diff --git a/jdsample.c b/jdsample.c index 5738c2fd..e1870fcd 100644 --- a/jdsample.c +++ b/jdsample.c @@ -7,7 +7,8 @@ * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2010, D. R. Commander. * Copyright (C) 2014, MIPS Technologies, Inc., California - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains upsampling routines. * diff --git a/jdsample.h b/jdsample.h index 5226f268..da905a62 100644 --- a/jdsample.h +++ b/jdsample.h @@ -3,7 +3,8 @@ * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1996, Thomas G. Lane. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. */ #define JPEG_INTERNALS diff --git a/jdtrans.c b/jdtrans.c index 86fda3b8..cfc85dd2 100644 --- a/jdtrans.c +++ b/jdtrans.c @@ -5,7 +5,8 @@ * Copyright (C) 1995-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains library routines for transcoding decompression, * that is, reading raw DCT coefficient arrays from an input JPEG file. diff --git a/jerror.c b/jerror.c index cd3098da..c1fffe53 100644 --- a/jerror.c +++ b/jerror.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1998, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains simple error-reporting and trace-message routines. * These are suitable for Unix-like systems and others where writing to diff --git a/jerror.h b/jerror.h index 402613e0..11a07cb5 100644 --- a/jerror.h +++ b/jerror.h @@ -6,7 +6,8 @@ * Modified 1997-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2014, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file defines the error and message codes for the JPEG library. * Edit this file to add new codes, or to translate the message strings to diff --git a/jfdctflt.c b/jfdctflt.c index a8367c68..bb08475d 100644 --- a/jfdctflt.c +++ b/jfdctflt.c @@ -3,7 +3,8 @@ * * Copyright (C) 1994-1996, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a floating-point implementation of the * forward DCT (Discrete Cosine Transform). @@ -20,8 +21,8 @@ * This implementation is based on Arai, Agui, and Nakajima's algorithm for * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. + * JPEG textbook (see REFERENCES section in file README.ijg). The following + * code is based directly on figure 4-8 in P&M. * While an 8-point DCT cannot be done in less than 11 multiplies, it is * possible to arrange the computation so that many of the multiplies are * simple scalings of the final outputs. These multiplies can then be diff --git a/jfdctfst.c b/jfdctfst.c index 4936d476..497f1209 100644 --- a/jfdctfst.c +++ b/jfdctfst.c @@ -3,7 +3,8 @@ * * Copyright (C) 1994-1996, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a fast, not so accurate integer implementation of the * forward DCT (Discrete Cosine Transform). @@ -15,8 +16,8 @@ * This implementation is based on Arai, Agui, and Nakajima's algorithm for * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. + * JPEG textbook (see REFERENCES section in file README.ijg). The following + * code is based directly on figure 4-8 in P&M. * While an 8-point DCT cannot be done in less than 11 multiplies, it is * possible to arrange the computation so that many of the multiplies are * simple scalings of the final outputs. These multiplies can then be diff --git a/jfdctint.c b/jfdctint.c index 68b08350..b0b89bdc 100644 --- a/jfdctint.c +++ b/jfdctint.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2015, D. R. Commander - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a slow-but-accurate integer implementation of the * forward DCT (Discrete Cosine Transform). diff --git a/jidctflt.c b/jidctflt.c index 324a2cbc..ed41fb1e 100644 --- a/jidctflt.c +++ b/jidctflt.c @@ -6,7 +6,8 @@ * Modified 2010 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2014, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a floating-point implementation of the * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine @@ -25,8 +26,8 @@ * This implementation is based on Arai, Agui, and Nakajima's algorithm for * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. + * JPEG textbook (see REFERENCES section in file README.ijg). The following + * code is based directly on figure 4-8 in P&M. * While an 8-point DCT cannot be done in less than 11 multiplies, it is * possible to arrange the computation so that many of the multiplies are * simple scalings of the final outputs. These multiplies can then be diff --git a/jidctfst.c b/jidctfst.c index cae22b9a..9ca3d172 100644 --- a/jidctfst.c +++ b/jidctfst.c @@ -3,7 +3,8 @@ * * Copyright (C) 1994-1998, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a fast, not so accurate integer implementation of the * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine @@ -17,8 +18,8 @@ * This implementation is based on Arai, Agui, and Nakajima's algorithm for * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. + * JPEG textbook (see REFERENCES section in file README.ijg). The following + * code is based directly on figure 4-8 in P&M. * While an 8-point DCT cannot be done in less than 11 multiplies, it is * possible to arrange the computation so that many of the multiplies are * simple scalings of the final outputs. These multiplies can then be diff --git a/jidctint.c b/jidctint.c index 3429795c..ebd3242a 100644 --- a/jidctint.c +++ b/jidctint.c @@ -6,7 +6,8 @@ * Modification developed 2002-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2015, D. R. Commander - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a slow-but-accurate integer implementation of the * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine diff --git a/jidctred.c b/jidctred.c index 4598698f..1b55aa84 100644 --- a/jidctred.c +++ b/jidctred.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1998, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2015, D. R. Commander - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains inverse-DCT routines that produce reduced-size output: * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block. diff --git a/jinclude.h b/jinclude.h index 4dced6e2..d461a1aa 100644 --- a/jinclude.h +++ b/jinclude.h @@ -5,7 +5,8 @@ * Copyright (C) 1991-1994, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file exists to provide a single place to fix any problems with * including the wrong system include files. (Common problems are taken diff --git a/jmemmgr.c b/jmemmgr.c index f7219d26..4ddf33ff 100644 --- a/jmemmgr.c +++ b/jmemmgr.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code and * information relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains the JPEG system-independent memory management * routines. This code is usable across a wide variety of machines; most diff --git a/jmemnobs.c b/jmemnobs.c index 62828327..63bdd895 100644 --- a/jmemnobs.c +++ b/jmemnobs.c @@ -5,7 +5,8 @@ * Copyright (C) 1992-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code and * information relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file provides a really simple implementation of the system- * dependent portion of the JPEG memory manager. This implementation diff --git a/jmemsys.h b/jmemsys.h index 5026c7c7..614ac7f8 100644 --- a/jmemsys.h +++ b/jmemsys.h @@ -5,7 +5,8 @@ * Copyright (C) 1992-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code and * information relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This include file defines the interface between the system-independent * and system-dependent portions of the JPEG memory manager. No other diff --git a/jmorecfg.h b/jmorecfg.h index be891896..806d6a47 100644 --- a/jmorecfg.h +++ b/jmorecfg.h @@ -6,7 +6,8 @@ * Modified 1997-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains additional configuration options that customize the * JPEG software for special applications or support machine-dependent diff --git a/jpegcomp.h b/jpegcomp.h index ed9eeab8..c39275b2 100644 --- a/jpegcomp.h +++ b/jpegcomp.h @@ -2,7 +2,8 @@ * jpegcomp.h * * Copyright (C) 2010, D. R. Commander - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * JPEG compatibility macros * These declarations are considered internal to the JPEG library; most diff --git a/jpegint.h b/jpegint.h index 5f56b110..10d36239 100644 --- a/jpegint.h +++ b/jpegint.h @@ -6,7 +6,8 @@ * Modified 1997-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2015, D. R. Commander - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file provides common declarations for the various JPEG modules. * These declarations are considered internal to the JPEG library; most diff --git a/jpeglib.h b/jpeglib.h index aec9180e..7d9c6ccd 100644 --- a/jpeglib.h +++ b/jpeglib.h @@ -7,7 +7,8 @@ * libjpeg-turbo Modifications: * Copyright (C) 2009-2011, 2013-2014, D. R. Commander. * Copyright (C) 2015, Google, Inc. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file defines the application interface for the JPEG library. * Most applications using the library need only include this file, diff --git a/jpegtran.c b/jpegtran.c index f978cef8..f5ebd7be 100644 --- a/jpegtran.c +++ b/jpegtran.c @@ -5,7 +5,8 @@ * Copyright (C) 1995-2010, Thomas G. Lane, Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2010, 2014, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a command-line user interface for JPEG transcoding. * It is very similar to cjpeg.c, and partly to djpeg.c, but provides diff --git a/jquant1.c b/jquant1.c index 0e253547..4bd0973a 100644 --- a/jquant1.c +++ b/jquant1.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2009, D. R. Commander - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains 1-pass color quantization (color mapping) routines. * These routines provide mapping to a fixed color map using equally spaced diff --git a/jquant2.c b/jquant2.c index 291b4f1b..aa56aa40 100644 --- a/jquant2.c +++ b/jquant2.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2009, 2014, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains 2-pass color quantization (color mapping) routines. * These routines provide selection of a custom color map for an image, diff --git a/jstdhuff.c b/jstdhuff.c index a6eb2d8a..cbdf61c7 100644 --- a/jstdhuff.c +++ b/jstdhuff.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1998, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2013, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to set the default Huffman tables, if they are * not already set. diff --git a/jutils.c b/jutils.c index 0e2611c8..883cc2ac 100644 --- a/jutils.c +++ b/jutils.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code * relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains tables and miscellaneous utility routines needed * for both compression and decompression. diff --git a/jversion.h b/jversion.h index 949b4f4d..89090ba8 100644 --- a/jversion.h +++ b/jversion.h @@ -5,7 +5,8 @@ * Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2010, 2012-2015, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains software version identification. */ diff --git a/libjpeg.txt b/libjpeg.txt index 52b6d8b8..d1f64179 100644 --- a/libjpeg.txt +++ b/libjpeg.txt @@ -5,7 +5,7 @@ Copyright (C) 1994-2011, Thomas G. Lane, Guido Vollbeding. libjpeg-turbo Modifications: Copyright (C) 2010, 2014, 2015, D. R. Commander. Copyright (C) 2015, Google, Inc. -For conditions of distribution and use, see the accompanying README file. +For conditions of distribution and use, see the accompanying README.ijg file. This file describes how to use the IJG JPEG library within an application @@ -201,7 +201,7 @@ or full grayscale (or sometimes another colorspace such as CMYK). You can feed in a colormapped image by expanding it to full-color format. However JPEG often doesn't work very well with source data that has been colormapped, because of dithering noise. This is discussed in more detail in the JPEG FAQ -and the other references mentioned in the README file. +and the other references mentioned in the README.ijg file. Pixels are stored by scanlines, with each scanline running from left to right. The component values for each pixel are adjacent in the row; for @@ -825,7 +825,7 @@ This section describes all the optional parameters you can set for JPEG compression, as well as the "helper" routines provided to assist in this task. Proper setting of some parameters requires detailed understanding of the JPEG standard; if you don't know what a parameter is for, it's best -not to mess with it! See REFERENCES in the README file for pointers to +not to mess with it! See REFERENCES in the README.ijg file for pointers to more info about JPEG. It's a good idea to call jpeg_set_defaults() first, even if you plan to set diff --git a/rdbmp.c b/rdbmp.c index df5dbcc5..e09a3cce 100644 --- a/rdbmp.c +++ b/rdbmp.c @@ -7,7 +7,8 @@ * libjpeg-turbo Modifications: * Modified 2011 by Siarhei Siamashka. * Copyright (C) 2015, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to read input images in Microsoft "BMP" * format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors). diff --git a/rdcolmap.c b/rdcolmap.c index ac6f50ee..deb2d15f 100644 --- a/rdcolmap.c +++ b/rdcolmap.c @@ -3,7 +3,8 @@ * * Copyright (C) 1994-1996, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file implements djpeg's "-map file" switch. It reads a source image * and constructs a colormap to be supplied to the JPEG decompressor. diff --git a/rdgif.c b/rdgif.c index 5caad8a0..ce689f7c 100644 --- a/rdgif.c +++ b/rdgif.c @@ -3,7 +3,8 @@ * * Copyright (C) 1991-1997, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to read input images in GIF format. * diff --git a/rdjpgcom.c b/rdjpgcom.c index 2f0115df..66f276d3 100644 --- a/rdjpgcom.c +++ b/rdjpgcom.c @@ -6,7 +6,8 @@ * Modified 2009 by Bill Allombert, Guido Vollbeding. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a very simple stand-alone application that displays * the text in COM (comment) markers in a JFIF file. diff --git a/rdppm.c b/rdppm.c index 2e9b54dd..3d493186 100644 --- a/rdppm.c +++ b/rdppm.c @@ -6,7 +6,8 @@ * Modified 2009 by Bill Allombert, Guido Vollbeding. * It was modified by The libjpeg-turbo Project to include only code and * information relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to read input images in PPM/PGM format. * The extended 2-byte-per-sample raw PPM/PGM formats are supported. diff --git a/rdrle.c b/rdrle.c index 8df3ddb5..bb14879e 100644 --- a/rdrle.c +++ b/rdrle.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code and * information relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to read input images in Utah RLE format. * The Utah Raster Toolkit library is required (version 3.1 or later). diff --git a/rdswitch.c b/rdswitch.c index a0aa37c7..6e6ab1b3 100644 --- a/rdswitch.c +++ b/rdswitch.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2010, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to process some of cjpeg's more complicated * command-line switches. Switches processed here are: diff --git a/rdtarga.c b/rdtarga.c index b15ac647..3f1b0114 100644 --- a/rdtarga.c +++ b/rdtarga.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to read input images in Targa format. * diff --git a/release/libjpeg-turbo.nsi.in b/release/libjpeg-turbo.nsi.in index c675eac2..4c9d453e 100755 --- a/release/libjpeg-turbo.nsi.in +++ b/release/libjpeg-turbo.nsi.in @@ -79,8 +79,8 @@ Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)" File "@CMAKE_SOURCE_DIR@\jpeglib.h" File "@CMAKE_SOURCE_DIR@\turbojpeg.h" SetOutPath $INSTDIR\doc - File "@CMAKE_SOURCE_DIR@\README" - File "@CMAKE_SOURCE_DIR@\README-turbo.txt" + File "@CMAKE_SOURCE_DIR@\README.ijg" + File "@CMAKE_SOURCE_DIR@\README.md" File "@CMAKE_SOURCE_DIR@\example.c" File "@CMAKE_SOURCE_DIR@\libjpeg.txt" File "@CMAKE_SOURCE_DIR@\structure.txt" @@ -140,8 +140,8 @@ Section "Uninstall" Delete $INSTDIR\include\jpeglib.h" Delete $INSTDIR\include\turbojpeg.h" Delete $INSTDIR\uninstall_@VERSION@.exe - Delete $INSTDIR\doc\README - Delete $INSTDIR\doc\README-turbo.txt + Delete $INSTDIR\doc\README.ijg + Delete $INSTDIR\doc\README.md Delete $INSTDIR\doc\example.c Delete $INSTDIR\doc\libjpeg.txt Delete $INSTDIR\doc\structure.txt diff --git a/simd/jcsample.h b/simd/jcsample.h index b1ef5021..2a50544e 100644 --- a/simd/jcsample.h +++ b/simd/jcsample.h @@ -3,7 +3,8 @@ * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1996, Thomas G. Lane. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. */ LOCAL(void) diff --git a/structure.txt b/structure.txt index 4c9fe398..296d1250 100644 --- a/structure.txt +++ b/structure.txt @@ -4,7 +4,7 @@ This file was part of the Independent JPEG Group's software: Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. It was modified by The libjpeg-turbo Project to include only information relevant to libjpeg-turbo. -For conditions of distribution and use, see the accompanying README file. +For conditions of distribution and use, see the accompanying README.ijg file. This file provides an overview of the architecture of the IJG JPEG software; @@ -13,7 +13,7 @@ between modules. For more precise details about any data structure or calling convention, see the include files and comments in the source code. We assume that the reader is already somewhat familiar with the JPEG standard. -The README file includes references for learning about JPEG. The file +The README.ijg file includes references for learning about JPEG. The file libjpeg.txt describes the library from the viewpoint of an application programmer using the library; it's best to read that file before this one. Also, the file coderules.txt describes the coding style conventions we use. diff --git a/transupp.c b/transupp.c index 93444e31..64183a93 100644 --- a/transupp.c +++ b/transupp.c @@ -5,7 +5,8 @@ * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2010, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains image transformation routines and other utility code * used by the jpegtran sample application. These are NOT part of the core diff --git a/transupp.h b/transupp.h index 8fe90710..4be6adee 100644 --- a/transupp.h +++ b/transupp.h @@ -5,7 +5,8 @@ * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains declarations for image transformation routines and * other utility code used by the jpegtran sample application. These are diff --git a/wrbmp.c b/wrbmp.c index b7ecb491..06630d88 100644 --- a/wrbmp.c +++ b/wrbmp.c @@ -6,7 +6,8 @@ * libjpeg-turbo Modifications: * Copyright (C) 2013, Linaro Limited. * Copyright (C) 2014, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to write output images in Microsoft "BMP" * format (MS Windows 3.x and OS/2 1.x flavors). diff --git a/wrgif.c b/wrgif.c index d260ee0f..d3d8d516 100644 --- a/wrgif.c +++ b/wrgif.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to write output images in GIF format. * diff --git a/wrjpgcom.c b/wrjpgcom.c index 0a22f629..8409dd21 100644 --- a/wrjpgcom.c +++ b/wrjpgcom.c @@ -5,7 +5,8 @@ * Copyright (C) 1994-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2014, D. R. Commander - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains a very simple stand-alone application that inserts * user-supplied text as a COM (comment) marker in a JFIF file. diff --git a/wrppm.c b/wrppm.c index d3a613c8..a930c810 100644 --- a/wrppm.c +++ b/wrppm.c @@ -6,7 +6,8 @@ * Modified 2009 by Guido Vollbeding. * It was modified by The libjpeg-turbo Project to include only code and * information relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to write output images in PPM/PGM format. * The extended 2-byte-per-sample raw PPM/PGM formats are supported. diff --git a/wrrle.c b/wrrle.c index 6f35ad91..3e4c24af 100644 --- a/wrrle.c +++ b/wrrle.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code and * information relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to write output images in RLE format. * The Utah Raster Toolkit library is required (version 3.1 or later). diff --git a/wrtarga.c b/wrtarga.c index 5fbfc538..30d71deb 100644 --- a/wrtarga.c +++ b/wrtarga.c @@ -5,7 +5,8 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code and * information relevant to libjpeg-turbo. - * For conditions of distribution and use, see the accompanying README file. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains routines to write output images in Targa format. * From 17de51835735e319ada5ca139a64227423946a8a Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 10 Oct 2015 10:34:55 -0500 Subject: [PATCH 071/140] Markdown versions of README, LICENSE, BUILDING --- BUILDING.md | 1011 +++++++++++++++++++++++++-------------------------- LICENSE.md | 65 ++-- README.md | 317 ++++++++-------- 3 files changed, 692 insertions(+), 701 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 32a9936e..239de921 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,192 +1,188 @@ -******************************************************************************* -** Building on Un*x Platforms (including Cygwin and OS X) -******************************************************************************* +Building on Un*x Platforms (including Cygwin and OS X) +======================================================= -================== Build Requirements -================== +------------------ --- autoconf 2.56 or later --- automake 1.7 or later --- libtool 1.4 or later - * If using Xcode 4.3 or later on OS X, autoconf and automake are no longer - provided. The easiest way to obtain them is from MacPorts - (http://www.macports.org/). +- autoconf 2.56 or later --- NASM or YASM (if building x86 or x86-64 SIMD extensions) - * NASM 0.98, or 2.01 or later is required for an x86 build (0.99 and 2.00 do - not work properly with libjpeg-turbo's x86 SIMD code.) - * NASM 2.00 or later is required for an x86-64 build. - * NASM 2.07, or 2.11.09 or later is required for an x86-64 Mac build - (2.11.08 does not work properly with libjpeg-turbo's x86-64 SIMD code when - building macho64 objects.) NASM or YASM can be obtained from MacPorts - (http://www.macports.org/). +- automake 1.7 or later - The binary RPMs released by the NASM project do not work on older Linux - systems, such as Red Hat Enterprise Linux 4. On such systems, you can +- libtool 1.4 or later + * If using Xcode 4.3 or later on OS X, autoconf and automake are no longer + provided. The easiest way to obtain them is from + [MacPorts](http://www.MacPorts.org). + +- NASM or YASM (if building x86 or x86-64 SIMD extensions) + * NASM 0.98, or 2.01 or later is required for an x86 build (0.99 and 2.00 do + not work properly with libjpeg-turbo's x86 SIMD code.) + * NASM 2.00 or later is required for an x86-64 build. + * NASM 2.07, or 2.11.09 or later is required for an x86-64 Mac build + (2.11.08 does not work properly with libjpeg-turbo's x86-64 SIMD code when + building macho64 objects.) NASM or YASM can be obtained from + [MacPorts](http://www.MacPorts.org). + + The binary RPMs released by the NASM project do not work on older Linux + systems, such as Red Hat Enterprise Linux 4. On such systems, you can easily build and install NASM from a source RPM by downloading one of the - SRPMs from + SRPMs from - http://www.nasm.us/pub/nasm/releasebuilds + http://www.nasm.us/pub/nasm/releasebuilds - and executing the following as root: + and executing the following as root: - ARCH=`uname -m` - rpmbuild --rebuild nasm-{version}.src.rpm - rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm + ARCH=`uname -m` + rpmbuild --rebuild nasm-{version}.src.rpm + rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm - NOTE: the NASM build will fail if texinfo is not installed. + NOTE: the NASM build will fail if texinfo is not installed. --- GCC v4.1 or later recommended for best performance - * Beginning with Xcode 4, Apple stopped distributing GCC and switched to - the LLVM compiler. Xcode v4.0 through v4.6 provides a GCC front end - called LLVM-GCC. Unfortunately, as of this writing, neither LLVM-GCC nor - the LLVM (clang) compiler produces optimal performance with libjpeg-turbo. - Building libjpeg-turbo with LLVM-GCC v4.2 results in a 10% performance - degradation when compressing using 64-bit code, relative to building - libjpeg-turbo with GCC v4.2. Building libjpeg-turbo with LLVM (clang) - results in a 20% performance degradation when compressing using 64-bit - code, relative to building libjpeg-turbo with GCC v4.2. If you are - running Snow Leopard or earlier, it is suggested that you continue to use - Xcode v3.2.6, which provides GCC v4.2. If you are using Lion or later, it - is suggested that you install Apple GCC v4.2 or GCC v5 through MacPorts. +- GCC v4.1 or later recommended for best performance + * Beginning with Xcode 4, Apple stopped distributing GCC and switched to + the LLVM compiler. Xcode v4.0 through v4.6 provides a GCC front end + called LLVM-GCC. Unfortunately, as of this writing, neither LLVM-GCC nor + the LLVM (clang) compiler produces optimal performance with libjpeg-turbo. + Building libjpeg-turbo with LLVM-GCC v4.2 results in a 10% performance + degradation when compressing using 64-bit code, relative to building + libjpeg-turbo with GCC v4.2. Building libjpeg-turbo with LLVM (clang) + results in a 20% performance degradation when compressing using 64-bit + code, relative to building libjpeg-turbo with GCC v4.2. If you are + running Snow Leopard or earlier, it is suggested that you continue to use + Xcode v3.2.6, which provides GCC v4.2. If you are using Lion or later, it + is suggested that you install Apple GCC v4.2 or GCC v5 through MacPorts. --- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is - required. Some systems, such as Solaris 10 and later and Red Hat Enterprise - Linux 5 and later, have this pre-installed. On OS X 10.5 and later, it will - be necessary to install the Java Developer Package, which can be downloaded - from http://developer.apple.com/downloads (Apple ID required.) For systems - that do not have a JDK installed, you can obtain the Oracle Java Development - Kit from http://www.java.com. +- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is + required. Some systems, such as Solaris 10 and later and Red Hat Enterprise + Linux 5 and later, have this pre-installed. On OS X 10.5 and later, it will + be necessary to install the Java Developer Package, which can be downloaded + from http://developer.apple.com/downloads (Apple ID required.) For systems + that do not have a JDK installed, you can obtain the Oracle Java Development + Kit from http://www.java.com. -================== Out-of-Tree Builds -================== +------------------ Binary objects, libraries, and executables are generated in the same directory -from which configure was executed (the "binary directory"), and this directory -need not necessarily be the same as the libjpeg-turbo source directory. You -can create multiple independent binary directories, in which different versions -of libjpeg-turbo can be built from the same source tree using different -compilers or settings. In the sections below, {build_directory} refers to the -binary directory, whereas {source_directory} refers to the libjpeg-turbo source -directory. For in-tree builds, these directories are the same. +from which `configure` was executed (the "binary directory"), and this +directory need not necessarily be the same as the libjpeg-turbo source +directory. You can create multiple independent binary directories, in which +different versions of libjpeg-turbo can be built from the same source tree +using different compilers or settings. In the sections below, +*{build_directory}* refers to the binary directory, whereas +*{source_directory}* refers to the libjpeg-turbo source directory. For in-tree +builds, these directories are the same. -====================== Building libjpeg-turbo -====================== +---------------------- The following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below for 64-bit build instructions.) - cd {source_directory} - cd {build_directory} - sh {source_directory}/configure [additional configure flags] - make + cd {source_directory} + cd {build_directory} + sh {source_directory}/configure [additional configure flags] + make -This will generate the following files under .libs/ +This will generate the following files under .libs/: - libjpeg.a - Static link library for the libjpeg API +**libjpeg.a** +Static link library for the libjpeg API - libjpeg.so.{version} (Linux, Unix) - libjpeg.{version}.dylib (OS X) - cygjpeg-{version}.dll (Cygwin) - Shared library for the libjpeg API +**libjpeg.so.{version}** (Linux, Unix) +**libjpeg.{version}.dylib** (OS X) +**cygjpeg-{version}.dll** (Cygwin) +Shared library for the libjpeg API - By default, {version} is 62.1.0, 7.1.0, or 8.0.2, depending on whether - libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin, - {version} is 62, 7, or 8. +By default, *{version}* is 62.1.0, 7.1.0, or 8.0.2, depending on whether +libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin, +*{version}* is 62, 7, or 8. - libjpeg.so (Linux, Unix) - libjpeg.dylib (OS X) - Development symlink for the libjpeg API +**libjpeg.so** (Linux, Unix) +**libjpeg.dylib** (OS X) +Development symlink for the libjpeg API - libjpeg.dll.a (Cygwin) - Import library for the libjpeg API +**libjpeg.dll.a** (Cygwin) +Import library for the libjpeg API - libturbojpeg.a - Static link library for the TurboJPEG API +**libturbojpeg.a** +Static link library for the TurboJPEG API - libturbojpeg.so.0.1.0 (Linux, Unix) - libturbojpeg.0.1.0.dylib (OS X) - cygturbojpeg-0.dll (Cygwin) - Shared library for the TurboJPEG API +**libturbojpeg.so.0.1.0** (Linux, Unix) +**libturbojpeg.0.1.0.dylib** (OS X) +**cygturbojpeg-0.dll** (Cygwin) +Shared library for the TurboJPEG API - libturbojpeg.so (Linux, Unix) - libturbojpeg.dylib (OS X) - Development symlink for the TurboJPEG API +**libturbojpeg.so** (Linux, Unix) +**libturbojpeg.dylib** (OS X) +Development symlink for the TurboJPEG API - libturbojpeg.dll.a (Cygwin) - Import library for the TurboJPEG API +**libturbojpeg.dll.a** (Cygwin) +Import library for the TurboJPEG API -libjpeg v7 or v8 API/ABI Emulation ----------------------------------- +### libjpeg v7 or v8 API/ABI Emulation -Add --with-jpeg7 to the configure command line to build a version of -libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add --with-jpeg8 to -the configure command to build a version of libjpeg-turbo that is -API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information -on libjpeg v7 and v8 emulation. +Add `--with-jpeg7` to the `configure` command line to build a version of +libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add `--with-jpeg8` +to the `configure` command to build a version of libjpeg-turbo that is +API/ABI-compatible with libjpeg v8. See [README.md](README.md) for more +information on libjpeg v7 and v8 emulation. -In-Memory Source/Destination Managers -------------------------------------- +### In-Memory Source/Destination Managers -When using libjpeg v6b or v7 API/ABI emulation, add --without-mem-srcdst to the -configure command line to build a version of libjpeg-turbo that lacks the -jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of -the original libjpeg v6b and v7 APIs, so removing them ensures strict -conformance with those APIs. See README-turbo.txt for more information. +When using libjpeg v6b or v7 API/ABI emulation, add `--without-mem-srcdst` to +the `configure` command line to build a version of libjpeg-turbo that lacks the +`jpeg_mem_src()` and `jpeg_mem_dest()` functions. These functions were not +part of the original libjpeg v6b and v7 APIs, so removing them ensures strict +conformance with those APIs. See [README.md](README.md) for more information. -Arithmetic Coding Support -------------------------- +### Arithmetic Coding Support Since the patent on arithmetic coding has expired, this functionality has been included in this release of libjpeg-turbo. libjpeg-turbo's implementation is based on the implementation in libjpeg v8, but it works when emulating libjpeg v7 or v6b as well. The default is to enable both arithmetic encoding and decoding, but those who have philosophical objections to arithmetic coding can -add --without-arith-enc or --without-arith-dec to the configure command line to -disable encoding or decoding (respectively.) +add `--without-arith-enc` or `--without-arith-dec` to the `configure` command +line to disable encoding or decoding (respectively.) -TurboJPEG Java Wrapper ----------------------- -Add --with-java to the configure command line to incorporate an optional Java -Native Interface wrapper into the TurboJPEG shared library and build the Java -front-end classes to support it. This allows the TurboJPEG shared library to -be used directly from Java applications. See java/README for more details. +### TurboJPEG Java Wrapper -You can set the JAVAC, JAR, and JAVA configure variables to specify +Add `--with-java` to the `configure` command line to incorporate an optional +Java Native Interface wrapper into the TurboJPEG shared library and build the +Java front-end classes to support it. This allows the TurboJPEG shared library +to be used directly from Java applications. See [java/README](java/README) for +more details. + +You can set the `JAVAC`, `JAR`, and `JAVA` configure variables to specify alternate commands for javac, jar, and java (respectively.) You can also -set the JAVACFLAGS configure variable to specify arguments that should be -passed to the Java compiler when building the front-end classes, and JNI_CFLAGS -to specify arguments that should be passed to the C compiler when building the -JNI wrapper. Run 'configure --help' for more details. +set the `JAVACFLAGS` configure variable to specify arguments that should be +passed to the Java compiler when building the front-end classes, and +`JNI_CFLAGS` to specify arguments that should be passed to the C compiler when +building the JNI wrapper. Run `configure --help` for more details. -======================== Installing libjpeg-turbo -======================== +------------------------ If you intend to install these libraries and the associated header files, then replace 'make' in the instructions above with - make install prefix={base dir} libdir={library directory} + make install prefix={base dir} libdir={library directory} For example, - make install prefix=/usr/local libdir=/usr/local/lib64 + make install prefix=/usr/local libdir=/usr/local/lib64 will install the header files in /usr/local/include and the library files in -/usr/local/lib64. If 'prefix' and 'libdir' are not specified, then the default +/usr/local/lib64. If `prefix` and `libdir` are not specified, then the default is to install the header files in /opt/libjpeg-turbo/include and the library files in /opt/libjpeg-turbo/lib32 (32-bit) or /opt/libjpeg-turbo/lib64 (64-bit.) @@ -195,124 +191,109 @@ NOTE: You can specify a prefix of /usr and a libdir of, for instance, /usr/lib64 to overwrite the system's version of libjpeg. If you do this, however, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before overwriting it. It is recommended that you instead install libjpeg-turbo into -a non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks +a non-system directory and manipulate the `LD_LIBRARY_PATH` or create symlinks to force applications to use libjpeg-turbo instead of libjpeg. See -README-turbo.txt for more information. +[README.md](README.md) for more information. -============= Build Recipes -============= +------------- -32-bit Build on 64-bit Linux ----------------------------- +### 32-bit Build on 64-bit Linux Add - --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32 + --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32 -to the configure command line. +to the `configure` command line. -64-bit Build on 64-bit OS X ---------------------------- +### 64-bit Build on 64-bit OS X Add - --host x86_64-apple-darwin NASM=/opt/local/bin/nasm + --host x86_64-apple-darwin NASM=/opt/local/bin/nasm -to the configure command line. NASM 2.07 or later from MacPorts must be +to the `configure` command line. NASM 2.07 or later from MacPorts must be installed. -32-bit Build on 64-bit OS X ---------------------------- +### 32-bit Build on 64-bit OS X Add - --host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32 + --host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32 -to the configure command line. +to the `configure` command line. -64-bit Backward-Compatible Build on 64-bit OS X ------------------------------------------------ +### 64-bit Backward-Compatible Build on 64-bit OS X Add - --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \ - CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \ - -mmacosx-version-min=10.5 -O3' \ - LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \ - -mmacosx-version-min=10.5' + --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \ + CFLAGS='-mmacosx-version-min=10.5 -O3' \ + LDFLAGS='-mmacosx-version-min=10.5' -to the configure command line. The OS X 10.5 SDK, and NASM 2.07 or later from -MacPorts, must be installed. - - -32-bit Backward-Compatible Build on OS X ----------------------------------------- - -Add - - --host i686-apple-darwin \ - CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \ - -mmacosx-version-min=10.5 -O3 -m32' \ - LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk \ - -mmacosx-version-min=10.5 -m32' - -to the configure command line. The OS X 10.5 SDK must be installed. - - -64-bit Library Build on 64-bit Solaris --------------------------------------- - -Add - - --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64 - -to the configure command line. - - -32-bit Build on 64-bit FreeBSD ------------------------------- - -Add - - --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \ - LDFLAGS='-B/usr/lib32' - -to the configure command line. NASM 2.07 or later from FreeBSD ports must be +to the `configure` command line. NASM 2.07 or later from MacPorts must be installed. -Oracle Solaris Studio ---------------------- +### 32-bit Backward-Compatible Build on OS X Add - CC=cc + --host i686-apple-darwin \ + CFLAGS='-mmacosx-version-min=10.5 -O3 -m32' \ + LDFLAGS='-mmacosx-version-min=10.5 -m32' -to the configure command line. libjpeg-turbo will automatically be built with -the maximum optimization level (-xO5) unless you override CFLAGS. +to the `configure` command line. + + +### 64-bit Build on 64-bit Solaris + +Add + + --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64 + +to the `configure` command line. + + +### 32-bit Build on 64-bit FreeBSD + +Add + + --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \ + LDFLAGS='-B/usr/lib32' + +to the `configure` command line. NASM 2.07 or later from FreeBSD ports must be +installed. + + +### Oracle Solaris Studio + +Add + + CC=cc + +to the `configure` command line. libjpeg-turbo will automatically be built +with the maximum optimization level (-xO5) unless you override `CFLAGS`. To build a 64-bit version of libjpeg-turbo using Oracle Solaris Studio, add - --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64 + --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64 -to the configure command line. +to the `configure` command line. -MinGW Build on Cygwin ---------------------- +### MinGW Build on Cygwin Use CMake (see recipes below) -=========== ARM Support -=========== +----------- This release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate JPEG compression/decompression by approximately 2-4x on ARMv7 and later @@ -321,253 +302,261 @@ build system will automatically include the NEON SIMD routines, if they are supported. Build instructions for other ARM-based platforms follow. -Building libjpeg-turbo for iOS ------------------------------- +### Building libjpeg-turbo for iOS iOS platforms, such as the iPhone and iPad, use ARM processors, some of which support NEON instructions. Additional steps are required in order to build libjpeg-turbo for these platforms. -Additional build requirements: - gas-preprocessor.pl +#### Additional build requirements + +- [gas-preprocessor.pl] (https://raw.githubusercontent.com/libjpeg-turbo/gas-preprocessor/master/gas-preprocessor.pl) - should be installed in your PATH. + should be installed in your `PATH`. -ARM 32-bit Build (Xcode 4.6.x and earlier, LLVM-GCC): +#### ARM 32-bit Build (Xcode 4.6.x and earlier, LLVM-GCC) Set the following shell variables for simplicity: - Xcode 4.2 and earlier: - IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform - Xcode 4.3 and later: - IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform + *Xcode 4.2 and earlier* - IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk - IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 + IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform` - ARMv6 (code will run on all iOS devices, not SIMD-accelerated): + *Xcode 4.3 and later* + + IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform + + *All Xcode versions* + + IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk + IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 + + *ARMv6 (code will run on all iOS devices, not SIMD-accelerated)* [NOTE: Requires Xcode 4.4.x or earlier] - IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp" - ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer): - IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon" + IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp" - ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer): + *ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer)* + + IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon" + + *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)* [NOTE: Requires Xcode 4.5 or later] - IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon" + + IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon" Follow the procedure under "Building libjpeg-turbo" above, adding - --host arm-apple-darwin10 \ - CC="$IOS_GCC" LD="$IOS_GCC" \ - CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ - LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" + --host arm-apple-darwin10 \ + CC="$IOS_GCC" LD="$IOS_GCC" \ + CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ + LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" -to the configure command line. +to the `configure` command line. -ARM 32-bit Build (Xcode 5.0.x and later, Clang): +#### ARM 32-bit Build (Xcode 5.0.x and later, Clang) Set the following shell variables for simplicity: - IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform - IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk - IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang + IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform + IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk + IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer): - IOS_CFLAGS="-arch armv7" + *ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer)* - ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer): - IOS_CFLAGS="-arch armv7s" + IOS_CFLAGS="-arch armv7" + + *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)* + + IOS_CFLAGS="-arch armv7s" Follow the procedure under "Building libjpeg-turbo" above, adding - --host arm-apple-darwin10 \ - CC="$IOS_GCC" LD="$IOS_GCC" \ - CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ - LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" \ - CCASFLAGS="-no-integrated-as $IOS_CFLAGS" + --host arm-apple-darwin10 \ + CC="$IOS_GCC" LD="$IOS_GCC" \ + CFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ + LDFLAGS="-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS" \ + CCASFLAGS="-no-integrated-as $IOS_CFLAGS" -to the configure command line. +to the `configure` command line. -ARMv8 64-bit Build (Xcode 5.0.x and later, Clang): +#### ARMv8 64-bit Build (Xcode 5.0.x and later, Clang) Code will run on iPhone 5S/iPad Mini 2/iPad Air and newer. Set the following shell variables for simplicity: - IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform - IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk - IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - IOS_CFLAGS="-arch arm64" + IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform + IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk + IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang + IOS_CFLAGS="-arch arm64" Follow the procedure under "Building libjpeg-turbo" above, adding - --host aarch64-apple-darwin \ - CC="$IOS_GCC" LD="$IOS_GCC" \ - CFLAGS="-isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ - LDFLAGS="-isysroot $IOS_SYSROOT $IOS_CFLAGS" + --host aarch64-apple-darwin \ + CC="$IOS_GCC" LD="$IOS_GCC" \ + CFLAGS="-isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS" \ + LDFLAGS="-isysroot $IOS_SYSROOT $IOS_CFLAGS" -to the configure command line. +to the `configure` command line. -NOTE: You can also add -miphoneos-version-min={version} to $IOS_CFLAGS above -in order to support older versions of iOS than the default version supported by -the SDK. +NOTE: You can also add `-miphoneos-version-min={version}` to `$IOS_CFLAGS` +above in order to support older versions of iOS than the default version +supported by the SDK. Once built, lipo can be used to combine the ARMv6, v7, v7s, and/or v8 variants into a universal library. -Building libjpeg-turbo for Android ----------------------------------- +### Building libjpeg-turbo for Android Building libjpeg-turbo for Android platforms requires the Android NDK (https://developer.android.com/tools/sdk/ndk) and autotools. The following is a general recipe script that can be modified for your specific needs. - # Set these variables to suit your needs - NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk} - BUILD_PLATFORM={the platform name for the NDK package you installed-- - for example, "windows-x86" or "linux-x86_64"} - TOOLCHAIN_VERSION={"4.6", "4.8", etc. This corresponds to a toolchain - directory under ${NDK_PATH}/toolchains/.} - ANDROID_VERSION={The minimum version of Android to support-- for example, - "9", "19", etc.} + # Set these variables to suit your needs + NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk} + BUILD_PLATFORM={the platform name for the NDK package you installed-- + for example, "windows-x86" or "linux-x86_64"} + TOOLCHAIN_VERSION={"4.6", "4.8", etc. This corresponds to a toolchain + directory under ${NDK_PATH}/toolchains/.} + ANDROID_VERSION={The minimum version of Android to support-- for example, + "9", "19", etc.} - HOST=arm-linux-androideabi - TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM} - SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm - ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include" - ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \ - -fstrict-aliasing --sysroot=${SYSROOT}" - export CPP=${TOOLCHAIN}/bin/${HOST}-cpp - export AR=${TOOLCHAIN}/bin/${HOST}-ar - export AS=${TOOLCHAIN}/bin/${HOST}-as - export NM=${TOOLCHAIN}/bin/${HOST}-nm - export CC=${TOOLCHAIN}/bin/${HOST}-gcc - export LD=${TOOLCHAIN}/bin/${HOST}-ld - export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib - export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump - export STRIP=${TOOLCHAIN}/bin/${HOST}-strip - cd {build_directory} - sh {source_directory}/configure --host=${HOST} \ - CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3" \ - CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \ - LDFLAGS="${ANDROID_CFLAGS}" --with-simd ${1+"$@"} - make + HOST=arm-linux-androideabi + TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM} + SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm + ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include" + ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \ + -fstrict-aliasing --sysroot=${SYSROOT}" + export CPP=${TOOLCHAIN}/bin/${HOST}-cpp + export AR=${TOOLCHAIN}/bin/${HOST}-ar + export AS=${TOOLCHAIN}/bin/${HOST}-as + export NM=${TOOLCHAIN}/bin/${HOST}-nm + export CC=${TOOLCHAIN}/bin/${HOST}-gcc + export LD=${TOOLCHAIN}/bin/${HOST}-ld + export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib + export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump + export STRIP=${TOOLCHAIN}/bin/${HOST}-strip + cd {build_directory} + sh {source_directory}/configure --host=${HOST} \ + CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3" \ + CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \ + LDFLAGS="${ANDROID_CFLAGS}" --with-simd ${1+"$@"} + make -******************************************************************************* -** Building on Windows (Visual C++ or MinGW) -******************************************************************************* +Building on Windows (Visual C++ or MinGW) +========================================= -================== Build Requirements -================== +------------------ --- CMake (http://www.cmake.org) v2.8.8 or later +- [CMake](http://www.cmake.org) v2.8.8 or later --- Microsoft Visual C++ 2005 or later +- Microsoft Visual C++ 2005 or later - If you don't already have Visual C++, then the easiest way to get it is by - installing the Windows SDK: + If you don't already have Visual C++, then the easiest way to get it is by + installing the Windows SDK: - http://msdn.microsoft.com/en-us/windows/bb980924.aspx + http://msdn.microsoft.com/en-us/windows/bb980924.aspx - The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and - everything necessary to build libjpeg-turbo. + The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and + everything necessary to build libjpeg-turbo. - * You can also use Microsoft Visual Studio Express Edition, which is a free - download. (NOTE: versions prior to 2012 can only be used to build 32-bit - code.) - * If you intend to build libjpeg-turbo from the command line, then add the - appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH - environment variables. This is generally accomplished by executing - vcvars32.bat or vcvars64.bat and SetEnv.cmd. vcvars32.bat and - vcvars64.bat are part of Visual C++ and are located in the same directory - as the compiler. SetEnv.cmd is part of the Windows SDK. You can pass - optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build - environment. + * You can also use Microsoft Visual Studio Express Edition, which is a free + download. (NOTE: versions prior to 2012 can only be used to build 32-bit + code.) + * If you intend to build libjpeg-turbo from the command line, then add the + appropriate compiler and SDK directories to the `INCLUDE`, `LIB`, and + `PATH` environment variables. This is generally accomplished by + executing `vcvars32.bat` or `vcvars64.bat` and `SetEnv.cmd`. + `vcvars32.bat` and `vcvars64.bat` are part of Visual C++ and are located in + the same directory as the compiler. `SetEnv.cmd` is part of the Windows + SDK. You can pass optional arguments to `SetEnv.cmd` to specify a 32-bit + or 64-bit build environment. ... OR ... --- MinGW +- MinGW - MinGW-builds (http://sourceforge.net/projects/mingwbuilds/) or - tdm-gcc (http://tdm-gcc.tdragon.net/) recommended if building on a Windows - machine. Both distributions install a Start Menu link that can be used to - launch a command prompt with the appropriate compiler paths automatically - set. + MinGW-builds (http://sourceforge.net/projects/mingwbuilds/) or + tdm-gcc (http://tdm-gcc.tdragon.net/) recommended if building on a Windows + machine. Both distributions install a Start Menu link that can be used to + launch a command prompt with the appropriate compiler paths automatically + set. --- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for - a 64-bit build) +- [NASM](http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for + a 64-bit build) --- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This - can be downloaded from http://www.java.com. +- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This + can be downloaded from http://www.java.com. -================== Out-of-Tree Builds -================== +------------------ Binary objects, libraries, and executables are generated in the same directory -from which cmake was executed (the "binary directory"), and this directory need -not necessarily be the same as the libjpeg-turbo source directory. You can -create multiple independent binary directories, in which different versions of -libjpeg-turbo can be built from the same source tree using different compilers -or settings. In the sections below, {build_directory} refers to the binary -directory, whereas {source_directory} refers to the libjpeg-turbo source -directory. For in-tree builds, these directories are the same. +from which `cmake` was executed (the "binary directory"), and this directory +need not necessarily be the same as the libjpeg-turbo source directory. You +can create multiple independent binary directories, in which different versions +of libjpeg-turbo can be built from the same source tree using different +compilers or settings. In the sections below, *{build_directory}* refers to +the binary directory, whereas *{source_directory}* refers to the libjpeg-turbo +source directory. For in-tree builds, these directories are the same. -====================== Building libjpeg-turbo -====================== +---------------------- -Visual C++ (Command Line) -------------------------- +### Visual C++ (Command Line) - cd {build_directory} - cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory} - nmake + cd {build_directory} + cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release {source_directory} + nmake This will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending -on which version of cl.exe is in the PATH. +on which version of cl.exe is in the `PATH`. -The following files will be generated under {build_directory}: +The following files will be generated under *{build_directory}*: - jpeg-static.lib - Static link library for the libjpeg API - sharedlib/jpeg{version}.dll - DLL for the libjpeg API - sharedlib/jpeg.lib - Import library for the libjpeg API - turbojpeg-static.lib - Static link library for the TurboJPEG API - turbojpeg.dll - DLL for the TurboJPEG API - turbojpeg.lib - Import library for the TurboJPEG API +**jpeg-static.lib** +Static link library for the libjpeg API -{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or +**sharedlib/jpeg{version}.dll** +DLL for the libjpeg API + +**sharedlib/jpeg.lib** +Import library for the libjpeg API + +**turbojpeg-static.lib** +Static link library for the TurboJPEG API + +**turbojpeg.dll** +DLL for the TurboJPEG API + +**turbojpeg.lib** +Import library for the TurboJPEG API + +*{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled. -Visual C++ (IDE) ----------------- +### Visual C++ (IDE) Choose the appropriate CMake generator option for your version of Visual Studio -(run "cmake" with no arguments for a list of available generators.) For +(run `cmake` with no arguments for a list of available generators.) For instance: - cd {build_directory} - cmake -G "Visual Studio 10" {source_directory} + cd {build_directory} + cmake -G "Visual Studio 10" {source_directory} NOTE: Add "Win64" to the generator name (for example, "Visual Studio 10 Win64") to build a 64-bit version of libjpeg-turbo. Recent versions of CMake @@ -578,182 +567,181 @@ You can then open ALL_BUILD.vcproj in Visual Studio and build one of the configurations in that project ("Debug", "Release", etc.) to generate a full build of libjpeg-turbo. -This will generate the following files under {build_directory}: +This will generate the following files under *{build_directory}*: - {configuration}/jpeg-static.lib - Static link library for the libjpeg API - sharedlib/{configuration}/jpeg{version}.dll - DLL for the libjpeg API - sharedlib/{configuration}/jpeg.lib - Import library for the libjpeg API - {configuration}/turbojpeg-static.lib - Static link library for the TurboJPEG API - {configuration}/turbojpeg.dll - DLL for the TurboJPEG API - {configuration}/turbojpeg.lib - Import library for the TurboJPEG API +**{configuration}/jpeg-static.lib** +Static link library for the libjpeg API -{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on -the configuration you built in the IDE, and {version} is 62, 7, or 8, +**sharedlib/{configuration}/jpeg{version}.dll** +DLL for the libjpeg API + +**sharedlib/{configuration}/jpeg.lib** +Import library for the libjpeg API + +**{configuration}/turbojpeg-static.lib** +Static link library for the TurboJPEG API + +**{configuration}/turbojpeg.dll** +DLL for the TurboJPEG API + +**{configuration}/turbojpeg.lib** +Import library for the TurboJPEG API + +*{configuration}* is Debug, Release, RelWithDebInfo, or MinSizeRel, depending +on the configuration you built in the IDE, and *{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled. -MinGW ------ +### MinGW NOTE: This assumes that you are building on a Windows machine. If you are cross-compiling on a Linux/Unix machine, then see "Build Recipes" below. - cd {build_directory} - cmake -G "MinGW Makefiles" {source_directory} - mingw32-make + cd {build_directory} + cmake -G "MinGW Makefiles" {source_directory} + mingw32-make -This will generate the following files under {build_directory} +This will generate the following files under *{build_directory}*: - libjpeg.a - Static link library for the libjpeg API - sharedlib/libjpeg-{version}.dll - DLL for the libjpeg API - sharedlib/libjpeg.dll.a - Import library for the libjpeg API - libturbojpeg.a - Static link library for the TurboJPEG API - libturbojpeg.dll - DLL for the TurboJPEG API - libturbojpeg.dll.a - Import library for the TurboJPEG API +**libjpeg.a** +Static link library for the libjpeg API -{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or +**sharedlib/libjpeg-{version}.dll** +DLL for the libjpeg API + +**sharedlib/libjpeg.dll.a** +Import library for the libjpeg API + +**libturbojpeg.a** +Static link library for the TurboJPEG API + +**libturbojpeg.dll** +DLL for the TurboJPEG API + +**libturbojpeg.dll.a** +Import library for the TurboJPEG API + +*{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled. -Debug Build ------------ +### Debug Build -Add "-DCMAKE_BUILD_TYPE=Debug" to the cmake command line. Or, if building with -NMake, remove "-DCMAKE_BUILD_TYPE=Release" (Debug builds are the default with -NMake.) +Add `-DCMAKE_BUILD_TYPE=Debug` to the `cmake` command line. Or, if building +with NMake, remove `-DCMAKE_BUILD_TYPE=Release` (Debug builds are the default +with NMake.) -libjpeg v7 or v8 API/ABI Emulation ------------------------------------ +### libjpeg v7 or v8 API/ABI Emulation -Add "-DWITH_JPEG7=1" to the cmake command line to build a version of -libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add "-DWITH_JPEG8=1" -to the cmake command to build a version of libjpeg-turbo that is -API/ABI-compatible with libjpeg v8. See README-turbo.txt for more information -on libjpeg v7 and v8 emulation. +Add `-DWITH_JPEG7=1` to the `cmake` command line to build a version of +libjpeg-turbo that is API/ABI-compatible with libjpeg v7. Add `-DWITH_JPEG8=1` +to the `cmake` command line to build a version of libjpeg-turbo that is +API/ABI-compatible with libjpeg v8. See [README.md](README.md) for more +information on libjpeg v7 and v8 emulation. -In-Memory Source/Destination Managers -------------------------------------- +### In-Memory Source/Destination Managers -When using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the -CMake command line to build a version of libjpeg-turbo that lacks the -jpeg_mem_src() and jpeg_mem_dest() functions. These functions were not part of -the original libjpeg v6b and v7 APIs, so removing them ensures strict -conformance with those APIs. See README-turbo.txt for more information. +When using libjpeg v6b or v7 API/ABI emulation, add `-DWITH_MEM_SRCDST=0` to +the `cmake` command line to build a version of libjpeg-turbo that lacks the +`jpeg_mem_src()` and `jpeg_mem_dest()` functions. These functions were not +part of the original libjpeg v6b and v7 APIs, so removing them ensures strict +conformance with those APIs. See [README.md](README.md) for more information. -Arithmetic Coding Support -------------------------- +### Arithmetic Coding Support Since the patent on arithmetic coding has expired, this functionality has been included in this release of libjpeg-turbo. libjpeg-turbo's implementation is based on the implementation in libjpeg v8, but it works when emulating libjpeg v7 or v6b as well. The default is to enable both arithmetic encoding and decoding, but those who have philosophical objections to arithmetic coding can -add "-DWITH_ARITH_ENC=0" or "-DWITH_ARITH_DEC=0" to the cmake command line to +add `-DWITH_ARITH_ENC=0` or `-DWITH_ARITH_DEC=0` to the `cmake` command line to disable encoding or decoding (respectively.) -TurboJPEG Java Wrapper ----------------------- -Add "-DWITH_JAVA=1" to the cmake command line to incorporate an optional Java +### TurboJPEG Java Wrapper + +Add `-DWITH_JAVA=1` to the `cmake` command line to incorporate an optional Java Native Interface wrapper into the TurboJPEG shared library and build the Java front-end classes to support it. This allows the TurboJPEG shared library to -be used directly from Java applications. See java/README for more details. +be used directly from Java applications. See [java/README](java/README) for +more details. -If you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE, -Java_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify -alternate commands or locations for javac, jar, and java (respectively.) If -you are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE -instead. You can also set the JAVACFLAGS CMake variable to specify arguments -that should be passed to the Java compiler when building the front-end classes. +If you are using CMake 2.8, you can set the `Java_JAVAC_EXECUTABLE`, +`Java_JAVA_EXECUTABLE`, and `Java_JAR_EXECUTABLE` CMake variables to specify +alternate commands or locations for javac, jar, and java (respectively.) You +can also set the `JAVACFLAGS` CMake variable to specify arguments that should +be passed to the Java compiler when building the front-end classes. -======================== Installing libjpeg-turbo -======================== +------------------------ You can use the build system to install libjpeg-turbo into a directory of your choosing (as opposed to creating an installer.) To do this, add: - -DCMAKE_INSTALL_PREFIX={install_directory} + -DCMAKE_INSTALL_PREFIX={install_directory} to the cmake command line. For example, - cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory} - nmake install + cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=c:\libjpeg-turbo {source_directory} + nmake install will install the header files in c:\libjpeg-turbo\include, the library files in c:\libjpeg-turbo\lib, the DLL's in c:\libjpeg-turbo\bin, and the documentation in c:\libjpeg-turbo\doc. -============= Build Recipes -============= +------------- -64-bit MinGW Build on Cygwin ----------------------------- +### 64-bit MinGW Build on Cygwin - cd {build_directory} - CC=/usr/bin/x86_64-w64-mingw32-gcc \ - cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ - -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \ - {source_directory} - make + cd {build_directory} + CC=/usr/bin/x86_64-w64-mingw32-gcc \ + cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ + -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \ + {source_directory} + make This produces a 64-bit build of libjpeg-turbo that does not depend on -cygwin1.dll or other Cygwin DLL's. The mingw64-x86_64-gcc-core and -mingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed. +cygwin1.dll or other Cygwin DLL's. The mingw64-x86\_64-gcc-core and +mingw64-x86\_64-gcc-g++ packages (and their dependencies) must be installed. -32-bit MinGW Build on Cygwin ----------------------------- +### 32-bit MinGW Build on Cygwin - cd {build_directory} - CC=/usr/bin/i686-w64-mingw32-gcc \ - cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ - -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \ - {source_directory} - make + cd {build_directory} + CC=/usr/bin/i686-w64-mingw32-gcc \ + cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ + -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \ + {source_directory} + make This produces a 32-bit build of libjpeg-turbo that does not depend on cygwin1.dll or other Cygwin DLL's. The mingw64-i686-gcc-core and mingw64-i686-gcc-g++ packages (and their dependencies) must be installed. -MinGW Build on Linux --------------------- +### MinGW Build on Linux - cd {build_directory} - CC={mingw_binary_path}/i386-mingw32-gcc \ - cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ - -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \ - -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \ + cd {build_directory} + CC={mingw_binary_path}/i386-mingw32-gcc \ + cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ + -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \ + -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \ {source_directory} - make + make -******************************************************************************* -** Creating Release Packages -******************************************************************************* +Creating Release Packages +========================= The following commands can be used to create various types of release packages: @@ -761,68 +749,68 @@ The following commands can be used to create various types of release packages: Unix/Linux ---------- -make rpm + make rpm - Create Red Hat-style binary RPM package. Requires RPM v4 or later. +Create Red Hat-style binary RPM package. Requires RPM v4 or later. -make srpm + make srpm - This runs 'make dist' to create a pristine source tarball, then creates a - Red Hat-style source RPM package from the tarball. Requires RPM v4 or later. +This runs `make dist` to create a pristine source tarball, then creates a +Red Hat-style source RPM package from the tarball. Requires RPM v4 or later. -make deb + make deb - Create Debian-style binary package. Requires dpkg. +Create Debian-style binary package. Requires dpkg. -make dmg + make dmg - Create Macintosh package/disk image. This requires pkgbuild and - productbuild, which are installed by default on OS X 10.7 and later and which - can be obtained by installing Xcode 3.2.6 (with the "Unix Development" - option) on OS X 10.6. Packages built in this manner can be installed on OS X - 10.5 and later, but they must be built on OS X 10.6 or later. +Create Macintosh package/disk image. This requires pkgbuild and +productbuild, which are installed by default on OS X 10.7 and later and which +can be obtained by installing Xcode 3.2.6 (with the "Unix Development" +option) on OS X 10.6. Packages built in this manner can be installed on OS X +10.5 and later, but they must be built on OS X 10.6 or later. -make udmg [BUILDDIR32={32-bit build directory}] + make udmg [BUILDDIR32={32-bit build directory}] - On 64-bit OS X systems, this creates a Macintosh package and disk image that - contains universal i386/x86-64 binaries. You should first configure a 32-bit - out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree - build, then run 'make udmg' from the 64-bit build directory. The build - system will look for the 32-bit build under {source_directory}/osxx86 by - default, but you can override this by setting the BUILDDIR32 variable on the - make command line as shown above. +On 64-bit OS X systems, this creates a Macintosh package and disk image that +contains universal i386/x86-64 binaries. You should first configure a 32-bit +out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree +build, then run `make udmg` from the 64-bit build directory. The build +system will look for the 32-bit build under *{source_directory}*/osxx86 by +default, but you can override this by setting the `BUILDDIR32` variable on the +make command line as shown above. -make iosdmg [BUILDDIR32={32-bit build directory}] \ - [BUILDDIRARMV6={ARMv6 build directory}] \ - [BUILDDIRARMV7={ARMv7 build directory}] \ - [BUILDDIRARMV7S={ARMv7s build directory}] \ - [BUILDDIRARMV8={ARMv8 build directory}] + make iosdmg [BUILDDIR32={32-bit build directory}] \ + [BUILDDIRARMV6={ARMv6 build directory}] \ + [BUILDDIRARMV7={ARMv7 build directory}] \ + [BUILDDIRARMV7S={ARMv7s build directory}] \ + [BUILDDIRARMV8={ARMv8 build directory}] - On OS X systems, this creates a Macintosh package and disk image in which the - libjpeg-turbo static libraries contain ARM architectures necessary to build - iOS applications. If building on an x86-64 system, the binaries will also - contain the i386 architecture, as with 'make udmg' above. You should first - configure ARMv6, ARMv7, ARMv7s, and/or ARMv8 out-of-tree builds of - libjpeg-turbo (see "Building libjpeg-turbo for iOS" above.) If you are - building an x86-64 version of libjpeg-turbo, you should configure a 32-bit - out-of-tree build as well. Next, build libjpeg-turbo as you would normally, - using an out-of-tree build. When it is built, run 'make iosdmg' from the - build directory. The build system will look for the ARMv6 build under - {source_directory}/iosarmv6 by default, the ARMv7 build under - {source_directory}/iosarmv7 by default, the ARMv7s build under - {source_directory}/iosarmv7s by default, the ARMv8 build under - {source_directory}/iosarmv8 by default, and (if applicable) the 32-bit build - under {source_directory}/osxx86 by default, but you can override this by - setting the BUILDDIR32, BUILDDIRARMV6, BUILDDIRARMV7, BUILDDIRARMV7S, and/or - BUILDDIRARMV8 variables on the make command line as shown above. +On OS X systems, this creates a Macintosh package and disk image in which the +libjpeg-turbo static libraries contain ARM architectures necessary to build +iOS applications. If building on an x86-64 system, the binaries will also +contain the i386 architecture, as with `make udmg` above. You should first +configure ARMv6, ARMv7, ARMv7s, and/or ARMv8 out-of-tree builds of +libjpeg-turbo (see "Building libjpeg-turbo for iOS" above.) If you are +building an x86-64 version of libjpeg-turbo, you should configure a 32-bit +out-of-tree build as well. Next, build libjpeg-turbo as you would normally, +using an out-of-tree build. When it is built, run `make iosdmg` from the +build directory. The build system will look for the ARMv6 build under +*{source_directory}*/iosarmv6 by default, the ARMv7 build under +*{source_directory}*/iosarmv7 by default, the ARMv7s build under +*{source_directory}*/iosarmv7s by default, the ARMv8 build under +*{source_directory}*/iosarmv8 by default, and (if applicable) the 32-bit build +under *{source_directory}*/osxx86 by default, but you can override this by +setting the `BUILDDIR32`, `BUILDDIRARMV6`, `BUILDDIRARMV7`, `BUILDDIRARMV7S`, +and/or `BUILDDIRARMV8` variables on the `make` command line as shown above. - NOTE: If including an ARMv8 build in the package, then you may need to use - Xcode's version of lipo instead of the operating system's. To do this, pass - an argument of LIPO="xcrun lipo" on the make command line. +NOTE: If including an ARMv8 build in the package, then you may need to use +Xcode's version of lipo instead of the operating system's. To do this, pass +an argument of `LIPO="xcrun lipo"` on the make command line. -make cygwinpkg + make cygwinpkg - Build a Cygwin binary package. +Build a Cygwin binary package. Windows @@ -830,32 +818,31 @@ Windows If using NMake: - cd {build_directory} - nmake installer + cd {build_directory} + nmake installer If using MinGW: - cd {build_directory} - make installer + cd {build_directory} + make installer If using the Visual Studio IDE, build the "installer" project. The installer package (libjpeg-turbo[-gcc][64].exe) will be located under -{build_directory}. If building using the Visual Studio IDE, then the installer -package will be located in a subdirectory with the same name as the -configuration you built (such as {build_directory}\Debug\ or -{build_directory}\Release\). +*{build_directory}*. If building using the Visual Studio IDE, then the +installer package will be located in a subdirectory with the same name as the +configuration you built (such as *{build_directory}*\Debug\ or +*{build_directory}*\Release\). Building a Windows installer requires the Nullsoft Install System -(http://nsis.sourceforge.net/.) makensis.exe should be in your PATH. +(http://nsis.sourceforge.net/.) makensis.exe should be in your `PATH`. -******************************************************************************* -** Regression testing -******************************************************************************* +Regression testing +================== -The most common way to test libjpeg-turbo is by invoking 'make test' on -Unix/Linux platforms or 'ctest' on Windows platforms, once the build has +The most common way to test libjpeg-turbo is by invoking `make test` on +Unix/Linux platforms or `ctest` on Windows platforms, once the build has completed. This runs a series of tests to ensure that mathematical compatibility has been maintained between libjpeg-turbo and libjpeg v6b. This also invokes the TurboJPEG unit tests, which ensure that the colorspace @@ -863,12 +850,12 @@ extensions, YUV encoding, decompression scaling, and other features of the TurboJPEG C and Java APIs are working properly (and, by extension, that the equivalent features of the underlying libjpeg API are also working.) -Invoking 'make testclean' or 'nmake testclean' (if using NMake) or building +Invoking `make testclean` or `nmake testclean` (if using NMake) or building the 'testclean' target (if using the Visual Studio IDE) will clean up the -output images generated by 'make test'. +output images generated by `make test`. On Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java -wrappers can be run by invoking 'make tjtest'. These extended TurboJPEG tests +wrappers can be run by invoking `make tjtest`. These extended TurboJPEG tests essentially iterate through all of the available features of the TurboJPEG APIs that are not covered by the TurboJPEG unit tests (this includes the lossless transform options) and compare the images generated by each feature to images diff --git a/LICENSE.md b/LICENSE.md index 5cab36ea..4623e294 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,25 +1,27 @@ libjpeg-turbo Licenses ----------------------- +====================== libjpeg-turbo is covered by three compatible BSD-style open source licenses: --- The IJG (Independent JPEG Group) License, which is listed in README +- The IJG (Independent JPEG Group) License, which is listed in + [README.ijg](README.ijg) - This license applies to the libjpeg API library and associated programs - (any code inherited from libjpeg, and any modifications to that code.) + This license applies to the libjpeg API library and associated programs + (any code inherited from libjpeg, and any modifications to that code.) --- The Modified (3-clause) BSD License, which is listed in turbojpeg.c +- The Modified (3-clause) BSD License, which is listed in + [turbojpeg.c](turbojpeg.c) - This license covers the TurboJPEG API library and associated programs. + This license covers the TurboJPEG API library and associated programs. --- The zlib License, which is listed in simd/jsimdext.inc +- The zlib License, which is listed in [simd/jsimdext.inc](simd/jsimdext.inc) - This license is a subset of the other two, and it covers the libjpeg-turbo - SIMD extensions. + This license is a subset of the other two, and it covers the libjpeg-turbo + SIMD extensions. Complying with the libjpeg-turbo Licenses ------------------------------------------ +========================================= This section provides a roll-up of the libjpeg-turbo licensing terms, to the best of our understanding. @@ -27,53 +29,60 @@ best of our understanding. 1. If you are distributing a modified version of the libjpeg-turbo source, then: - a. You cannot alter or remove any existing copyright or license notices + 1. You cannot alter or remove any existing copyright or license notices from the source. - Origin: Clause 1 of the IJG License - Clause 1 of the Modified BSD License - Clauses 1 and 3 of the zlib License + **Origin** + - Clause 1 of the IJG License + - Clause 1 of the Modified BSD License + - Clauses 1 and 3 of the zlib License - b. You must add your own copyright notice to the header of each source + 2. You must add your own copyright notice to the header of each source file you modified, so others can tell that you modified that file (if there is not an existing copyright header in that file, then you can simply add a notice stating that you modified the file.) - Origin: Clause 1 of the IJG License - Clause 2 of the zlib License + **Origin** + - Clause 1 of the IJG License + - Clause 2 of the zlib License - c. You must include the IJG README file, and you must not alter any of the + 3. You must include the IJG README file, and you must not alter any of the copyright or license text in that file. - Origin: Clause 1 of the IJG License + **Origin** + - Clause 1 of the IJG License 2. If you are distributing only libjpeg-turbo binaries without the source, or if you are distributing an application that statically links with libjpeg-turbo, then: - a. Your product documentation must include a message stating: + 1. Your product documentation must include a message stating: This software is based in part on the work of the Independent JPEG Group. - Origin: Clause 2 of the IJG license + **Origin** + - Clause 2 of the IJG license - b. If your binary distribution includes or uses the TurboJPEG API, then + 2. If your binary distribution includes or uses the TurboJPEG API, then your product documentation must include the text of the Modified BSD License. - Origin: Clause 2 of the Modified BSD License + **Origin** + - Clause 2 of the Modified BSD License 3. You cannot use the name of the IJG or The libjpeg-turbo Project or the contributors thereof in advertising, publicity, etc. - Origin: IJG License - Clause 3 of the Modified BSD License + **Origin** + - IJG License + - Clause 3 of the Modified BSD License 4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be free of defects, nor do we accept any liability for undesirable consequences resulting from your use of the software. - Origin: IJG License - Modified BSD License - zlib License + **Origin** + - IJG License + - Modified BSD License + - zlib License diff --git a/README.md b/README.md index d81a9c44..670445f9 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ -******************************************************************************* -** Background -******************************************************************************* +Background +========== libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on @@ -24,59 +23,58 @@ of making high-speed JPEG compression/decompression technology available to a broader range of users and developers. -******************************************************************************* -** License -******************************************************************************* +License +======= libjpeg-turbo is covered by three compatible BSD-style open source licenses. -Refer to LICENSE.txt for a roll-up of license terms. +Refer to [LICENSE.md](LICENSE.md) for a roll-up of license terms. -******************************************************************************* -** Using libjpeg-turbo -******************************************************************************* +Using libjpeg-turbo +=================== libjpeg-turbo includes two APIs that can be used to compress and decompress JPEG images: - TurboJPEG API: This API provides an easy-to-use interface for compressing - and decompressing JPEG images in memory. It also provides some functionality - that would not be straightforward to achieve using the underlying libjpeg - API, such as generating planar YUV images and performing multiple - simultaneous lossless transforms on an image. The Java interface for - libjpeg-turbo is written on top of the TurboJPEG API. +- **TurboJPEG API** + This API provides an easy-to-use interface for compressing and decompressing + JPEG images in memory. It also provides some functionality that would not be + straightforward to achieve using the underlying libjpeg API, such as + generating planar YUV images and performing multiple simultaneous lossless + transforms on an image. The Java interface for libjpeg-turbo is written on + top of the TurboJPEG API. - libjpeg API: This is the de facto industry-standard API for compressing and - decompressing JPEG images. It is more difficult to use than the TurboJPEG - API but also more powerful. The libjpeg API implementation in libjpeg-turbo - is both API/ABI-compatible and mathematically compatible with libjpeg v6b. - It can also optionally be configured to be API/ABI-compatible with libjpeg v7 - and v8 (see below.) +- **libjpeg API** + This is the de facto industry-standard API for compressing and decompressing + JPEG images. It is more difficult to use than the TurboJPEG API but also + more powerful. The libjpeg API implementation in libjpeg-turbo is both + API/ABI-compatible and mathematically compatible with libjpeg v6b. It can + also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8 + (see below.) There is no significant performance advantage to either API when both are used to perform similar operations. -===================== Colorspace Extensions -===================== +--------------------- libjpeg-turbo includes extensions that allow JPEG images to be compressed directly from (and decompressed directly to) buffers that use BGR, BGRX, RGBX, XBGR, and XRGB pixel ordering. This is implemented with ten new colorspace constants: - JCS_EXT_RGB /* red/green/blue */ - JCS_EXT_RGBX /* red/green/blue/x */ - JCS_EXT_BGR /* blue/green/red */ - JCS_EXT_BGRX /* blue/green/red/x */ - JCS_EXT_XBGR /* x/blue/green/red */ - JCS_EXT_XRGB /* x/red/green/blue */ - JCS_EXT_RGBA /* red/green/blue/alpha */ - JCS_EXT_BGRA /* blue/green/red/alpha */ - JCS_EXT_ABGR /* alpha/blue/green/red */ - JCS_EXT_ARGB /* alpha/red/green/blue */ + JCS_EXT_RGB /* red/green/blue */ + JCS_EXT_RGBX /* red/green/blue/x */ + JCS_EXT_BGR /* blue/green/red */ + JCS_EXT_BGRX /* blue/green/red/x */ + JCS_EXT_XBGR /* x/blue/green/red */ + JCS_EXT_XRGB /* x/red/green/blue */ + JCS_EXT_RGBA /* red/green/blue/alpha */ + JCS_EXT_BGRA /* blue/green/red/alpha */ + JCS_EXT_ABGR /* alpha/blue/green/red */ + JCS_EXT_ARGB /* alpha/red/green/blue */ -Setting cinfo.in_color_space (compression) or cinfo.out_color_space +Setting `cinfo.in_color_space` (compression) or `cinfo.out_color_space` (decompression) to one of these values will cause libjpeg-turbo to read the red, green, and blue values from (or write them to) the appropriate position in the pixel when compressing from/decompressing to an RGB buffer. @@ -84,7 +82,7 @@ the pixel when compressing from/decompressing to an RGB buffer. Your application can check for the existence of these extensions at compile time with: - #ifdef JCS_EXTENSIONS + #ifdef JCS_EXTENSIONS At run time, attempting to use these extensions with a libjpeg implementation that does not support them will result in a "Bogus input colorspace" error. @@ -94,21 +92,21 @@ available for the colorspace extensions. When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the X byte is undefined, and in order to ensure the best performance, libjpeg-turbo can set that byte to whatever value it wishes. If an application expects the X -byte to be used as an alpha channel, then it should specify JCS_EXT_RGBA, -JCS_EXT_BGRA, JCS_EXT_ABGR, or JCS_EXT_ARGB. When these colorspace constants -are used, the X byte is guaranteed to be 0xFF, which is interpreted as opaque. +byte to be used as an alpha channel, then it should specify `JCS_EXT_RGBA`, +`JCS_EXT_BGRA`, `JCS_EXT_ABGR`, or `JCS_EXT_ARGB`. When these colorspace +constants are used, the X byte is guaranteed to be 0xFF, which is interpreted +as opaque. Your application can check for the existence of the alpha channel colorspace extensions at compile time with: - #ifdef JCS_ALPHA_EXTENSIONS + #ifdef JCS_ALPHA_EXTENSIONS jcstest.c, located in the libjpeg-turbo source tree, demonstrates how to check for the existence of the colorspace extensions at compile time and run time. -=================================== libjpeg v7 and v8 API/ABI Emulation -=================================== +----------------------------------- With libjpeg v7 and v8, new features were added that necessitated extending the compression and decompression structures. Unfortunately, due to the exposed @@ -125,49 +123,48 @@ without recompiling. libjpeg-turbo does not claim to support all of the libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all cases (see below.) -By passing an argument of --with-jpeg7 or --with-jpeg8 to configure, or an -argument of -DWITH_JPEG7=1 or -DWITH_JPEG8=1 to cmake, you can build a version -of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that programs -that are built against libjpeg v7 or v8 can be run with libjpeg-turbo. The -following section describes which libjpeg v7+ features are supported and which -aren't. +By passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or +an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a +version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that +programs that are built against libjpeg v7 or v8 can be run with libjpeg-turbo. +The following section describes which libjpeg v7+ features are supported and +which aren't. -Support for libjpeg v7 and v8 Features: ---------------------------------------- +### Support for libjpeg v7 and v8 Features -Fully supported: +#### Fully supported --- libjpeg: IDCT scaling extensions in decompressor - libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8, - 1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4 - and 1/2 are SIMD-accelerated.) +- **libjpeg: IDCT scaling extensions in decompressor** + libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8, + 1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4 + and 1/2 are SIMD-accelerated.) --- libjpeg: arithmetic coding +- **libjpeg: Arithmetic coding** --- libjpeg: In-memory source and destination managers - See notes below. +- **libjpeg: In-memory source and destination managers** + See notes below. --- cjpeg: Separate quality settings for luminance and chrominance - Note that the libpjeg v7+ API was extended to accommodate this feature only - for convenience purposes. It has always been possible to implement this - feature with libjpeg v6b (see rdswitch.c for an example.) +- **cjpeg: Separate quality settings for luminance and chrominance** + Note that the libpjeg v7+ API was extended to accommodate this feature only + for convenience purposes. It has always been possible to implement this + feature with libjpeg v6b (see rdswitch.c for an example.) --- cjpeg: 32-bit BMP support +- **cjpeg: 32-bit BMP support** --- cjpeg: -rgb option +- **cjpeg: `-rgb` option** --- jpegtran: lossless cropping +- **jpegtran: Lossless cropping** --- jpegtran: -perfect option +- **jpegtran: `-perfect` option** --- jpegtran: forcing width/height when performing lossless crop +- **jpegtran: Forcing width/height when performing lossless crop** --- rdjpgcom: -raw option +- **rdjpgcom: `-raw` option** --- rdjpgcom: locale awareness +- **rdjpgcom: Locale awareness** -Not supported: +#### Not supported NOTE: As of this writing, extensive research has been conducted into the usefulness of DCT scaling as a means of data reduction and SmartScale as a @@ -176,74 +173,73 @@ http://www.libjpeg-turbo.org/About/SmartScale and draw his/her own conclusions, but it is the general belief of our project that these features have not demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo. --- libjpeg: DCT scaling in compressor - cinfo.scale_num and cinfo.scale_denom are silently ignored. - There is no technical reason why DCT scaling could not be supported when - emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see - below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and - 8/9 would be available, which is of limited usefulness. +- **libjpeg: DCT scaling in compressor** + `cinfo.scale_num` and `cinfo.scale_denom` are silently ignored. + There is no technical reason why DCT scaling could not be supported when + emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see + below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and + 8/9 would be available, which is of limited usefulness. --- libjpeg: SmartScale - cinfo.block_size is silently ignored. - SmartScale is an extension to the JPEG format that allows for DCT block - sizes other than 8x8. Providing support for this new format would be - feasible (particularly without full acceleration.) However, until/unless - the format becomes either an official industry standard or, at minimum, an - accepted solution in the community, we are hesitant to implement it, as - there is no sense of whether or how it might change in the future. It is - our belief that SmartScale has not demonstrated sufficient usefulness as a - lossless format nor as a means of quality enhancement, and thus, our primary - interest in providing this feature would be as a means of supporting - additional DCT scaling factors. +- **libjpeg: SmartScale** + `cinfo.block_size` is silently ignored. + SmartScale is an extension to the JPEG format that allows for DCT block + sizes other than 8x8. Providing support for this new format would be + feasible (particularly without full acceleration.) However, until/unless + the format becomes either an official industry standard or, at minimum, an + accepted solution in the community, we are hesitant to implement it, as + there is no sense of whether or how it might change in the future. It is + our belief that SmartScale has not demonstrated sufficient usefulness as a + lossless format nor as a means of quality enhancement, and thus our primary + interest in providing this feature would be as a means of supporting + additional DCT scaling factors. --- libjpeg: Fancy downsampling in compressor - cinfo.do_fancy_downsampling is silently ignored. - This requires the DCT scaling feature, which is not supported. +- **libjpeg: Fancy downsampling in compressor** + `cinfo.do_fancy_downsampling` is silently ignored. + This requires the DCT scaling feature, which is not supported. --- jpegtran: Scaling - This requires both the DCT scaling and SmartScale features, which are not - supported. +- **jpegtran: Scaling** + This requires both the DCT scaling and SmartScale features, which are not + supported. --- Lossless RGB JPEG files - This requires the SmartScale feature, which is not supported. +- **Lossless RGB JPEG files** + This requires the SmartScale feature, which is not supported. -What About libjpeg v9? ----------------------- +### What About libjpeg v9? libjpeg v9 introduced yet another field to the JPEG compression structure -(color_transform), thus making the ABI backward incompatible with that of +(`color_transform`), thus making the ABI backward incompatible with that of libjpeg v8. This new field was introduced solely for the purpose of supporting -lossless SmartScale encoding. Further, there was actually no reason to extend -the API in this manner, as the color transform could have just as easily been -activated by way of a new JPEG colorspace constant, thus preserving backward -ABI compatibility. +lossless SmartScale encoding. Furthermore, there was actually no reason to +extend the API in this manner, as the color transform could have just as easily +been activated by way of a new JPEG colorspace constant, thus preserving +backward ABI compatibility. Our research (see link above) has shown that lossless SmartScale does not generally accomplish anything that can't already be accomplished better with -existing, standard lossless formats. Thus, at this time, it is our belief that -there is not sufficient technical justification for software to upgrade from -libjpeg v8 to libjpeg v9, and therefore, not sufficient technical justification -for us to emulate the libjpeg v9 ABI. +existing, standard lossless formats. Therefore, at this time it is our belief +that there is not sufficient technical justification for software projects to +upgrade from libjpeg v8 to libjpeg v9, and thus there is not sufficient +echnical justification for us to emulate the libjpeg v9 ABI. -===================================== In-Memory Source/Destination Managers -===================================== +------------------------------------- -By default, libjpeg-turbo 1.3 and later includes the jpeg_mem_src() and -jpeg_mem_dest() functions, even when not emulating the libjpeg v8 API/ABI. +By default, libjpeg-turbo 1.3 and later includes the `jpeg_mem_src()` and +`jpeg_mem_dest()` functions, even when not emulating the libjpeg v8 API/ABI. Previously, it was necessary to build libjpeg-turbo from source with libjpeg v8 API/ABI emulation in order to use the in-memory source/destination managers, but several projects requested that those functions be included when emulating the libjpeg v6b API/ABI as well. This allows the use of those functions by -programs that need them without breaking ABI compatibility for programs that +programs that need them, without breaking ABI compatibility for programs that don't, and it allows those functions to be provided in the "official" libjpeg-turbo binaries. Those who are concerned about maintaining strict conformance with the libjpeg -v6b or v7 API can pass an argument of --without-mem-srcdst to configure or -an argument of -DWITH_MEM_SRCDST=0 to CMake prior to building libjpeg-turbo. -This will restore the pre-1.3 behavior, in which jpeg_mem_src() and -jpeg_mem_dest() are only included when emulating the libjpeg v8 API/ABI. +v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or +an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building +libjpeg-turbo. This will restore the pre-1.3 behavior, in which +`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the +libjpeg v8 API/ABI. On Un*x systems, including the in-memory source/destination managers changes the dynamic library version from 62.0.0 to 62.1.0 if using libjpeg v6b API/ABI @@ -251,72 +247,72 @@ emulation and from 7.0.0 to 7.1.0 if using libjpeg v7 API/ABI emulation. Note that, on most Un*x systems, the dynamic linker will not look for a function in a library until that function is actually used. Thus, if a program -is built against libjpeg-turbo 1.3+ and uses jpeg_mem_src() or jpeg_mem_dest(), -that program will not fail if run against an older version of libjpeg-turbo or -against libjpeg v7- until the program actually tries to call jpeg_mem_src() or -jpeg_mem_dest(). Such is not the case on Windows. If a program is built -against the libjpeg-turbo 1.3+ DLL and uses jpeg_mem_src() or jpeg_mem_dest(), -then it must use the libjpeg-turbo 1.3+ DLL at run time. +is built against libjpeg-turbo 1.3+ and uses `jpeg_mem_src()` or +`jpeg_mem_dest()`, that program will not fail if run against an older version +of libjpeg-turbo or against libjpeg v7- until the program actually tries to +call `jpeg_mem_src()` or `jpeg_mem_dest()`. Such is not the case on Windows. +If a program is built against the libjpeg-turbo 1.3+ DLL and uses +`jpeg_mem_src()` or `jpeg_mem_dest()`, then it must use the libjpeg-turbo 1.3+ +DLL at run time. Both cjpeg and djpeg have been extended to allow testing the in-memory source/destination manager functions. See their respective man pages for more details. -******************************************************************************* -** Mathematical Compatibility -******************************************************************************* +Mathematical Compatibility +========================== For the most part, libjpeg-turbo should produce identical output to libjpeg v6b. The one exception to this is when using the floating point DCT/IDCT, in which case the outputs of libjpeg v6b and libjpeg-turbo can differ for the following reasons: --- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so - slightly more accurate than the implementation in libjpeg v6b, but not by - any amount perceptible to human vision (generally in the range of 0.01 to - 0.08 dB gain in PNSR.) --- When not using the SIMD extensions, libjpeg-turbo uses the more accurate - (and slightly faster) floating point IDCT algorithm introduced in libjpeg - v8a as opposed to the algorithm used in libjpeg v6b. It should be noted, - however, that this algorithm basically brings the accuracy of the floating - point IDCT in line with the accuracy of the slow integer IDCT. The floating - point DCT/IDCT algorithms are mainly a legacy feature, and they do not - produce significantly more accuracy than the slow integer algorithms (to put - numbers on this, the typical difference in PNSR between the two algorithms - is less than 0.10 dB, whereas changing the quality level by 1 in the upper - range of the quality scale is typically more like a 1.0 dB difference.) --- If the floating point algorithms in libjpeg-turbo are not implemented using - SIMD instructions on a particular platform, then the accuracy of the - floating point DCT/IDCT can depend on the compiler settings. +- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so + slightly more accurate than the implementation in libjpeg v6b, but not by + any amount perceptible to human vision (generally in the range of 0.01 to + 0.08 dB gain in PNSR.) -While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood, it is +- When not using the SIMD extensions, libjpeg-turbo uses the more accurate + (and slightly faster) floating point IDCT algorithm introduced in libjpeg + v8a as opposed to the algorithm used in libjpeg v6b. It should be noted, + however, that this algorithm basically brings the accuracy of the floating + point IDCT in line with the accuracy of the slow integer IDCT. The floating + point DCT/IDCT algorithms are mainly a legacy feature, and they do not + produce significantly more accuracy than the slow integer algorithms (to put + numbers on this, the typical difference in PNSR between the two algorithms + is less than 0.10 dB, whereas changing the quality level by 1 in the upper + range of the quality scale is typically more like a 1.0 dB difference.) + +- If the floating point algorithms in libjpeg-turbo are not implemented using + SIMD instructions on a particular platform, then the accuracy of the + floating point DCT/IDCT can depend on the compiler settings. + +While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is still using the same algorithms as libjpeg v6b, so there are several specific cases in which libjpeg-turbo cannot be expected to produce the same output as libjpeg v8: --- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8 - implements those scaling algorithms differently than libjpeg v6b does, and - libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior. +- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8 + implements those scaling algorithms differently than libjpeg v6b does, and + libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior. --- When using chrominance subsampling, because libjpeg v8 implements this - with its DCT/IDCT scaling algorithms rather than with a separate - downsampling/upsampling algorithm. In our testing, the subsampled/upsampled - output of libjpeg v8 is less accurate than that of libjpeg v6b for this - reason. +- When using chrominance subsampling, because libjpeg v8 implements this + with its DCT/IDCT scaling algorithms rather than with a separate + downsampling/upsampling algorithm. In our testing, the subsampled/upsampled + output of libjpeg v8 is less accurate than that of libjpeg v6b for this + reason. --- When decompressing using a scaling factor > 1 and merged (AKA "non-fancy" or - "non-smooth") chrominance upsampling, because libjpeg v8 does not support - merged upsampling with scaling factors > 1. +- When decompressing using a scaling factor > 1 and merged (AKA "non-fancy" or + "non-smooth") chrominance upsampling, because libjpeg v8 does not support + merged upsampling with scaling factors > 1. -******************************************************************************* -** Performance Pitfalls -******************************************************************************* +Performance Pitfalls +==================== -=============== Restart Markers -=============== +--------------- The optimized Huffman decoder in libjpeg-turbo does not handle restart markers in a way that makes the rest of the libjpeg infrastructure happy, so it is @@ -327,9 +323,8 @@ libjpeg. Many consumer packages, such as PhotoShop, use restart markers when generating JPEG images, so images generated by those programs will experience this issue. -=============================================== Fast Integer Forward DCT at High Quality Levels -=============================================== +----------------------------------------------- The algorithm used by the SIMD-accelerated quantization function cannot produce correct results whenever the fast integer forward DCT is used along with a JPEG From e42032ba6257404c6676fbaf8b2fdbd5be735d67 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 10 Oct 2015 10:56:58 -0500 Subject: [PATCH 072/140] README.md: create link for jcstest.c --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 670445f9..1d3c3da5 100755 --- a/README.md +++ b/README.md @@ -102,8 +102,9 @@ extensions at compile time with: #ifdef JCS_ALPHA_EXTENSIONS -jcstest.c, located in the libjpeg-turbo source tree, demonstrates how to check -for the existence of the colorspace extensions at compile time and run time. +[jcstest.c](jcstest.c), located in the libjpeg-turbo source tree, demonstrates +how to check for the existence of the colorspace extensions at compile time and +run time. libjpeg v7 and v8 API/ABI Emulation ----------------------------------- From 250c887763d4d5c47449adfed04e6a617edad2ff Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 13 Oct 2015 13:37:32 -0500 Subject: [PATCH 073/140] ChangeLog: acknowledge existence of 1.4.2 --- ChangeLog.txt | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 9ebbfa93..4a6f488f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -20,26 +20,30 @@ try-with-resources statement. caused by incorrect API usage, and those classes throw a new checked exception type (TJException) for errors that are passed through from the C library. -[5] Fixed an issue whereby cjpeg would segfault if a Windows bitmap with a -negative width or height was used as an input image (Windows bitmaps can have -a negative height if they are stored in top-down order, but such files are -rare and not supported by libjpeg-turbo.) - -[6] Source buffers for the TurboJPEG C API functions, as well as the +[5] Source buffers for the TurboJPEG C API functions, as well as the jpeg_mem_src() function in the libjpeg API, are now declared as const pointers. This facilitates passing read-only buffers to those functions and ensures the caller that the source buffer will not be modified. This should not create any backward API or ABI incompatibilities with prior libjpeg-turbo releases. -[7] The MIPS DSPr2 SIMD code can now be compiled to support either FR=0 or FR=1 +[6] The MIPS DSPr2 SIMD code can now be compiled to support either FR=0 or FR=1 FPUs. -[8] Fixed an issue whereby, under certain circumstances, libjpeg-turbo would + +1.4.2 +===== + +[1] Fixed an issue whereby cjpeg would segfault if a Windows bitmap with a +negative width or height was used as an input image (Windows bitmaps can have +a negative height if they are stored in top-down order, but such files are +rare and not supported by libjpeg-turbo.) + +[2] Fixed an issue whereby, under certain circumstances, libjpeg-turbo would incorrectly encode certain JPEG images when quality=100 and the fast integer forward DCT were used. This was known to cause 'make test' to fail when the library was built with '-march=haswell' on x86 systems. -[9] Fixed an issue whereby libjpeg-turbo would crash when built with the latest +[3] Fixed an issue whereby libjpeg-turbo would crash when built with the latest & greatest development version of the Clang/LLVM compiler. This was caused by an x86-64 ABI conformance issue in some of libjpeg-turbo's 64-bit SSE2 SIMD routines. Those routines were incorrectly using a 64-bit mov instruction to @@ -49,15 +53,15 @@ Clang/LLVM optimizer uses load combining to transfer multiple adjacent 32-bit structure members into a single 64-bit register, and this exposed the ABI conformance issue. -[10] Fixed a bug in the MIPS DSPr2 4:2:0 "plain" (non-fancy and non-merged) +[4] Fixed a bug in the MIPS DSPr2 4:2:0 "plain" (non-fancy and non-merged) upsampling routine that caused a buffer overflow (and subsequent segfault) when decompressing a 4:2:0 JPEG image whose scaled output width was less than 16 pixels. The "plain" upsampling routines are normally only used when decompressing a non-YCbCr JPEG image, but they are also used when decompressing a JPEG image whose scaled output height is 1. -[11] Fixed various negative left shifts and other issues reported by the GCC -and Clang undefined behavior sanitizers. None of these was known to pose a +[5] Fixed various negative left shifts and other issues reported by the GCC and +Clang undefined behavior sanitizers. None of these was known to pose a security threat, but removing the warnings makes it easier to detect actual security issues, should they arise in the future. From 1e32fe3113bd212d48fea93574c2a05282a67708 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Oct 2015 17:32:39 -0500 Subject: [PATCH 074/140] Replace INT32 with a new internal datatype (JLONG) These days, INT32 is a commonly-defined datatype in system headers. We cannot eliminate the definition of that datatype from jmorecfg.h, since the INT32 typedef has technically been part of the libjpeg API since version 5 (1994.) However, using INT32 internally is risky, because the inclusion of a particular header (Xmd.h, for instance) could change the definition of INT32 from long to int on 64-bit platforms and thus change the internal behavior of libjpeg-turbo in unexpected ways (for instance, failing to correctly set __INT32_IS_ACTUALLY_LONG to match the INT32 typedef-- perhaps as a result of including the wrong version of jpeglib.h-- could cause libjpeg-turbo to produce incorrect results.) The library has always been built in environments in which INT32 is effectively long (on Windows, long is always 32-bit, so effectively it's the same as int), so it makes sense to turn INT32 into an explicitly long datatype. This ensures that libjpeg-turbo will always behave consistently, regardless of the headers included at compile time. Addresses a concern expressed in #26. --- djpeg.c | 2 +- jaricom.c | 10 +- jcarith.c | 20 +-- jccolext.c | 6 +- jccolor.c | 18 +-- jcdctmgr.c | 8 +- jchuff.c | 8 +- jcphuff.c | 14 +- jcsample.c | 9 +- jdarith.c | 6 +- jdcoefct.c | 4 +- jdcol565.c | 28 ++-- jdcolext.c | 6 +- jdcolor.c | 36 ++--- jdct.h | 22 ++-- jddctmgr.c | 6 +- jdhuff.c | 6 +- jdhuff.h | 8 +- jdmarker.c | 32 ++--- jdmerge.c | 22 ++-- jdmrg565.c | 32 ++--- jdmrgext.c | 10 +- jdsample.c | 4 +- jfdctfst.c | 14 +- jfdctint.c | 34 ++--- jidctfst.c | 18 +-- jidctint.c | 282 ++++++++++++++++++++-------------------- jidctred.c | 66 +++++----- jmorecfg.h | 26 +++- jpegint.h | 18 +-- jquant1.c | 16 +-- jquant2.c | 32 ++--- rdppm.c | 8 +- simd/jsimd_arm64_neon.S | 10 +- simd/jsimd_arm_neon.S | 9 +- simd/jsimd_mips_dspr2.S | 53 ++++---- wrbmp.c | 14 +- wrgif.c | 8 +- 38 files changed, 478 insertions(+), 447 deletions(-) diff --git a/djpeg.c b/djpeg.c index 8b516a6d..93567c68 100644 --- a/djpeg.c +++ b/djpeg.c @@ -431,7 +431,7 @@ METHODDEF(boolean) print_text_marker (j_decompress_ptr cinfo) { boolean traceit = (cinfo->err->trace_level >= 1); - INT32 length; + long length; unsigned int ch; unsigned int lastch = 0; diff --git a/jaricom.c b/jaricom.c index 1c807d12..3bb557f7 100644 --- a/jaricom.c +++ b/jaricom.c @@ -1,8 +1,10 @@ /* * jaricom.c * + * This file was part of the Independent JPEG Group's software: * Developed 1997-2009 by Guido Vollbeding. - * This file is part of the Independent JPEG Group's software. + * libjpeg-turbo Modifications: + * Copyright (C) 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -19,7 +21,7 @@ #include "jpeglib.h" /* The following #define specifies the packing of the four components - * into the compact INT32 representation. + * into the compact JLONG representation. * Note that this formula must match the actual arithmetic encoder * and decoder implementation. The implementation has to be changed * if this formula is changed. @@ -27,9 +29,9 @@ * implementation (jbig_tab.c). */ -#define V(i,a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b) +#define V(i,a,b,c,d) (((JLONG)a << 16) | ((JLONG)c << 8) | ((JLONG)d << 7) | b) -const INT32 jpeg_aritab[113+1] = { +const JLONG jpeg_aritab[113+1] = { /* * Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS */ diff --git a/jcarith.c b/jcarith.c index a66da3e2..b960a349 100644 --- a/jcarith.c +++ b/jcarith.c @@ -3,8 +3,8 @@ * * This file was part of the Independent JPEG Group's software: * Developed 1997-2009 by Guido Vollbeding. - * It was modified by The libjpeg-turbo Project to include only code relevant - * to libjpeg-turbo. + * libjpeg-turbo Modifications: + * Copyright (C) 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -26,10 +26,10 @@ typedef struct { struct jpeg_entropy_encoder pub; /* public fields */ - INT32 c; /* C register, base of coding interval, layout as in sec. D.1.3 */ - INT32 a; /* A register, normalized size of coding interval */ - INT32 sc; /* counter for stacked 0xFF values which might overflow */ - INT32 zc; /* counter for pending 0x00 output values which might * + JLONG c; /* C register, base of coding interval, layout as in sec. D.1.3 */ + JLONG a; /* A register, normalized size of coding interval */ + JLONG sc; /* counter for stacked 0xFF values which might overflow */ + JLONG zc; /* counter for pending 0x00 output values which might * * be discarded at the end ("Pacman" termination) */ int ct; /* bit shift counter, determines when next byte will be written */ int buffer; /* buffer for most recent output byte != 0xFF */ @@ -98,8 +98,8 @@ typedef arith_entropy_encoder * arith_entropy_ptr; #define CALCULATE_SPECTRAL_CONDITIONING */ -/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32. - * We assume that int right shift is unsigned if INT32 right shift is, +/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than JLONG. + * We assume that int right shift is unsigned if JLONG right shift is, * which should be safe. */ @@ -136,7 +136,7 @@ METHODDEF(void) finish_pass (j_compress_ptr cinfo) { arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy; - INT32 temp; + JLONG temp; /* Section D.1.8: Termination of encoding */ @@ -223,7 +223,7 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val) { register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy; register unsigned char nl, nm; - register INT32 qe, temp; + register JLONG qe, temp; register int sv; /* Fetch values from our compact representation of Table D.2: diff --git a/jccolext.c b/jccolext.c index 77a218d5..479b3204 100644 --- a/jccolext.c +++ b/jccolext.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2009-2012, D. R. Commander. + * Copyright (C) 2009-2012, 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -35,7 +35,7 @@ rgb_ycc_convert_internal (j_compress_ptr cinfo, { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; register int r, g, b; - register INT32 * ctab = cconvert->rgb_ycc_tab; + register JLONG * ctab = cconvert->rgb_ycc_tab; register JSAMPROW inptr; register JSAMPROW outptr0, outptr1, outptr2; register JDIMENSION col; @@ -92,7 +92,7 @@ rgb_gray_convert_internal (j_compress_ptr cinfo, { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; register int r, g, b; - register INT32 * ctab = cconvert->rgb_ycc_tab; + register JLONG * ctab = cconvert->rgb_ycc_tab; register JSAMPROW inptr; register JSAMPROW outptr; register JDIMENSION col; diff --git a/jccolor.c b/jccolor.c index 27af306a..12d68bc0 100644 --- a/jccolor.c +++ b/jccolor.c @@ -26,7 +26,7 @@ typedef struct { struct jpeg_color_converter pub; /* public fields */ /* Private state for RGB->YCC conversion */ - INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */ + JLONG * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */ } my_color_converter; typedef my_color_converter * my_cconvert_ptr; @@ -63,9 +63,9 @@ typedef my_color_converter * my_cconvert_ptr; */ #define SCALEBITS 16 /* speediest right-shift on some machines */ -#define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS) -#define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) -#define FIX(x) ((INT32) ((x) * (1L<cconvert; - INT32 * rgb_ycc_tab; - INT32 i; + JLONG * rgb_ycc_tab; + JLONG i; /* Allocate and fill in the conversion tables. */ - cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *) + cconvert->rgb_ycc_tab = rgb_ycc_tab = (JLONG *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (TABLE_SIZE * sizeof(INT32))); + (TABLE_SIZE * sizeof(JLONG))); for (i = 0; i <= MAXJSAMPLE; i++) { rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i; @@ -382,7 +382,7 @@ cmyk_ycck_convert (j_compress_ptr cinfo, { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; register int r, g, b; - register INT32 * ctab = cconvert->rgb_ycc_tab; + register JLONG * ctab = cconvert->rgb_ycc_tab; register JSAMPROW inptr; register JSAMPROW outptr0, outptr1, outptr2, outptr3; register JDIMENSION col; diff --git a/jcdctmgr.c b/jcdctmgr.c index 73f3ea42..cef4b5e7 100644 --- a/jcdctmgr.c +++ b/jcdctmgr.c @@ -302,15 +302,15 @@ start_pass_fdctmgr (j_compress_ptr cinfo) for (i = 0; i < DCTSIZE2; i++) { #if BITS_IN_JSAMPLE == 8 if(!compute_reciprocal( - DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i], - (INT32) aanscales[i]), + DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i], + (JLONG) aanscales[i]), CONST_BITS-3), &dtbl[i]) && fdct->quantize == jsimd_quantize) fdct->quantize = quantize; #else dtbl[i] = (DCTELEM) - DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i], - (INT32) aanscales[i]), + DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i], + (JLONG) aanscales[i]), CONST_BITS-3); #endif } diff --git a/jchuff.c b/jchuff.c index 2ca80b2e..e02fd6ac 100644 --- a/jchuff.c +++ b/jchuff.c @@ -269,7 +269,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, /* code is now 1 more than the last code used for codelength si; but * it must still fit in si bits, since no code is allowed to be all ones. */ - if (((INT32) code) >= (((INT32) 1) << si)) + if (((JLONG) code) >= (((JLONG) 1) << si)) ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); code <<= 1; si++; @@ -389,7 +389,7 @@ dump_buffer (working_state * state) } #define EMIT_CODE(code, size) { \ - temp2 &= (((INT32) 1)< next byte to write in buffer */ size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - INT32 put_buffer; /* current bit-accumulation buffer */ + JLONG put_buffer; /* current bit-accumulation buffer */ int put_bits; /* # of bits now in it */ j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */ @@ -72,8 +72,8 @@ typedef phuff_entropy_encoder * phuff_entropy_ptr; #define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */ -/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32. - * We assume that int right shift is unsigned if INT32 right shift is, +/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than JLONG. + * We assume that int right shift is unsigned if JLONG right shift is, * which should be safe. */ @@ -231,7 +231,7 @@ emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size) /* Emit some bits, unless we are in gather mode */ { /* This routine is heavily used, so it's worth coding tightly. */ - register INT32 put_buffer = (INT32) code; + register JLONG put_buffer = (JLONG) code; register int put_bits = entropy->put_bits; /* if size is 0, caller used an invalid Huffman table entry */ @@ -241,7 +241,7 @@ emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size) if (entropy->gather_statistics) return; /* do nothing if we're only getting stats */ - put_buffer &= (((INT32) 1)< for Cendio AB * Copyright (C) 2014, MIPS Technologies, Inc., California + * Copyright (C) 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -150,7 +151,7 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */ JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE; JSAMPROW inptr, outptr; - INT32 outvalue; + JLONG outvalue; h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor; v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor; @@ -173,7 +174,7 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, for (v = 0; v < v_expand; v++) { inptr = input_data[inrow+v] + outcol_h; for (h = 0; h < h_expand; h++) { - outvalue += (INT32) GETJSAMPLE(*inptr++); + outvalue += (JLONG) GETJSAMPLE(*inptr++); } } *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix); @@ -302,7 +303,7 @@ h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, JDIMENSION colctr; JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE; register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr; - INT32 membersum, neighsum, memberscale, neighscale; + JLONG membersum, neighsum, memberscale, neighscale; /* Expand input data enough to let all the output samples be generated * by the standard loop. Special-casing padded output would be more @@ -402,7 +403,7 @@ fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JDIMENSION colctr; JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE; register JSAMPROW inptr, above_ptr, below_ptr, outptr; - INT32 membersum, neighsum, memberscale, neighscale; + JLONG membersum, neighsum, memberscale, neighscale; int colsum, lastcolsum, nextcolsum; /* Expand input data enough to let all the output samples be generated diff --git a/jdarith.c b/jdarith.c index f92b034e..a9a6ec6b 100644 --- a/jdarith.c +++ b/jdarith.c @@ -26,8 +26,8 @@ typedef struct { struct jpeg_entropy_decoder pub; /* public fields */ - INT32 c; /* C register, base of coding interval + input bit buffer */ - INT32 a; /* A register, normalized size of coding interval */ + JLONG c; /* C register, base of coding interval + input bit buffer */ + JLONG a; /* A register, normalized size of coding interval */ int ct; /* bit shift counter, # of bits left in bit buffer part of C */ /* init: ct = -16 */ /* run: ct = 0..7 */ @@ -110,7 +110,7 @@ arith_decode (j_decompress_ptr cinfo, unsigned char *st) { register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy; register unsigned char nl, nm; - register INT32 qe, temp; + register JLONG qe, temp; register int sv, data; /* Renormalization & data input per section D.2.6 */ diff --git a/jdcoefct.c b/jdcoefct.c index 79c662e9..baf6bc8c 100644 --- a/jdcoefct.c +++ b/jdcoefct.c @@ -5,7 +5,7 @@ * Copyright (C) 1994-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright (C) 2010, D. R. Commander. + * Copyright (C) 2010, 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -411,7 +411,7 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) JCOEF * workspace; int *coef_bits; JQUANT_TBL *quanttbl; - INT32 Q00,Q01,Q02,Q10,Q11,Q20, num; + JLONG Q00,Q01,Q02,Q10,Q11,Q20, num; int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9; int Al, pred; diff --git a/jdcol565.c b/jdcol565.c index 2641abe5..944ce839 100644 --- a/jdcol565.c +++ b/jdcol565.c @@ -5,7 +5,7 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * Modifications: * Copyright (C) 2013, Linaro Limited. - * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014-2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -31,12 +31,12 @@ ycc_rgb565_convert_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; register int * Crrtab = cconvert->Cr_r_tab; register int * Cbbtab = cconvert->Cb_b_tab; - register INT32 * Crgtab = cconvert->Cr_g_tab; - register INT32 * Cbgtab = cconvert->Cb_g_tab; + register JLONG * Crgtab = cconvert->Cr_g_tab; + register JLONG * Cbgtab = cconvert->Cb_g_tab; SHIFT_TEMPS while (--num_rows >= 0) { - INT32 rgb; + JLONG rgb; unsigned int r, g, b; inptr0 = input_buf[0][input_row]; inptr1 = input_buf[1][input_row]; @@ -110,13 +110,13 @@ ycc_rgb565D_convert_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; register int * Crrtab = cconvert->Cr_r_tab; register int * Cbbtab = cconvert->Cb_b_tab; - register INT32 * Crgtab = cconvert->Cr_g_tab; - register INT32 * Cbgtab = cconvert->Cb_g_tab; - INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; + register JLONG * Crgtab = cconvert->Cr_g_tab; + register JLONG * Cbgtab = cconvert->Cb_g_tab; + JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; SHIFT_TEMPS while (--num_rows >= 0) { - INT32 rgb; + JLONG rgb; unsigned int r, g, b; inptr0 = input_buf[0][input_row]; @@ -193,7 +193,7 @@ rgb_rgb565_convert_internal (j_decompress_ptr cinfo, SHIFT_TEMPS while (--num_rows >= 0) { - INT32 rgb; + JLONG rgb; unsigned int r, g, b; inptr0 = input_buf[0][input_row]; @@ -246,11 +246,11 @@ rgb_rgb565D_convert_internal (j_decompress_ptr cinfo, register JDIMENSION col; register JSAMPLE * range_limit = cinfo->sample_range_limit; JDIMENSION num_cols = cinfo->output_width; - INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; + JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; SHIFT_TEMPS while (--num_rows >= 0) { - INT32 rgb; + JLONG rgb; unsigned int r, g, b; inptr0 = input_buf[0][input_row]; @@ -305,7 +305,7 @@ gray_rgb565_convert_internal (j_decompress_ptr cinfo, JDIMENSION num_cols = cinfo->output_width; while (--num_rows >= 0) { - INT32 rgb; + JLONG rgb; unsigned int g; inptr = input_buf[0][input_row++]; @@ -344,10 +344,10 @@ gray_rgb565D_convert_internal (j_decompress_ptr cinfo, register JDIMENSION col; register JSAMPLE * range_limit = cinfo->sample_range_limit; JDIMENSION num_cols = cinfo->output_width; - INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; + JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; while (--num_rows >= 0) { - INT32 rgb; + JLONG rgb; unsigned int g; inptr = input_buf[0][input_row++]; diff --git a/jdcolext.c b/jdcolext.c index e2ebcddb..59b676cc 100644 --- a/jdcolext.c +++ b/jdcolext.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2009, 2011, D. R. Commander. + * Copyright (C) 2009, 2011, 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -42,8 +42,8 @@ ycc_rgb_convert_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; register int * Crrtab = cconvert->Cr_r_tab; register int * Cbbtab = cconvert->Cb_b_tab; - register INT32 * Crgtab = cconvert->Cr_g_tab; - register INT32 * Cbgtab = cconvert->Cb_g_tab; + register JLONG * Crgtab = cconvert->Cr_g_tab; + register JLONG * Cbgtab = cconvert->Cb_g_tab; SHIFT_TEMPS while (--num_rows >= 0) { diff --git a/jdcolor.c b/jdcolor.c index ac96b233..6a5d8195 100644 --- a/jdcolor.c +++ b/jdcolor.c @@ -29,11 +29,11 @@ typedef struct { /* Private state for YCC->RGB conversion */ int * Cr_r_tab; /* => table for Cr to R conversion */ int * Cb_b_tab; /* => table for Cb to B conversion */ - INT32 * Cr_g_tab; /* => table for Cr to G conversion */ - INT32 * Cb_g_tab; /* => table for Cb to G conversion */ + JLONG * Cr_g_tab; /* => table for Cr to G conversion */ + JLONG * Cb_g_tab; /* => table for Cb to G conversion */ /* Private state for RGB->Y conversion */ - INT32 * rgb_y_tab; /* => table for RGB to Y conversion */ + JLONG * rgb_y_tab; /* => table for RGB to Y conversion */ } my_color_deconverter; typedef my_color_deconverter * my_cconvert_ptr; @@ -74,8 +74,8 @@ typedef my_color_deconverter * my_cconvert_ptr; */ #define SCALEBITS 16 /* speediest right-shift on some machines */ -#define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) -#define FIX(x) ((INT32) ((x) * (1L<Y conversion and divide it up into * three parts, instead of doing three alloc_small requests. This lets us @@ -212,7 +212,7 @@ build_ycc_rgb_table (j_decompress_ptr cinfo) { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; int i; - INT32 x; + JLONG x; SHIFT_TEMPS cconvert->Cr_r_tab = (int *) @@ -221,12 +221,12 @@ build_ycc_rgb_table (j_decompress_ptr cinfo) cconvert->Cb_b_tab = (int *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * sizeof(int)); - cconvert->Cr_g_tab = (INT32 *) + cconvert->Cr_g_tab = (JLONG *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * sizeof(INT32)); - cconvert->Cb_g_tab = (INT32 *) + (MAXJSAMPLE+1) * sizeof(JLONG)); + cconvert->Cb_g_tab = (JLONG *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * sizeof(INT32)); + (MAXJSAMPLE+1) * sizeof(JLONG)); for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ @@ -303,13 +303,13 @@ LOCAL(void) build_rgb_y_table (j_decompress_ptr cinfo) { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - INT32 * rgb_y_tab; - INT32 i; + JLONG * rgb_y_tab; + JLONG i; /* Allocate and fill in the conversion tables. */ - cconvert->rgb_y_tab = rgb_y_tab = (INT32 *) + cconvert->rgb_y_tab = rgb_y_tab = (JLONG *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (TABLE_SIZE * sizeof(INT32))); + (TABLE_SIZE * sizeof(JLONG))); for (i = 0; i <= MAXJSAMPLE; i++) { rgb_y_tab[i+R_Y_OFF] = FIX(0.29900) * i; @@ -330,7 +330,7 @@ rgb_gray_convert (j_decompress_ptr cinfo, { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; register int r, g, b; - register INT32 * ctab = cconvert->rgb_y_tab; + register JLONG * ctab = cconvert->rgb_y_tab; register JSAMPROW outptr; register JSAMPROW inptr0, inptr1, inptr2; register JDIMENSION col; @@ -546,8 +546,8 @@ ycck_cmyk_convert (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; register int * Crrtab = cconvert->Cr_r_tab; register int * Cbbtab = cconvert->Cb_b_tab; - register INT32 * Crgtab = cconvert->Cr_g_tab; - register INT32 * Cbgtab = cconvert->Cb_g_tab; + register JLONG * Crgtab = cconvert->Cr_g_tab; + register JLONG * Cbgtab = cconvert->Cb_g_tab; SHIFT_TEMPS while (--num_rows >= 0) { @@ -605,7 +605,7 @@ ycck_cmyk_convert (j_decompress_ptr cinfo, #define DITHER_MASK 0x3 #define DITHER_ROTATE(x) (((x) << 24) | (((x) >> 8) & 0x00FFFFFF)) -static const INT32 dither_matrix[4] = { +static const JLONG dither_matrix[4] = { 0x0008020A, 0x0C040E06, 0x030B0109, diff --git a/jdct.h b/jdct.h index b770f2ca..f1c7cdf4 100644 --- a/jdct.h +++ b/jdct.h @@ -3,8 +3,8 @@ * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. - * It was modified by The libjpeg-turbo Project to include only code relevant - * to libjpeg-turbo. + * libjpeg-turbo Modifications: + * Copyright (C) 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -19,7 +19,7 @@ /* * A forward DCT routine is given a pointer to a work area of type DCTELEM[]; * the DCT is to be performed in-place in that buffer. Type DCTELEM is int - * for 8-bit samples, INT32 for 12-bit samples. (NOTE: Floating-point DCT + * for 8-bit samples, JLONG for 12-bit samples. (NOTE: Floating-point DCT * implementations use an array of type FAST_FLOAT, instead.) * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE). * The DCT outputs are returned scaled up by a factor of 8; they therefore @@ -41,7 +41,7 @@ typedef unsigned short UDCTELEM; typedef unsigned int UDCTELEM2; #endif #else -typedef INT32 DCTELEM; /* must have 32 bits */ +typedef JLONG DCTELEM; /* must have 32 bits */ typedef unsigned long long UDCTELEM2; #endif @@ -68,7 +68,7 @@ typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */ typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */ #define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */ #else -typedef INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */ +typedef JLONG IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */ #define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */ #endif typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ @@ -154,13 +154,13 @@ EXTERN(void) jpeg_idct_16x16 * Macros for handling fixed-point arithmetic; these are used by many * but not all of the DCT/IDCT modules. * - * All values are expected to be of type INT32. + * All values are expected to be of type JLONG. * Fractional constants are scaled left by CONST_BITS bits. * CONST_BITS is defined within each module using these macros, * and may differ from one module to the next. */ -#define ONE ((INT32) 1) +#define ONE ((JLONG) 1) #define CONST_SCALE (ONE << CONST_BITS) /* Convert a positive real constant to an integer scaled by CONST_SCALE. @@ -168,16 +168,16 @@ EXTERN(void) jpeg_idct_16x16 * thus causing a lot of useless floating-point operations at run time. */ -#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5)) +#define FIX(x) ((JLONG) ((x) * CONST_SCALE + 0.5)) -/* Descale and correctly round an INT32 value that's scaled by N bits. +/* Descale and correctly round a JLONG value that's scaled by N bits. * We assume RIGHT_SHIFT rounds towards minus infinity, so adding * the fudge factor is correct for either sign of X. */ #define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. +/* Multiply a JLONG variable by a JLONG constant to yield a JLONG result. * This macro is used only when the two inputs will actually be no more than * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a * full 32x32 multiply. This provides a useful speedup on many machines. @@ -190,7 +190,7 @@ EXTERN(void) jpeg_idct_16x16 #define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const))) #endif #ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ -#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const))) +#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((JLONG) (const))) #endif #ifndef MULTIPLY16C16 /* default definition */ diff --git a/jddctmgr.c b/jddctmgr.c index de7266f9..5bab0179 100644 --- a/jddctmgr.c +++ b/jddctmgr.c @@ -6,7 +6,7 @@ * Modified 2002-2010 by Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright (C) 2010, D. R. Commander. + * Copyright (C) 2010, 2015, D. R. Commander. * Copyright (C) 2013, MIPS Technologies, Inc., California * For conditions of distribution and use, see the accompanying README.ijg * file. @@ -280,8 +280,8 @@ start_pass (j_decompress_ptr cinfo) for (i = 0; i < DCTSIZE2; i++) { ifmtbl[i] = (IFAST_MULT_TYPE) - DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i], - (INT32) aanscales[i]), + DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i], + (JLONG) aanscales[i]), CONST_BITS-IFAST_SCALE_BITS); } } diff --git a/jdhuff.c b/jdhuff.c index ea0ece98..e3a3f0aa 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -210,7 +210,7 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, /* code is now 1 more than the last code used for codelength si; but * it must still fit in si bits, since no code is allowed to be all ones. */ - if (((INT32) code) >= (((INT32) 1) << si)) + if (((JLONG) code) >= (((JLONG) 1) << si)) ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); code <<= 1; si++; @@ -224,7 +224,7 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, /* valoffset[l] = huffval[] index of 1st symbol of code length l, * minus the minimum code of length l */ - dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p]; + dtbl->valoffset[l] = (JLONG) p - (JLONG) huffcode[p]; p += htbl->bits[l]; dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */ } else { @@ -451,7 +451,7 @@ jpeg_huff_decode (bitread_working_state * state, d_derived_tbl * htbl, int min_bits) { register int l = min_bits; - register INT32 code; + register JLONG code; /* HUFF_DECODE has determined that the code is at least min_bits */ /* bits long, so fetch that many bits in one swoop. */ diff --git a/jdhuff.h b/jdhuff.h index 3cc93403..46d1916a 100644 --- a/jdhuff.h +++ b/jdhuff.h @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2010-2011, D. R. Commander. + * Copyright (C) 2010-2011, 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -20,9 +20,9 @@ typedef struct { /* Basic tables: (element [0] of each array is unused) */ - INT32 maxcode[18]; /* largest code of length k (-1 if none) */ + JLONG maxcode[18]; /* largest code of length k (-1 if none) */ /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */ - INT32 valoffset[18]; /* huffval[] offset for codes of length k */ + JLONG valoffset[18]; /* huffval[] offset for codes of length k */ /* valoffset[k] = huffval[] index of 1st symbol of code length k, less * the smallest code of length k; so given a code of length k, the * corresponding symbol is huffval[code + valoffset[k]] @@ -79,7 +79,7 @@ typedef size_t bit_buf_type; /* type of bit-extraction buffer */ #else -typedef INT32 bit_buf_type; /* type of bit-extraction buffer */ +typedef JLONG bit_buf_type; /* type of bit-extraction buffer */ #define BIT_BUF_SIZE 32 /* size of buffer in bits */ #endif diff --git a/jdmarker.c b/jdmarker.c index 383ba10f..4f59d87d 100644 --- a/jdmarker.c +++ b/jdmarker.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1998, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2012, D. R. Commander. + * Copyright (C) 2012, 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -154,7 +154,7 @@ typedef my_marker_reader * my_marker_ptr; V = GETJOCTET(*next_input_byte++); ) /* As above, but read two bytes interpreted as an unsigned 16-bit integer. - * V should be declared unsigned int or perhaps INT32. + * V should be declared unsigned int or perhaps JLONG. */ #define INPUT_2BYTES(cinfo,V,action) \ MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ @@ -240,7 +240,7 @@ LOCAL(boolean) get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) /* Process a SOFn marker */ { - INT32 length; + JLONG length; int c, ci; jpeg_component_info * compptr; INPUT_VARS(cinfo); @@ -304,7 +304,7 @@ LOCAL(boolean) get_sos (j_decompress_ptr cinfo) /* Process a SOS marker */ { - INT32 length; + JLONG length; int i, ci, n, c, cc, pi; jpeg_component_info * compptr; INPUT_VARS(cinfo); @@ -387,7 +387,7 @@ LOCAL(boolean) get_dac (j_decompress_ptr cinfo) /* Process a DAC marker */ { - INT32 length; + JLONG length; int index, val; INPUT_VARS(cinfo); @@ -433,7 +433,7 @@ LOCAL(boolean) get_dht (j_decompress_ptr cinfo) /* Process a DHT marker */ { - INT32 length; + JLONG length; UINT8 bits[17]; UINT8 huffval[256]; int i, index, count; @@ -467,7 +467,7 @@ get_dht (j_decompress_ptr cinfo) /* Here we just do minimal validation of the counts to avoid walking * off the end of our table space. jdhuff.c will check more carefully. */ - if (count > 256 || ((INT32) count) > length) + if (count > 256 || ((JLONG) count) > length) ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); for (i = 0; i < count; i++) @@ -507,7 +507,7 @@ LOCAL(boolean) get_dqt (j_decompress_ptr cinfo) /* Process a DQT marker */ { - INT32 length; + JLONG length; int n, i, prec; unsigned int tmp; JQUANT_TBL *quant_ptr; @@ -565,7 +565,7 @@ LOCAL(boolean) get_dri (j_decompress_ptr cinfo) /* Process a DRI marker */ { - INT32 length; + JLONG length; unsigned int tmp; INPUT_VARS(cinfo); @@ -599,13 +599,13 @@ get_dri (j_decompress_ptr cinfo) LOCAL(void) examine_app0 (j_decompress_ptr cinfo, JOCTET * data, - unsigned int datalen, INT32 remaining) + unsigned int datalen, JLONG remaining) /* Examine first few bytes from an APP0. * Take appropriate action if it is a JFIF marker. * datalen is # of bytes at data[], remaining is length of rest of marker data. */ { - INT32 totallen = (INT32) datalen + remaining; + JLONG totallen = (JLONG) datalen + remaining; if (datalen >= APP0_DATA_LEN && GETJOCTET(data[0]) == 0x4A && @@ -639,7 +639,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET * data, GETJOCTET(data[12]), GETJOCTET(data[13])); totallen -= APP0_DATA_LEN; if (totallen != - ((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3)) + ((JLONG)GETJOCTET(data[12]) * (JLONG)GETJOCTET(data[13]) * (JLONG) 3)) TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen); } else if (datalen >= 6 && GETJOCTET(data[0]) == 0x4A && @@ -675,7 +675,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET * data, LOCAL(void) examine_app14 (j_decompress_ptr cinfo, JOCTET * data, - unsigned int datalen, INT32 remaining) + unsigned int datalen, JLONG remaining) /* Examine first few bytes from an APP14. * Take appropriate action if it is an Adobe marker. * datalen is # of bytes at data[], remaining is length of rest of marker data. @@ -708,7 +708,7 @@ METHODDEF(boolean) get_interesting_appn (j_decompress_ptr cinfo) /* Process an APP0 or APP14 marker without saving it */ { - INT32 length; + JLONG length; JOCTET b[APPN_DATA_LEN]; unsigned int i, numtoread; INPUT_VARS(cinfo); @@ -760,7 +760,7 @@ save_marker (j_decompress_ptr cinfo) jpeg_saved_marker_ptr cur_marker = marker->cur_marker; unsigned int bytes_read, data_length; JOCTET * data; - INT32 length = 0; + JLONG length = 0; INPUT_VARS(cinfo); if (cur_marker == NULL) { @@ -862,7 +862,7 @@ METHODDEF(boolean) skip_variable (j_decompress_ptr cinfo) /* Skip over an unknown or uninteresting variable-length marker */ { - INT32 length; + JLONG length; INPUT_VARS(cinfo); INPUT_2BYTES(cinfo, length, return FALSE); diff --git a/jdmerge.c b/jdmerge.c index 22d76233..9b2fdf82 100644 --- a/jdmerge.c +++ b/jdmerge.c @@ -5,7 +5,7 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * Copyright 2009 Pierre Ossman for Cendio AB * libjpeg-turbo Modifications: - * Copyright (C) 2009, 2011, 2014 D. R. Commander. + * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander. * Copyright (C) 2013, Linaro Limited. * For conditions of distribution and use, see the accompanying README.ijg * file. @@ -58,8 +58,8 @@ typedef struct { /* Private state for YCC->RGB conversion */ int * Cr_r_tab; /* => table for Cr to R conversion */ int * Cb_b_tab; /* => table for Cb to B conversion */ - INT32 * Cr_g_tab; /* => table for Cr to G conversion */ - INT32 * Cb_g_tab; /* => table for Cb to G conversion */ + JLONG * Cr_g_tab; /* => table for Cr to G conversion */ + JLONG * Cb_g_tab; /* => table for Cb to G conversion */ /* For 2:1 vertical sampling, we produce two output rows at a time. * We need a "spare" row buffer to hold the second output row if the @@ -76,8 +76,8 @@ typedef struct { typedef my_upsampler * my_upsample_ptr; #define SCALEBITS 16 /* speediest right-shift on some machines */ -#define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) -#define FIX(x) ((INT32) ((x) * (1L<upsample; int i; - INT32 x; + JLONG x; SHIFT_TEMPS upsample->Cr_r_tab = (int *) @@ -200,12 +200,12 @@ build_ycc_rgb_table (j_decompress_ptr cinfo) upsample->Cb_b_tab = (int *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * sizeof(int)); - upsample->Cr_g_tab = (INT32 *) + upsample->Cr_g_tab = (JLONG *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * sizeof(INT32)); - upsample->Cb_g_tab = (INT32 *) + (MAXJSAMPLE+1) * sizeof(JLONG)); + upsample->Cb_g_tab = (JLONG *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * sizeof(INT32)); + (MAXJSAMPLE+1) * sizeof(JLONG)); for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ @@ -457,7 +457,7 @@ h2v2_merged_upsample (j_decompress_ptr cinfo, #define DITHER_MASK 0x3 #define DITHER_ROTATE(x) (((x) << 24) | (((x) >> 8) & 0x00FFFFFF)) -static const INT32 dither_matrix[4] = { +static const JLONG dither_matrix[4] = { 0x0008020A, 0x0C040E06, 0x030B0109, diff --git a/jdmrg565.c b/jdmrg565.c index 43c73772..09f0d27b 100644 --- a/jdmrg565.c +++ b/jdmrg565.c @@ -5,7 +5,7 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2013, Linaro Limited. - * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014-2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -30,10 +30,10 @@ h2v1_merged_upsample_565_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; unsigned int r, g, b; - INT32 rgb; + JLONG rgb; SHIFT_TEMPS inptr0 = input_buf[0][in_row_group_ctr]; @@ -101,11 +101,11 @@ h2v1_merged_upsample_565D_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; - INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; + JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; unsigned int r, g, b; - INT32 rgb; + JLONG rgb; SHIFT_TEMPS inptr0 = input_buf[0][in_row_group_ctr]; @@ -175,10 +175,10 @@ h2v2_merged_upsample_565_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; unsigned int r, g, b; - INT32 rgb; + JLONG rgb; SHIFT_TEMPS inptr00 = input_buf[0][in_row_group_ctr * 2]; @@ -271,12 +271,12 @@ h2v2_merged_upsample_565D_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; - INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; - INT32 d1 = dither_matrix[(cinfo->output_scanline+1) & DITHER_MASK]; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; + JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; + JLONG d1 = dither_matrix[(cinfo->output_scanline+1) & DITHER_MASK]; unsigned int r, g, b; - INT32 rgb; + JLONG rgb; SHIFT_TEMPS inptr00 = input_buf[0][in_row_group_ctr*2]; diff --git a/jdmrgext.c b/jdmrgext.c index 3792c4f6..9d7d2af2 100644 --- a/jdmrgext.c +++ b/jdmrgext.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2011, D. R. Commander. + * Copyright (C) 2011, 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -36,8 +36,8 @@ h2v1_merged_upsample_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; SHIFT_TEMPS inptr0 = input_buf[0][in_row_group_ctr]; @@ -109,8 +109,8 @@ h2v2_merged_upsample_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; SHIFT_TEMPS inptr00 = input_buf[0][in_row_group_ctr*2]; diff --git a/jdsample.c b/jdsample.c index e1870fcd..276feae2 100644 --- a/jdsample.c +++ b/jdsample.c @@ -5,7 +5,7 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright (C) 2010, D. R. Commander. + * Copyright (C) 2010, 2015, D. R. Commander. * Copyright (C) 2014, MIPS Technologies, Inc., California * For conditions of distribution and use, see the accompanying README.ijg * file. @@ -318,7 +318,7 @@ h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, #if BITS_IN_JSAMPLE == 8 register int thiscolsum, lastcolsum, nextcolsum; #else - register INT32 thiscolsum, lastcolsum, nextcolsum; + register JLONG thiscolsum, lastcolsum, nextcolsum; #endif register JDIMENSION colctr; int inrow, outrow, v; diff --git a/jfdctfst.c b/jfdctfst.c index 497f1209..5ba6f137 100644 --- a/jfdctfst.c +++ b/jfdctfst.c @@ -1,8 +1,10 @@ /* * jfdctfst.c * + * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. + * libjpeg-turbo Modifications: + * Copyright (C) 2015, D. R. Commander * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -77,10 +79,10 @@ */ #if CONST_BITS == 8 -#define FIX_0_382683433 ((INT32) 98) /* FIX(0.382683433) */ -#define FIX_0_541196100 ((INT32) 139) /* FIX(0.541196100) */ -#define FIX_0_707106781 ((INT32) 181) /* FIX(0.707106781) */ -#define FIX_1_306562965 ((INT32) 334) /* FIX(1.306562965) */ +#define FIX_0_382683433 ((JLONG) 98) /* FIX(0.382683433) */ +#define FIX_0_541196100 ((JLONG) 139) /* FIX(0.541196100) */ +#define FIX_0_707106781 ((JLONG) 181) /* FIX(0.707106781) */ +#define FIX_1_306562965 ((JLONG) 334) /* FIX(1.306562965) */ #else #define FIX_0_382683433 FIX(0.382683433) #define FIX_0_541196100 FIX(0.541196100) @@ -100,7 +102,7 @@ #endif -/* Multiply a DCTELEM variable by an INT32 constant, and immediately +/* Multiply a DCTELEM variable by an JLONG constant, and immediately * descale to yield a DCTELEM result. */ diff --git a/jfdctint.c b/jfdctint.c index b0b89bdc..adfb6e36 100644 --- a/jfdctint.c +++ b/jfdctint.c @@ -70,7 +70,7 @@ * they are represented to better-than-integral precision. These outputs * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word * with the recommended scaling. (For 12-bit sample data, the intermediate - * array is INT32 anyway.) + * array is JLONG anyway.) * * To avoid overflow of the 32-bit intermediate results in pass 2, we must * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis @@ -93,18 +93,18 @@ */ #if CONST_BITS == 13 -#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ -#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ -#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ -#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ -#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ -#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ -#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ -#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ -#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ -#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ -#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ -#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ +#define FIX_0_298631336 ((JLONG) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((JLONG) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((JLONG) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((JLONG) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((JLONG) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((JLONG) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((JLONG) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((JLONG) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((JLONG) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((JLONG) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((JLONG) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((JLONG) 25172) /* FIX(3.072711026) */ #else #define FIX_0_298631336 FIX(0.298631336) #define FIX_0_390180644 FIX(0.390180644) @@ -121,7 +121,7 @@ #endif -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. +/* Multiply an JLONG variable by an JLONG constant to yield an JLONG result. * For 8-bit samples with the recommended scaling, all the variable * and constant values involved are no more than 16 bits wide, so a * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. @@ -142,9 +142,9 @@ GLOBAL(void) jpeg_fdct_islow (DCTELEM * data) { - INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - INT32 tmp10, tmp11, tmp12, tmp13; - INT32 z1, z2, z3, z4, z5; + JLONG tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + JLONG tmp10, tmp11, tmp12, tmp13; + JLONG z1, z2, z3, z4, z5; DCTELEM *dataptr; int ctr; SHIFT_TEMPS diff --git a/jidctfst.c b/jidctfst.c index 9ca3d172..98205eb8 100644 --- a/jidctfst.c +++ b/jidctfst.c @@ -1,8 +1,10 @@ /* * jidctfst.c * + * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. + * libjpeg-turbo Modifications: + * Copyright (C) 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -90,10 +92,10 @@ */ #if CONST_BITS == 8 -#define FIX_1_082392200 ((INT32) 277) /* FIX(1.082392200) */ -#define FIX_1_414213562 ((INT32) 362) /* FIX(1.414213562) */ -#define FIX_1_847759065 ((INT32) 473) /* FIX(1.847759065) */ -#define FIX_2_613125930 ((INT32) 669) /* FIX(2.613125930) */ +#define FIX_1_082392200 ((JLONG) 277) /* FIX(1.082392200) */ +#define FIX_1_414213562 ((JLONG) 362) /* FIX(1.414213562) */ +#define FIX_1_847759065 ((JLONG) 473) /* FIX(1.847759065) */ +#define FIX_2_613125930 ((JLONG) 669) /* FIX(2.613125930) */ #else #define FIX_1_082392200 FIX(1.082392200) #define FIX_1_414213562 FIX(1.414213562) @@ -113,7 +115,7 @@ #endif -/* Multiply a DCTELEM variable by an INT32 constant, and immediately +/* Multiply a DCTELEM variable by an JLONG constant, and immediately * descale to yield a DCTELEM result. */ @@ -123,7 +125,7 @@ /* Dequantize a coefficient by multiplying it by the multiplier-table * entry; produce a DCTELEM result. For 8-bit data a 16x16->16 * multiplication will do. For 12-bit data, the multiplier table is - * declared INT32, so a 32-bit multiply will be used. + * declared JLONG, so a 32-bit multiply will be used. */ #if BITS_IN_JSAMPLE == 8 @@ -135,7 +137,7 @@ /* Like DESCALE, but applies to a DCTELEM and produces an int. - * We assume that int right shift is unsigned if INT32 right shift is. + * We assume that int right shift is unsigned if JLONG right shift is. */ #ifdef RIGHT_SHIFT_IS_UNSIGNED diff --git a/jidctint.c b/jidctint.c index ebd3242a..66d6cb32 100644 --- a/jidctint.c +++ b/jidctint.c @@ -92,7 +92,7 @@ * they are represented to better-than-integral precision. These outputs * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word * with the recommended scaling. (To scale up 12-bit sample data further, an - * intermediate INT32 array would be needed.) + * intermediate JLONG array would be needed.) * * To avoid overflow of the 32-bit intermediate results in pass 2, we must * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis @@ -115,18 +115,18 @@ */ #if CONST_BITS == 13 -#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ -#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ -#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ -#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ -#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ -#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ -#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ -#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ -#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ -#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ -#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ -#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ +#define FIX_0_298631336 ((JLONG) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((JLONG) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((JLONG) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((JLONG) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((JLONG) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((JLONG) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((JLONG) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((JLONG) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((JLONG) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((JLONG) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((JLONG) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((JLONG) 25172) /* FIX(3.072711026) */ #else #define FIX_0_298631336 FIX(0.298631336) #define FIX_0_390180644 FIX(0.390180644) @@ -143,7 +143,7 @@ #endif -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. +/* Multiply an JLONG variable by an JLONG constant to yield an JLONG result. * For 8-bit samples with the recommended scaling, all the variable * and constant values involved are no more than 16 bits wide, so a * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. @@ -174,9 +174,9 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp1, tmp2, tmp3; - INT32 tmp10, tmp11, tmp12, tmp13; - INT32 z1, z2, z3, z4, z5; + JLONG tmp0, tmp1, tmp2, tmp3; + JLONG tmp10, tmp11, tmp12, tmp13; + JLONG z1, z2, z3, z4, z5; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -314,7 +314,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { /* AC terms all zero */ - JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3) + JSAMPLE dcval = range_limit[(int) DESCALE((JLONG) wsptr[0], PASS1_BITS+3) & RANGE_MASK]; outptr[0] = dcval; @@ -334,15 +334,15 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part: reverse the even part of the forward DCT. */ /* The rotator is sqrt(2)*c(-6). */ - z2 = (INT32) wsptr[2]; - z3 = (INT32) wsptr[6]; + z2 = (JLONG) wsptr[2]; + z3 = (JLONG) wsptr[6]; z1 = MULTIPLY(z2 + z3, FIX_0_541196100); tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); - tmp0 = LEFT_SHIFT((INT32) wsptr[0] + (INT32) wsptr[4], CONST_BITS); - tmp1 = LEFT_SHIFT((INT32) wsptr[0] - (INT32) wsptr[4], CONST_BITS); + tmp0 = LEFT_SHIFT((JLONG) wsptr[0] + (JLONG) wsptr[4], CONST_BITS); + tmp1 = LEFT_SHIFT((JLONG) wsptr[0] - (JLONG) wsptr[4], CONST_BITS); tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; @@ -353,10 +353,10 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. */ - tmp0 = (INT32) wsptr[7]; - tmp1 = (INT32) wsptr[5]; - tmp2 = (INT32) wsptr[3]; - tmp3 = (INT32) wsptr[1]; + tmp0 = (JLONG) wsptr[7]; + tmp1 = (JLONG) wsptr[5]; + tmp2 = (JLONG) wsptr[3]; + tmp3 = (JLONG) wsptr[1]; z1 = tmp0 + tmp3; z2 = tmp1 + tmp2; @@ -428,8 +428,8 @@ jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13; - INT32 z1, z2, z3; + JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13; + JLONG z1, z2, z3; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -502,12 +502,12 @@ jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - tmp13 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp13 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp13 = LEFT_SHIFT(tmp13, CONST_BITS); - z1 = (INT32) wsptr[2]; - z2 = (INT32) wsptr[4]; - z3 = (INT32) wsptr[6]; + z1 = (JLONG) wsptr[2]; + z2 = (JLONG) wsptr[4]; + z3 = (JLONG) wsptr[6]; tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734)); /* c4 */ tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123)); /* c6 */ @@ -521,9 +521,9 @@ jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z3 = (INT32) wsptr[5]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z3 = (JLONG) wsptr[5]; tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347)); /* (c3+c1-c5)/2 */ tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339)); /* (c3+c5-c1)/2 */ @@ -577,8 +577,8 @@ jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12; - INT32 z1, z2, z3; + JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12; + JLONG z1, z2, z3; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -638,22 +638,22 @@ jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = LEFT_SHIFT(tmp0, CONST_BITS); - tmp2 = (INT32) wsptr[4]; + tmp2 = (JLONG) wsptr[4]; tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */ tmp1 = tmp0 + tmp10; tmp11 = tmp0 - tmp10 - tmp10; - tmp10 = (INT32) wsptr[2]; + tmp10 = (JLONG) wsptr[2]; tmp0 = MULTIPLY(tmp10, FIX(1.224744871)); /* c2 */ tmp10 = tmp1 + tmp0; tmp12 = tmp1 - tmp0; /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z3 = (INT32) wsptr[5]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z3 = (JLONG) wsptr[5]; tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */ tmp0 = tmp1 + LEFT_SHIFT(z1 + z2, CONST_BITS); tmp2 = tmp1 + LEFT_SHIFT(z3 - z2, CONST_BITS); @@ -698,8 +698,8 @@ jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp1, tmp10, tmp11, tmp12; - INT32 z1, z2, z3; + JLONG tmp0, tmp1, tmp10, tmp11, tmp12; + JLONG z1, z2, z3; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -757,10 +757,10 @@ jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp12 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp12 = LEFT_SHIFT(tmp12, CONST_BITS); - tmp0 = (INT32) wsptr[2]; - tmp1 = (INT32) wsptr[4]; + tmp0 = (JLONG) wsptr[2]; + tmp1 = (JLONG) wsptr[4]; z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */ z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */ z3 = tmp12 + z2; @@ -770,8 +770,8 @@ jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z2 = (INT32) wsptr[1]; - z3 = (INT32) wsptr[3]; + z2 = (JLONG) wsptr[1]; + z3 = (JLONG) wsptr[3]; z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c3 */ tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c1-c3 */ @@ -813,7 +813,7 @@ jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp2, tmp10, tmp12; + JLONG tmp0, tmp2, tmp10, tmp12; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -861,16 +861,16 @@ jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = LEFT_SHIFT(tmp0, CONST_BITS); - tmp2 = (INT32) wsptr[2]; + tmp2 = (JLONG) wsptr[2]; tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */ tmp10 = tmp0 + tmp12; tmp2 = tmp0 - tmp12 - tmp12; /* Odd part */ - tmp12 = (INT32) wsptr[1]; + tmp12 = (JLONG) wsptr[1]; tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */ /* Final output stage */ @@ -903,8 +903,8 @@ jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14; - INT32 z1, z2, z3, z4; + JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14; + JLONG z1, z2, z3, z4; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -986,12 +986,12 @@ jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = LEFT_SHIFT(tmp0, CONST_BITS); - z1 = (INT32) wsptr[2]; - z2 = (INT32) wsptr[4]; - z3 = (INT32) wsptr[6]; + z1 = (JLONG) wsptr[2]; + z2 = (JLONG) wsptr[4]; + z3 = (JLONG) wsptr[6]; tmp3 = MULTIPLY(z3, FIX(0.707106781)); /* c6 */ tmp1 = tmp0 + tmp3; @@ -1011,10 +1011,10 @@ jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z3 = (INT32) wsptr[5]; - z4 = (INT32) wsptr[7]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z3 = (JLONG) wsptr[5]; + z4 = (JLONG) wsptr[7]; z2 = MULTIPLY(z2, - FIX(1.224744871)); /* -c3 */ @@ -1074,9 +1074,9 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp10, tmp11, tmp12, tmp13, tmp14; - INT32 tmp20, tmp21, tmp22, tmp23, tmp24; - INT32 z1, z2, z3, z4, z5; + JLONG tmp10, tmp11, tmp12, tmp13, tmp14; + JLONG tmp20, tmp21, tmp22, tmp23, tmp24; + JLONG z1, z2, z3, z4, z5; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -1169,9 +1169,9 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z3 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = LEFT_SHIFT(z3, CONST_BITS); - z4 = (INT32) wsptr[4]; + z4 = (JLONG) wsptr[4]; z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */ z2 = MULTIPLY(z4, FIX(0.437016024)); /* c8 */ tmp10 = z3 + z1; @@ -1179,8 +1179,8 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp22 = z3 - LEFT_SHIFT(z1 - z2, 1); /* c0 = (c4-c8)*2 */ - z2 = (INT32) wsptr[2]; - z3 = (INT32) wsptr[6]; + z2 = (JLONG) wsptr[2]; + z3 = (JLONG) wsptr[6]; z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c6 */ tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */ @@ -1193,11 +1193,11 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z3 = (INT32) wsptr[5]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z3 = (JLONG) wsptr[5]; z3 = LEFT_SHIFT(z3, CONST_BITS); - z4 = (INT32) wsptr[7]; + z4 = (JLONG) wsptr[7]; tmp11 = z2 + z4; tmp13 = z2 - z4; @@ -1269,9 +1269,9 @@ jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp10, tmp11, tmp12, tmp13, tmp14; - INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; - INT32 z1, z2, z3, z4; + JLONG tmp10, tmp11, tmp12, tmp13, tmp14; + JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; + JLONG z1, z2, z3, z4; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -1362,12 +1362,12 @@ jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp10 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp10 = LEFT_SHIFT(tmp10, CONST_BITS); - z1 = (INT32) wsptr[2]; - z2 = (INT32) wsptr[4]; - z3 = (INT32) wsptr[6]; + z1 = (JLONG) wsptr[2]; + z2 = (JLONG) wsptr[4]; + z3 = (JLONG) wsptr[6]; tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132)); /* c2+c4 */ tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045)); /* c2-c6 */ @@ -1387,10 +1387,10 @@ jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z3 = (INT32) wsptr[5]; - z4 = (INT32) wsptr[7]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z3 = (JLONG) wsptr[5]; + z4 = (JLONG) wsptr[7]; tmp11 = z1 + z2; tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */ @@ -1463,9 +1463,9 @@ jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; - INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; - INT32 z1, z2, z3, z4; + JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; + JLONG z1, z2, z3, z4; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -1566,19 +1566,19 @@ jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z3 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = LEFT_SHIFT(z3, CONST_BITS); - z4 = (INT32) wsptr[4]; + z4 = (JLONG) wsptr[4]; z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */ tmp10 = z3 + z4; tmp11 = z3 - z4; - z1 = (INT32) wsptr[2]; + z1 = (JLONG) wsptr[2]; z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */ z1 = LEFT_SHIFT(z1, CONST_BITS); - z2 = (INT32) wsptr[6]; + z2 = (JLONG) wsptr[6]; z2 = LEFT_SHIFT(z2, CONST_BITS); tmp12 = z1 - z2; @@ -1598,10 +1598,10 @@ jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z3 = (INT32) wsptr[5]; - z4 = (INT32) wsptr[7]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z3 = (JLONG) wsptr[5]; + z4 = (JLONG) wsptr[7]; tmp11 = MULTIPLY(z2, FIX(1.306562965)); /* c3 */ tmp14 = MULTIPLY(z2, - FIX_0_541196100); /* -c9 */ @@ -1679,9 +1679,9 @@ jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; - INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; - INT32 z1, z2, z3, z4; + JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; + JLONG z1, z2, z3, z4; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -1787,12 +1787,12 @@ jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z1 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); z1 = LEFT_SHIFT(z1, CONST_BITS); - z2 = (INT32) wsptr[2]; - z3 = (INT32) wsptr[4]; - z4 = (INT32) wsptr[6]; + z2 = (JLONG) wsptr[2]; + z3 = (JLONG) wsptr[4]; + z4 = (JLONG) wsptr[6]; tmp10 = z3 + z4; tmp11 = z3 - z4; @@ -1819,10 +1819,10 @@ jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z3 = (INT32) wsptr[5]; - z4 = (INT32) wsptr[7]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z3 = (JLONG) wsptr[5]; + z4 = (JLONG) wsptr[7]; tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651)); /* c3 */ tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945)); /* c5 */ @@ -1907,9 +1907,9 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; - INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; - INT32 z1, z2, z3, z4; + JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; + JLONG z1, z2, z3, z4; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -2014,9 +2014,9 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z1 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); z1 = LEFT_SHIFT(z1, CONST_BITS); - z4 = (INT32) wsptr[4]; + z4 = (JLONG) wsptr[4]; z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */ z3 = MULTIPLY(z4, FIX(0.314692123)); /* c12 */ z4 = MULTIPLY(z4, FIX(0.881747734)); /* c8 */ @@ -2027,8 +2027,8 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp23 = z1 - LEFT_SHIFT(z2 + z3 - z4, 1); /* c0 = (c4+c12-c8)*2 */ - z1 = (INT32) wsptr[2]; - z2 = (INT32) wsptr[6]; + z1 = (JLONG) wsptr[2]; + z2 = (JLONG) wsptr[6]; z3 = MULTIPLY(z1 + z2, FIX(1.105676686)); /* c6 */ @@ -2046,10 +2046,10 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z3 = (INT32) wsptr[5]; - z4 = (INT32) wsptr[7]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z3 = (JLONG) wsptr[5]; + z4 = (JLONG) wsptr[7]; z4 = LEFT_SHIFT(z4, CONST_BITS); tmp14 = z1 + z3; @@ -2133,9 +2133,9 @@ jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; - INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; - INT32 z1, z2, z3, z4; + JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; + JLONG z1, z2, z3, z4; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -2246,12 +2246,12 @@ jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z1 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); z1 = LEFT_SHIFT(z1, CONST_BITS); - z2 = (INT32) wsptr[2]; - z3 = (INT32) wsptr[4]; - z4 = (INT32) wsptr[6]; + z2 = (JLONG) wsptr[2]; + z3 = (JLONG) wsptr[4]; + z4 = (JLONG) wsptr[6]; tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */ tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */ @@ -2286,11 +2286,11 @@ jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z4 = (INT32) wsptr[5]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z4 = (JLONG) wsptr[5]; z3 = MULTIPLY(z4, FIX(1.224744871)); /* c5 */ - z4 = (INT32) wsptr[7]; + z4 = (JLONG) wsptr[7]; tmp13 = z2 - z4; tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876)); /* c9 */ @@ -2375,9 +2375,9 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13; - INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; - INT32 z1, z2, z3, z4; + JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13; + JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; + JLONG z1, z2, z3, z4; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -2497,10 +2497,10 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2)); tmp0 = LEFT_SHIFT(tmp0, CONST_BITS); - z1 = (INT32) wsptr[4]; + z1 = (JLONG) wsptr[4]; tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */ tmp2 = MULTIPLY(z1, FIX_0_541196100); /* c12[16] = c6[8] */ @@ -2509,8 +2509,8 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp12 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; - z1 = (INT32) wsptr[2]; - z2 = (INT32) wsptr[6]; + z1 = (JLONG) wsptr[2]; + z2 = (JLONG) wsptr[6]; z3 = z1 - z2; z4 = MULTIPLY(z3, FIX(0.275899379)); /* c14[16] = c7[8] */ z3 = MULTIPLY(z3, FIX(1.387039845)); /* c2[16] = c1[8] */ @@ -2531,10 +2531,10 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Odd part */ - z1 = (INT32) wsptr[1]; - z2 = (INT32) wsptr[3]; - z3 = (INT32) wsptr[5]; - z4 = (INT32) wsptr[7]; + z1 = (JLONG) wsptr[1]; + z2 = (JLONG) wsptr[3]; + z3 = (JLONG) wsptr[5]; + z4 = (JLONG) wsptr[7]; tmp11 = z1 + z3; diff --git a/jidctred.c b/jidctred.c index 1b55aa84..2d2d6242 100644 --- a/jidctred.c +++ b/jidctred.c @@ -58,20 +58,20 @@ */ #if CONST_BITS == 13 -#define FIX_0_211164243 ((INT32) 1730) /* FIX(0.211164243) */ -#define FIX_0_509795579 ((INT32) 4176) /* FIX(0.509795579) */ -#define FIX_0_601344887 ((INT32) 4926) /* FIX(0.601344887) */ -#define FIX_0_720959822 ((INT32) 5906) /* FIX(0.720959822) */ -#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ -#define FIX_0_850430095 ((INT32) 6967) /* FIX(0.850430095) */ -#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ -#define FIX_1_061594337 ((INT32) 8697) /* FIX(1.061594337) */ -#define FIX_1_272758580 ((INT32) 10426) /* FIX(1.272758580) */ -#define FIX_1_451774981 ((INT32) 11893) /* FIX(1.451774981) */ -#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ -#define FIX_2_172734803 ((INT32) 17799) /* FIX(2.172734803) */ -#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ -#define FIX_3_624509785 ((INT32) 29692) /* FIX(3.624509785) */ +#define FIX_0_211164243 ((JLONG) 1730) /* FIX(0.211164243) */ +#define FIX_0_509795579 ((JLONG) 4176) /* FIX(0.509795579) */ +#define FIX_0_601344887 ((JLONG) 4926) /* FIX(0.601344887) */ +#define FIX_0_720959822 ((JLONG) 5906) /* FIX(0.720959822) */ +#define FIX_0_765366865 ((JLONG) 6270) /* FIX(0.765366865) */ +#define FIX_0_850430095 ((JLONG) 6967) /* FIX(0.850430095) */ +#define FIX_0_899976223 ((JLONG) 7373) /* FIX(0.899976223) */ +#define FIX_1_061594337 ((JLONG) 8697) /* FIX(1.061594337) */ +#define FIX_1_272758580 ((JLONG) 10426) /* FIX(1.272758580) */ +#define FIX_1_451774981 ((JLONG) 11893) /* FIX(1.451774981) */ +#define FIX_1_847759065 ((JLONG) 15137) /* FIX(1.847759065) */ +#define FIX_2_172734803 ((JLONG) 17799) /* FIX(2.172734803) */ +#define FIX_2_562915447 ((JLONG) 20995) /* FIX(2.562915447) */ +#define FIX_3_624509785 ((JLONG) 29692) /* FIX(3.624509785) */ #else #define FIX_0_211164243 FIX(0.211164243) #define FIX_0_509795579 FIX(0.509795579) @@ -90,7 +90,7 @@ #endif -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. +/* Multiply a JLONG variable by a JLONG constant to yield a JLONG result. * For 8-bit samples with the recommended scaling, all the variable * and constant values involved are no more than 16 bits wide, so a * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. @@ -122,8 +122,8 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp2, tmp10, tmp12; - INT32 z1, z2, z3, z4; + JLONG tmp0, tmp2, tmp10, tmp12; + JLONG z1, z2, z3, z4; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -206,7 +206,7 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { /* AC terms all zero */ - JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3) + JSAMPLE dcval = range_limit[(int) DESCALE((JLONG) wsptr[0], PASS1_BITS+3) & RANGE_MASK]; outptr[0] = dcval; @@ -221,20 +221,20 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - tmp0 = LEFT_SHIFT((INT32) wsptr[0], CONST_BITS+1); + tmp0 = LEFT_SHIFT((JLONG) wsptr[0], CONST_BITS+1); - tmp2 = MULTIPLY((INT32) wsptr[2], FIX_1_847759065) - + MULTIPLY((INT32) wsptr[6], - FIX_0_765366865); + tmp2 = MULTIPLY((JLONG) wsptr[2], FIX_1_847759065) + + MULTIPLY((JLONG) wsptr[6], - FIX_0_765366865); tmp10 = tmp0 + tmp2; tmp12 = tmp0 - tmp2; /* Odd part */ - z1 = (INT32) wsptr[7]; - z2 = (INT32) wsptr[5]; - z3 = (INT32) wsptr[3]; - z4 = (INT32) wsptr[1]; + z1 = (JLONG) wsptr[7]; + z2 = (JLONG) wsptr[5]; + z3 = (JLONG) wsptr[3]; + z4 = (JLONG) wsptr[1]; tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */ + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */ @@ -276,7 +276,7 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp10, z1; + JLONG tmp0, tmp10, z1; JCOEFPTR inptr; ISLOW_MULT_TYPE * quantptr; int * wsptr; @@ -339,7 +339,7 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, #ifndef NO_ZERO_ROW_TEST if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) { /* AC terms all zero */ - JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3) + JSAMPLE dcval = range_limit[(int) DESCALE((JLONG) wsptr[0], PASS1_BITS+3) & RANGE_MASK]; outptr[0] = dcval; @@ -352,14 +352,14 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - tmp10 = LEFT_SHIFT((INT32) wsptr[0], CONST_BITS+2); + tmp10 = LEFT_SHIFT((JLONG) wsptr[0], CONST_BITS+2); /* Odd part */ - tmp0 = MULTIPLY((INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */ - + MULTIPLY((INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */ - + MULTIPLY((INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */ - + MULTIPLY((INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ + tmp0 = MULTIPLY((JLONG) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */ + + MULTIPLY((JLONG) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */ + + MULTIPLY((JLONG) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */ + + MULTIPLY((JLONG) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ /* Final output stage */ @@ -395,7 +395,7 @@ jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; dcval = DEQUANTIZE(coef_block[0], quantptr[0]); - dcval = (int) DESCALE((INT32) dcval, 3); + dcval = (int) DESCALE((JLONG) dcval, 3); output_buf[0][output_col] = range_limit[dcval & RANGE_MASK]; } diff --git a/jmorecfg.h b/jmorecfg.h index 806d6a47..1d967863 100644 --- a/jmorecfg.h +++ b/jmorecfg.h @@ -147,13 +147,35 @@ typedef unsigned int UINT16; typedef short INT16; #endif -/* INT32 must hold at least signed 32-bit values. */ +/* INT32 must hold at least signed 32-bit values. + * + * NOTE: The INT32 typedef dates back to libjpeg v5 (1994.) Integers were + * sometimes 16-bit back then (MS-DOS), which is why INT32 is typedef'd to + * long. It also wasn't common (or at least as common) in 1994 for INT32 to be + * defined by platform headers. Since then, however, INT32 is defined in + * several other common places: + * + * Xmd.h (X11 header) typedefs INT32 to int on 64-bit platforms and long on + * 32-bit platforms (i.e always a 32-bit signed type.) + * + * basetsd.h (Win32 header) typedefs INT32 to int (always a 32-bit signed type + * on modern platforms.) + * + * qglobal.h (Qt header) typedefs INT32 to int (always a 32-bit signed type on + * modern platforms.) + * + * This is a recipe for conflict, since "long" and "int" aren't always + * compatible types. Since the definition of INT32 has technically been part + * of the libjpeg API for more than 20 years, we can't remove it, but we do not + * use it internally any longer. We instead define a separate type (JLONG) + * for internal use, which ensures that internal behavior will always be the + * same regardless of any external headers that may be included. + */ #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ #ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ #ifndef _BASETSD_H /* MinGW is slightly different */ #ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ -#define __INT32_IS_ACTUALLY_LONG typedef long INT32; #endif #endif diff --git a/jpegint.h b/jpegint.h index 10d36239..1530e0c7 100644 --- a/jpegint.h +++ b/jpegint.h @@ -43,16 +43,16 @@ typedef enum { /* Operating modes for buffer controllers */ #define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */ +/* JLONG must hold at least signed 32-bit values. */ +typedef long JLONG; + + /* * Left shift macro that handles a negative operand without causing any * sanitizer warnings */ -#ifdef __INT32_IS_ACTUALLY_LONG -#define LEFT_SHIFT(a, b) ((INT32)((unsigned long)(a) << (b))) -#else -#define LEFT_SHIFT(a, b) ((INT32)((unsigned int)(a) << (b))) -#endif +#define LEFT_SHIFT(a, b) ((JLONG)((unsigned long)(a) << (b))) /* Declarations for compression modules */ @@ -276,16 +276,16 @@ struct jpeg_color_quantizer { * shift" instructions that shift in copies of the sign bit. But some * C compilers implement >> with an unsigned shift. For these machines you * must define RIGHT_SHIFT_IS_UNSIGNED. - * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. + * RIGHT_SHIFT provides a proper signed right shift of a JLONG quantity. * It is only applied with constant shift counts. SHIFT_TEMPS must be * included in the variables of any routine using RIGHT_SHIFT. */ #ifdef RIGHT_SHIFT_IS_UNSIGNED -#define SHIFT_TEMPS INT32 shift_temp; +#define SHIFT_TEMPS JLONG shift_temp; #define RIGHT_SHIFT(x,shft) \ ((shift_temp = (x)) < 0 ? \ - (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \ + (shift_temp >> (shft)) | ((~((JLONG) 0)) << (32-(shft))) : \ (shift_temp >> (shft))) #else #define SHIFT_TEMPS @@ -348,7 +348,7 @@ extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ /* Arithmetic coding probability estimation tables in jaricom.c */ -extern const INT32 jpeg_aritab[]; +extern const JLONG jpeg_aritab[]; /* Suppress undefined-structure complaints if necessary. */ diff --git a/jquant1.c b/jquant1.c index 4bd0973a..0082c2f0 100644 --- a/jquant1.c +++ b/jquant1.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2009, D. R. Commander + * Copyright (C) 2009, 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -128,8 +128,8 @@ static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = { typedef INT16 FSERROR; /* 16 bits should be enough */ typedef int LOCFSERROR; /* use 'int' for calculation temps */ #else -typedef INT32 FSERROR; /* may need more than 16 bits */ -typedef INT32 LOCFSERROR; /* be sure calculation temps are big enough */ +typedef JLONG FSERROR; /* may need more than 16 bits */ +typedef JLONG LOCFSERROR; /* be sure calculation temps are big enough */ #endif typedef FSERROR *FSERRPTR; /* pointer to error array */ @@ -254,7 +254,7 @@ output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) * (Forcing the upper and lower values to the limits ensures that * dithering can't produce a color outside the selected gamut.) */ - return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj); + return (int) (((JLONG) j * MAXJSAMPLE + maxj/2) / maxj); } @@ -264,7 +264,7 @@ largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) /* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ { /* Breakpoints are halfway between values returned by output_value */ - return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj)); + return (int) (((JLONG) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj)); } @@ -400,7 +400,7 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors) { ODITHER_MATRIX_PTR odither; int j,k; - INT32 num,den; + JLONG num,den; odither = (ODITHER_MATRIX_PTR) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, @@ -410,10 +410,10 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors) * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1). * On 16-bit-int machine, be careful to avoid overflow. */ - den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1)); + den = 2 * ODITHER_CELLS * ((JLONG) (ncolors - 1)); for (j = 0; j < ODITHER_SIZE; j++) { for (k = 0; k < ODITHER_SIZE; k++) { - num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k]))) + num = ((JLONG) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k]))) * MAXJSAMPLE; /* Ensure round towards zero despite C's lack of consistency * about rounding negative values in integer division... diff --git a/jquant2.c b/jquant2.c index aa56aa40..fec4e4e3 100644 --- a/jquant2.c +++ b/jquant2.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2009, 2014, D. R. Commander. + * Copyright (C) 2009, 2014-2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -160,8 +160,8 @@ typedef hist2d * hist3d; /* type for top-level pointer */ typedef INT16 FSERROR; /* 16 bits should be enough */ typedef int LOCFSERROR; /* use 'int' for calculation temps */ #else -typedef INT32 FSERROR; /* may need more than 16 bits */ -typedef INT32 LOCFSERROR; /* be sure calculation temps are big enough */ +typedef JLONG FSERROR; /* may need more than 16 bits */ +typedef JLONG LOCFSERROR; /* be sure calculation temps are big enough */ #endif typedef FSERROR *FSERRPTR; /* pointer to error array */ @@ -240,7 +240,7 @@ typedef struct { int c1min, c1max; int c2min, c2max; /* The volume (actually 2-norm) of the box */ - INT32 volume; + JLONG volume; /* The number of nonzero histogram cells within this box */ long colorcount; } box; @@ -275,7 +275,7 @@ find_biggest_volume (boxptr boxlist, int numboxes) { register boxptr boxp; register int i; - register INT32 maxv = 0; + register JLONG maxv = 0; boxptr which = NULL; for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { @@ -298,7 +298,7 @@ update_box (j_decompress_ptr cinfo, boxptr boxp) histptr histp; int c0,c1,c2; int c0min,c0max,c1min,c1max,c2min,c2max; - INT32 dist0,dist1,dist2; + JLONG dist0,dist1,dist2; long ccount; c0min = boxp->c0min; c0max = boxp->c0max; @@ -572,7 +572,7 @@ select_colors (j_decompress_ptr cinfo, int desired_colors) * distance from every colormap entry to every histogram cell. Unfortunately, * it needs a work array to hold the best-distance-so-far for each histogram * cell (because the inner loop has to be over cells, not colormap entries). - * The work array elements have to be INT32s, so the work array would need + * The work array elements have to be JLONGs, so the work array would need * 256Kb at our recommended precision. This is not feasible in DOS machines. * * To get around these problems, we apply Thomas' method to compute the @@ -638,8 +638,8 @@ find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, int maxc0, maxc1, maxc2; int centerc0, centerc1, centerc2; int i, x, ncolors; - INT32 minmaxdist, min_dist, max_dist, tdist; - INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ + JLONG minmaxdist, min_dist, max_dist, tdist; + JLONG mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ /* Compute true coordinates of update box's upper corner and center. * Actually we compute the coordinates of the center of the upper-corner @@ -763,15 +763,15 @@ find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, { int ic0, ic1, ic2; int i, icolor; - register INT32 * bptr; /* pointer into bestdist[] array */ + register JLONG * bptr; /* pointer into bestdist[] array */ JSAMPLE * cptr; /* pointer into bestcolor[] array */ - INT32 dist0, dist1; /* initial distance values */ - register INT32 dist2; /* current distance in inner loop */ - INT32 xx0, xx1; /* distance increments */ - register INT32 xx2; - INT32 inc0, inc1, inc2; /* initial values for increments */ + JLONG dist0, dist1; /* initial distance values */ + register JLONG dist2; /* current distance in inner loop */ + JLONG xx0, xx1; /* distance increments */ + register JLONG xx2; + JLONG inc0, inc1, inc2; /* initial values for increments */ /* This array holds the distance to the nearest-so-far color for each cell */ - INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; + JLONG bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; /* Initialize best-distance for each cell of the update box */ bptr = bestdist; diff --git a/rdppm.c b/rdppm.c index 3d493186..c2556d09 100644 --- a/rdppm.c +++ b/rdppm.c @@ -4,8 +4,8 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 2009 by Bill Allombert, Guido Vollbeding. - * It was modified by The libjpeg-turbo Project to include only code and - * information relevant to libjpeg-turbo. + * libjpeg-turbo Modifications: + * Copyright (C) 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -410,14 +410,14 @@ start_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) /* Compute the rescaling array if required. */ if (need_rescale) { - INT32 val, half_maxval; + long val, half_maxval; /* On 16-bit-int machines we have to be careful of maxval = 65535 */ source->rescale = (JSAMPLE *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (size_t) (((long) maxval + 1L) * sizeof(JSAMPLE))); half_maxval = maxval / 2; - for (val = 0; val <= (INT32) maxval; val++) { + for (val = 0; val <= (long) maxval; val++) { /* The multiplication here must be done in 32 bits to avoid overflow */ source->rescale[val] = (JSAMPLE) ((val*MAXJSAMPLE + half_maxval)/maxval); } diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index 2186f248..37f5a1b5 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -6,7 +6,7 @@ * Author: Siarhei Siamashka * Copyright (C) 2013-2014, Linaro Limited * Author: Ragesh Radhakrishnan - * Copyright (C) 2014, D. R. Commander. All rights reserved. + * Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -134,8 +134,8 @@ _\fname: #define REF_1D_IDCT(xrow0, xrow1, xrow2, xrow3, xrow4, xrow5, xrow6, xrow7) \ { \ DCTELEM row0, row1, row2, row3, row4, row5, row6, row7; \ - INT32 q1, q2, q3, q4, q5, q6, q7; \ - INT32 tmp11_plus_tmp2, tmp11_minus_tmp2; \ + JLONG q1, q2, q3, q4, q5, q6, q7; \ + JLONG tmp11_plus_tmp2, tmp11_minus_tmp2; \ \ /* 1-D iDCT input data */ \ row0 = xrow0; \ @@ -156,7 +156,7 @@ _\fname: q2 = MULTIPLY(row2, FIX_0_541196100) + \ MULTIPLY(row6, FIX_0_541196100_MINUS_1_847759065); \ q4 = q6; \ - q3 = ((INT32) row0 - (INT32) row4) << 13; \ + q3 = ((JLONG) row0 - (JLONG) row4) << 13; \ q6 += MULTIPLY(row5, -FIX_2_562915447) + \ MULTIPLY(row3, FIX_3_072711026_MINUS_2_562915447); \ /* now we can use q1 (reloadable constants have been used up) */ \ @@ -183,7 +183,7 @@ _\fname: /* (tmp11 - tmp2) has been calculated (out_row6 before descale) */ \ tmp11_minus_tmp2 = q1; \ \ - q1 = ((INT32) row0 + (INT32) row4) << 13; \ + q1 = ((JLONG) row0 + (JLONG) row4) << 13; \ q2 = q1 + q6; \ q1 = q1 - q6; \ \ diff --git a/simd/jsimd_arm_neon.S b/simd/jsimd_arm_neon.S index 4d9685b0..c83e1c74 100644 --- a/simd/jsimd_arm_neon.S +++ b/simd/jsimd_arm_neon.S @@ -6,6 +6,7 @@ * Author: Siarhei Siamashka * Copyright (C) 2014 Siarhei Siamashka. All Rights Reserved. * Copyright (C) 2014 Linaro Limited. All Rights Reserved. + * Copyright (C) 2015 D. R. Commander. All Rights Reserved. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -105,8 +106,8 @@ _\fname: #define REF_1D_IDCT(xrow0, xrow1, xrow2, xrow3, xrow4, xrow5, xrow6, xrow7) \ { \ DCTELEM row0, row1, row2, row3, row4, row5, row6, row7; \ - INT32 q1, q2, q3, q4, q5, q6, q7; \ - INT32 tmp11_plus_tmp2, tmp11_minus_tmp2; \ + JLONG q1, q2, q3, q4, q5, q6, q7; \ + JLONG tmp11_plus_tmp2, tmp11_minus_tmp2; \ \ /* 1-D iDCT input data */ \ row0 = xrow0; \ @@ -127,7 +128,7 @@ _\fname: q2 = MULTIPLY(row2, FIX_0_541196100) + \ MULTIPLY(row6, FIX_0_541196100_MINUS_1_847759065); \ q4 = q6; \ - q3 = ((INT32) row0 - (INT32) row4) << 13; \ + q3 = ((JLONG) row0 - (JLONG) row4) << 13; \ q6 += MULTIPLY(row5, -FIX_2_562915447) + \ MULTIPLY(row3, FIX_3_072711026_MINUS_2_562915447); \ /* now we can use q1 (reloadable constants have been used up) */ \ @@ -154,7 +155,7 @@ _\fname: /* (tmp11 - tmp2) has been calculated (out_row6 before descale) */ \ tmp11_minus_tmp2 = q1; \ \ - q1 = ((INT32) row0 + (INT32) row4) << 13; \ + q1 = ((JLONG) row0 + (JLONG) row4) << 13; \ q2 = q1 + q6; \ q1 = q1 - q6; \ \ diff --git a/simd/jsimd_mips_dspr2.S b/simd/jsimd_mips_dspr2.S index bd55c763..0eed1ce2 100644 --- a/simd/jsimd_mips_dspr2.S +++ b/simd/jsimd_mips_dspr2.S @@ -5,6 +5,7 @@ * All rights reserved. * Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) * Darko Laus (darko.laus@imgtec.com) + * Copyright (C) 2015, D. R. Commander. All Rights Reserved. * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. @@ -1992,14 +1993,14 @@ LEAF_MIPS_DSPR2(jsimd_idct_islow_mips_dspr2) move v0, sp addiu v1, zero, 8 4: - lw t0, 8(v0) // z2 = (INT32) wsptr[2] - lw t1, 24(v0) // z3 = (INT32) wsptr[6] - lw t2, 0(v0) // (INT32) wsptr[0] - lw t3, 16(v0) // (INT32) wsptr[4] - lw s4, 4(v0) // (INT32) wsptr[1] - lw s5, 12(v0) // (INT32) wsptr[3] - lw s6, 20(v0) // (INT32) wsptr[5] - lw s7, 28(v0) // (INT32) wsptr[7] + lw t0, 8(v0) // z2 = (JLONG) wsptr[2] + lw t1, 24(v0) // z3 = (JLONG) wsptr[6] + lw t2, 0(v0) // (JLONG) wsptr[0] + lw t3, 16(v0) // (JLONG) wsptr[4] + lw s4, 4(v0) // (JLONG) wsptr[1] + lw s5, 12(v0) // (JLONG) wsptr[3] + lw s6, 20(v0) // (JLONG) wsptr[5] + lw s7, 28(v0) // (JLONG) wsptr[7] or s4, s4, t0 or s4, s4, t1 or s4, s4, t3 @@ -2025,8 +2026,8 @@ LEAF_MIPS_DSPR2(jsimd_idct_islow_mips_dspr2) mul t1, t1, t8 // MULTIPLY(z3, FIX_1_847759065) addiu t8, zero, 6270 // FIX_0_765366865 mul t0, t0, t8 // MULTIPLY(z2, FIX_0_765366865) - addu t4, t2, t3 // (INT32) wsptr[0] + (INT32) wsptr[4] - subu t2, t2, t3 // (INT32) wsptr[0] - (INT32) wsptr[4] + addu t4, t2, t3 // (JLONG) wsptr[0] + (JLONG) wsptr[4] + subu t2, t2, t3 // (JLONG) wsptr[0] - (JLONG) wsptr[4] sll t4, t4, 13 // tmp0 = ((wsptr[0] + wsptr[4]) << CONST_BITS sll t2, t2, 13 // tmp1 = ((wsptr[0] - wsptr[4]) << CONST_BITS subu t1, t5, t1 // tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065) @@ -2035,10 +2036,10 @@ LEAF_MIPS_DSPR2(jsimd_idct_islow_mips_dspr2) addu t5, t5, t0 // tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865) subu t1, t4, t5 // tmp13 = tmp0 - tmp3 addu t0, t4, t5 // tmp10 = tmp0 + tmp3 - lw t4, 28(v0) // tmp0 = (INT32) wsptr[7] - lw t6, 12(v0) // tmp2 = (INT32) wsptr[3] - lw t5, 20(v0) // tmp1 = (INT32) wsptr[5] - lw t7, 4(v0) // tmp3 = (INT32) wsptr[1] + lw t4, 28(v0) // tmp0 = (JLONG) wsptr[7] + lw t6, 12(v0) // tmp2 = (JLONG) wsptr[3] + lw t5, 20(v0) // tmp1 = (JLONG) wsptr[5] + lw t7, 4(v0) // tmp3 = (JLONG) wsptr[1] addu s0, t4, t6 // z3 = tmp0 + tmp2 addiu t8, zero, 9633 // FIX_1_175875602 addu s1, t5, t7 // z4 = tmp1 + tmp3 @@ -3269,9 +3270,9 @@ LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) lw s6, 8(t1) // wsptr[2] li s5, 6270 lw s7, 24(t1) // wsptr[6] - mul s4, s4, s6 // MULTIPLY((INT32) wsptr[2], FIX_1_847759065) + mul s4, s4, s6 // MULTIPLY((JLONG) wsptr[2], FIX_1_847759065) lw t2, 0(t1) // wsptr[0] - mul s5, s5, s7 // MULTIPLY((INT32) wsptr[6], - FIX_0_765366865) + mul s5, s5, s7 // MULTIPLY((JLONG) wsptr[6], - FIX_0_765366865) lh t5, 28(t1) // wsptr[7] lh t6, 20(t1) // wsptr[5] lh t7, 12(t1) // wsptr[3] @@ -3284,7 +3285,7 @@ LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) mult $ac1, zero, zero dpa.w.ph $ac1, t5, s2 dpa.w.ph $ac1, t7, s3 - sll t2, t2, 14 // tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1) + sll t2, t2, 14 // tmp0 = ((JLONG) wsptr[0]) << (CONST_BITS+1) mflo s6, $ac0 // MULTIPLY(wsptr[2], FIX_1_847759065 + MULTIPLY(wsptr[6], -FIX_0_765366865) subu s4, s4, s5 @@ -3323,9 +3324,9 @@ LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) lw s6, 40(t1) // wsptr[2] li s5, 6270 lw s7, 56(t1) // wsptr[6] - mul s4, s4, s6 // MULTIPLY((INT32) wsptr[2], FIX_1_847759065) + mul s4, s4, s6 // MULTIPLY((JLONG) wsptr[2], FIX_1_847759065) lw t2, 32(t1) // wsptr[0] - mul s5, s5, s7 // MULTIPLY((INT32) wsptr[6], - FIX_0_765366865) + mul s5, s5, s7 // MULTIPLY((JLONG) wsptr[6], - FIX_0_765366865) lh t5, 60(t1) // wsptr[7] lh t6, 52(t1) // wsptr[5] lh t7, 44(t1) // wsptr[3] @@ -3338,7 +3339,7 @@ LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) mult $ac1, zero, zero dpa.w.ph $ac1, t5, s2 dpa.w.ph $ac1, t7, s3 - sll t2, t2, 14 // tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1) + sll t2, t2, 14 // tmp0 = ((JLONG) wsptr[0]) << (CONST_BITS+1) mflo s6, $ac0 // MULTIPLY(wsptr[2], FIX_1_847759065 + MULTIPLY(wsptr[6], -FIX_0_765366865) subu s4, s4, s5 @@ -3377,9 +3378,9 @@ LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) lw s6, 72(t1) // wsptr[2] li s5, 6270 lw s7, 88(t1) // wsptr[6] - mul s4, s4, s6 // MULTIPLY((INT32) wsptr[2], FIX_1_847759065) + mul s4, s4, s6 // MULTIPLY((JLONG) wsptr[2], FIX_1_847759065) lw t2, 64(t1) // wsptr[0] - mul s5, s5, s7 // MULTIPLY((INT32) wsptr[6], - FIX_0_765366865) + mul s5, s5, s7 // MULTIPLY((JLONG) wsptr[6], - FIX_0_765366865) lh t5, 92(t1) // wsptr[7] lh t6, 84(t1) // wsptr[5] lh t7, 76(t1) // wsptr[3] @@ -3392,7 +3393,7 @@ LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) mult $ac1, zero, zero dpa.w.ph $ac1, t5, s2 dpa.w.ph $ac1, t7, s3 - sll t2, t2, 14 // tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1) + sll t2, t2, 14 // tmp0 = ((JLONG) wsptr[0]) << (CONST_BITS+1) mflo s6, $ac0 // MULTIPLY(wsptr[2], FIX_1_847759065 + MULTIPLY(wsptr[6], -FIX_0_765366865) subu s4, s4, s5 @@ -3430,9 +3431,9 @@ LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) lw s6, 104(t1) // wsptr[2] li s5, 6270 lw s7, 120(t1) // wsptr[6] - mul s4, s4, s6 // MULTIPLY((INT32) wsptr[2], FIX_1_847759065) + mul s4, s4, s6 // MULTIPLY((JLONG) wsptr[2], FIX_1_847759065) lw t2, 96(t1) // wsptr[0] - mul s5, s5, s7 // MULTIPLY((INT32) wsptr[6], -FIX_0_765366865) + mul s5, s5, s7 // MULTIPLY((JLONG) wsptr[6], -FIX_0_765366865) lh t5, 124(t1) // wsptr[7] lh t6, 116(t1) // wsptr[5] lh t7, 108(t1) // wsptr[3] @@ -3445,7 +3446,7 @@ LEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2) mult $ac1, zero, zero dpa.w.ph $ac1, t5, s2 dpa.w.ph $ac1, t7, s3 - sll t2, t2, 14 // tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1) + sll t2, t2, 14 // tmp0 = ((JLONG) wsptr[0]) << (CONST_BITS+1) mflo s6, $ac0 // MULTIPLY(wsptr[2], FIX_1_847759065 + MULTIPLY(wsptr[6], -FIX_0_765366865) subu s4, s4, s5 diff --git a/wrbmp.c b/wrbmp.c index 06630d88..5e307de0 100644 --- a/wrbmp.c +++ b/wrbmp.c @@ -5,7 +5,7 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2013, Linaro Limited. - * Copyright (C) 2014, D. R. Commander. + * Copyright (C) 2014-2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -200,7 +200,7 @@ write_bmp_header (j_decompress_ptr cinfo, bmp_dest_ptr dest) array[offset+1] = (char) (((value) >> 8) & 0xFF), \ array[offset+2] = (char) (((value) >> 16) & 0xFF), \ array[offset+3] = (char) (((value) >> 24) & 0xFF)) - INT32 headersize, bfSize; + long headersize, bfSize; int bits_per_pixel, cmap_entries; /* Compute colormap size and total file size */ @@ -224,7 +224,7 @@ write_bmp_header (j_decompress_ptr cinfo, bmp_dest_ptr dest) } /* File size */ headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */ - bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height; + bfSize = headersize + (long) dest->row_width * (long) cinfo->output_height; /* Set unused fields of header to 0 */ MEMZERO(bmpfileheader, sizeof(bmpfileheader)); @@ -246,8 +246,8 @@ write_bmp_header (j_decompress_ptr cinfo, bmp_dest_ptr dest) /* we leave biCompression = 0, for none */ /* we leave biSizeImage = 0; this is correct for uncompressed data */ if (cinfo->density_unit == 2) { /* if have density in dots/cm, then */ - PUT_4B(bmpinfoheader, 24, (INT32) (cinfo->X_density*100)); /* XPels/M */ - PUT_4B(bmpinfoheader, 28, (INT32) (cinfo->Y_density*100)); /* XPels/M */ + PUT_4B(bmpinfoheader, 24, (long) (cinfo->X_density*100)); /* XPels/M */ + PUT_4B(bmpinfoheader, 28, (long) (cinfo->Y_density*100)); /* XPels/M */ } PUT_2B(bmpinfoheader, 32, cmap_entries); /* biClrUsed */ /* we leave biClrImportant = 0 */ @@ -268,7 +268,7 @@ write_os2_header (j_decompress_ptr cinfo, bmp_dest_ptr dest) { char bmpfileheader[14]; char bmpcoreheader[12]; - INT32 headersize, bfSize; + long headersize, bfSize; int bits_per_pixel, cmap_entries; /* Compute colormap size and total file size */ @@ -292,7 +292,7 @@ write_os2_header (j_decompress_ptr cinfo, bmp_dest_ptr dest) } /* File size */ headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */ - bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height; + bfSize = headersize + (long) dest->row_width * (long) cinfo->output_height; /* Set unused fields of header to 0 */ MEMZERO(bmpfileheader, sizeof(bmpfileheader)); diff --git a/wrgif.c b/wrgif.c index d3d8d516..53592de5 100644 --- a/wrgif.c +++ b/wrgif.c @@ -3,8 +3,8 @@ * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. - * It was modified by The libjpeg-turbo Project to include only code relevant - * to libjpeg-turbo. + * libjpeg-turbo Modifications: + * Copyright (C) 2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -55,7 +55,7 @@ typedef struct { /* State for packing variable-width codes into a bitstream */ int n_bits; /* current number of bits/code */ int maxcode; /* maximum code, given n_bits */ - INT32 cur_accum; /* holds bits not yet output */ + long cur_accum; /* holds bits not yet output */ int cur_bits; /* # of bits in cur_accum */ /* State for GIF code assignment */ @@ -109,7 +109,7 @@ output (gif_dest_ptr dinfo, int code) /* Emit a code of n_bits bits */ /* Uses cur_accum and cur_bits to reblock into 8-bit bytes */ { - dinfo->cur_accum |= ((INT32) code) << dinfo->cur_bits; + dinfo->cur_accum |= ((long) code) << dinfo->cur_bits; dinfo->cur_bits += dinfo->n_bits; while (dinfo->cur_bits >= 8) { From d65e768b2e802c2a182203f5644904cfcd7e5240 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Oct 2015 22:26:25 -0500 Subject: [PATCH 075/140] Fix additional issues reported by UB sanitizers Most of these involved overrunning the signed 32-bit JLONG type whenever building libjpeg-turbo with a 32-bit compiler. These issues are not believed to represent actual security threats, but eliminating them makes it easier to detect such threats should they arise in the future. --- ChangeLog.txt | 6 ++++++ jcdctmgr.c | 6 +++++- jcphuff.c | 2 +- jdcolor.c | 2 +- jdhuff.h | 4 ++-- jdmerge.c | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4a6f488f..a064973f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -29,6 +29,12 @@ backward API or ABI incompatibilities with prior libjpeg-turbo releases. [6] The MIPS DSPr2 SIMD code can now be compiled to support either FR=0 or FR=1 FPUs. +[7] Fixed additional negative left shifts and other issues reported by the GCC +and Clang undefined behavior sanitizers. Most of these issues affected only +32-bit code, and none of them was known to pose a security threat, but removing +the warnings makes it easier to detect actual security issues, should they +arise in the future. + 1.4.2 ===== diff --git a/jcdctmgr.c b/jcdctmgr.c index cef4b5e7..1a0d4060 100644 --- a/jcdctmgr.c +++ b/jcdctmgr.c @@ -6,7 +6,7 @@ * libjpeg-turbo Modifications: * Copyright (C) 1999-2006, MIYASAKA Masaru. * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright (C) 2011, 2014-2015 D. R. Commander + * Copyright (C) 2011, 2014-2015, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -209,7 +209,11 @@ compute_reciprocal (UINT16 divisor, DCTELEM * dtbl) dtbl[DCTSIZE2 * 0] = (DCTELEM) fq; /* reciprocal */ dtbl[DCTSIZE2 * 1] = (DCTELEM) c; /* correction + roundfactor */ +#ifdef WITH_SIMD dtbl[DCTSIZE2 * 2] = (DCTELEM) (1 << (sizeof(DCTELEM)*8*2 - r)); /* scale */ +#else + dtbl[DCTSIZE2 * 2] = 1; +#endif dtbl[DCTSIZE2 * 3] = (DCTELEM) r - sizeof(DCTELEM)*8; /* shift */ if(r <= 16) return 0; diff --git a/jcphuff.c b/jcphuff.c index 3b29e02f..656fc67c 100644 --- a/jcphuff.c +++ b/jcphuff.c @@ -231,7 +231,7 @@ emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size) /* Emit some bits, unless we are in gather mode */ { /* This routine is heavily used, so it's worth coding tightly. */ - register JLONG put_buffer = (JLONG) code; + register size_t put_buffer = (size_t) code; register int put_bits = entropy->put_bits; /* if size is 0, caller used an invalid Huffman table entry */ diff --git a/jdcolor.c b/jdcolor.c index 6a5d8195..af7c5758 100644 --- a/jdcolor.c +++ b/jdcolor.c @@ -604,7 +604,7 @@ ycck_cmyk_convert (j_decompress_ptr cinfo, */ #define DITHER_MASK 0x3 -#define DITHER_ROTATE(x) (((x) << 24) | (((x) >> 8) & 0x00FFFFFF)) +#define DITHER_ROTATE(x) ((((x) & 0xFF) << 24) | (((x) >> 8) & 0x00FFFFFF)) static const JLONG dither_matrix[4] = { 0x0008020A, 0x0C040E06, diff --git a/jdhuff.h b/jdhuff.h index 46d1916a..422a7a16 100644 --- a/jdhuff.h +++ b/jdhuff.h @@ -74,12 +74,12 @@ EXTERN(void) jpeg_make_d_derived_tbl #if SIZEOF_SIZE_T==8 || defined(_WIN64) -typedef size_t bit_buf_type; /* type of bit-extraction buffer */ +typedef size_t bit_buf_type; /* type of bit-extraction buffer */ #define BIT_BUF_SIZE 64 /* size of buffer in bits */ #else -typedef JLONG bit_buf_type; /* type of bit-extraction buffer */ +typedef unsigned long bit_buf_type; /* type of bit-extraction buffer */ #define BIT_BUF_SIZE 32 /* size of buffer in bits */ #endif diff --git a/jdmerge.c b/jdmerge.c index 9b2fdf82..629b8719 100644 --- a/jdmerge.c +++ b/jdmerge.c @@ -456,7 +456,7 @@ h2v2_merged_upsample (j_decompress_ptr cinfo, */ #define DITHER_MASK 0x3 -#define DITHER_ROTATE(x) (((x) << 24) | (((x) >> 8) & 0x00FFFFFF)) +#define DITHER_ROTATE(x) ((((x) & 0xFF) << 24) | (((x) >> 8) & 0x00FFFFFF)) static const JLONG dither_matrix[4] = { 0x0008020A, 0x0C040E06, From aa769febf25c64f115c2a237516b0c7d65f651cd Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 15 Oct 2015 02:25:00 -0500 Subject: [PATCH 076/140] Fix compiler warnings under Visual C++ A few of these are long-standing, but most were exposed when switching from INT32 to JLONG. --- jcdctmgr.c | 6 +++--- jcphuff.c | 4 ++-- jdcol565.c | 24 ++++++++++++------------ jdmerge.c | 8 ++++---- jdmrg565.c | 12 ++++++------ rdppm.c | 3 +-- 6 files changed, 28 insertions(+), 29 deletions(-) diff --git a/jcdctmgr.c b/jcdctmgr.c index 1a0d4060..abbbe2ac 100644 --- a/jcdctmgr.c +++ b/jcdctmgr.c @@ -185,7 +185,7 @@ compute_reciprocal (UINT16 divisor, DCTELEM * dtbl) dtbl[DCTSIZE2 * 0] = (DCTELEM) 1; /* reciprocal */ dtbl[DCTSIZE2 * 1] = (DCTELEM) 0; /* correction */ dtbl[DCTSIZE2 * 2] = (DCTELEM) 1; /* scale */ - dtbl[DCTSIZE2 * 3] = (DCTELEM) (-sizeof(DCTELEM) * 8); /* shift */ + dtbl[DCTSIZE2 * 3] = -(DCTELEM) (sizeof(DCTELEM) * 8); /* shift */ return 0; } @@ -427,12 +427,12 @@ quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace) temp = -temp; product = (UDCTELEM2)(temp + corr) * recip; product >>= shift + sizeof(DCTELEM)*8; - temp = product; + temp = (DCTELEM)product; temp = -temp; } else { product = (UDCTELEM2)(temp + corr) * recip; product >>= shift + sizeof(DCTELEM)*8; - temp = product; + temp = (DCTELEM)product; } output_ptr[i] = (JCOEF) temp; } diff --git a/jcphuff.c b/jcphuff.c index 656fc67c..1e7e282d 100644 --- a/jcphuff.c +++ b/jcphuff.c @@ -35,7 +35,7 @@ typedef struct { */ JOCTET * next_output_byte; /* => next byte to write in buffer */ size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - JLONG put_buffer; /* current bit-accumulation buffer */ + size_t put_buffer; /* current bit-accumulation buffer */ int put_bits; /* # of bits now in it */ j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */ @@ -241,7 +241,7 @@ emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size) if (entropy->gather_statistics) return; /* do nothing if we're only getting stats */ - put_buffer &= (((JLONG) 1)<> 16; \ + ((INT16*)(addr))[0] = (INT16)(pixels); \ + ((INT16*)(addr))[1] = (INT16)((pixels) >> 16); \ } #define WRITE_TWO_PIXELS_BE(addr, pixels) { \ - ((INT16*)(addr))[1] = (pixels); \ - ((INT16*)(addr))[0] = (pixels) >> 16; \ + ((INT16*)(addr))[1] = (INT16)(pixels); \ + ((INT16*)(addr))[0] = (INT16)((pixels) >> 16); \ } #define DITHER_565_R(r, dither) ((r) + ((dither) & 0xFF)) diff --git a/jdmrg565.c b/jdmrg565.c index 09f0d27b..18287b37 100644 --- a/jdmrg565.c +++ b/jdmrg565.c @@ -79,7 +79,7 @@ h2v1_merged_upsample_565_internal (j_decompress_ptr cinfo, g = range_limit[y + cgreen]; b = range_limit[y + cblue]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr = rgb; + *(INT16*)outptr = (INT16)rgb; } } @@ -153,7 +153,7 @@ h2v1_merged_upsample_565D_internal (j_decompress_ptr cinfo, g = range_limit[DITHER_565_G(y + cgreen, d0)]; b = range_limit[DITHER_565_B(y + cblue, d0)]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr = rgb; + *(INT16*)outptr = (INT16)rgb; } } @@ -242,14 +242,14 @@ h2v2_merged_upsample_565_internal (j_decompress_ptr cinfo, g = range_limit[y + cgreen]; b = range_limit[y + cblue]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr0 = rgb; + *(INT16*)outptr0 = (INT16)rgb; y = GETJSAMPLE(*inptr01); r = range_limit[y + cred]; g = range_limit[y + cgreen]; b = range_limit[y + cblue]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr1 = rgb; + *(INT16*)outptr1 = (INT16)rgb; } } @@ -344,13 +344,13 @@ h2v2_merged_upsample_565D_internal (j_decompress_ptr cinfo, g = range_limit[DITHER_565_G(y + cgreen, d0)]; b = range_limit[DITHER_565_B(y + cblue, d0)]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr0 = rgb; + *(INT16*)outptr0 = (INT16)rgb; y = GETJSAMPLE(*inptr01); r = range_limit[DITHER_565_R(y + cred, d1)]; g = range_limit[DITHER_565_G(y + cgreen, d1)]; b = range_limit[DITHER_565_B(y + cblue, d1)]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr1 = rgb; + *(INT16*)outptr1 = (INT16)rgb; } } diff --git a/rdppm.c b/rdppm.c index c2556d09..bf8ded01 100644 --- a/rdppm.c +++ b/rdppm.c @@ -99,8 +99,7 @@ read_pbm_integer (j_compress_ptr cinfo, FILE * infile, int maxval) /* Note that on a 16-bit-int machine, only values up to 64k can be read. */ /* This should not be a problem in practice. */ { - register int ch; - register unsigned int val; + register int ch, val; /* Skip any leading whitespace */ do { From d70a5c12fcb72443483456a2cc8dd18a4c238618 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 14 Dec 2015 16:59:43 -0600 Subject: [PATCH 077/140] Remove unnecessary .arch directive in ARM64 code This directive was preventing the code from assembling using the integrated assembler in clang. Fixes #33 --- ChangeLog.txt | 4 ++++ acinclude.m4 | 2 -- simd/jsimd_arm64_neon.S | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index a064973f..9faadeba 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -35,6 +35,10 @@ and Clang undefined behavior sanitizers. Most of these issues affected only the warnings makes it easier to detect actual security issues, should they arise in the future. +[8] Removed the unnecessary .arch directive from the ARM64 NEON SIMD code. +This directive was preventing the code from assembling using the clang +integrated assembler. + 1.4.2 ===== diff --git a/acinclude.m4 b/acinclude.m4 index 4a130825..8d667849 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -219,7 +219,6 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[ CC="$CCAS" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ .text - .arch armv8-a+fp+simd movi v0.16b, #100]])], ac_good_gnu_arm_assembler=yes) ac_use_gas_preprocessor=no @@ -227,7 +226,6 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[ CC="gas-preprocessor.pl $CCAS" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ .text - .arch armv8-a+fp+simd movi v0.16b, #100]])], ac_use_gas_preprocessor=yes) fi CFLAGS="$ac_save_CFLAGS" diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index 37f5a1b5..89fc6603 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -30,7 +30,6 @@ #endif .text -.arch armv8-a+fp+simd #define RESPECT_STRICT_ALIGNMENT 1 From 6fa5ebdc102fe46ba444b913e2c220103c7e4655 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 17 Dec 2015 10:41:51 -0600 Subject: [PATCH 078/140] cjpeg: Adjust claims RE: image quality settings Quality values > 95 are not useless. They just may not provide as good of a size vs. perceptual quality tradeoff as lower quality values. This also displays the default quality value in the cjpeg usage. Closes #39 --- cjpeg.1 | 15 +++++++-------- cjpeg.c | 3 ++- usage.txt | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cjpeg.1 b/cjpeg.1 index e338c80c..9d09b810 100644 --- a/cjpeg.1 +++ b/cjpeg.1 @@ -1,4 +1,4 @@ -.TH CJPEG 1 "21 November 2014" +.TH CJPEG 1 "17 December 2015" .SH NAME cjpeg \- compress an image file to a JPEG file .SH SYNOPSIS @@ -85,8 +85,8 @@ reconstructed image: the higher the quality setting, the larger the JPEG file, and the closer the output image will be to the original input. Normally you want to use the lowest quality setting (smallest file) that decompresses into something visually indistinguishable from the original image. For this -purpose the quality setting should be between 50 and 95; the default of 75 is -often about right. If you see defects at +purpose the quality setting should generally be between 50 and 95 (the default +is 75) for photographic images. If you see defects at .B \-quality 75, then go up 5 or 10 counts at a time until you are happy with the output image. (The optimal setting will vary from one image to another.) @@ -94,11 +94,10 @@ image. (The optimal setting will vary from one image to another.) .B \-quality 100 will generate a quantization table of all 1's, minimizing loss in the quantization step (but there is still information loss in subsampling, as well -as roundoff error). This setting is mainly of interest for experimental -purposes. Quality values above about 95 are -.B not -recommended for normal use; the compressed file size goes up dramatically for -hardly any gain in output image quality. +as roundoff error.) For most images, specifying a quality value above +about 95 will increase the size of the compressed file dramatically, and while +the quality gain from these higher quality values is measurable (using metrics +such as PSNR or SSIM), it is rarely perceivable by human vision. .PP In the other direction, quality values below 50 will produce very small files of low image quality. Settings around 5 to 10 might be useful in preparing an diff --git a/cjpeg.c b/cjpeg.c index 7aa061e6..1816f59c 100644 --- a/cjpeg.c +++ b/cjpeg.c @@ -155,7 +155,8 @@ usage (void) #endif fprintf(stderr, "Switches (names may be abbreviated):\n"); - fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is useful range)\n"); + fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is most useful range,\n"); + fprintf(stderr, " default is 75)\n"); fprintf(stderr, " -grayscale Create monochrome JPEG file\n"); fprintf(stderr, " -rgb Create RGB JPEG file\n"); #ifdef ENTROPY_OPT_SUPPORTED diff --git a/usage.txt b/usage.txt index ef8e6d09..27c4f9ce 100644 --- a/usage.txt +++ b/usage.txt @@ -104,17 +104,17 @@ the reconstructed image: the higher the quality setting, the larger the JPEG file, and the closer the output image will be to the original input. Normally you want to use the lowest quality setting (smallest file) that decompresses into something visually indistinguishable from the original image. For this -purpose the quality setting should be between 50 and 95; the default of 75 is -often about right. If you see defects at -quality 75, then go up 5 or 10 -counts at a time until you are happy with the output image. (The optimal -setting will vary from one image to another.) +purpose the quality setting should generally be between 50 and 95 (the default +is 75) for photographic images. If you see defects at -quality 75, then go up +5 or 10 counts at a time until you are happy with the output image. (The +optimal setting will vary from one image to another.) -quality 100 will generate a quantization table of all 1's, minimizing loss in the quantization step (but there is still information loss in subsampling, -as well as roundoff error). This setting is mainly of interest for -experimental purposes. Quality values above about 95 are NOT recommended for -normal use; the compressed file size goes up dramatically for hardly any gain -in output image quality. +as well as roundoff error.) For most images, specifying a quality value above +about 95 will increase the size of the compressed file dramatically, and while +the quality gain from these higher quality values is measurable (using metrics +such as PSNR or SSIM), it is rarely perceivable by human vision. In the other direction, quality values below 50 will produce very small files of low image quality. Settings around 5 to 10 might be useful in preparing an From 5f2cbbd039ee71586ef39d5e41695079bf96b139 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 6 Jan 2016 14:02:27 -0600 Subject: [PATCH 079/140] Fix iOS ARM64 build broken by removal of .arch The unnecessary .arch directive was removed from the ARM64 SIMD code in d70a5c12fcb72443483456a2cc8dd18a4c238618, thus allowing clang's integrated assembler to assemble the code on Linux systems. However, this broke the detection mechanism in acinclude.m4 that tells the build system whether it needs to use gas-preprocessor.pl. Since one of the primary motivators for using gas-preprocessor.pl with ARM64 builds is the lack of .req/.unreq directives in Apple's implementation of clang, acinclude.m4 now checks whether .req/.unreq can be properly assembled and uses gas-preprocessor.pl if not. Closes #33. --- acinclude.m4 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 8d667849..c59c4b63 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -219,14 +219,20 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[ CC="$CCAS" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ .text - movi v0.16b, #100]])], ac_good_gnu_arm_assembler=yes) + MYVAR .req x0 + movi v0.16b, #100 + mov MYVAR, #100 + .unreq MYVAR]])], ac_good_gnu_arm_assembler=yes) ac_use_gas_preprocessor=no if test "x$ac_good_gnu_arm_assembler" = "xno" ; then CC="gas-preprocessor.pl $CCAS" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ .text - movi v0.16b, #100]])], ac_use_gas_preprocessor=yes) + MYVAR .req x0 + movi v0.16b, #100 + mov MYVAR, #100 + .unreq MYVAR]])], ac_use_gas_preprocessor=yes) fi CFLAGS="$ac_save_CFLAGS" CC="$ac_save_CC" From 368cd52d381dab7ac22079805231329cf5b1708e Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 11 Jan 2016 22:03:16 -0600 Subject: [PATCH 080/140] Allow JSIMD_FORCENONE=1 env to disable x86-64 SIMD Traditionally, the x86-64 code did not call init_simd() because it had no need to (only SSE2 was supported.) However, having the ability to disable SIMD at run time is a useful testing tool, and all of the other SIMD implementations have this ability. --- ChangeLog.txt | 4 + simd/jsimd_x86_64.c | 207 ++++++++++++++++++++++++++++++++------------ 2 files changed, 157 insertions(+), 54 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 10379e3e..3279b465 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -48,6 +48,10 @@ between the i386 and x86_64 RPMs (any differing files, other than executables, are not allowed when 32-bit and 64-bit RPMs are installed simultaneously.) Since the macro is used only internally, it has been moved into jconfigint.h. +[10] The x86-64 SIMD code can now be disabled at run time by setting the +JSIMD_FORCENONE environment variable to 1 (the other SIMD implementations +already had this capability.) + 1.4.2 ===== diff --git a/simd/jsimd_x86_64.c b/simd/jsimd_x86_64.c index 2c47a7f3..345237c9 100644 --- a/simd/jsimd_x86_64.c +++ b/simd/jsimd_x86_64.c @@ -29,9 +29,34 @@ #define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */ +static unsigned int simd_support = ~0; + +/* + * Check what SIMD accelerations are supported. + * + * FIXME: This code is racy under a multi-threaded environment. + */ +LOCAL(void) +init_simd (void) +{ + char *env = NULL; + + if (simd_support != ~0U) + return; + + simd_support = JSIMD_SSE2 | JSIMD_SSE; + + /* Force different settings through environment variables */ + env = getenv("JSIMD_FORCENONE"); + if ((env != NULL) && (strcmp(env, "1") == 0)) + simd_support = 0; +} + GLOBAL(int) jsimd_can_rgb_ycc (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; @@ -40,15 +65,18 @@ jsimd_can_rgb_ycc (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (!IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && + IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) jsimd_can_rgb_gray (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; @@ -57,15 +85,18 @@ jsimd_can_rgb_gray (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (!IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && + IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) jsimd_can_ycc_rgb (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; @@ -74,10 +105,11 @@ jsimd_can_ycc_rgb (void) if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) return 0; - if (!IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && + IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) @@ -210,25 +242,35 @@ jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_downsample (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - return 1; + if (simd_support & JSIMD_SSE2) + return 1; + + return 0; } GLOBAL(int) jsimd_can_h2v1_downsample (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - return 1; + if (simd_support & JSIMD_SSE2) + return 1; + + return 0; } GLOBAL(void) @@ -252,25 +294,35 @@ jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, GLOBAL(int) jsimd_can_h2v2_upsample (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - return 1; + if (simd_support & JSIMD_SSE2) + return 1; + + return 0; } GLOBAL(int) jsimd_can_h2v1_upsample (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - return 1; + if (simd_support & JSIMD_SSE2) + return 1; + + return 0; } GLOBAL(void) @@ -296,31 +348,37 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_fancy_upsample (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - if (!IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && + IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) jsimd_can_h2v1_fancy_upsample (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - if (!IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && + IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) + return 1; - return 1; + return 0; } GLOBAL(void) @@ -348,31 +406,37 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_h2v2_merged_upsample (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - if (!IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && + IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) jsimd_can_h2v1_merged_upsample (void) { + init_simd(); + /* The code is optimised for these values only */ if (BITS_IN_JSAMPLE != 8) return 0; if (sizeof(JDIMENSION) != 4) return 0; - if (!IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && + IS_ALIGNED_SSE(jconst_merged_upsample_sse2)) + return 1; - return 1; + return 0; } GLOBAL(void) @@ -456,6 +520,8 @@ jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo, GLOBAL(int) jsimd_can_convsamp (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; @@ -466,12 +532,17 @@ jsimd_can_convsamp (void) if (sizeof(DCTELEM) != 2) return 0; - return 1; + if (simd_support & JSIMD_SSE2) + return 1; + + return 0; } GLOBAL(int) jsimd_can_convsamp_float (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; @@ -482,7 +553,10 @@ jsimd_can_convsamp_float (void) if (sizeof(FAST_FLOAT) != 4) return 0; - return 1; + if (simd_support & JSIMD_SSE2) + return 1; + + return 0; } GLOBAL(void) @@ -502,46 +576,52 @@ jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, GLOBAL(int) jsimd_can_fdct_islow (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; if (sizeof(DCTELEM) != 2) return 0; - if (!IS_ALIGNED_SSE(jconst_fdct_islow_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) jsimd_can_fdct_ifast (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; if (sizeof(DCTELEM) != 2) return 0; - if (!IS_ALIGNED_SSE(jconst_fdct_ifast_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_ifast_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) jsimd_can_fdct_float (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; if (sizeof(FAST_FLOAT) != 4) return 0; - if (!IS_ALIGNED_SSE(jconst_fdct_float_sse)) - return 0; + if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse)) + return 1; - return 1; + return 0; } GLOBAL(void) @@ -565,6 +645,8 @@ jsimd_fdct_float (FAST_FLOAT * data) GLOBAL(int) jsimd_can_quantize (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; @@ -573,12 +655,17 @@ jsimd_can_quantize (void) if (sizeof(DCTELEM) != 2) return 0; - return 1; + if (simd_support & JSIMD_SSE2) + return 1; + + return 0; } GLOBAL(int) jsimd_can_quantize_float (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; @@ -587,7 +674,10 @@ jsimd_can_quantize_float (void) if (sizeof(FAST_FLOAT) != 4) return 0; - return 1; + if (simd_support & JSIMD_SSE2) + return 1; + + return 0; } GLOBAL(void) @@ -607,6 +697,8 @@ jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, GLOBAL(int) jsimd_can_idct_2x2 (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; @@ -619,15 +711,17 @@ jsimd_can_idct_2x2 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (!IS_ALIGNED_SSE(jconst_idct_red_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) jsimd_can_idct_4x4 (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; @@ -640,10 +734,10 @@ jsimd_can_idct_4x4 (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (!IS_ALIGNED_SSE(jconst_idct_red_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2)) + return 1; - return 1; + return 0; } GLOBAL(void) @@ -665,6 +759,8 @@ jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, GLOBAL(int) jsimd_can_idct_islow (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; @@ -677,15 +773,17 @@ jsimd_can_idct_islow (void) if (sizeof(ISLOW_MULT_TYPE) != 2) return 0; - if (!IS_ALIGNED_SSE(jconst_idct_islow_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) jsimd_can_idct_ifast (void) { + init_simd(); + /* The code is optimised for these values only */ if (DCTSIZE != 8) return 0; @@ -700,15 +798,17 @@ jsimd_can_idct_ifast (void) if (IFAST_SCALE_BITS != 2) return 0; - if (!IS_ALIGNED_SSE(jconst_idct_ifast_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2)) + return 1; - return 1; + return 0; } GLOBAL(int) jsimd_can_idct_float (void) { + init_simd(); + if (DCTSIZE != 8) return 0; if (sizeof(JCOEF) != 2) @@ -722,10 +822,10 @@ jsimd_can_idct_float (void) if (sizeof(FLOAT_MULT_TYPE) != 4) return 0; - if (!IS_ALIGNED_SSE(jconst_idct_float_sse2)) - return 0; + if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2)) + return 1; - return 1; + return 0; } GLOBAL(void) @@ -754,4 +854,3 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_float_sse2(compptr->dct_table, coef_block, output_buf, output_col); } - From eb59b6e72d8098a1f7b8c7e0c710b32eb6f5dc45 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 11 Jan 2016 22:27:38 -0600 Subject: [PATCH 081/140] Add -nowrite arg to TJBench to improve consistency Prevents any images from being written to disk, thus making the performance of the benchmark as CPU-bound as possible. --- ChangeLog.txt | 5 +++++ java/TJBench.java | 14 ++++++++++---- tjbench.c | 15 +++++++++------ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 3279b465..16f695b2 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -52,6 +52,11 @@ Since the macro is used only internally, it has been moved into jconfigint.h. JSIMD_FORCENONE environment variable to 1 (the other SIMD implementations already had this capability.) +[11] Added a new command-line argument to TJBench (-nowrite) that prevents the +benchmark from outputting any images. This removes any potential operating +system overhead that might be caused by lazy writes to disk and thus improves +the consistency of the performance measurements. + 1.4.2 ===== diff --git a/java/TJBench.java b/java/TJBench.java index c9d110c3..19db789c 100644 --- a/java/TJBench.java +++ b/java/TJBench.java @@ -1,5 +1,5 @@ /* - * Copyright (C)2009-2014 D. R. Commander. All Rights Reserved. + * Copyright (C)2009-2014, 2016 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -35,7 +35,7 @@ import org.libjpegturbo.turbojpeg.*; class TJBench { static int flags = 0, quiet = 0, pf = TJ.PF_BGR, yuvpad = 1, warmup = 1; - static boolean compOnly, decompOnly, doTile, doYUV; + static boolean compOnly, decompOnly, doTile, doYUV, write; static final String[] pixFormatStr = { "RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "GRAY" @@ -223,6 +223,8 @@ class TJBench { } } + if (!write) return; + if (sf.getNum() != 1 || sf.getDenom() != 1) sizeStr = new String(sf.getNum() + "_" + sf.getDenom()); else if (tilew != w || tileh != h) @@ -394,7 +396,7 @@ class TJBench { System.out.format(" Output bit stream: %f Megabits/sec\n", (double)totalJpegSize * 8. / 1000000. * (double)iter / elapsed); } - if (tilew == w && tileh == h) { + if (tilew == w && tileh == h && write) { String tempStr = fileName + "_" + subName[subsamp] + "_" + "Q" + jpegQual + ".jpg"; FileOutputStream fos = new FileOutputStream(tempStr); @@ -659,7 +661,9 @@ class TJBench { System.out.println("-benchtime = Run each benchmark for at least seconds (default = 5.0)"); System.out.println("-warmup = Execute each benchmark times to prime the cache before"); System.out.println(" taking performance measurements (default = 1)"); - System.out.println("-componly = Stop after running compression tests. Do not test decompression.\n"); + System.out.println("-componly = Stop after running compression tests. Do not test decompression."); + System.out.println("-nowrite = Do not write reference or output images (improves consistency"); + System.out.println(" of performance measurements.)\n"); System.out.println("NOTE: If the quality is specified as a range (e.g. 90-100), a separate"); System.out.println("test will be performed for all quality values in the range.\n"); System.exit(1); @@ -817,6 +821,8 @@ class TJBench { } if (argv[i].equalsIgnoreCase("-componly")) compOnly = true; + if (argv[i].equalsIgnoreCase("-nowrite")) + write = false; if (argv[i].equalsIgnoreCase("-warmup") && i < argv.length - 1) { int temp = -1; try { diff --git a/tjbench.c b/tjbench.c index 29ed3d0f..d04786cc 100644 --- a/tjbench.c +++ b/tjbench.c @@ -1,5 +1,5 @@ /* - * Copyright (C)2009-2015 D. R. Commander. All Rights Reserved. + * Copyright (C)2009-2016 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -46,7 +46,7 @@ #define _throwbmp(m) _throw(m, bmpgeterr()) int flags=TJFLAG_NOREALLOC, componly=0, decomponly=0, doyuv=0, quiet=0, - dotile=0, pf=TJPF_BGR, yuvpad=1, warmup=1; + dotile=0, pf=TJPF_BGR, yuvpad=1, warmup=1, write=1; char *ext="ppm"; const char *pixFormatStr[TJ_NUMPF]= { @@ -224,7 +224,7 @@ int decomp(unsigned char *srcbuf, unsigned char **jpegbuf, snprintf(tempstr, 1024, "%s_%s%s_%s.%s", filename, subName[subsamp], qualstr, sizestr, ext); - if(savebmp(tempstr, dstbuf, scaledw, scaledh, pf, + if(write && savebmp(tempstr, dstbuf, scaledw, scaledh, pf, (flags&TJFLAG_BOTTOMUP)!=0)==-1) _throwbmp("saving bitmap"); ptr=strrchr(tempstr, '.'); @@ -259,7 +259,7 @@ int decomp(unsigned char *srcbuf, unsigned char **jpegbuf, dstbuf[pitch*row+col] =abs(dstbuf[pitch*row+col]-srcbuf[pitch*row+col]); } - if(savebmp(tempstr, dstbuf, w, h, pf, + if(write && savebmp(tempstr, dstbuf, w, h, pf, (flags&TJFLAG_BOTTOMUP)!=0)==-1) _throwbmp("saving bitmap"); } @@ -422,7 +422,7 @@ int fullTest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual, printf(" Output bit stream: %f Megabits/sec\n", (double)totaljpegsize*8./1000000.*(double)iter/elapsed); } - if(tilew==w && tileh==h) + if(tilew==w && tileh==h && write) { snprintf(tempstr, 1024, "%s_%s_Q%d.jpg", filename, subName[subsamp], jpegqual); @@ -756,7 +756,9 @@ void usage(char *progname) printf("-benchtime = Run each benchmark for at least seconds (default = 5.0)\n"); printf("-warmup = Execute each benchmark times to prime the cache before\n"); printf(" taking performance measurements (default = 1)\n"); - printf("-componly = Stop after running compression tests. Do not test decompression.\n\n"); + printf("-componly = Stop after running compression tests. Do not test decompression.\n"); + printf("-nowrite = Do not write reference or output images (improves consistency of\n"); + printf(" performance measurements.)\n\n"); printf("NOTE: If the quality is specified as a range (e.g. 90-100), a separate\n"); printf("test will be performed for all quality values in the range.\n\n"); exit(1); @@ -906,6 +908,7 @@ int main(int argc, char *argv[]) } } if(!strcasecmp(argv[i], "-componly")) componly=1; + if(!strcasecmp(argv[i], "-nowrite")) write=0; } } From f3a8684cd1c28e557d394470962a7a224c76ddbc Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 7 Jan 2016 00:19:43 -0600 Subject: [PATCH 082/140] SSE2 SIMD implementation of Huffman encoding Full-color compression speedups relative to libjpeg-turbo 1.4.2: 2.8 GHz Intel Xeon W3530, Linux, 64-bit: 2.2-18% (avg. 9.5%) 2.8 GHz Intel Xeon W3530, Linux, 32-bit: 10-25% (avg. 17%) 2.3 GHz AMD A10-4600M APU, Linux, 64-bit: 4.9-17% (avg. 11%) 2.3 GHz AMD A10-4600M APU, Linux, 32-bit: 8.8-19% (avg. 15%) 3.0 GHz Intel Core i7, OS X, 64-bit: 3.5-16% (avg. 10%) 3.0 GHz Intel Core i7, OS X, 32-bit: 4.8-14% (avg. 11%) 2.6 GHz AMD Athlon 64 X2 5050e: Performance-neutral (give or take a few percent) Full-color compression speedups relative to IPP: 2.8 GHz Intel Xeon W3530, Linux, 64-bit: 4.8-34% (avg. 19%) 2.8 GHz Intel Xeon W3530, Linux, 32-bit: -19%-7.0% (avg. -7.0%) Refer to #42 for discussion. Numerous other approaches were attempted, but this one proved to be the most performant across all platforms. This commit also fixes #3 (works around, really-- the clang-compiled version of jchuff.c still performs 20% worse than its GCC-compiled counterpart, but that code is now bypassed by the new SSE2 Huffman algorithm.) Based on: https://github.com/mayeut/libjpeg-turbo/commit/2cb4d41330e1edc4469f6b97ba73b73abfbeb02f https://github.com/mayeut/libjpeg-turbo/commit/36c94e050d117912adbff9fbcc6fe307df240168 --- BUILDING.md | 90 +- ChangeLog.txt | 10 + jchuff.c | 58 +- jsimd.h | 9 + jsimd_none.c | 14 + jversion.h | 3 +- simd/CMakeLists.txt | 14 +- simd/Makefile.am | 20 +- simd/jchuff-sse2-64.asm | 361 ++++ simd/jchuff-sse2.asm | 427 ++++ simd/jpeg_nbits_table.inc | 4097 +++++++++++++++++++++++++++++++++++++ simd/jsimd.h | 9 +- simd/jsimd_arm.c | 15 + simd/jsimd_arm64.c | 19 +- simd/jsimd_i386.c | 32 +- simd/jsimd_mips.c | 15 + simd/jsimd_powerpc.c | 15 + simd/jsimd_x86_64.c | 33 +- 18 files changed, 5157 insertions(+), 84 deletions(-) create mode 100644 simd/jchuff-sse2-64.asm create mode 100644 simd/jchuff-sse2.asm create mode 100644 simd/jpeg_nbits_table.inc diff --git a/BUILDING.md b/BUILDING.md index 239de921..7d794a98 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -38,19 +38,7 @@ Build Requirements NOTE: the NASM build will fail if texinfo is not installed. -- GCC v4.1 or later recommended for best performance - * Beginning with Xcode 4, Apple stopped distributing GCC and switched to - the LLVM compiler. Xcode v4.0 through v4.6 provides a GCC front end - called LLVM-GCC. Unfortunately, as of this writing, neither LLVM-GCC nor - the LLVM (clang) compiler produces optimal performance with libjpeg-turbo. - Building libjpeg-turbo with LLVM-GCC v4.2 results in a 10% performance - degradation when compressing using 64-bit code, relative to building - libjpeg-turbo with GCC v4.2. Building libjpeg-turbo with LLVM (clang) - results in a 20% performance degradation when compressing using 64-bit - code, relative to building libjpeg-turbo with GCC v4.2. If you are - running Snow Leopard or earlier, it is suggested that you continue to use - Xcode v3.2.6, which provides GCC v4.2. If you are using Lion or later, it - is suggested that you install Apple GCC v4.2 or GCC v5 through MacPorts. +- GCC v4.1 (or later) or clang recommended for best performance - If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is required. Some systems, such as Solaris 10 and later and Red Hat Enterprise @@ -89,38 +77,38 @@ for 64-bit build instructions.) This will generate the following files under .libs/: -**libjpeg.a** +**libjpeg.a** Static link library for the libjpeg API -**libjpeg.so.{version}** (Linux, Unix) -**libjpeg.{version}.dylib** (OS X) -**cygjpeg-{version}.dll** (Cygwin) +**libjpeg.so.{version}** (Linux, Unix) +**libjpeg.{version}.dylib** (OS X) +**cygjpeg-{version}.dll** (Cygwin) Shared library for the libjpeg API By default, *{version}* is 62.1.0, 7.1.0, or 8.0.2, depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin, *{version}* is 62, 7, or 8. -**libjpeg.so** (Linux, Unix) -**libjpeg.dylib** (OS X) +**libjpeg.so** (Linux, Unix) +**libjpeg.dylib** (OS X) Development symlink for the libjpeg API -**libjpeg.dll.a** (Cygwin) +**libjpeg.dll.a** (Cygwin) Import library for the libjpeg API -**libturbojpeg.a** +**libturbojpeg.a** Static link library for the TurboJPEG API -**libturbojpeg.so.0.1.0** (Linux, Unix) -**libturbojpeg.0.1.0.dylib** (OS X) -**cygturbojpeg-0.dll** (Cygwin) +**libturbojpeg.so.0.1.0** (Linux, Unix) +**libturbojpeg.0.1.0.dylib** (OS X) +**cygturbojpeg-0.dll** (Cygwin) Shared library for the TurboJPEG API -**libturbojpeg.so** (Linux, Unix) -**libturbojpeg.dylib** (OS X) +**libturbojpeg.so** (Linux, Unix) +**libturbojpeg.dylib** (OS X) Development symlink for the TurboJPEG API -**libturbojpeg.dll.a** (Cygwin) +**libturbojpeg.dll.a** (Cygwin) Import library for the TurboJPEG API @@ -333,16 +321,16 @@ Set the following shell variables for simplicity: IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 - *ARMv6 (code will run on all iOS devices, not SIMD-accelerated)* + *ARMv6 (code will run on all iOS devices, not SIMD-accelerated)* [NOTE: Requires Xcode 4.4.x or earlier] IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp" - *ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer)* + *ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer)* IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon" - *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)* + *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)* [NOTE: Requires Xcode 4.5 or later] IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon" @@ -365,11 +353,11 @@ Set the following shell variables for simplicity: IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - *ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer)* + *ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer)* IOS_CFLAGS="-arch armv7" - *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)* + *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)* IOS_CFLAGS="-arch armv7s" @@ -527,22 +515,22 @@ on which version of cl.exe is in the `PATH`. The following files will be generated under *{build_directory}*: -**jpeg-static.lib** +**jpeg-static.lib** Static link library for the libjpeg API -**sharedlib/jpeg{version}.dll** +**sharedlib/jpeg{version}.dll** DLL for the libjpeg API -**sharedlib/jpeg.lib** +**sharedlib/jpeg.lib** Import library for the libjpeg API - -**turbojpeg-static.lib** + +**turbojpeg-static.lib** Static link library for the TurboJPEG API -**turbojpeg.dll** +**turbojpeg.dll** DLL for the TurboJPEG API -**turbojpeg.lib** +**turbojpeg.lib** Import library for the TurboJPEG API *{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or @@ -569,22 +557,22 @@ build of libjpeg-turbo. This will generate the following files under *{build_directory}*: -**{configuration}/jpeg-static.lib** +**{configuration}/jpeg-static.lib** Static link library for the libjpeg API -**sharedlib/{configuration}/jpeg{version}.dll** +**sharedlib/{configuration}/jpeg{version}.dll** DLL for the libjpeg API -**sharedlib/{configuration}/jpeg.lib** +**sharedlib/{configuration}/jpeg.lib** Import library for the libjpeg API -**{configuration}/turbojpeg-static.lib** +**{configuration}/turbojpeg-static.lib** Static link library for the TurboJPEG API -**{configuration}/turbojpeg.dll** +**{configuration}/turbojpeg.dll** DLL for the TurboJPEG API -**{configuration}/turbojpeg.lib** +**{configuration}/turbojpeg.lib** Import library for the TurboJPEG API *{configuration}* is Debug, Release, RelWithDebInfo, or MinSizeRel, depending @@ -603,22 +591,22 @@ cross-compiling on a Linux/Unix machine, then see "Build Recipes" below. This will generate the following files under *{build_directory}*: -**libjpeg.a** +**libjpeg.a** Static link library for the libjpeg API -**sharedlib/libjpeg-{version}.dll** +**sharedlib/libjpeg-{version}.dll** DLL for the libjpeg API -**sharedlib/libjpeg.dll.a** +**sharedlib/libjpeg.dll.a** Import library for the libjpeg API -**libturbojpeg.a** +**libturbojpeg.a** Static link library for the TurboJPEG API -**libturbojpeg.dll** +**libturbojpeg.dll** DLL for the TurboJPEG API -**libturbojpeg.dll.a** +**libturbojpeg.dll.a** Import library for the TurboJPEG API *{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or diff --git a/ChangeLog.txt b/ChangeLog.txt index 16f695b2..2b0cd321 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -57,6 +57,16 @@ benchmark from outputting any images. This removes any potential operating system overhead that might be caused by lazy writes to disk and thus improves the consistency of the performance measurements. +[12] Added SIMD acceleration for Huffman encoding on SSE2-capable x86 and +x86-64 platforms. This speeds up the compression of full-color JPEGs by about +10-15% on average (relative to libjpeg-turbo 1.4.x) when using modern Intel and +AMD CPUs. Additionally, this works around an issue in the clang optimizer that +prevents it (as of this writing) from achieving the same performance as GCC +when compiling the C version of the Huffman encoder +(https://llvm.org/bugs/show_bug.cgi?id=16035). For the purposes of benchmarking +or regression testing, SIMD-accelerated Huffman encoding can be disabled by +setting the JSIMD_NOHUFFENC environment variable to 1. + 1.4.2 ===== diff --git a/jchuff.c b/jchuff.c index 9d7a4680..f8e89cad 100644 --- a/jchuff.c +++ b/jchuff.c @@ -5,6 +5,7 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2009-2011, 2014-2016 D. R. Commander. + * Copyright (C) 2015 Matthieu Darbois. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -20,7 +21,7 @@ #define JPEG_INTERNALS #include "jinclude.h" #include "jpeglib.h" -#include "jchuff.h" /* Declarations shared with jcphuff.c */ +#include "jsimd.h" #include "jconfigint.h" #include @@ -108,6 +109,8 @@ typedef struct { long * dc_count_ptrs[NUM_HUFF_TBLS]; long * ac_count_ptrs[NUM_HUFF_TBLS]; #endif + + int simd; } huff_entropy_encoder; typedef huff_entropy_encoder * huff_entropy_ptr; @@ -159,6 +162,8 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) entropy->pub.finish_pass = finish_pass_huff; } + entropy->simd = jsimd_can_huff_encode_one_block(); + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { compptr = cinfo->cur_comp_info[ci]; dctbl = compptr->dc_tbl_no; @@ -480,6 +485,23 @@ flush_bits (working_state * state) /* Encode a single block's worth of coefficients */ +LOCAL(boolean) +encode_one_block_simd (working_state * state, JCOEFPTR block, int last_dc_val, + c_derived_tbl *dctbl, c_derived_tbl *actbl) +{ + JOCTET _buffer[BUFSIZE], *buffer; + size_t bytes, bytestocopy; int localbuf = 0; + + LOAD_BUFFER() + + buffer = jsimd_huff_encode_one_block(state, buffer, block, last_dc_val, + dctbl, actbl); + + STORE_BUFFER() + + return TRUE; +} + LOCAL(boolean) encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) @@ -640,16 +662,30 @@ encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data) } /* Encode the MCU data blocks */ - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - if (! encode_one_block(&state, - MCU_data[blkn][0], state.cur.last_dc_val[ci], - entropy->dc_derived_tbls[compptr->dc_tbl_no], - entropy->ac_derived_tbls[compptr->ac_tbl_no])) - return FALSE; - /* Update last_dc_val */ - state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; + if (entropy->simd) { + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + if (! encode_one_block_simd(&state, + MCU_data[blkn][0], state.cur.last_dc_val[ci], + entropy->dc_derived_tbls[compptr->dc_tbl_no], + entropy->ac_derived_tbls[compptr->ac_tbl_no])) + return FALSE; + /* Update last_dc_val */ + state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; + } + } else { + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + if (! encode_one_block(&state, + MCU_data[blkn][0], state.cur.last_dc_val[ci], + entropy->dc_derived_tbls[compptr->dc_tbl_no], + entropy->ac_derived_tbls[compptr->ac_tbl_no])) + return FALSE; + /* Update last_dc_val */ + state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; + } } /* Completed MCU, so update state */ diff --git a/jsimd.h b/jsimd.h index f1f584b8..7fc7a0b7 100644 --- a/jsimd.h +++ b/jsimd.h @@ -3,6 +3,7 @@ * * Copyright 2009 Pierre Ossman for Cendio AB * Copyright 2011, 2014 D. R. Commander + * Copyright 2015 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -10,6 +11,8 @@ * */ +#include "jchuff.h" /* Declarations shared with jcphuff.c */ + EXTERN(int) jsimd_can_rgb_ycc (void); EXTERN(int) jsimd_can_rgb_gray (void); EXTERN(int) jsimd_can_ycc_rgb (void); @@ -82,3 +85,9 @@ EXTERN(void) jsimd_h2v2_merged_upsample EXTERN(void) jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); + +EXTERN(int) jsimd_can_huff_encode_one_block (void); + +EXTERN(JOCTET*) jsimd_huff_encode_one_block + (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, + c_derived_tbl *dctbl, c_derived_tbl *actbl); diff --git a/jsimd_none.c b/jsimd_none.c index 34aefc9f..65e3f8f8 100644 --- a/jsimd_none.c +++ b/jsimd_none.c @@ -3,6 +3,7 @@ * * Copyright 2009 Pierre Ossman for Cendio AB * Copyright 2009-2011, 2014 D. R. Commander + * Copyright 2015 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -387,3 +388,16 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, { } +GLOBAL(int) +jsimd_can_huff_encode_one_block (void) +{ + return 0; +} + +GLOBAL(JOCTET*) +jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, + int last_dc_val, c_derived_tbl *dctbl, + c_derived_tbl *actbl) +{ + return NULL; +} diff --git a/jversion.h b/jversion.h index fed5b5e9..dfea3789 100644 --- a/jversion.h +++ b/jversion.h @@ -32,6 +32,7 @@ "Copyright (C) 2009-2016 D. R. Commander\n" \ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \ - "Copyright (C) 2013 Linaro Limited" + "Copyright (C) 2013 Linaro Limited\n" \ + "Copyright (C) 2015 Matthieu Darbois" #define JCOPYRIGHT_SHORT "Copyright (C) 1991-2016 The libjpeg-turbo Project and many others" diff --git a/simd/CMakeLists.txt b/simd/CMakeLists.txt index b16c4678..37938ecc 100755 --- a/simd/CMakeLists.txt +++ b/simd/CMakeLists.txt @@ -22,17 +22,19 @@ endif() if(SIMD_X86_64) set(SIMD_BASENAMES jfdctflt-sse-64 jccolor-sse2-64 jcgray-sse2-64 - jcsample-sse2-64 jdcolor-sse2-64 jdmerge-sse2-64 jdsample-sse2-64 - jfdctfst-sse2-64 jfdctint-sse2-64 jidctflt-sse2-64 jidctfst-sse2-64 - jidctint-sse2-64 jidctred-sse2-64 jquantf-sse2-64 jquanti-sse2-64) + jchuff-sse2-64 jcsample-sse2-64 jdcolor-sse2-64 jdmerge-sse2-64 + jdsample-sse2-64 jfdctfst-sse2-64 jfdctint-sse2-64 jidctflt-sse2-64 + jidctfst-sse2-64 jidctint-sse2-64 jidctred-sse2-64 jquantf-sse2-64 + jquanti-sse2-64) message(STATUS "Building x86_64 SIMD extensions") else() set(SIMD_BASENAMES jsimdcpu jfdctflt-3dn jidctflt-3dn jquant-3dn jccolor-mmx jcgray-mmx jcsample-mmx jdcolor-mmx jdmerge-mmx jdsample-mmx jfdctfst-mmx jfdctint-mmx jidctfst-mmx jidctint-mmx jidctred-mmx jquant-mmx jfdctflt-sse - jidctflt-sse jquant-sse jccolor-sse2 jcgray-sse2 jcsample-sse2 jdcolor-sse2 - jdmerge-sse2 jdsample-sse2 jfdctfst-sse2 jfdctint-sse2 jidctflt-sse2 - jidctfst-sse2 jidctint-sse2 jidctred-sse2 jquantf-sse2 jquanti-sse2) + jidctflt-sse jquant-sse jccolor-sse2 jcgray-sse2 jchuff-sse2 jcsample-sse2 + jdcolor-sse2 jdmerge-sse2 jdsample-sse2 jfdctfst-sse2 jfdctint-sse2 + jidctflt-sse2 jidctfst-sse2 jidctint-sse2 jidctred-sse2 jquantf-sse2 + jquanti-sse2) message(STATUS "Building i386 SIMD extensions") endif() diff --git a/simd/Makefile.am b/simd/Makefile.am index ebb9ec6d..f78d51c2 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -13,11 +13,11 @@ if SIMD_X86_64 libsimd_la_SOURCES = jsimd_x86_64.c jsimd.h jsimdcfg.inc.h jsimdext.inc \ jcolsamp.inc jdct.inc jfdctflt-sse-64.asm \ - jccolor-sse2-64.asm jcgray-sse2-64.asm jcsample-sse2-64.asm \ - jdcolor-sse2-64.asm jdmerge-sse2-64.asm jdsample-sse2-64.asm \ - jfdctfst-sse2-64.asm jfdctint-sse2-64.asm jidctflt-sse2-64.asm \ - jidctfst-sse2-64.asm jidctint-sse2-64.asm jidctred-sse2-64.asm \ - jquantf-sse2-64.asm jquanti-sse2-64.asm + jccolor-sse2-64.asm jcgray-sse2-64.asm jchuff-sse2-64.asm \ + jcsample-sse2-64.asm jdcolor-sse2-64.asm jdmerge-sse2-64.asm \ + jdsample-sse2-64.asm jfdctfst-sse2-64.asm jfdctint-sse2-64.asm \ + jidctflt-sse2-64.asm jidctfst-sse2-64.asm jidctint-sse2-64.asm \ + jidctred-sse2-64.asm jquantf-sse2-64.asm jquanti-sse2-64.asm jccolor-sse2-64.lo: jccolext-sse2-64.asm jcgray-sse2-64.lo: jcgryext-sse2-64.asm @@ -36,11 +36,11 @@ libsimd_la_SOURCES = jsimd_i386.c jsimd.h jsimdcfg.inc.h jsimdext.inc \ jfdctfst-mmx.asm jfdctint-mmx.asm jidctfst-mmx.asm \ jidctint-mmx.asm jidctred-mmx.asm jquant-mmx.asm \ jfdctflt-sse.asm jidctflt-sse.asm jquant-sse.asm \ - jccolor-sse2.asm jcgray-sse2.asm jcsample-sse2.asm \ - jdcolor-sse2.asm jdmerge-sse2.asm jdsample-sse2.asm \ - jfdctfst-sse2.asm jfdctint-sse2.asm jidctflt-sse2.asm \ - jidctfst-sse2.asm jidctint-sse2.asm jidctred-sse2.asm \ - jquantf-sse2.asm jquanti-sse2.asm + jccolor-sse2.asm jcgray-sse2.asm jchuff-sse2.asm \ + jcsample-sse2.asm jdcolor-sse2.asm jdmerge-sse2.asm \ + jdsample-sse2.asm jfdctfst-sse2.asm jfdctint-sse2.asm \ + jidctflt-sse2.asm jidctfst-sse2.asm jidctint-sse2.asm \ + jidctred-sse2.asm jquantf-sse2.asm jquanti-sse2.asm jccolor-mmx.lo: jccolext-mmx.asm jcgray.-mmx.lo: jcgryext-mmx.asm diff --git a/simd/jchuff-sse2-64.asm b/simd/jchuff-sse2-64.asm new file mode 100644 index 00000000..f9949cb3 --- /dev/null +++ b/simd/jchuff-sse2-64.asm @@ -0,0 +1,361 @@ +; +; jchuff-sse2-64.asm - Huffman entropy encoding (64-bit SSE2) +; +; Copyright 2009-2011, 2014-2016 D. R. Commander. +; Copyright 2015 Matthieu Darbois +; +; Based on +; x86 SIMD extension for IJG JPEG library +; Copyright (C) 1999-2006, MIYASAKA Masaru. +; For conditions of distribution and use, see copyright notice in jsimdext.inc +; +; This file should be assembled with NASM (Netwide Assembler), +; can *not* be assembled with Microsoft's MASM or any compatible +; assembler (including Borland's Turbo Assembler). +; NASM is available from http://nasm.sourceforge.net/ or +; http://sourceforge.net/project/showfiles.php?group_id=6208 +; +; This file contains an SSE2 implementation for Huffman coding of one block. +; The following code is based directly on jchuff.c; see jchuff.c for more +; details. +; +; [TAB8] + +%include "jsimdext.inc" + +; -------------------------------------------------------------------------- + SECTION SEG_CONST + + alignz 16 + global EXTN(jconst_huff_encode_one_block) + +EXTN(jconst_huff_encode_one_block): + +%include "jpeg_nbits_table.inc" + + alignz 16 + +; -------------------------------------------------------------------------- + SECTION SEG_TEXT + BITS 64 + +; These macros perform the same task as the emit_bits() function in the +; original libjpeg code. In addition to reducing overhead by explicitly +; inlining the code, additional performance is achieved by taking into +; account the size of the bit buffer and waiting until it is almost full +; before emptying it. This mostly benefits 64-bit platforms, since 6 +; bytes can be stored in a 64-bit bit buffer before it has to be emptied. + +%macro EMIT_BYTE 0 + sub put_bits, 8 ; put_bits -= 8; + mov rdx, put_buffer + mov ecx, put_bits + shr rdx, cl ; c = (JOCTET)GETJOCTET(put_buffer >> put_bits); + mov byte [buffer], dl ; *buffer++ = c; + add buffer, 1 + cmp dl, 0xFF ; need to stuff a zero byte? + jne %%.EMIT_BYTE_END + mov byte [buffer], 0 ; *buffer++ = 0; + add buffer, 1 +%%.EMIT_BYTE_END: +%endmacro + +%macro PUT_BITS 1 + add put_bits, ecx ; put_bits += size; + shl put_buffer, cl ; put_buffer = (put_buffer << size); + or put_buffer, %1 +%endmacro + +%macro CHECKBUF31 0 + cmp put_bits, 32 ; if (put_bits > 31) { + jl %%.CHECKBUF31_END + EMIT_BYTE + EMIT_BYTE + EMIT_BYTE + EMIT_BYTE +%%.CHECKBUF31_END: +%endmacro + +%macro CHECKBUF47 0 + cmp put_bits, 48 ; if (put_bits > 47) { + jl %%.CHECKBUF47_END + EMIT_BYTE + EMIT_BYTE + EMIT_BYTE + EMIT_BYTE + EMIT_BYTE + EMIT_BYTE +%%.CHECKBUF47_END: +%endmacro + +%macro EMIT_BITS 2 + CHECKBUF47 + mov ecx, %2 + PUT_BITS %1 +%endmacro + +%macro kloop_prepare 37 ;(ko, jno0, ..., jno31, xmm0, xmm1, xmm2, xmm3) + pxor xmm8, xmm8 ; __m128i neg = _mm_setzero_si128(); + pxor xmm9, xmm9 ; __m128i neg = _mm_setzero_si128(); + pxor xmm10, xmm10 ; __m128i neg = _mm_setzero_si128(); + pxor xmm11, xmm11 ; __m128i neg = _mm_setzero_si128(); + pinsrw %34, word [r12 + %2 * SIZEOF_WORD], 0 ; xmm_shadow[0] = block[jno0]; + pinsrw %35, word [r12 + %10 * SIZEOF_WORD], 0 ; xmm_shadow[8] = block[jno8]; + pinsrw %36, word [r12 + %18 * SIZEOF_WORD], 0 ; xmm_shadow[16] = block[jno16]; + pinsrw %37, word [r12 + %26 * SIZEOF_WORD], 0 ; xmm_shadow[24] = block[jno24]; + pinsrw %34, word [r12 + %3 * SIZEOF_WORD], 1 ; xmm_shadow[1] = block[jno1]; + pinsrw %35, word [r12 + %11 * SIZEOF_WORD], 1 ; xmm_shadow[9] = block[jno9]; + pinsrw %36, word [r12 + %19 * SIZEOF_WORD], 1 ; xmm_shadow[17] = block[jno17]; + pinsrw %37, word [r12 + %27 * SIZEOF_WORD], 1 ; xmm_shadow[25] = block[jno25]; + pinsrw %34, word [r12 + %4 * SIZEOF_WORD], 2 ; xmm_shadow[2] = block[jno2]; + pinsrw %35, word [r12 + %12 * SIZEOF_WORD], 2 ; xmm_shadow[10] = block[jno10]; + pinsrw %36, word [r12 + %20 * SIZEOF_WORD], 2 ; xmm_shadow[18] = block[jno18]; + pinsrw %37, word [r12 + %28 * SIZEOF_WORD], 2 ; xmm_shadow[26] = block[jno26]; + pinsrw %34, word [r12 + %5 * SIZEOF_WORD], 3 ; xmm_shadow[3] = block[jno3]; + pinsrw %35, word [r12 + %13 * SIZEOF_WORD], 3 ; xmm_shadow[11] = block[jno11]; + pinsrw %36, word [r12 + %21 * SIZEOF_WORD], 3 ; xmm_shadow[19] = block[jno19]; + pinsrw %37, word [r12 + %29 * SIZEOF_WORD], 3 ; xmm_shadow[27] = block[jno27]; + pinsrw %34, word [r12 + %6 * SIZEOF_WORD], 4 ; xmm_shadow[4] = block[jno4]; + pinsrw %35, word [r12 + %14 * SIZEOF_WORD], 4 ; xmm_shadow[12] = block[jno12]; + pinsrw %36, word [r12 + %22 * SIZEOF_WORD], 4 ; xmm_shadow[20] = block[jno20]; + pinsrw %37, word [r12 + %30 * SIZEOF_WORD], 4 ; xmm_shadow[28] = block[jno28]; + pinsrw %34, word [r12 + %7 * SIZEOF_WORD], 5 ; xmm_shadow[5] = block[jno5]; + pinsrw %35, word [r12 + %15 * SIZEOF_WORD], 5 ; xmm_shadow[13] = block[jno13]; + pinsrw %36, word [r12 + %23 * SIZEOF_WORD], 5 ; xmm_shadow[21] = block[jno21]; + pinsrw %37, word [r12 + %31 * SIZEOF_WORD], 5 ; xmm_shadow[29] = block[jno29]; + pinsrw %34, word [r12 + %8 * SIZEOF_WORD], 6 ; xmm_shadow[6] = block[jno6]; + pinsrw %35, word [r12 + %16 * SIZEOF_WORD], 6 ; xmm_shadow[14] = block[jno14]; + pinsrw %36, word [r12 + %24 * SIZEOF_WORD], 6 ; xmm_shadow[22] = block[jno22]; + pinsrw %37, word [r12 + %32 * SIZEOF_WORD], 6 ; xmm_shadow[30] = block[jno30]; + pinsrw %34, word [r12 + %9 * SIZEOF_WORD], 7 ; xmm_shadow[7] = block[jno7]; + pinsrw %35, word [r12 + %17 * SIZEOF_WORD], 7 ; xmm_shadow[15] = block[jno15]; + pinsrw %36, word [r12 + %25 * SIZEOF_WORD], 7 ; xmm_shadow[23] = block[jno23]; +%if %1 != 32 + pinsrw %37, word [r12 + %33 * SIZEOF_WORD], 7 ; xmm_shadow[31] = block[jno31]; +%else + pinsrw %37, ebx, 7 ; xmm_shadow[31] = block[jno31]; +%endif + pcmpgtw xmm8, %34 ; neg = _mm_cmpgt_epi16(neg, x1); + pcmpgtw xmm9, %35 ; neg = _mm_cmpgt_epi16(neg, x1); + pcmpgtw xmm10, %36 ; neg = _mm_cmpgt_epi16(neg, x1); + pcmpgtw xmm11, %37 ; neg = _mm_cmpgt_epi16(neg, x1); + paddw %34, xmm8 ; x1 = _mm_add_epi16(x1, neg); + paddw %35, xmm9 ; x1 = _mm_add_epi16(x1, neg); + paddw %36, xmm10 ; x1 = _mm_add_epi16(x1, neg); + paddw %37, xmm11 ; x1 = _mm_add_epi16(x1, neg); + pxor %34, xmm8 ; x1 = _mm_xor_si128(x1, neg); + pxor %35, xmm9 ; x1 = _mm_xor_si128(x1, neg); + pxor %36, xmm10 ; x1 = _mm_xor_si128(x1, neg); + pxor %37, xmm11 ; x1 = _mm_xor_si128(x1, neg); + pxor xmm8, %34 ; neg = _mm_xor_si128(neg, x1); + pxor xmm9, %35 ; neg = _mm_xor_si128(neg, x1); + pxor xmm10, %36 ; neg = _mm_xor_si128(neg, x1); + pxor xmm11, %37 ; neg = _mm_xor_si128(neg, x1); + movdqa XMMWORD [t1 + %1 * SIZEOF_WORD], %34 ; _mm_storeu_si128((__m128i *)(t1 + ko), x1); + movdqa XMMWORD [t1 + (%1 + 8) * SIZEOF_WORD], %35 ; _mm_storeu_si128((__m128i *)(t1 + ko + 8), x1); + movdqa XMMWORD [t1 + (%1 + 16) * SIZEOF_WORD], %36 ; _mm_storeu_si128((__m128i *)(t1 + ko + 16), x1); + movdqa XMMWORD [t1 + (%1 + 24) * SIZEOF_WORD], %37 ; _mm_storeu_si128((__m128i *)(t1 + ko + 24), x1); + movdqa XMMWORD [t2 + %1 * SIZEOF_WORD], xmm8 ; _mm_storeu_si128((__m128i *)(t2 + ko), neg); + movdqa XMMWORD [t2 + (%1 + 8) * SIZEOF_WORD], xmm9 ; _mm_storeu_si128((__m128i *)(t2 + ko + 8), neg); + movdqa XMMWORD [t2 + (%1 + 16) * SIZEOF_WORD], xmm10 ; _mm_storeu_si128((__m128i *)(t2 + ko + 16), neg); + movdqa XMMWORD [t2 + (%1 + 24) * SIZEOF_WORD], xmm11 ; _mm_storeu_si128((__m128i *)(t2 + ko + 24), neg); +%endmacro + +; +; Encode a single block's worth of coefficients. +; +; GLOBAL(JOCTET*) +; jsimd_huff_encode_one_block_sse2 (working_state * state, JOCTET *buffer, +; JCOEFPTR block, int last_dc_val, +; c_derived_tbl *dctbl, c_derived_tbl *actbl) +; + +; r10 = working_state *state +; r11 = JOCTET *buffer +; r12 = JCOEFPTR block +; r13 = int last_dc_val +; r14 = c_derived_tbl *dctbl +; r15 = c_derived_tbl *actbl + +%define t1 rbp-(DCTSIZE2*SIZEOF_WORD) +%define t2 t1-(DCTSIZE2*SIZEOF_WORD) +%define put_buffer r8 +%define put_bits r9d +%define buffer rax + + align 16 + global EXTN(jsimd_huff_encode_one_block_sse2) + +EXTN(jsimd_huff_encode_one_block_sse2): + push rbp + mov rax,rsp ; rax = original rbp + sub rsp, byte 4 + and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits + mov [rsp],rax + mov rbp,rsp ; rbp = aligned rbp + lea rsp, [t2] + collect_args +%ifdef WIN64 + sub rsp, 4*SIZEOF_XMMWORD + movaps XMMWORD [rsp-3*SIZEOF_XMMWORD], xmm8 + movaps XMMWORD [rsp-2*SIZEOF_XMMWORD], xmm9 + movaps XMMWORD [rsp-1*SIZEOF_XMMWORD], xmm10 + movaps XMMWORD [rsp-0*SIZEOF_XMMWORD], xmm11 +%endif + push rbx + + mov buffer, r11 ; r11 is now sratch + + mov put_buffer, MMWORD [r10+16] ; put_buffer = state->cur.put_buffer; + mov put_bits, DWORD [r10+24] ; put_bits = state->cur.put_bits; + push r10 ; r10 is now scratch + + ; Encode the DC coefficient difference per section F.1.2.1 + movsx edi, word [r12] ; temp = temp2 = block[0] - last_dc_val; + sub edi, r13d ; r13 is not used anymore + mov ebx, edi + + ; This is a well-known technique for obtaining the absolute value + ; without a branch. It is derived from an assembly language technique + ; presented in "How to Optimize for the Pentium Processors", + ; Copyright (c) 1996, 1997 by Agner Fog. + mov esi, edi + sar esi, 31 ; temp3 = temp >> (CHAR_BIT * sizeof(int) - 1); + xor edi, esi ; temp ^= temp3; + sub edi, esi ; temp -= temp3; + + ; For a negative input, want temp2 = bitwise complement of abs(input) + ; This code assumes we are on a two's complement machine + add ebx, esi ; temp2 += temp3; + + ; Find the number of bits needed for the magnitude of the coefficient + lea r11, [rel jpeg_nbits_table] + movzx rdi, byte [r11 + rdi] ; nbits = JPEG_NBITS(temp); + ; Emit the Huffman-coded symbol for the number of bits + mov r11d, INT [r14 + rdi * 4] ; code = dctbl->ehufco[nbits]; + movzx esi, byte [r14 + rdi + 1024] ; size = dctbl->ehufsi[nbits]; + EMIT_BITS r11, esi ; EMIT_BITS(code, size) + + ; Mask off any extra bits in code + mov esi, 1 + mov ecx, edi + shl esi, cl + dec esi + and ebx, esi ; temp2 &= (((JLONG) 1)<ehufco[0xf0]; + movzx r14d, byte [r15 + 1024 + 240] ; size_0xf0 = actbl->ehufsi[0xf0]; + lea rsi, [t1] +.BLOOP: + bsf r12, r11 ; r = __builtin_ctzl(index); + jz .ELOOP + mov rcx, r12 + lea rsi, [rsi+r12*2] ; k += r; + shr r11, cl ; index >>= r; + movzx rdi, word [rsi] ; temp = t1[k]; + lea rbx, [rel jpeg_nbits_table] + movzx rdi, byte [rbx + rdi] ; nbits = JPEG_NBITS(temp); +.BRLOOP: + cmp r12, 16 ; while (r > 15) { + jl .ERLOOP + EMIT_BITS r13, r14d ; EMIT_BITS(code_0xf0, size_0xf0) + sub r12, 16 ; r -= 16; + jmp .BRLOOP +.ERLOOP: + ; Emit Huffman symbol for run length / number of bits + CHECKBUF31 ; uses rcx, rdx + + shl r12, 4 ; temp3 = (r << 4) + nbits; + add r12, rdi + mov ebx, INT [r15 + r12 * 4] ; code = actbl->ehufco[temp3]; + movzx ecx, byte [r15 + r12 + 1024] ; size = actbl->ehufsi[temp3]; + PUT_BITS rbx + + ;EMIT_CODE(code, size) + + movsx ebx, word [rsi-DCTSIZE2*2] ; temp2 = t2[k]; + ; Mask off any extra bits in code + mov rcx, rdi + mov rdx, 1 + shl rdx, cl + dec rdx + and rbx, rdx ; temp2 &= (((JLONG) 1)<>= 1; + add rsi, 2 ; ++k; + jmp .BLOOP +.ELOOP: + ; If the last coef(s) were zero, emit an end-of-block code + lea rdi, [t1 + (DCTSIZE2-1) * 2] ; r = DCTSIZE2-1-k; + cmp rdi, rsi ; if (r > 0) { + je .EFN + mov ebx, INT [r15] ; code = actbl->ehufco[0]; + movzx r12d, byte [r15 + 1024] ; size = actbl->ehufsi[0]; + EMIT_BITS rbx, r12d +.EFN: + pop r10 + ; Save put_buffer & put_bits + mov MMWORD [r10+16], put_buffer ; state->cur.put_buffer = put_buffer; + mov DWORD [r10+24], put_bits ; state->cur.put_bits = put_bits; + + pop rbx +%ifdef WIN64 + movaps xmm8, XMMWORD [rsp-3*SIZEOF_XMMWORD] + movaps xmm9, XMMWORD [rsp-2*SIZEOF_XMMWORD] + movaps xmm10, XMMWORD [rsp-1*SIZEOF_XMMWORD] + movaps xmm11, XMMWORD [rsp-0*SIZEOF_XMMWORD] + add rsp, 4*SIZEOF_XMMWORD +%endif + uncollect_args + mov rsp,rbp ; rsp <- aligned rbp + pop rsp ; rsp <- original rbp + pop rbp + ret + +; For some reason, the OS X linker does not honor the request to align the +; segment unless we do this. + align 16 diff --git a/simd/jchuff-sse2.asm b/simd/jchuff-sse2.asm new file mode 100644 index 00000000..5d48cff9 --- /dev/null +++ b/simd/jchuff-sse2.asm @@ -0,0 +1,427 @@ +; +; jchuff-sse2.asm - Huffman entropy encoding (SSE2) +; +; Copyright 2009-2011, 2014-2016 D. R. Commander. +; Copyright 2015 Matthieu Darbois +; +; Based on +; x86 SIMD extension for IJG JPEG library +; Copyright (C) 1999-2006, MIYASAKA Masaru. +; For conditions of distribution and use, see copyright notice in jsimdext.inc +; +; This file should be assembled with NASM (Netwide Assembler), +; can *not* be assembled with Microsoft's MASM or any compatible +; assembler (including Borland's Turbo Assembler). +; NASM is available from http://nasm.sourceforge.net/ or +; http://sourceforge.net/project/showfiles.php?group_id=6208 +; +; This file contains an SSE2 implementation for Huffman coding of one block. +; The following code is based directly on jchuff.c; see jchuff.c for more +; details. +; +; [TAB8] + +%include "jsimdext.inc" + +; -------------------------------------------------------------------------- + SECTION SEG_CONST + + alignz 16 + global EXTN(jconst_huff_encode_one_block) + +EXTN(jconst_huff_encode_one_block): + +%include "jpeg_nbits_table.inc" + + alignz 16 + +; -------------------------------------------------------------------------- + SECTION SEG_TEXT + BITS 32 + +; These macros perform the same task as the emit_bits() function in the +; original libjpeg code. In addition to reducing overhead by explicitly +; inlining the code, additional performance is achieved by taking into +; account the size of the bit buffer and waiting until it is almost full +; before emptying it. This mostly benefits 64-bit platforms, since 6 +; bytes can be stored in a 64-bit bit buffer before it has to be emptied. + +%macro EMIT_BYTE 0 + sub put_bits, 8 ; put_bits -= 8; + mov edx, put_buffer + mov ecx, put_bits + shr edx, cl ; c = (JOCTET)GETJOCTET(put_buffer >> put_bits); + mov byte [eax], dl ; *buffer++ = c; + add eax, 1 + cmp dl, 0xFF ; need to stuff a zero byte? + jne %%.EMIT_BYTE_END + mov byte [eax], 0 ; *buffer++ = 0; + add eax, 1 +%%.EMIT_BYTE_END: +%endmacro + +%macro PUT_BITS 1 + add put_bits, ecx ; put_bits += size; + shl put_buffer, cl ; put_buffer = (put_buffer << size); + or put_buffer, %1 +%endmacro + +%macro CHECKBUF15 0 + cmp put_bits, 16 ; if (put_bits > 31) { + jl %%.CHECKBUF15_END + mov eax, POINTER [esp+buffer] + EMIT_BYTE + EMIT_BYTE + mov POINTER [esp+buffer], eax +%%.CHECKBUF15_END: +%endmacro + +%macro EMIT_BITS 1 + PUT_BITS %1 + CHECKBUF15 +%endmacro + +%macro kloop_prepare 37 ;(ko, jno0, ..., jno31, xmm0, xmm1, xmm2, xmm3) + pxor xmm4, xmm4 ; __m128i neg = _mm_setzero_si128(); + pxor xmm5, xmm5 ; __m128i neg = _mm_setzero_si128(); + pxor xmm6, xmm6 ; __m128i neg = _mm_setzero_si128(); + pxor xmm7, xmm7 ; __m128i neg = _mm_setzero_si128(); + pinsrw %34, word [esi + %2 * SIZEOF_WORD], 0 ; xmm_shadow[0] = block[jno0]; + pinsrw %35, word [esi + %10 * SIZEOF_WORD], 0 ; xmm_shadow[8] = block[jno8]; + pinsrw %36, word [esi + %18 * SIZEOF_WORD], 0 ; xmm_shadow[16] = block[jno16]; + pinsrw %37, word [esi + %26 * SIZEOF_WORD], 0 ; xmm_shadow[24] = block[jno24]; + pinsrw %34, word [esi + %3 * SIZEOF_WORD], 1 ; xmm_shadow[1] = block[jno1]; + pinsrw %35, word [esi + %11 * SIZEOF_WORD], 1 ; xmm_shadow[9] = block[jno9]; + pinsrw %36, word [esi + %19 * SIZEOF_WORD], 1 ; xmm_shadow[17] = block[jno17]; + pinsrw %37, word [esi + %27 * SIZEOF_WORD], 1 ; xmm_shadow[25] = block[jno25]; + pinsrw %34, word [esi + %4 * SIZEOF_WORD], 2 ; xmm_shadow[2] = block[jno2]; + pinsrw %35, word [esi + %12 * SIZEOF_WORD], 2 ; xmm_shadow[10] = block[jno10]; + pinsrw %36, word [esi + %20 * SIZEOF_WORD], 2 ; xmm_shadow[18] = block[jno18]; + pinsrw %37, word [esi + %28 * SIZEOF_WORD], 2 ; xmm_shadow[26] = block[jno26]; + pinsrw %34, word [esi + %5 * SIZEOF_WORD], 3 ; xmm_shadow[3] = block[jno3]; + pinsrw %35, word [esi + %13 * SIZEOF_WORD], 3 ; xmm_shadow[11] = block[jno11]; + pinsrw %36, word [esi + %21 * SIZEOF_WORD], 3 ; xmm_shadow[19] = block[jno19]; + pinsrw %37, word [esi + %29 * SIZEOF_WORD], 3 ; xmm_shadow[27] = block[jno27]; + pinsrw %34, word [esi + %6 * SIZEOF_WORD], 4 ; xmm_shadow[4] = block[jno4]; + pinsrw %35, word [esi + %14 * SIZEOF_WORD], 4 ; xmm_shadow[12] = block[jno12]; + pinsrw %36, word [esi + %22 * SIZEOF_WORD], 4 ; xmm_shadow[20] = block[jno20]; + pinsrw %37, word [esi + %30 * SIZEOF_WORD], 4 ; xmm_shadow[28] = block[jno28]; + pinsrw %34, word [esi + %7 * SIZEOF_WORD], 5 ; xmm_shadow[5] = block[jno5]; + pinsrw %35, word [esi + %15 * SIZEOF_WORD], 5 ; xmm_shadow[13] = block[jno13]; + pinsrw %36, word [esi + %23 * SIZEOF_WORD], 5 ; xmm_shadow[21] = block[jno21]; + pinsrw %37, word [esi + %31 * SIZEOF_WORD], 5 ; xmm_shadow[29] = block[jno29]; + pinsrw %34, word [esi + %8 * SIZEOF_WORD], 6 ; xmm_shadow[6] = block[jno6]; + pinsrw %35, word [esi + %16 * SIZEOF_WORD], 6 ; xmm_shadow[14] = block[jno14]; + pinsrw %36, word [esi + %24 * SIZEOF_WORD], 6 ; xmm_shadow[22] = block[jno22]; + pinsrw %37, word [esi + %32 * SIZEOF_WORD], 6 ; xmm_shadow[30] = block[jno30]; + pinsrw %34, word [esi + %9 * SIZEOF_WORD], 7 ; xmm_shadow[7] = block[jno7]; + pinsrw %35, word [esi + %17 * SIZEOF_WORD], 7 ; xmm_shadow[15] = block[jno15]; + pinsrw %36, word [esi + %25 * SIZEOF_WORD], 7 ; xmm_shadow[23] = block[jno23]; +%if %1 != 32 + pinsrw %37, word [esi + %33 * SIZEOF_WORD], 7 ; xmm_shadow[31] = block[jno31]; +%else + pinsrw %37, ecx, 7 ; xmm_shadow[31] = block[jno31]; +%endif + pcmpgtw xmm4, %34 ; neg = _mm_cmpgt_epi16(neg, x1); + pcmpgtw xmm5, %35 ; neg = _mm_cmpgt_epi16(neg, x1); + pcmpgtw xmm6, %36 ; neg = _mm_cmpgt_epi16(neg, x1); + pcmpgtw xmm7, %37 ; neg = _mm_cmpgt_epi16(neg, x1); + paddw %34, xmm4 ; x1 = _mm_add_epi16(x1, neg); + paddw %35, xmm5 ; x1 = _mm_add_epi16(x1, neg); + paddw %36, xmm6 ; x1 = _mm_add_epi16(x1, neg); + paddw %37, xmm7 ; x1 = _mm_add_epi16(x1, neg); + pxor %34, xmm4 ; x1 = _mm_xor_si128(x1, neg); + pxor %35, xmm5 ; x1 = _mm_xor_si128(x1, neg); + pxor %36, xmm6 ; x1 = _mm_xor_si128(x1, neg); + pxor %37, xmm7 ; x1 = _mm_xor_si128(x1, neg); + pxor xmm4, %34 ; neg = _mm_xor_si128(neg, x1); + pxor xmm5, %35 ; neg = _mm_xor_si128(neg, x1); + pxor xmm6, %36 ; neg = _mm_xor_si128(neg, x1); + pxor xmm7, %37 ; neg = _mm_xor_si128(neg, x1); + movdqa XMMWORD [esp + t1 + %1 * SIZEOF_WORD], %34 ; _mm_storeu_si128((__m128i *)(t1 + ko), x1); + movdqa XMMWORD [esp + t1 + (%1 + 8) * SIZEOF_WORD], %35 ; _mm_storeu_si128((__m128i *)(t1 + ko + 8), x1); + movdqa XMMWORD [esp + t1 + (%1 + 16) * SIZEOF_WORD], %36 ; _mm_storeu_si128((__m128i *)(t1 + ko + 16), x1); + movdqa XMMWORD [esp + t1 + (%1 + 24) * SIZEOF_WORD], %37 ; _mm_storeu_si128((__m128i *)(t1 + ko + 24), x1); + movdqa XMMWORD [esp + t2 + %1 * SIZEOF_WORD], xmm4 ; _mm_storeu_si128((__m128i *)(t2 + ko), neg); + movdqa XMMWORD [esp + t2 + (%1 + 8) * SIZEOF_WORD], xmm5 ; _mm_storeu_si128((__m128i *)(t2 + ko + 8), neg); + movdqa XMMWORD [esp + t2 + (%1 + 16) * SIZEOF_WORD], xmm6 ; _mm_storeu_si128((__m128i *)(t2 + ko + 16), neg); + movdqa XMMWORD [esp + t2 + (%1 + 24) * SIZEOF_WORD], xmm7 ; _mm_storeu_si128((__m128i *)(t2 + ko + 24), neg); +%endmacro + +; +; Encode a single block's worth of coefficients. +; +; GLOBAL(JOCTET*) +; jsimd_huff_encode_one_block_sse2 (working_state * state, JOCTET *buffer, +; JCOEFPTR block, int last_dc_val, +; c_derived_tbl *dctbl, c_derived_tbl *actbl) +; + +; eax + 8 = working_state *state +; eax + 12 = JOCTET *buffer +; eax + 16 = JCOEFPTR block +; eax + 20 = int last_dc_val +; eax + 24 = c_derived_tbl *dctbl +; eax + 28 = c_derived_tbl *actbl + +%define pad 6*SIZEOF_DWORD ; Align to 16 bytes +%define t1 pad +%define t2 t1+(DCTSIZE2*SIZEOF_WORD) +%define block t2+(DCTSIZE2*SIZEOF_WORD) +%define actbl block+SIZEOF_DWORD +%define buffer actbl+SIZEOF_DWORD +%define temp buffer+SIZEOF_DWORD +%define temp2 temp+SIZEOF_DWORD +%define temp3 temp2+SIZEOF_DWORD +%define temp4 temp3+SIZEOF_DWORD +%define temp5 temp4+SIZEOF_DWORD +%define gotptr temp5+SIZEOF_DWORD ; void * gotptr +%define put_buffer ebx +%define put_bits edi + + align 16 + global EXTN(jsimd_huff_encode_one_block_sse2) + +EXTN(jsimd_huff_encode_one_block_sse2): + push ebp + mov eax,esp ; eax = original ebp + sub esp, byte 4 + and esp, byte (-SIZEOF_XMMWORD) ; align to 128 bits + mov [esp],eax + mov ebp,esp ; ebp = aligned ebp + sub esp, temp5+9*SIZEOF_DWORD-pad + push ebx + push ecx +; push edx ; need not be preserved + push esi + push edi + push ebp + + mov esi, POINTER [eax+8] ; (working_state *state) + mov put_buffer, DWORD [esi+8] ; put_buffer = state->cur.put_buffer; + mov put_bits, DWORD [esi+12] ; put_bits = state->cur.put_bits; + push esi ; esi is now scratch + + get_GOT edx ; get GOT address + movpic POINTER [esp+gotptr], edx ; save GOT address + + mov ecx, POINTER [eax+28] + mov edx, POINTER [eax+16] + mov esi, POINTER [eax+12] + mov POINTER [esp+actbl], ecx + mov POINTER [esp+block], edx + mov POINTER [esp+buffer], esi + + ; Encode the DC coefficient difference per section F.1.2.1 + mov esi, POINTER [esp+block] ; block + movsx ecx, word [esi] ; temp = temp2 = block[0] - last_dc_val; + sub ecx, DWORD [eax+20] + mov esi, ecx + + ; This is a well-known technique for obtaining the absolute value + ; without a branch. It is derived from an assembly language technique + ; presented in "How to Optimize for the Pentium Processors", + ; Copyright (c) 1996, 1997 by Agner Fog. + mov edx, ecx + sar edx, 31 ; temp3 = temp >> (CHAR_BIT * sizeof(int) - 1); + xor ecx, edx ; temp ^= temp3; + sub ecx, edx ; temp -= temp3; + + ; For a negative input, want temp2 = bitwise complement of abs(input) + ; This code assumes we are on a two's complement machine + add esi, edx ; temp2 += temp3; + mov DWORD [esp+temp], esi ; backup temp2 in temp + + ; Find the number of bits needed for the magnitude of the coefficient + movpic ebp, POINTER [esp+gotptr] ; load GOT address (ebp) + movzx edx, byte [GOTOFF(ebp, jpeg_nbits_table + ecx)] ; nbits = JPEG_NBITS(temp); + mov DWORD [esp+temp2], edx ; backup nbits in temp2 + + ; Emit the Huffman-coded symbol for the number of bits + mov ebp, POINTER [eax+24] ; After this point, arguments are not accessible anymore + mov eax, INT [ebp + edx * 4] ; code = dctbl->ehufco[nbits]; + movzx ecx, byte [ebp + edx + 1024] ; size = dctbl->ehufsi[nbits]; + EMIT_BITS eax ; EMIT_BITS(code, size) + + mov ecx, DWORD [esp+temp2] ; restore nbits + + ; Mask off any extra bits in code + mov eax, 1 + shl eax, cl + dec eax + and eax, DWORD [esp+temp] ; temp2 &= (((JLONG) 1)<>= r; + mov DWORD [esp+temp3], edx +.BRLOOP: + cmp ecx, 16 ; while (r > 15) { + jl .ERLOOP + sub ecx, 16 ; r -= 16; + mov DWORD [esp+temp], ecx + mov eax, INT [ebp + 240 * 4] ; code_0xf0 = actbl->ehufco[0xf0]; + movzx ecx, byte [ebp + 1024 + 240] ; size_0xf0 = actbl->ehufsi[0xf0]; + EMIT_BITS eax ; EMIT_BITS(code_0xf0, size_0xf0) + mov ecx, DWORD [esp+temp] + jmp .BRLOOP +.ERLOOP: + movsx eax, word [esi] ; temp = t1[k]; + movpic edx, POINTER [esp+gotptr] ; load GOT address (edx) + movzx eax, byte [GOTOFF(edx, jpeg_nbits_table + eax)] ; nbits = JPEG_NBITS(temp); + mov DWORD [esp+temp2], eax + ; Emit Huffman symbol for run length / number of bits + shl ecx, 4 ; temp3 = (r << 4) + nbits; + add ecx, eax + mov eax, INT [ebp + ecx * 4] ; code = actbl->ehufco[temp3]; + movzx ecx, byte [ebp + ecx + 1024] ; size = actbl->ehufsi[temp3]; + EMIT_BITS eax + + movsx edx, word [esi+DCTSIZE2*2] ; temp2 = t2[k]; + ; Mask off any extra bits in code + mov ecx, DWORD [esp+temp2] + mov eax, 1 + shl eax, cl + dec eax + and eax, edx ; temp2 &= (((JLONG) 1)<>= 1; + + jmp .BLOOP +.ELOOP: + movdqa xmm0, XMMWORD [esp + t1 + 32 * SIZEOF_WORD] ; __m128i tmp0 = _mm_loadu_si128((__m128i *)(t1 + 0)); + movdqa xmm1, XMMWORD [esp + t1 + 40 * SIZEOF_WORD] ; __m128i tmp1 = _mm_loadu_si128((__m128i *)(t1 + 8)); + movdqa xmm2, XMMWORD [esp + t1 + 48 * SIZEOF_WORD] ; __m128i tmp2 = _mm_loadu_si128((__m128i *)(t1 + 16)); + movdqa xmm3, XMMWORD [esp + t1 + 56 * SIZEOF_WORD] ; __m128i tmp3 = _mm_loadu_si128((__m128i *)(t1 + 24)); + pcmpeqw xmm0, xmm7 ; tmp0 = _mm_cmpeq_epi16(tmp0, zero); + pcmpeqw xmm1, xmm7 ; tmp1 = _mm_cmpeq_epi16(tmp1, zero); + pcmpeqw xmm2, xmm7 ; tmp2 = _mm_cmpeq_epi16(tmp2, zero); + pcmpeqw xmm3, xmm7 ; tmp3 = _mm_cmpeq_epi16(tmp3, zero); + packsswb xmm0, xmm1 ; tmp0 = _mm_packs_epi16(tmp0, tmp1); + packsswb xmm2, xmm3 ; tmp2 = _mm_packs_epi16(tmp2, tmp3); + pmovmskb edx, xmm0 ; index = ((uint64_t)_mm_movemask_epi8(tmp0)) << 0; + pmovmskb ecx, xmm2 ; index = ((uint64_t)_mm_movemask_epi8(tmp2)) << 16; + shl ecx, 16 + or edx, ecx + not edx ; index = ~index; + + lea eax, [esp + t1 + (DCTSIZE2/2) * 2] + sub eax, esi + shr eax, 1 + bsf ecx, edx ; r = __builtin_ctzl(index); + jz .ELOOP2 + shr edx, cl ; index >>= r; + add ecx, eax + lea esi, [esi+ecx*2] ; k += r; + mov DWORD [esp+temp3], edx + jmp .BRLOOP2 +.BLOOP2: + bsf ecx, edx ; r = __builtin_ctzl(index); + jz .ELOOP2 + lea esi, [esi+ecx*2] ; k += r; + shr edx, cl ; index >>= r; + mov DWORD [esp+temp3], edx +.BRLOOP2: + cmp ecx, 16 ; while (r > 15) { + jl .ERLOOP2 + sub ecx, 16 ; r -= 16; + mov DWORD [esp+temp], ecx + mov eax, INT [ebp + 240 * 4] ; code_0xf0 = actbl->ehufco[0xf0]; + movzx ecx, byte [ebp + 1024 + 240] ; size_0xf0 = actbl->ehufsi[0xf0]; + EMIT_BITS eax ; EMIT_BITS(code_0xf0, size_0xf0) + mov ecx, DWORD [esp+temp] + jmp .BRLOOP2 +.ERLOOP2: + movsx eax, word [esi] ; temp = t1[k]; + bsr eax, eax ; nbits = 32 - __builtin_clz(temp); + inc eax + mov DWORD [esp+temp2], eax + ; Emit Huffman symbol for run length / number of bits + shl ecx, 4 ; temp3 = (r << 4) + nbits; + add ecx, eax + mov eax, INT [ebp + ecx * 4] ; code = actbl->ehufco[temp3]; + movzx ecx, byte [ebp + ecx + 1024] ; size = actbl->ehufsi[temp3]; + EMIT_BITS eax + + movsx edx, word [esi+DCTSIZE2*2] ; temp2 = t2[k]; + ; Mask off any extra bits in code + mov ecx, DWORD [esp+temp2] + mov eax, 1 + shl eax, cl + dec eax + and eax, edx ; temp2 &= (((JLONG) 1)<>= 1; + + jmp .BLOOP2 +.ELOOP2: + ; If the last coef(s) were zero, emit an end-of-block code + lea edx, [esp + t1 + (DCTSIZE2-1) * 2] ; r = DCTSIZE2-1-k; + cmp edx, esi ; if (r > 0) { + je .EFN + mov eax, INT [ebp] ; code = actbl->ehufco[0]; + movzx ecx, byte [ebp + 1024] ; size = actbl->ehufsi[0]; + EMIT_BITS eax +.EFN: + mov eax, [esp+buffer] + pop esi + ; Save put_buffer & put_bits + mov DWORD [esi+8], put_buffer ; state->cur.put_buffer = put_buffer; + mov DWORD [esi+12], put_bits ; state->cur.put_bits = put_bits; + + pop ebp + pop edi + pop esi +; pop edx ; need not be preserved + pop ecx + pop ebx + mov esp,ebp ; esp <- aligned ebp + pop esp ; esp <- original ebp + pop ebp + ret + +; For some reason, the OS X linker does not honor the request to align the +; segment unless we do this. + align 16 diff --git a/simd/jpeg_nbits_table.inc b/simd/jpeg_nbits_table.inc new file mode 100644 index 00000000..cbc69904 --- /dev/null +++ b/simd/jpeg_nbits_table.inc @@ -0,0 +1,4097 @@ +jpeg_nbits_table db \ + 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, \ + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, \ + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, \ + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, \ + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \ + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \ + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \ + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \ + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 diff --git a/simd/jsimd.h b/simd/jsimd.h index c0de7e7a..04277fc6 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -2,9 +2,10 @@ * simd/jsimd.h * * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright (C) 2011, 2014-2015 D. R. Commander + * Copyright (C) 2011, 2014-2016 D. R. Commander * Copyright (C) 2013-2014, MIPS Technologies, Inc., California * Copyright (C) 2014 Linaro Limited + * Copyright (C) 2015 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -828,3 +829,9 @@ extern const int jconst_idct_float_sse2[]; EXTERN(void) jsimd_idct_float_sse2 (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); + +/* Huffman coding */ +extern const int jconst_huff_encode_one_block[]; +EXTERN(JOCTET*) jsimd_huff_encode_one_block_sse2 + (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, + c_derived_tbl *dctbl, c_derived_tbl *actbl); diff --git a/simd/jsimd_arm.c b/simd/jsimd_arm.c index 4cbcf2d5..e715291e 100644 --- a/simd/jsimd_arm.c +++ b/simd/jsimd_arm.c @@ -3,6 +3,7 @@ * * Copyright 2009 Pierre Ossman for Cendio AB * Copyright 2009-2011, 2013-2014 D. R. Commander + * Copyright 2015 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -706,3 +707,17 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, JDIMENSION output_col) { } + +GLOBAL(int) +jsimd_can_huff_encode_one_block (void) +{ + return 0; +} + +GLOBAL(JOCTET*) +jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, + int last_dc_val, c_derived_tbl *dctbl, + c_derived_tbl *actbl) +{ + return NULL; +} diff --git a/simd/jsimd_arm64.c b/simd/jsimd_arm64.c index 65724cb9..585feeb9 100644 --- a/simd/jsimd_arm64.c +++ b/simd/jsimd_arm64.c @@ -3,6 +3,7 @@ * * Copyright 2009 Pierre Ossman for Cendio AB * Copyright 2009-2011, 2013-2014 D. R. Commander + * Copyright 2015 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -33,10 +34,10 @@ static unsigned int simd_support = ~0; * FIXME: This code is racy under a multi-threaded environment. */ -/* +/* * ARMv8 architectures support NEON extensions by default. * It is no longer optional as it was with ARMv7. - */ + */ LOCAL(void) @@ -542,3 +543,17 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, JDIMENSION output_col) { } + +GLOBAL(int) +jsimd_can_huff_encode_one_block (void) +{ + return 0; +} + +GLOBAL(JOCTET*) +jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, + int last_dc_val, c_derived_tbl *dctbl, + c_derived_tbl *actbl) +{ + return NULL; +} diff --git a/simd/jsimd_i386.c b/simd/jsimd_i386.c index 25d06974..6362aaae 100644 --- a/simd/jsimd_i386.c +++ b/simd/jsimd_i386.c @@ -2,7 +2,8 @@ * jsimd_i386.c * * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright 2009-2011, 2013-2014 D. R. Commander + * Copyright 2009-2011, 2013-2014, 2016 D. R. Commander + * Copyright 2015 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -30,6 +31,7 @@ #define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */ static unsigned int simd_support = ~0; +static unsigned int simd_huffman = 1; /* * Check what SIMD accelerations are supported. @@ -62,6 +64,9 @@ init_simd (void) env = getenv("JSIMD_FORCENONE"); if ((env != NULL) && (strcmp(env, "1") == 0)) simd_support = 0; + env = getenv("JSIMD_NOHUFFENC"); + if ((env != NULL) && (strcmp(env, "1") == 0)) + simd_huffman = 0; } GLOBAL(int) @@ -1059,3 +1064,28 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, output_col); } +GLOBAL(int) +jsimd_can_huff_encode_one_block (void) +{ + init_simd(); + + if (DCTSIZE != 8) + return 0; + if (sizeof(JCOEF) != 2) + return 0; + + if ((simd_support & JSIMD_SSE2) && simd_huffman && + IS_ALIGNED_SSE(jconst_huff_encode_one_block)) + return 1; + + return 0; +} + +GLOBAL(JOCTET*) +jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, + int last_dc_val, c_derived_tbl *dctbl, + c_derived_tbl *actbl) +{ + return jsimd_huff_encode_one_block_sse2(state, buffer, block, last_dc_val, + dctbl, actbl); +} diff --git a/simd/jsimd_mips.c b/simd/jsimd_mips.c index cf87b32b..62d3215b 100644 --- a/simd/jsimd_mips.c +++ b/simd/jsimd_mips.c @@ -4,6 +4,7 @@ * Copyright 2009 Pierre Ossman for Cendio AB * Copyright 2009-2011, 2014 D. R. Commander * Copyright (C) 2013-2014, MIPS Technologies, Inc., California + * Copyright 2015 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -1113,3 +1114,17 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, JDIMENSION output_col) { } + +GLOBAL(int) +jsimd_can_huff_encode_one_block (void) +{ + return 0; +} + +GLOBAL(JOCTET*) +jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, + int last_dc_val, c_derived_tbl *dctbl, + c_derived_tbl *actbl) +{ + return NULL; +} diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index 2fc68142..5a3036f1 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -3,6 +3,7 @@ * * Copyright 2009 Pierre Ossman for Cendio AB * Copyright 2009-2011, 2014-2015 D. R. Commander + * Copyright 2015 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -724,3 +725,17 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, JDIMENSION output_col) { } + +GLOBAL(int) +jsimd_can_huff_encode_one_block (void) +{ + return 0; +} + +GLOBAL(JOCTET*) +jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, + int last_dc_val, c_derived_tbl *dctbl, + c_derived_tbl *actbl) +{ + return NULL; +} diff --git a/simd/jsimd_x86_64.c b/simd/jsimd_x86_64.c index 345237c9..d17c8638 100644 --- a/simd/jsimd_x86_64.c +++ b/simd/jsimd_x86_64.c @@ -2,7 +2,8 @@ * jsimd_x86_64.c * * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright 2009-2011, 2014 D. R. Commander + * Copyright 2009-2011, 2014, 2016 D. R. Commander + * Copyright 2015 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -30,6 +31,7 @@ #define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */ static unsigned int simd_support = ~0; +static unsigned int simd_huffman = 1; /* * Check what SIMD accelerations are supported. @@ -50,6 +52,9 @@ init_simd (void) env = getenv("JSIMD_FORCENONE"); if ((env != NULL) && (strcmp(env, "1") == 0)) simd_support = 0; + env = getenv("JSIMD_NOHUFFENC"); + if ((env != NULL) && (strcmp(env, "1") == 0)) + simd_huffman = 0; } GLOBAL(int) @@ -854,3 +859,29 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, jsimd_idct_float_sse2(compptr->dct_table, coef_block, output_buf, output_col); } + +GLOBAL(int) +jsimd_can_huff_encode_one_block (void) +{ + init_simd(); + + if (DCTSIZE != 8) + return 0; + if (sizeof(JCOEF) != 2) + return 0; + + if ((simd_support & JSIMD_SSE2) && simd_huffman && + IS_ALIGNED_SSE(jconst_huff_encode_one_block)) + return 1; + + return 0; +} + +GLOBAL(JOCTET*) +jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, + int last_dc_val, c_derived_tbl *dctbl, + c_derived_tbl *actbl) +{ + return jsimd_huff_encode_one_block_sse2(state, buffer, block, last_dc_val, + dctbl, actbl); +} From 4e356a92dc6ee443b6a40e50992afbdbf86fbb2f Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 13 Jan 2016 12:25:03 -0600 Subject: [PATCH 083/140] BUILDING.md: Restore autotools processing instr. Partially reverts 54014d9c2a41905b7b766057af6728834da64b59. When building from a git sandbox, as opposed to from an official source tarball, it is still necessary to run autoreconf. Closes #48 --- BUILDING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BUILDING.md b/BUILDING.md index 7d794a98..94ee1409 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -71,10 +71,14 @@ Solaris/x86 systems (on Solaris, this generates a 32-bit library. See below for 64-bit build instructions.) cd {source_directory} + autoreconf -fiv cd {build_directory} sh {source_directory}/configure [additional configure flags] make +NOTE: Running autoreconf in the source directory is not necessary if building +libjpeg-turbo from one of the official release tarballs. + This will generate the following files under .libs/: **libjpeg.a** From 9c8cee8c29a863d5c7ebd8bf21bdcf0c370c6730 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 13 Jan 2016 13:01:45 -0600 Subject: [PATCH 084/140] tjbench: Further tweaks to -nowrite feature * Do not compute compression error if -nowrite is specified * Adjust formatting of -nowrite usage description --- tjbench.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tjbench.c b/tjbench.c index d04786cc..036d631e 100644 --- a/tjbench.c +++ b/tjbench.c @@ -213,6 +213,9 @@ int decomp(unsigned char *srcbuf, unsigned char **jpegbuf, (double)(w*h)/1000000.*(double)iter/elapsedDecode); } } + + if (!write) goto bailout; + if(sf.num!=1 || sf.denom!=1) snprintf(sizestr, 20, "%d_%d", sf.num, sf.denom); else if(tilew!=w || tileh!=h) @@ -224,7 +227,7 @@ int decomp(unsigned char *srcbuf, unsigned char **jpegbuf, snprintf(tempstr, 1024, "%s_%s%s_%s.%s", filename, subName[subsamp], qualstr, sizestr, ext); - if(write && savebmp(tempstr, dstbuf, scaledw, scaledh, pf, + if(savebmp(tempstr, dstbuf, scaledw, scaledh, pf, (flags&TJFLAG_BOTTOMUP)!=0)==-1) _throwbmp("saving bitmap"); ptr=strrchr(tempstr, '.'); @@ -259,7 +262,7 @@ int decomp(unsigned char *srcbuf, unsigned char **jpegbuf, dstbuf[pitch*row+col] =abs(dstbuf[pitch*row+col]-srcbuf[pitch*row+col]); } - if(write && savebmp(tempstr, dstbuf, w, h, pf, + if(savebmp(tempstr, dstbuf, w, h, pf, (flags&TJFLAG_BOTTOMUP)!=0)==-1) _throwbmp("saving bitmap"); } @@ -758,7 +761,7 @@ void usage(char *progname) printf(" taking performance measurements (default = 1)\n"); printf("-componly = Stop after running compression tests. Do not test decompression.\n"); printf("-nowrite = Do not write reference or output images (improves consistency of\n"); - printf(" performance measurements.)\n\n"); + printf(" performance measurements.)\n\n"); printf("NOTE: If the quality is specified as a range (e.g. 90-100), a separate\n"); printf("test will be performed for all quality values in the range.\n\n"); exit(1); From 499c470b63fb427791b2602fcc0d3f165a81144c Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 13 Jan 2016 03:13:20 -0600 Subject: [PATCH 085/140] ARM32 NEON SIMD implementation of Huffman encoding Full-color compression speedups relative to libjpeg-turbo 1.4.2: 800 MHz ARM Cortex-A9, iOS, 32-bit: 26-44% (avg. 32%) Refer to #42 and #47 for discussion. This commit also removes the unnecessary if (simd_support & JSIMD_ARM_NEON) statements from the jsimd* algorithm functions. Since the jsimd_can*() functions check for the existence of NEON, the corresponding algorithm functions will never be called if NEON isn't available. Removing those if statements improved performance across the board by a couple of percent. Based on: https://github.com/mayeut/libjpeg-turbo/commit/fc023c880ce1d6c908fb78ccc25f5d5fd910ccc5 --- ChangeLog.txt | 4 + simd/jsimd.h | 6 +- simd/jsimd_arm.c | 64 +++---- simd/jsimd_arm_neon.S | 435 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 476 insertions(+), 33 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 2b0cd321..f79660e9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -67,6 +67,10 @@ when compiling the C version of the Huffman encoder or regression testing, SIMD-accelerated Huffman encoding can be disabled by setting the JSIMD_NOHUFFENC environment variable to 1. +[13] Added SIMD acceleration for Huffman encoding on NEON-capable ARM 32-bit +platforms. This speeds up the compression of full-color JPEGs by about 30% on +average. + 1.4.2 ===== diff --git a/simd/jsimd.h b/simd/jsimd.h index 04277fc6..e259feab 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -5,7 +5,7 @@ * Copyright (C) 2011, 2014-2016 D. R. Commander * Copyright (C) 2013-2014, MIPS Technologies, Inc., California * Copyright (C) 2014 Linaro Limited - * Copyright (C) 2015 Matthieu Darbois + * Copyright (C) 2015-2016 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -835,3 +835,7 @@ extern const int jconst_huff_encode_one_block[]; EXTERN(JOCTET*) jsimd_huff_encode_one_block_sse2 (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl); + +EXTERN(JOCTET*) jsimd_huff_encode_one_block_neon + (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, + c_derived_tbl *dctbl, c_derived_tbl *actbl); diff --git a/simd/jsimd_arm.c b/simd/jsimd_arm.c index e715291e..635cbd70 100644 --- a/simd/jsimd_arm.c +++ b/simd/jsimd_arm.c @@ -2,8 +2,8 @@ * jsimd_arm.c * * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright 2009-2011, 2013-2014 D. R. Commander - * Copyright 2015 Matthieu Darbois + * Copyright 2009-2011, 2013-2014, 2016 D. R. Commander + * Copyright 2015-2016 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -228,8 +228,7 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo, break; } - if (simd_support & JSIMD_ARM_NEON) - neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); + neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); } GLOBAL(void) @@ -274,8 +273,7 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo, break; } - if (simd_support & JSIMD_ARM_NEON) - neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows); + neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows); } GLOBAL(void) @@ -283,9 +281,8 @@ jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row, - output_buf, num_rows); + jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row, + output_buf, num_rows); } GLOBAL(int) @@ -387,10 +384,9 @@ jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor, - compptr->downsampled_width, input_data, - output_data_ptr); + jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor, + compptr->downsampled_width, input_data, + output_data_ptr); } GLOBAL(int) @@ -458,8 +454,7 @@ GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_convsamp_neon(sample_data, start_col, workspace); + jsimd_convsamp_neon(sample_data, start_col, workspace); } GLOBAL(void) @@ -509,8 +504,7 @@ jsimd_fdct_islow (DCTELEM * data) GLOBAL(void) jsimd_fdct_ifast (DCTELEM * data) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_fdct_ifast_neon(data); + jsimd_fdct_ifast_neon(data); } GLOBAL(void) @@ -549,8 +543,7 @@ GLOBAL(void) jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_quantize_neon(coef_block, divisors, workspace); + jsimd_quantize_neon(coef_block, divisors, workspace); } GLOBAL(void) @@ -610,9 +603,8 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(void) @@ -620,9 +612,8 @@ jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(int) @@ -686,9 +677,8 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(void) @@ -696,9 +686,8 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(void) @@ -711,6 +700,16 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, GLOBAL(int) jsimd_can_huff_encode_one_block (void) { + init_simd(); + + if (DCTSIZE != 8) + return 0; + if (sizeof(JCOEF) != 2) + return 0; + + if (simd_support & JSIMD_ARM_NEON) + return 1; + return 0; } @@ -719,5 +718,6 @@ jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { - return NULL; + return jsimd_huff_encode_one_block_neon(state, buffer, block, last_dc_val, + dctbl, actbl); } diff --git a/simd/jsimd_arm_neon.S b/simd/jsimd_arm_neon.S index c83e1c74..ecbdea8a 100644 --- a/simd/jsimd_arm_neon.S +++ b/simd/jsimd_arm_neon.S @@ -7,6 +7,7 @@ * Copyright (C) 2014 Siarhei Siamashka. All Rights Reserved. * Copyright (C) 2014 Linaro Limited. All Rights Reserved. * Copyright (C) 2015 D. R. Commander. All Rights Reserved. + * Copyright (C) 2015-2016 Matthieu Darbois. All Rights Reserved. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -2438,3 +2439,437 @@ asm_function jsimd_h2v1_fancy_upsample_neon .purgem upsample16 .purgem upsample32 .purgem upsample_row + +/*****************************************************************************/ + +/* + * GLOBAL(JOCTET*) + * jsimd_chuff_encode_one_block (working_state * state, JOCTET *buffer, + * JCOEFPTR block, int last_dc_val, + * c_derived_tbl *dctbl, c_derived_tbl *actbl) + * + */ + +.macro emit_byte BUFFER, PUT_BUFFER, PUT_BITS, ZERO, TMP + sub \PUT_BITS, \PUT_BITS, #0x8 + lsr \TMP, \PUT_BUFFER, \PUT_BITS + uxtb \TMP, \TMP + strb \TMP, [\BUFFER, #1]! + cmp \TMP, #0xff + /*it eq*/ + streqb \ZERO, [\BUFFER, #1]! +.endm +.macro put_bits PUT_BUFFER, PUT_BITS, CODE, SIZE + /*lsl \PUT_BUFFER, \PUT_BUFFER, \SIZE*/ + add \PUT_BITS, \SIZE + /*orr \PUT_BUFFER, \PUT_BUFFER, \CODE*/ + orr \PUT_BUFFER, \CODE, \PUT_BUFFER, lsl \SIZE +.endm +.macro checkbuf15 BUFFER, PUT_BUFFER, PUT_BITS, ZERO, TMP + cmp \PUT_BITS, #0x10 + blt 15f + eor \ZERO, \ZERO, \ZERO + emit_byte \BUFFER, \PUT_BUFFER, \PUT_BITS, \ZERO, \TMP + emit_byte \BUFFER, \PUT_BUFFER, \PUT_BITS, \ZERO, \TMP +15: +.endm + +.balign 16 +jsimd_huff_encode_one_block_neon_consts: + .byte 0x01 + .byte 0x02 + .byte 0x04 + .byte 0x08 + .byte 0x10 + .byte 0x20 + .byte 0x40 + .byte 0x80 + +asm_function jsimd_huff_encode_one_block_neon + push {r4, r5, r6, r7, r8, r9, r10, r11, lr} + add r7, sp, #0x1c + sub r4, sp, #0x40 + bfc r4, #0, #5 + mov sp, r4 /* align sp on 32 bytes */ + vst1.64 {d8, d9, d10, d11}, [r4, :128]! + vst1.64 {d12, d13, d14, d15}, [r4, :128] + sub sp, #0x140 /* reserve 320 bytes */ + str r0, [sp, #0x18] /* working state > sp + Ox18 */ + add r4, sp, #0x20 /* r4 = t1 */ + ldr lr, [r7, #0x8] /* lr = dctbl */ + sub r10, r1, #0x1 /* r10=buffer-- */ + ldrsh r1, [r2] + mov r9, #0x10 + mov r8, #0x1 + adr r5, jsimd_huff_encode_one_block_neon_consts + /* prepare data */ + vld1.8 {d26}, [r5, :64] + veor q8, q8, q8 + veor q9, q9, q9 + vdup.16 q14, r9 + vdup.16 q15, r8 + veor q10, q10, q10 + veor q11, q11, q11 + sub r1, r1, r3 + add r9, r2, #0x22 + add r8, r2, #0x18 + add r3, r2, #0x36 + vmov.16 d0[0], r1 + vld1.16 {d2[0]}, [r9, :16] + vld1.16 {d4[0]}, [r8, :16] + vld1.16 {d6[0]}, [r3, :16] + add r1, r2, #0x2 + add r9, r2, #0x30 + add r8, r2, #0x26 + add r3, r2, #0x28 + vld1.16 {d0[1]}, [r1, :16] + vld1.16 {d2[1]}, [r9, :16] + vld1.16 {d4[1]}, [r8, :16] + vld1.16 {d6[1]}, [r3, :16] + add r1, r2, #0x10 + add r9, r2, #0x40 + add r8, r2, #0x34 + add r3, r2, #0x1a + vld1.16 {d0[2]}, [r1, :16] + vld1.16 {d2[2]}, [r9, :16] + vld1.16 {d4[2]}, [r8, :16] + vld1.16 {d6[2]}, [r3, :16] + add r1, r2, #0x20 + add r9, r2, #0x32 + add r8, r2, #0x42 + add r3, r2, #0xc + vld1.16 {d0[3]}, [r1, :16] + vld1.16 {d2[3]}, [r9, :16] + vld1.16 {d4[3]}, [r8, :16] + vld1.16 {d6[3]}, [r3, :16] + add r1, r2, #0x12 + add r9, r2, #0x24 + add r8, r2, #0x50 + add r3, r2, #0xe + vld1.16 {d1[0]}, [r1, :16] + vld1.16 {d3[0]}, [r9, :16] + vld1.16 {d5[0]}, [r8, :16] + vld1.16 {d7[0]}, [r3, :16] + add r1, r2, #0x4 + add r9, r2, #0x16 + add r8, r2, #0x60 + add r3, r2, #0x1c + vld1.16 {d1[1]}, [r1, :16] + vld1.16 {d3[1]}, [r9, :16] + vld1.16 {d5[1]}, [r8, :16] + vld1.16 {d7[1]}, [r3, :16] + add r1, r2, #0x6 + add r9, r2, #0x8 + add r8, r2, #0x52 + add r3, r2, #0x2a + vld1.16 {d1[2]}, [r1, :16] + vld1.16 {d3[2]}, [r9, :16] + vld1.16 {d5[2]}, [r8, :16] + vld1.16 {d7[2]}, [r3, :16] + add r1, r2, #0x14 + add r9, r2, #0xa + add r8, r2, #0x44 + add r3, r2, #0x38 + vld1.16 {d1[3]}, [r1, :16] + vld1.16 {d3[3]}, [r9, :16] + vld1.16 {d5[3]}, [r8, :16] + vld1.16 {d7[3]}, [r3, :16] + vcgt.s16 q8, q8, q0 + vcgt.s16 q9, q9, q1 + vcgt.s16 q10, q10, q2 + vcgt.s16 q11, q11, q3 + vabs.s16 q0, q0 + vabs.s16 q1, q1 + vabs.s16 q2, q2 + vabs.s16 q3, q3 + veor q8, q8, q0 + veor q9, q9, q1 + veor q10, q10, q2 + veor q11, q11, q3 + add r9, r4, #0x20 + add r8, r4, #0x80 + add r3, r4, #0xa0 + vclz.i16 q0, q0 + vclz.i16 q1, q1 + vclz.i16 q2, q2 + vclz.i16 q3, q3 + vsub.i16 q0, q14, q0 + vsub.i16 q1, q14, q1 + vsub.i16 q2, q14, q2 + vsub.i16 q3, q14, q3 + vst1.16 {d0, d1, d2, d3}, [r4, :256] + vst1.16 {d4, d5, d6, d7}, [r9, :256] + vshl.s16 q0, q15, q0 + vshl.s16 q1, q15, q1 + vshl.s16 q2, q15, q2 + vshl.s16 q3, q15, q3 + vsub.i16 q0, q0, q15 + vsub.i16 q1, q1, q15 + vsub.i16 q2, q2, q15 + vsub.i16 q3, q3, q15 + vand q8, q8, q0 + vand q9, q9, q1 + vand q10, q10, q2 + vand q11, q11, q3 + vst1.16 {d16, d17, d18, d19}, [r8, :256] + vst1.16 {d20, d21, d22, d23}, [r3, :256] + add r1, r2, #0x46 + add r9, r2, #0x3a + add r8, r2, #0x74 + add r3, r2, #0x6a + vld1.16 {d8[0]}, [r1, :16] + vld1.16 {d10[0]}, [r9, :16] + vld1.16 {d12[0]}, [r8, :16] + vld1.16 {d14[0]}, [r3, :16] + veor q8, q8, q8 + veor q9, q9, q9 + veor q10, q10, q10 + veor q11, q11, q11 + add r1, r2, #0x54 + add r9, r2, #0x2c + add r8, r2, #0x76 + add r3, r2, #0x78 + vld1.16 {d8[1]}, [r1, :16] + vld1.16 {d10[1]}, [r9, :16] + vld1.16 {d12[1]}, [r8, :16] + vld1.16 {d14[1]}, [r3, :16] + add r1, r2, #0x62 + add r9, r2, #0x1e + add r8, r2, #0x68 + add r3, r2, #0x7a + vld1.16 {d8[2]}, [r1, :16] + vld1.16 {d10[2]}, [r9, :16] + vld1.16 {d12[2]}, [r8, :16] + vld1.16 {d14[2]}, [r3, :16] + add r1, r2, #0x70 + add r9, r2, #0x2e + add r8, r2, #0x5a + add r3, r2, #0x6c + vld1.16 {d8[3]}, [r1, :16] + vld1.16 {d10[3]}, [r9, :16] + vld1.16 {d12[3]}, [r8, :16] + vld1.16 {d14[3]}, [r3, :16] + add r1, r2, #0x72 + add r9, r2, #0x3c + add r8, r2, #0x4c + add r3, r2, #0x5e + vld1.16 {d9[0]}, [r1, :16] + vld1.16 {d11[0]}, [r9, :16] + vld1.16 {d13[0]}, [r8, :16] + vld1.16 {d15[0]}, [r3, :16] + add r1, r2, #0x64 + add r9, r2, #0x4a + add r8, r2, #0x3e + add r3, r2, #0x6e + vld1.16 {d9[1]}, [r1, :16] + vld1.16 {d11[1]}, [r9, :16] + vld1.16 {d13[1]}, [r8, :16] + vld1.16 {d15[1]}, [r3, :16] + add r1, r2, #0x56 + add r9, r2, #0x58 + add r8, r2, #0x4e + add r3, r2, #0x7c + vld1.16 {d9[2]}, [r1, :16] + vld1.16 {d11[2]}, [r9, :16] + vld1.16 {d13[2]}, [r8, :16] + vld1.16 {d15[2]}, [r3, :16] + add r1, r2, #0x48 + add r9, r2, #0x66 + add r8, r2, #0x5c + add r3, r2, #0x7e + vld1.16 {d9[3]}, [r1, :16] + vld1.16 {d11[3]}, [r9, :16] + vld1.16 {d13[3]}, [r8, :16] + vld1.16 {d15[3]}, [r3, :16] + vcgt.s16 q8, q8, q4 + vcgt.s16 q9, q9, q5 + vcgt.s16 q10, q10, q6 + vcgt.s16 q11, q11, q7 + vabs.s16 q4, q4 + vabs.s16 q5, q5 + vabs.s16 q6, q6 + vabs.s16 q7, q7 + veor q8, q8, q4 + veor q9, q9, q5 + veor q10, q10, q6 + veor q11, q11, q7 + add r1, r4, #0x40 + add r9, r4, #0x60 + add r8, r4, #0xc0 + add r3, r4, #0xe0 + vclz.i16 q4, q4 + vclz.i16 q5, q5 + vclz.i16 q6, q6 + vclz.i16 q7, q7 + vsub.i16 q4, q14, q4 + vsub.i16 q5, q14, q5 + vsub.i16 q6, q14, q6 + vsub.i16 q7, q14, q7 + vst1.16 {d8, d9, d10, d11}, [r1, :256] + vst1.16 {d12, d13, d14, d15}, [r9, :256] + vshl.s16 q4, q15, q4 + vshl.s16 q5, q15, q5 + vshl.s16 q6, q15, q6 + vshl.s16 q7, q15, q7 + vsub.i16 q4, q4, q15 + vsub.i16 q5, q5, q15 + vsub.i16 q6, q6, q15 + vsub.i16 q7, q7, q15 + vand q8, q8, q4 + vand q9, q9, q5 + vand q10, q10, q6 + vand q11, q11, q7 + vst1.16 {d16, d17, d18, d19}, [r8, :256] + vst1.16 {d20, d21, d22, d23}, [r3, :256] + ldr r12, [r7, #0xc] /* r12 = actbl */ + add r1, lr, #0x400 /* r1 = dctbl->ehufsi */ + mov r9, r12 /* r9 = actbl */ + add r6, r4, #0x80 /* r6 = t2 */ + ldr r11, [r0, #0x8] /* r11 = put_buffer */ + ldr r4, [r0, #0xc] /* r4 = put_bits */ + ldrh r2, [r6, #-128] /* r2 = nbits */ + ldrh r3, [r6] /* r3 = temp2 & (((JLONG) 1)<ehufsi */ + ldrsb r6, [r5, #0xf0] /* r6 = actbl->ehufsi[0xf0] */ + veor q8, q8, q8 + vceq.i16 q0, q0, q8 + vceq.i16 q1, q1, q8 + vceq.i16 q2, q2, q8 + vceq.i16 q3, q3, q8 + vceq.i16 q4, q4, q8 + vceq.i16 q5, q5, q8 + vceq.i16 q6, q6, q8 + vceq.i16 q7, q7, q8 + vmovn.i16 d0, q0 + vmovn.i16 d2, q1 + vmovn.i16 d4, q2 + vmovn.i16 d6, q3 + vmovn.i16 d8, q4 + vmovn.i16 d10, q5 + vmovn.i16 d12, q6 + vmovn.i16 d14, q7 + vand d0, d0, d26 + vand d2, d2, d26 + vand d4, d4, d26 + vand d6, d6, d26 + vand d8, d8, d26 + vand d10, d10, d26 + vand d12, d12, d26 + vand d14, d14, d26 + vpadd.i8 d0, d0, d2 + vpadd.i8 d4, d4, d6 + vpadd.i8 d8, d8, d10 + vpadd.i8 d12, d12, d14 + vpadd.i8 d0, d0, d4 + vpadd.i8 d8, d8, d12 + vpadd.i8 d0, d0, d8 + vmov.32 r1, d0[1] + vmov.32 r8, d0[0] + mvn r1, r1 + mvn r8, r8 + lsrs r1, r1, #0x1 + rrx r8, r8 /* shift in last r1 bit while shifting out DC bit */ + rbit r1, r1 /* r1 = index1 */ + rbit r8, r8 /* r8 = index0 */ + ldr r0, [r9, #0x3c0] /* r0 = actbl->ehufco[0xf0] */ + str r1, [sp, #0x14] /* index1 > sp + 0x14 */ + cmp r8, #0x0 + beq 6f +1: + clz r2, r8 + add lr, lr, r2, lsl #1 + lsl r8, r8, r2 + ldrh r1, [lr, #-126] +2: + cmp r2, #0x10 + blt 3f + sub r2, r2, #0x10 + put_bits r11, r4, r0, r6 + cmp r4, #0x10 + blt 2b + eor r3, r3, r3 + emit_byte r10, r11, r4, r3, r12 + emit_byte r10, r11, r4, r3, r12 + b 2b +3: + add r2, r1, r2, lsl #4 + ldrh r3, [lr, #2]! + ldr r12, [r9, r2, lsl #2] + ldrb r2, [r5, r2] + put_bits r11, r4, r12, r2 + checkbuf15 r10, r11, r4, r2, r12 + put_bits r11, r4, r3, r1 + checkbuf15 r10, r11, r4, r2, r12 + lsls r8, r8, #0x1 + bne 1b +6: + add r12, sp, #0x20 /* r12 = t1 */ + ldr r8,[sp, #0x14] /* r8 = index1 */ + adds r12, #0xc0 /* r12 = t2 + (DCTSIZE2/2) */ + cmp r8, #0x0 + beq 6f + clz r2, r8 + sub r12, r12, lr + lsl r8, r8, r2 + add r2, r2, r12, lsr #1 + add lr, lr, r2, lsl #1 + b 7f +1: + clz r2, r8 + add lr, lr, r2, lsl #1 + lsl r8, r8, r2 +7: + ldrh r1, [lr, #-126] +2: + cmp r2, #0x10 + blt 3f + sub r2, r2, #0x10 + put_bits r11, r4, r0, r6 + cmp r4, #0x10 + blt 2b + eor r3, r3, r3 + emit_byte r10, r11, r4, r3, r12 + emit_byte r10, r11, r4, r3, r12 + b 2b +3: + add r2, r1, r2, lsl #4 + ldrh r3, [lr, #2]! + ldr r12, [r9, r2, lsl #2] + ldrb r2, [r5, r2] + put_bits r11, r4, r12, r2 + checkbuf15 r10, r11, r4, r2, r12 + put_bits r11, r4, r3, r1 + checkbuf15 r10, r11, r4, r2, r12 + lsls r8, r8, #0x1 + bne 1b +6: + add r0, sp, #0x20 + add r0, #0xfe + cmp lr, r0 + bhs 1f + ldr r1, [r9] + ldrb r0, [r5] + put_bits r11, r4, r1, r0 + checkbuf15 r10, r11, r4, r0, r1 +1: + ldr r12, [sp, #0x18] + str r11, [r12, #0x8] + str r4, [r12, #0xc] + add r0, r10, #0x1 + add r4, sp, #0x140 + vld1.64 {d8, d9, d10, d11}, [r4, :128]! + vld1.64 {d12, d13, d14, d15}, [r4, :128] + sub r4, r7, #0x1c + mov sp, r4 + pop {r4, r5, r6, r7, r8, r9, r10, r11, pc} + +.purgem emit_byte +.purgem put_bits +.purgem checkbuf15 From ec6941f7bc5b3ea354825cef24085e8d4abbab02 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 15 Jan 2016 09:29:11 -0600 Subject: [PATCH 086/140] Complete the ARM64 NEON SIMD implementation This adds 64-bit NEON coverage for all of the algorithms that are covered by the 32-bit NEON implementation, except for h2v1 (4:2:2) fancy upsampling (used when decompressing 4:2:2 JPEG images.) It also adds 64-bit NEON SIMD coverage for: * slow integer forward DCT (compressor) * h2v2 (4:2:0) downsampling (compressor) * h2v1 (4:2:2) downsampling (compressor) which are not covered in the 32-bit implementation. Compression speedups relative to libjpeg-turbo 1.4.2: Apple A7 (iPhone 5S), iOS, 64-bit: 113-150% (reported) 48-core ThunderX (RunAbove ARM Cloud), Linux, 64-bit: 2.1-33% (avg. 15%) Refer to #44 and #49 for discussion This commit also removes the unnecessary if (simd_support & JSIMD_ARM_NEON) statements from the jsimd* algorithm functions. Since the jsimd_can*() functions check for the existence of NEON, the corresponding algorithm functions will never be called if NEON isn't available. Based on: https://github.com/mayeut/libjpeg-turbo/commit/dcd9d84f10fae192c0e3935818dc289bca9c3e29 https://github.com/mayeut/libjpeg-turbo/commit/b0d87b811f37bd560083deea8c6e7d704e5cd944 https://github.com/mayeut/libjpeg-turbo/commit/70cd5c8a493a67f4d54dd2067ae6dedb65d95389 https://github.com/mayeut/libjpeg-turbo/commit/3e58d9a064648503c57ec2650ee79880f749a52b https://github.com/mayeut/libjpeg-turbo/commit/837b19542f53fa81af83e6ba002d559877aaf597 https://github.com/mayeut/libjpeg-turbo/commit/73dc43ccc870c2e10ba893e9764b8e48d6836585 https://github.com/mayeut/libjpeg-turbo/commit/a82b71a261b4c0213f558baf4bc745f1c27356d8 https://github.com/mayeut/libjpeg-turbo/commit/c1b1188c2106d6ea7b76644b6023b57edeb602e1 https://github.com/mayeut/libjpeg-turbo/commit/305c89284e1bb222b34fbc7261f697a0cc452a41 https://github.com/mayeut/libjpeg-turbo/commit/7f443f99950b4d7d442b9b879648eca5273209bd https://github.com/mayeut/libjpeg-turbo/commit/4c2b53b77da5a20e30e2aadaeddb0efbfe24e06d Unified version with fixes: https://github.com/mayeut/libjpeg-turbo/commit/1004a3cd05870612a194b410efeaa1b4da76d246 --- ChangeLog.txt | 7 + simd/jsimd.h | 12 + simd/jsimd_arm64.c | 148 ++++- simd/jsimd_arm64_neon.S | 1211 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 1359 insertions(+), 19 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f79660e9..379cfbd8 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -71,6 +71,13 @@ setting the JSIMD_NOHUFFENC environment variable to 1. platforms. This speeds up the compression of full-color JPEGs by about 30% on average. +[14] Completed the ARM 64-bit (ARMv8) NEON SIMD implementation. 64-bit ARM +now has SIMD coverage for all of the algorithms that are covered in the 32-bit +(ARMv7) implementation, except for h2v1 (4:2:2) fancy upsampling. +Additionally, the ARM 64-bit SIMD implementation now accelerates the slow +integer forward DCT and h2v2 & h2v1 downsampling algorithms, which are not +accelerated in the 32-bit implementation. + 1.4.2 ===== diff --git a/simd/jsimd.h b/simd/jsimd.h index e259feab..1c598f05 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -360,6 +360,11 @@ EXTERN(void) jsimd_h2v1_downsample_sse2 JDIMENSION v_samp_factor, JDIMENSION width_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); +EXTERN(void) jsimd_h2v1_downsample_neon + (JDIMENSION image_width, int max_v_samp_factor, + JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JSAMPARRAY input_data, JSAMPARRAY output_data); + EXTERN(void) jsimd_h2v1_downsample_mips_dspr2 (JDIMENSION image_width, int max_v_samp_factor, JDIMENSION v_samp_factor, JDIMENSION width_blocks, @@ -381,6 +386,11 @@ EXTERN(void) jsimd_h2v2_downsample_sse2 JDIMENSION v_samp_factor, JDIMENSION width_blocks, JSAMPARRAY input_data, JSAMPARRAY output_data); +EXTERN(void) jsimd_h2v2_downsample_neon + (JDIMENSION image_width, int max_v_samp_factor, + JDIMENSION v_samp_factor, JDIMENSION width_blocks, + JSAMPARRAY input_data, JSAMPARRAY output_data); + EXTERN(void) jsimd_h2v2_downsample_mips_dspr2 (JDIMENSION image_width, int max_v_samp_factor, JDIMENSION v_samp_factor, JDIMENSION width_blocks, @@ -680,6 +690,8 @@ EXTERN(void) jsimd_fdct_islow_mmx (DCTELEM * data); extern const int jconst_fdct_islow_sse2[]; EXTERN(void) jsimd_fdct_islow_sse2 (DCTELEM * data); +EXTERN(void) jsimd_fdct_islow_neon (DCTELEM * data); + EXTERN(void) jsimd_fdct_islow_mips_dspr2 (DCTELEM * data); EXTERN(void) jsimd_fdct_islow_altivec (DCTELEM * data); diff --git a/simd/jsimd_arm64.c b/simd/jsimd_arm64.c index 585feeb9..2b0e6f77 100644 --- a/simd/jsimd_arm64.c +++ b/simd/jsimd_arm64.c @@ -2,8 +2,8 @@ * jsimd_arm64.c * * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright 2009-2011, 2013-2014 D. R. Commander - * Copyright 2015 Matthieu Darbois + * Copyright 2009-2011, 2013-2014, 2016 D. R. Commander + * Copyright 2015-2016 Matthieu Darbois * * Based on the x86 SIMD extension for IJG JPEG library, * Copyright (C) 1999-2006, MIYASAKA Masaru. @@ -66,6 +66,17 @@ jsimd_can_rgb_ycc (void) { init_simd(); + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4)) + return 0; + + if (simd_support & JSIMD_ARM_NEON) + return 1; + return 0; } @@ -118,6 +129,37 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { + void (*neonfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int); + + switch(cinfo->in_color_space) { + case JCS_EXT_RGB: + neonfct=jsimd_extrgb_ycc_convert_neon; + break; + case JCS_EXT_RGBX: + case JCS_EXT_RGBA: + neonfct=jsimd_extrgbx_ycc_convert_neon; + break; + case JCS_EXT_BGR: + neonfct=jsimd_extbgr_ycc_convert_neon; + break; + case JCS_EXT_BGRX: + case JCS_EXT_BGRA: + neonfct=jsimd_extbgrx_ycc_convert_neon; + break; + case JCS_EXT_XBGR: + case JCS_EXT_ABGR: + neonfct=jsimd_extxbgr_ycc_convert_neon; + break; + case JCS_EXT_XRGB: + case JCS_EXT_ARGB: + neonfct=jsimd_extxrgb_ycc_convert_neon; + break; + default: + neonfct=jsimd_extrgb_ycc_convert_neon; + break; + } + + neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows); } GLOBAL(void) @@ -162,8 +204,7 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo, break; } - if (simd_support & JSIMD_ARM_NEON) - neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows); + neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows); } GLOBAL(void) @@ -171,9 +212,8 @@ jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row, - output_buf, num_rows); + jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row, + output_buf, num_rows); } GLOBAL(int) @@ -181,6 +221,17 @@ jsimd_can_h2v2_downsample (void) { init_simd(); + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (DCTSIZE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ARM_NEON) + return 1; + return 0; } @@ -189,6 +240,17 @@ jsimd_can_h2v1_downsample (void) { init_simd(); + /* The code is optimised for these values only */ + if (BITS_IN_JSAMPLE != 8) + return 0; + if (DCTSIZE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + + if (simd_support & JSIMD_ARM_NEON) + return 1; + return 0; } @@ -196,12 +258,18 @@ GLOBAL(void) jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { + jsimd_h2v2_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor, + compptr->v_samp_factor, compptr->width_in_blocks, + input_data, output_data); } GLOBAL(void) jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { + jsimd_h2v1_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor, + compptr->v_samp_factor, compptr->width_in_blocks, + input_data, output_data); } GLOBAL(int) @@ -305,6 +373,19 @@ jsimd_can_convsamp (void) { init_simd(); + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (BITS_IN_JSAMPLE != 8) + return 0; + if (sizeof(JDIMENSION) != 4) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ARM_NEON) + return 1; + return 0; } @@ -320,6 +401,7 @@ GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace) { + jsimd_convsamp_neon(sample_data, start_col, workspace); } GLOBAL(void) @@ -333,6 +415,15 @@ jsimd_can_fdct_islow (void) { init_simd(); + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ARM_NEON) + return 1; + return 0; } @@ -341,6 +432,15 @@ jsimd_can_fdct_ifast (void) { init_simd(); + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ARM_NEON) + return 1; + return 0; } @@ -355,11 +455,13 @@ jsimd_can_fdct_float (void) GLOBAL(void) jsimd_fdct_islow (DCTELEM * data) { + jsimd_fdct_islow_neon(data); } GLOBAL(void) jsimd_fdct_ifast (DCTELEM * data) { + jsimd_fdct_ifast_neon(data); } GLOBAL(void) @@ -372,6 +474,17 @@ jsimd_can_quantize (void) { init_simd(); + /* The code is optimised for these values only */ + if (DCTSIZE != 8) + return 0; + if (sizeof(JCOEF) != 2) + return 0; + if (sizeof(DCTELEM) != 2) + return 0; + + if (simd_support & JSIMD_ARM_NEON) + return 1; + return 0; } @@ -387,6 +500,7 @@ GLOBAL(void) jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace) { + jsimd_quantize_neon(coef_block, divisors, workspace); } GLOBAL(void) @@ -446,9 +560,8 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(void) @@ -456,9 +569,8 @@ jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(int) @@ -522,9 +634,8 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(void) @@ -532,9 +643,8 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - if (simd_support & JSIMD_ARM_NEON) - jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, - output_col); + jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, + output_col); } GLOBAL(void) diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index 89fc6603..040386d5 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -7,6 +7,7 @@ * Copyright (C) 2013-2014, Linaro Limited * Author: Ragesh Radhakrishnan * Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. + * Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -91,6 +92,35 @@ _\fname: transpose_4x4_32 \x0,.2s, \x1,.2s, \x2,.2s,\x3,.2s,\x5,.16b .endm +.macro transpose_8x8 l0, l1, l2, l3, l4, l5, l6, l7, t0, t1, t2, t3 + trn1 \t0\().8h, \l0\().8h, \l1\().8h + trn1 \t1\().8h, \l2\().8h, \l3\().8h + trn1 \t2\().8h, \l4\().8h, \l5\().8h + trn1 \t3\().8h, \l6\().8h, \l7\().8h + trn2 \l1\().8h, \l0\().8h, \l1\().8h + trn2 \l3\().8h, \l2\().8h, \l3\().8h + trn2 \l5\().8h, \l4\().8h, \l5\().8h + trn2 \l7\().8h, \l6\().8h, \l7\().8h + + trn1 \l4\().4s, \t2\().4s, \t3\().4s + trn2 \t3\().4s, \t2\().4s, \t3\().4s + trn1 \t2\().4s, \t0\().4s, \t1\().4s + trn2 \l2\().4s, \t0\().4s, \t1\().4s + trn1 \t0\().4s, \l1\().4s, \l3\().4s + trn2 \l3\().4s, \l1\().4s, \l3\().4s + trn2 \t1\().4s, \l5\().4s, \l7\().4s + trn1 \l5\().4s, \l5\().4s, \l7\().4s + + trn2 \l6\().2d, \l2\().2d, \t3\().2d + trn1 \l0\().2d, \t2\().2d, \l4\().2d + trn1 \l1\().2d, \t0\().2d, \l5\().2d + trn2 \l7\().2d, \l3\().2d, \t1\().2d + trn1 \l2\().2d, \l2\().2d, \t3\().2d + trn2 \l4\().2d, \t2\().2d, \l4\().2d + trn1 \l3\().2d, \l3\().2d, \t1\().2d + trn2 \l5\().2d, \t0\().2d, \l5\().2d +.endm + #define CENTERJSAMPLE 128 @@ -1055,6 +1085,7 @@ asm_function jsimd_idct_ifast_neon .unreq TMP2 .unreq TMP3 .unreq TMP4 + .unreq TMP5 /*****************************************************************************/ @@ -1859,3 +1890,1183 @@ generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, .4h, 2, .4h, 3, .4h, . generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b .purgem do_load .purgem do_store + +/*****************************************************************************/ + +/* + * jsimd_extrgb_ycc_convert_neon + * jsimd_extbgr_ycc_convert_neon + * jsimd_extrgbx_ycc_convert_neon + * jsimd_extbgrx_ycc_convert_neon + * jsimd_extxbgr_ycc_convert_neon + * jsimd_extxrgb_ycc_convert_neon + * + * Colorspace conversion RGB -> YCbCr + */ + +.macro do_store size + .if \size == 8 + st1 {v20.8b}, [Y], #8 + st1 {v21.8b}, [U], #8 + st1 {v22.8b}, [V], #8 + .elseif \size == 4 + st1 {v20.b}[0], [Y], #1 + st1 {v20.b}[1], [Y], #1 + st1 {v20.b}[2], [Y], #1 + st1 {v20.b}[3], [Y], #1 + st1 {v21.b}[0], [U], #1 + st1 {v21.b}[1], [U], #1 + st1 {v21.b}[2], [U], #1 + st1 {v21.b}[3], [U], #1 + st1 {v22.b}[0], [V], #1 + st1 {v22.b}[1], [V], #1 + st1 {v22.b}[2], [V], #1 + st1 {v22.b}[3], [V], #1 + .elseif \size == 2 + st1 {v20.b}[4], [Y], #1 + st1 {v20.b}[5], [Y], #1 + st1 {v21.b}[4], [U], #1 + st1 {v21.b}[5], [U], #1 + st1 {v22.b}[4], [V], #1 + st1 {v22.b}[5], [V], #1 + .elseif \size == 1 + st1 {v20.b}[6], [Y], #1 + st1 {v21.b}[6], [U], #1 + st1 {v22.b}[6], [V], #1 + .else + .error unsupported macroblock size + .endif +.endm + +.macro do_load bpp, size + .if \bpp == 24 + .if \size == 8 + ld3 {v10.8b, v11.8b, v12.8b}, [RGB], #24 + prfm pldl1keep, [RGB, #128] + .elseif \size == 4 + ld3 {v10.b, v11.b, v12.b}[0], [RGB], #3 + ld3 {v10.b, v11.b, v12.b}[1], [RGB], #3 + ld3 {v10.b, v11.b, v12.b}[2], [RGB], #3 + ld3 {v10.b, v11.b, v12.b}[3], [RGB], #3 + .elseif \size == 2 + ld3 {v10.b, v11.b, v12.b}[4], [RGB], #3 + ld3 {v10.b, v11.b, v12.b}[5], [RGB], #3 + .elseif \size == 1 + ld3 {v10.b, v11.b, v12.b}[6], [RGB], #3 + .else + .error unsupported macroblock size + .endif + .elseif \bpp == 32 + .if \size == 8 + ld4 {v10.8b, v11.8b, v12.8b, v13.8b}, [RGB], #32 + prfm pldl1keep, [RGB, #128] + .elseif \size == 4 + ld4 {v10.b, v11.b, v12.b, v13.b}[0], [RGB], #4 + ld4 {v10.b, v11.b, v12.b, v13.b}[1], [RGB], #4 + ld4 {v10.b, v11.b, v12.b, v13.b}[2], [RGB], #4 + ld4 {v10.b, v11.b, v12.b, v13.b}[3], [RGB], #4 + .elseif \size == 2 + ld4 {v10.b, v11.b, v12.b, v13.b}[4], [RGB], #4 + ld4 {v10.b, v11.b, v12.b, v13.b}[5], [RGB], #4 + .elseif \size == 1 + ld4 {v10.b, v11.b, v12.b, v13.b}[6], [RGB], #4 + .else + .error unsupported macroblock size + .endif + .else + .error unsupported bpp + .endif +.endm + +.macro generate_jsimd_rgb_ycc_convert_neon colorid, bpp, r_offs, g_offs, b_offs + +/* + * 2-stage pipelined RGB->YCbCr conversion + */ + +.macro do_rgb_to_yuv_stage1 + ushll v4.8h, v1\r_offs\().8b, #0 /* r = { d4, d5 } */ + ushll v6.8h, v1\g_offs\().8b, #0 /* g = { d6, d7 } */ + ushll v8.8h, v1\b_offs\().8b, #0 /* b = { d8, d9 } */ + ins v5.d[0], v4.d[1] + ins v7.d[0], v6.d[1] + ins v9.d[0], v8.d[1] + rev64 v18.4s, v1.4s + rev64 v26.4s, v1.4s + rev64 v28.4s, v1.4s + rev64 v30.4s, v1.4s + umull v14.4s, v4.4h, v0.h[0] + umull v16.4s, v5.4h, v0.h[0] + umlsl v18.4s, v4.4h, v0.h[3] + umlsl v26.4s, v5.4h, v0.h[3] + umlal v28.4s, v4.4h, v0.h[5] + umlal v30.4s, v5.4h, v0.h[5] + umlal v14.4s, v6.4h, v0.h[1] + umlal v16.4s, v7.4h, v0.h[1] + umlsl v18.4s, v6.4h, v0.h[4] + umlsl v26.4s, v7.4h, v0.h[4] + umlsl v28.4s, v6.4h, v0.h[6] + umlsl v30.4s, v7.4h, v0.h[6] + umlal v14.4s, v8.4h, v0.h[2] + umlal v16.4s, v9.4h, v0.h[2] + umlal v18.4s, v8.4h, v0.h[5] + umlal v26.4s, v9.4h, v0.h[5] + umlsl v28.4s, v8.4h, v0.h[7] + umlsl v30.4s, v9.4h, v0.h[7] +.endm + +.macro do_rgb_to_yuv_stage2 + rshrn v20.4h, v14.4s, #16 + rshrn v21.4h, v16.4s, #16 + shrn v22.4h, v18.4s, #16 + shrn v23.4h, v26.4s, #16 + shrn v24.4h, v28.4s, #16 + shrn v25.4h, v30.4s, #16 + ins v20.d[1], v21.d[0] + ins v22.d[1], v23.d[0] + ins v24.d[1], v25.d[0] + xtn v20.8b, v20.8h /* v20 = y */ + xtn v21.8b, v22.8h /* v21 = u */ + xtn v22.8b, v24.8h /* v22 = v */ +.endm + +.macro do_rgb_to_yuv + do_rgb_to_yuv_stage1 + do_rgb_to_yuv_stage2 +.endm + +.macro do_rgb_to_yuv_stage2_store_load_stage1 + rshrn v20.4h, v14.4s, #16 + rshrn v21.4h, v16.4s, #16 + shrn v22.4h, v18.4s, #16 + rev64 v18.4s, v1.4s + shrn v23.4h, v26.4s, #16 + ins v20.d[1], v21.d[0] + rev64 v26.4s, v1.4s + shrn v24.4h, v28.4s, #16 + shrn v25.4h, v30.4s, #16 + ins v22.d[1], v23.d[0] + do_load \bpp, 8 + xtn v20.8b, v20.8h /* dv0 = y */ + ins v24.d[1], v25.d[0] + ushll v4.8h, v1\r_offs\().8b, #0 /* r = { v4.8h } */ + xtn v21.8b, v22.8h /* v21 = u */ + ushll v6.8h, v1\g_offs\().8b, #0 /* g = { v6.8h } */ + ushll v8.8h, v1\b_offs\().8b, #0 /* b = { v8.8h } */ + xtn v22.8b, v24.8h /* v22 = v */ + ins v5.d[0], v4.d[1] + ins v7.d[0], v6.d[1] + ins v9.d[0], v8.d[1] + st1 {v20.8b}, [Y], #8 + umull v14.4s, v4.4h, v0.h[0] + umull v16.4s, v5.4h, v0.h[0] + umlsl v18.4s, v4.4h, v0.h[3] + umlal v14.4s, v6.4h, v0.h[1] + umlal v16.4s, v7.4h, v0.h[1] + umlsl v18.4s, v6.4h, v0.h[4] + umlal v14.4s, v8.4h, v0.h[2] + umlal v16.4s, v9.4h, v0.h[2] + umlal v18.4s, v8.4h, v0.h[5] + rev64 v28.4s, v1.4s + rev64 v30.4s, v1.4s + st1 {v21.8b}, [U], #8 + umlsl v26.4s, v5.4h, v0.h[3] + umlal v28.4s, v4.4h, v0.h[5] + umlal v30.4s, v5.4h, v0.h[5] + st1 {v22.8b}, [V], #8 + umlsl v26.4s, v7.4h, v0.h[4] + umlsl v28.4s, v6.4h, v0.h[6] + umlsl v30.4s, v7.4h, v0.h[6] + umlal v26.4s, v9.4h, v0.h[5] + umlsl v28.4s, v8.4h, v0.h[7] + umlsl v30.4s, v9.4h, v0.h[7] +.endm + +.balign 16 +Ljsimd_\colorid\()_ycc_neon_consts: + .short 19595, 38470, 7471, 11059 + .short 21709, 32768, 27439, 5329 + .short 32767, 128, 32767, 128 + .short 32767, 128, 32767, 128 + +asm_function jsimd_\colorid\()_ycc_convert_neon + OUTPUT_WIDTH .req w0 + INPUT_BUF .req x1 + OUTPUT_BUF .req x2 + OUTPUT_ROW .req x3 + NUM_ROWS .req x4 + + OUTPUT_BUF0 .req x5 + OUTPUT_BUF1 .req x6 + OUTPUT_BUF2 .req x2 /* OUTPUT_BUF */ + + RGB .req x7 + Y .req x9 + U .req x10 + V .req x11 + N .req w12 + + /* Load constants to d0, d1, d2, d3 */ + adr x13, Ljsimd_\colorid\()_ycc_neon_consts + ld1 {v0.8h, v1.8h}, [x13] + + ldr OUTPUT_BUF0, [OUTPUT_BUF] + ldr OUTPUT_BUF1, [OUTPUT_BUF, #8] + ldr OUTPUT_BUF2, [OUTPUT_BUF, #16] + .unreq OUTPUT_BUF + + /* Save NEON registers */ + sub sp, sp, #64 + st1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 + st1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 + + /* Outer loop over scanlines */ + cmp NUM_ROWS, #1 + b.lt 9f +0: + ldr Y, [OUTPUT_BUF0, OUTPUT_ROW, lsl #3] + ldr U, [OUTPUT_BUF1, OUTPUT_ROW, lsl #3] + mov N, OUTPUT_WIDTH + ldr V, [OUTPUT_BUF2, OUTPUT_ROW, lsl #3] + add OUTPUT_ROW, OUTPUT_ROW, #1 + ldr RGB, [INPUT_BUF], #8 + + /* Inner loop over pixels */ + subs N, N, #8 + b.lt 3f + do_load \bpp, 8 + do_rgb_to_yuv_stage1 + subs N, N, #8 + b.lt 2f +1: + do_rgb_to_yuv_stage2_store_load_stage1 + subs N, N, #8 + b.ge 1b +2: + do_rgb_to_yuv_stage2 + do_store 8 + tst N, #7 + b.eq 8f +3: + tbz N, #2, 3f + do_load \bpp, 4 +3: + tbz N, #1, 4f + do_load \bpp, 2 +4: + tbz N, #0, 5f + do_load \bpp, 1 +5: + do_rgb_to_yuv + tbz N, #2, 6f + do_store 4 +6: + tbz N, #1, 7f + do_store 2 +7: + tbz N, #0, 8f + do_store 1 +8: + subs NUM_ROWS, NUM_ROWS, #1 + b.gt 0b +9: + /* Restore all registers and return */ + sub sp, sp, #64 + ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 + ld1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 + br x30 + + .unreq OUTPUT_WIDTH + .unreq OUTPUT_ROW + .unreq INPUT_BUF + .unreq NUM_ROWS + .unreq OUTPUT_BUF0 + .unreq OUTPUT_BUF1 + .unreq OUTPUT_BUF2 + .unreq RGB + .unreq Y + .unreq U + .unreq V + .unreq N + +.purgem do_rgb_to_yuv +.purgem do_rgb_to_yuv_stage1 +.purgem do_rgb_to_yuv_stage2 +.purgem do_rgb_to_yuv_stage2_store_load_stage1 + +.endm + +/*--------------------------------- id ----- bpp R G B */ +generate_jsimd_rgb_ycc_convert_neon extrgb, 24, 0, 1, 2 +generate_jsimd_rgb_ycc_convert_neon extbgr, 24, 2, 1, 0 +generate_jsimd_rgb_ycc_convert_neon extrgbx, 32, 0, 1, 2 +generate_jsimd_rgb_ycc_convert_neon extbgrx, 32, 2, 1, 0 +generate_jsimd_rgb_ycc_convert_neon extxbgr, 32, 3, 2, 1 +generate_jsimd_rgb_ycc_convert_neon extxrgb, 32, 1, 2, 3 + +.purgem do_load +.purgem do_store + +/*****************************************************************************/ + +/* + * Load data into workspace, applying unsigned->signed conversion + * + * TODO: can be combined with 'jsimd_fdct_ifast_neon' to get + * rid of VST1.16 instructions + */ + +asm_function jsimd_convsamp_neon + SAMPLE_DATA .req x0 + START_COL .req x1 + WORKSPACE .req x2 + TMP1 .req x9 + TMP2 .req x10 + TMP3 .req x11 + TMP4 .req x12 + TMP5 .req x13 + TMP6 .req x14 + TMP7 .req x15 + TMP8 .req x4 + TMPDUP .req w3 + + + mov TMPDUP, #128 + ldp TMP1, TMP2, [SAMPLE_DATA], 16 + ldp TMP3, TMP4, [SAMPLE_DATA], 16 + dup v0.8b, TMPDUP + add TMP1, TMP1, START_COL + add TMP2, TMP2, START_COL + ldp TMP5, TMP6, [SAMPLE_DATA], 16 + add TMP3, TMP3, START_COL + add TMP4, TMP4, START_COL + ldp TMP7, TMP8, [SAMPLE_DATA], 16 + add TMP5, TMP5, START_COL + add TMP6, TMP6, START_COL + ld1 {v16.8b}, [TMP1] + add TMP7, TMP7, START_COL + add TMP8, TMP8, START_COL + ld1 {v17.8b}, [TMP2] + usubl v16.8h, v16.8b, v0.8b + ld1 {v18.8b}, [TMP3] + usubl v17.8h, v17.8b, v0.8b + ld1 {v19.8b}, [TMP4] + usubl v18.8h, v18.8b, v0.8b + ld1 {v20.8b}, [TMP5] + usubl v19.8h, v19.8b, v0.8b + ld1 {v21.8b}, [TMP6] + st1 {v16.8h, v17.8h, v18.8h, v19.8h}, [WORKSPACE], 64 + usubl v20.8h, v20.8b, v0.8b + ld1 {v22.8b}, [TMP7] + usubl v21.8h, v21.8b, v0.8b + ld1 {v23.8b}, [TMP8] + usubl v22.8h, v22.8b, v0.8b + usubl v23.8h, v23.8b, v0.8b + st1 {v20.8h, v21.8h, v22.8h, v23.8h}, [WORKSPACE], 64 + + br x30 + + .unreq SAMPLE_DATA + .unreq START_COL + .unreq WORKSPACE + .unreq TMP1 + .unreq TMP2 + .unreq TMP3 + .unreq TMP4 + .unreq TMP5 + .unreq TMP6 + .unreq TMP7 + .unreq TMP8 + .unreq TMPDUP + +/*****************************************************************************/ + +/* + * jsimd_fdct_islow_neon + * + * This file contains a slow-but-accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). The following code is based + * directly on the IJG''s original jfdctint.c; see the jfdctint.c for + * more details. + * + * TODO: can be combined with 'jsimd_convsamp_neon' to get + * rid of a bunch of VLD1.16 instructions + */ + +#define CONST_BITS 13 +#define PASS1_BITS 2 + +#define DESCALE_P1 (CONST_BITS-PASS1_BITS) +#define DESCALE_P2 (CONST_BITS+PASS1_BITS) + +#if CONST_BITS == 13 +#define F_0_298 2446 /* FIX(0.298631336) */ +#define F_0_390 3196 /* FIX(0.390180644) */ +#define F_0_541 4433 /* FIX(0.541196100) */ +#define F_0_765 6270 /* FIX(0.765366865) */ +#define F_0_899 7373 /* FIX(0.899976223) */ +#define F_1_175 9633 /* FIX(1.175875602) */ +#define F_1_501 12299 /* FIX(1.501321110) */ +#define F_1_847 15137 /* FIX(1.847759065) */ +#define F_1_961 16069 /* FIX(1.961570560) */ +#define F_2_053 16819 /* FIX(2.053119869) */ +#define F_2_562 20995 /* FIX(2.562915447) */ +#define F_3_072 25172 /* FIX(3.072711026) */ +#else +#define DESCALE(x,n) (((x)+(1<<((n)-1)))>>(n)) +#define F_0_298 DESCALE( 320652955, 30-CONST_BITS) /* FIX(0.298631336) */ +#define F_0_390 DESCALE( 418953276, 30-CONST_BITS) /* FIX(0.390180644) */ +#define F_0_541 DESCALE( 581104887, 30-CONST_BITS) /* FIX(0.541196100) */ +#define F_0_765 DESCALE( 821806413, 30-CONST_BITS) /* FIX(0.765366865) */ +#define F_0_899 DESCALE( 966342111, 30-CONST_BITS) /* FIX(0.899976223) */ +#define F_1_175 DESCALE(1262586813, 30-CONST_BITS) /* FIX(1.175875602) */ +#define F_1_501 DESCALE(1612031267, 30-CONST_BITS) /* FIX(1.501321110) */ +#define F_1_847 DESCALE(1984016188, 30-CONST_BITS) /* FIX(1.847759065) */ +#define F_1_961 DESCALE(2106220350, 30-CONST_BITS) /* FIX(1.961570560) */ +#define F_2_053 DESCALE(2204520673, 30-CONST_BITS) /* FIX(2.053119869) */ +#define F_2_562 DESCALE(2751909506, 30-CONST_BITS) /* FIX(2.562915447) */ +#define F_3_072 DESCALE(3299298341, 30-CONST_BITS) /* FIX(3.072711026) */ +#endif + +.balign 16 +Ljsimd_fdct_islow_neon_consts: + .short F_0_298 + .short -F_0_390 + .short F_0_541 + .short F_0_765 + .short - F_0_899 + .short F_1_175 + .short F_1_501 + .short - F_1_847 + .short - F_1_961 + .short F_2_053 + .short - F_2_562 + .short F_3_072 + .short 0 /* padding */ + .short 0 + .short 0 + .short 0 + +#undef F_0_298 +#undef F_0_390 +#undef F_0_541 +#undef F_0_765 +#undef F_0_899 +#undef F_1_175 +#undef F_1_501 +#undef F_1_847 +#undef F_1_961 +#undef F_2_053 +#undef F_2_562 +#undef F_3_072 +#define XFIX_P_0_298 v0.h[0] +#define XFIX_N_0_390 v0.h[1] +#define XFIX_P_0_541 v0.h[2] +#define XFIX_P_0_765 v0.h[3] +#define XFIX_N_0_899 v0.h[4] +#define XFIX_P_1_175 v0.h[5] +#define XFIX_P_1_501 v0.h[6] +#define XFIX_N_1_847 v0.h[7] +#define XFIX_N_1_961 v1.h[0] +#define XFIX_P_2_053 v1.h[1] +#define XFIX_N_2_562 v1.h[2] +#define XFIX_P_3_072 v1.h[3] + +asm_function jsimd_fdct_islow_neon + + DATA .req x0 + TMP .req x9 + + /* Load constants */ + adr TMP, Ljsimd_fdct_islow_neon_consts + ld1 {v0.8h, v1.8h}, [TMP] + + /* Save NEON registers */ + sub sp, sp, #64 + st1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 + st1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 + + /* Load all DATA into NEON registers with the following allocation: + * 0 1 2 3 | 4 5 6 7 + * ---------+-------- + * 0 | d16 | d17 | v16.8h + * 1 | d18 | d19 | v17.8h + * 2 | d20 | d21 | v18.8h + * 3 | d22 | d23 | v19.8h + * 4 | d24 | d25 | v20.8h + * 5 | d26 | d27 | v21.8h + * 6 | d28 | d29 | v22.8h + * 7 | d30 | d31 | v23.8h + */ + + ld1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 + ld1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] + sub DATA, DATA, #64 + + /* Transpose */ + transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v31, v2, v3, v4 + /* 1-D FDCT */ + add v24.8h, v16.8h, v23.8h /* tmp0 = dataptr[0] + dataptr[7]; */ + sub v31.8h, v16.8h, v23.8h /* tmp7 = dataptr[0] - dataptr[7]; */ + add v25.8h, v17.8h, v22.8h /* tmp1 = dataptr[1] + dataptr[6]; */ + sub v30.8h, v17.8h, v22.8h /* tmp6 = dataptr[1] - dataptr[6]; */ + add v26.8h, v18.8h, v21.8h /* tmp2 = dataptr[2] + dataptr[5]; */ + sub v29.8h, v18.8h, v21.8h /* tmp5 = dataptr[2] - dataptr[5]; */ + add v27.8h, v19.8h, v20.8h /* tmp3 = dataptr[3] + dataptr[4]; */ + sub v28.8h, v19.8h, v20.8h /* tmp4 = dataptr[3] - dataptr[4]; */ + + /* even part */ + + add v8.8h, v24.8h, v27.8h /* tmp10 = tmp0 + tmp3; */ + sub v9.8h, v24.8h, v27.8h /* tmp13 = tmp0 - tmp3; */ + add v10.8h, v25.8h, v26.8h /* tmp11 = tmp1 + tmp2; */ + sub v11.8h, v25.8h, v26.8h /* tmp12 = tmp1 - tmp2; */ + + add v16.8h, v8.8h, v10.8h /* tmp10 + tmp11 */ + sub v20.8h, v8.8h, v10.8h /* tmp10 - tmp11 */ + + add v18.8h, v11.8h, v9.8h /* tmp12 + tmp13 */ + + shl v16.8h, v16.8h, #PASS1_BITS /* dataptr[0] = (DCTELEM) LEFT_SHIFT(tmp10 + tmp11, PASS1_BITS); */ + shl v20.8h, v20.8h, #PASS1_BITS /* dataptr[4] = (DCTELEM) LEFT_SHIFT(tmp10 - tmp11, PASS1_BITS); */ + + smull2 v24.4s, v18.8h, XFIX_P_0_541 /* z1 hi = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1 lo = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ + mov v22.16b, v18.16b + mov v25.16b, v24.16b + + smlal v18.4s, v9.4h, XFIX_P_0_765 /* lo z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ + smlal2 v24.4s, v9.8h, XFIX_P_0_765 /* hi z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ + smlal v22.4s, v11.4h, XFIX_N_1_847 /* lo z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ + smlal2 v25.4s, v11.8h, XFIX_N_1_847 /* hi z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ + + rshrn v18.4h, v18.4s, #DESCALE_P1 + rshrn v22.4h, v22.4s, #DESCALE_P1 + rshrn2 v18.8h, v24.4s, #DESCALE_P1 /* dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, XFIX_P_0_765), + CONST_BITS-PASS1_BITS); */ + rshrn2 v22.8h, v25.4s, #DESCALE_P1 /* dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, XFIX_N_1_847), + CONST_BITS-PASS1_BITS); */ + + /* Odd part */ + + add v8.8h, v28.8h, v31.8h /* z1 = tmp4 + tmp7; */ + add v9.8h, v29.8h, v30.8h /* z2 = tmp5 + tmp6; */ + add v10.8h, v28.8h, v30.8h /* z3 = tmp4 + tmp6; */ + add v11.8h, v29.8h, v31.8h /* z4 = tmp5 + tmp7; */ + smull v4.4s, v10.4h, XFIX_P_1_175 /* z5 lo = z3 lo * XFIX_P_1_175 */ + smull2 v5.4s, v10.8h, XFIX_P_1_175 + smlal v4.4s, v11.4h, XFIX_P_1_175 /* z5 = MULTIPLY(z3 + z4, FIX_1_175875602); */ + smlal2 v5.4s, v11.8h, XFIX_P_1_175 + + smull2 v24.4s, v28.8h, XFIX_P_0_298 + smull2 v25.4s, v29.8h, XFIX_P_2_053 + smull2 v26.4s, v30.8h, XFIX_P_3_072 + smull2 v27.4s, v31.8h, XFIX_P_1_501 + smull v28.4s, v28.4h, XFIX_P_0_298 /* tmp4 = MULTIPLY(tmp4, FIX_0_298631336); */ + smull v29.4s, v29.4h, XFIX_P_2_053 /* tmp5 = MULTIPLY(tmp5, FIX_2_053119869); */ + smull v30.4s, v30.4h, XFIX_P_3_072 /* tmp6 = MULTIPLY(tmp6, FIX_3_072711026); */ + smull v31.4s, v31.4h, XFIX_P_1_501 /* tmp7 = MULTIPLY(tmp7, FIX_1_501321110); */ + + smull2 v12.4s, v8.8h, XFIX_N_0_899 + smull2 v13.4s, v9.8h, XFIX_N_2_562 + smull2 v14.4s, v10.8h, XFIX_N_1_961 + smull2 v15.4s, v11.8h, XFIX_N_0_390 + smull v8.4s, v8.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223); */ + smull v9.4s, v9.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447); */ + smull v10.4s, v10.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560); */ + smull v11.4s, v11.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644); */ + + add v10.4s, v10.4s, v4.4s /* z3 += z5 */ + add v14.4s, v14.4s, v5.4s + add v11.4s, v11.4s, v4.4s /* z4 += z5 */ + add v15.4s, v15.4s, v5.4s + + add v28.4s, v28.4s, v8.4s /* tmp4 += z1 */ + add v24.4s, v24.4s, v12.4s + add v29.4s, v29.4s, v9.4s /* tmp5 += z2 */ + add v25.4s, v25.4s, v13.4s + add v30.4s, v30.4s, v10.4s /* tmp6 += z3 */ + add v26.4s, v26.4s, v14.4s + add v31.4s, v31.4s, v11.4s /* tmp7 += z4 */ + add v27.4s, v27.4s, v15.4s + + add v28.4s, v28.4s, v10.4s /* tmp4 += z3 */ + add v24.4s, v24.4s, v14.4s + add v29.4s, v29.4s, v11.4s /* tmp5 += z4 */ + add v25.4s, v25.4s, v15.4s + add v30.4s, v30.4s, v9.4s /* tmp6 += z2 */ + add v26.4s, v26.4s, v13.4s + add v31.4s, v31.4s, v8.4s /* tmp7 += z1 */ + add v27.4s, v27.4s, v12.4s + + rshrn v23.4h, v28.4s, #DESCALE_P1 + rshrn v21.4h, v29.4s, #DESCALE_P1 + rshrn v19.4h, v30.4s, #DESCALE_P1 + rshrn v17.4h, v31.4s, #DESCALE_P1 + rshrn2 v23.8h, v24.4s, #DESCALE_P1 /* dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); */ + rshrn2 v21.8h, v25.4s, #DESCALE_P1 /* dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); */ + rshrn2 v19.8h, v26.4s, #DESCALE_P1 /* dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); */ + rshrn2 v17.8h, v27.4s, #DESCALE_P1 /* dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); */ + + /* Transpose */ + transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v31, v2, v3, v4 + + /* 1-D FDCT */ + add v24.8h, v16.8h, v23.8h /* tmp0 = dataptr[0] + dataptr[7]; */ + sub v31.8h, v16.8h, v23.8h /* tmp7 = dataptr[0] - dataptr[7]; */ + add v25.8h, v17.8h, v22.8h /* tmp1 = dataptr[1] + dataptr[6]; */ + sub v30.8h, v17.8h, v22.8h /* tmp6 = dataptr[1] - dataptr[6]; */ + add v26.8h, v18.8h, v21.8h /* tmp2 = dataptr[2] + dataptr[5]; */ + sub v29.8h, v18.8h, v21.8h /* tmp5 = dataptr[2] - dataptr[5]; */ + add v27.8h, v19.8h, v20.8h /* tmp3 = dataptr[3] + dataptr[4]; */ + sub v28.8h, v19.8h, v20.8h /* tmp4 = dataptr[3] - dataptr[4]; */ + + /* even part */ + + add v8.8h, v24.8h, v27.8h /* tmp10 = tmp0 + tmp3; */ + sub v9.8h, v24.8h, v27.8h /* tmp13 = tmp0 - tmp3; */ + add v10.8h, v25.8h, v26.8h /* tmp11 = tmp1 + tmp2; */ + sub v11.8h, v25.8h, v26.8h /* tmp12 = tmp1 - tmp2; */ + + add v16.8h, v8.8h, v10.8h /* tmp10 + tmp11 */ + sub v20.8h, v8.8h, v10.8h /* tmp10 - tmp11 */ + + add v18.8h, v11.8h, v9.8h /* tmp12 + tmp13 */ + + srshr v16.8h, v16.8h, #PASS1_BITS /* dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); */ + srshr v20.8h, v20.8h, #PASS1_BITS /* dataptr[4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); */ + + smull2 v24.4s, v18.8h, XFIX_P_0_541 /* z1 hi = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1 lo = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ + mov v22.16b, v18.16b + mov v25.16b, v24.16b + + smlal v18.4s, v9.4h, XFIX_P_0_765 /* lo z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ + smlal2 v24.4s, v9.8h, XFIX_P_0_765 /* hi z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ + smlal v22.4s, v11.4h, XFIX_N_1_847 /* lo z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ + smlal2 v25.4s, v11.8h, XFIX_N_1_847 /* hi z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ + + rshrn v18.4h, v18.4s, #DESCALE_P2 + rshrn v22.4h, v22.4s, #DESCALE_P2 + rshrn2 v18.8h, v24.4s, #DESCALE_P2 /* dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, XFIX_P_0_765), + CONST_BITS-PASS1_BITS); */ + rshrn2 v22.8h, v25.4s, #DESCALE_P2 /* dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, XFIX_N_1_847), + CONST_BITS-PASS1_BITS); */ + + /* Odd part */ + + add v8.8h, v28.8h, v31.8h /* z1 = tmp4 + tmp7; */ + add v9.8h, v29.8h, v30.8h /* z2 = tmp5 + tmp6; */ + add v10.8h, v28.8h, v30.8h /* z3 = tmp4 + tmp6; */ + add v11.8h, v29.8h, v31.8h /* z4 = tmp5 + tmp7; */ + + smull v4.4s, v10.4h, XFIX_P_1_175 /* z5 lo = z3 lo * XFIX_P_1_175 */ + smull2 v5.4s, v10.8h, XFIX_P_1_175 + smlal v4.4s, v11.4h, XFIX_P_1_175 /* z5 = MULTIPLY(z3 + z4, FIX_1_175875602); */ + smlal2 v5.4s, v11.8h, XFIX_P_1_175 + + smull2 v24.4s, v28.8h, XFIX_P_0_298 + smull2 v25.4s, v29.8h, XFIX_P_2_053 + smull2 v26.4s, v30.8h, XFIX_P_3_072 + smull2 v27.4s, v31.8h, XFIX_P_1_501 + smull v28.4s, v28.4h, XFIX_P_0_298 /* tmp4 = MULTIPLY(tmp4, FIX_0_298631336); */ + smull v29.4s, v29.4h, XFIX_P_2_053 /* tmp5 = MULTIPLY(tmp5, FIX_2_053119869); */ + smull v30.4s, v30.4h, XFIX_P_3_072 /* tmp6 = MULTIPLY(tmp6, FIX_3_072711026); */ + smull v31.4s, v31.4h, XFIX_P_1_501 /* tmp7 = MULTIPLY(tmp7, FIX_1_501321110); */ + + smull2 v12.4s, v8.8h, XFIX_N_0_899 + smull2 v13.4s, v9.8h, XFIX_N_2_562 + smull2 v14.4s, v10.8h, XFIX_N_1_961 + smull2 v15.4s, v11.8h, XFIX_N_0_390 + smull v8.4s, v8.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223); */ + smull v9.4s, v9.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447); */ + smull v10.4s, v10.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560); */ + smull v11.4s, v11.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644); */ + + add v10.4s, v10.4s, v4.4s + add v14.4s, v14.4s, v5.4s + add v11.4s, v11.4s, v4.4s + add v15.4s, v15.4s, v5.4s + + add v28.4s, v28.4s, v8.4s /* tmp4 += z1 */ + add v24.4s, v24.4s, v12.4s + add v29.4s, v29.4s, v9.4s /* tmp5 += z2 */ + add v25.4s, v25.4s, v13.4s + add v30.4s, v30.4s, v10.4s /* tmp6 += z3 */ + add v26.4s, v26.4s, v14.4s + add v31.4s, v31.4s, v11.4s /* tmp7 += z4 */ + add v27.4s, v27.4s, v15.4s + + add v28.4s, v28.4s, v10.4s /* tmp4 += z3 */ + add v24.4s, v24.4s, v14.4s + add v29.4s, v29.4s, v11.4s /* tmp5 += z4 */ + add v25.4s, v25.4s, v15.4s + add v30.4s, v30.4s, v9.4s /* tmp6 += z2 */ + add v26.4s, v26.4s, v13.4s + add v31.4s, v31.4s, v8.4s /* tmp7 += z1 */ + add v27.4s, v27.4s, v12.4s + + rshrn v23.4h, v28.4s, #DESCALE_P2 + rshrn v21.4h, v29.4s, #DESCALE_P2 + rshrn v19.4h, v30.4s, #DESCALE_P2 + rshrn v17.4h, v31.4s, #DESCALE_P2 + rshrn2 v23.8h, v24.4s, #DESCALE_P2 /* dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); */ + rshrn2 v21.8h, v25.4s, #DESCALE_P2 /* dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); */ + rshrn2 v19.8h, v26.4s, #DESCALE_P2 /* dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); */ + rshrn2 v17.8h, v27.4s, #DESCALE_P2 /* dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); */ + + /* store results */ + st1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 + st1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] + + /* Restore NEON registers */ + sub sp, sp, #64 + ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 + ld1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 + + br x30 + + .unreq DATA + .unreq TMP + +#undef XFIX_P_0_298 +#undef XFIX_N_0_390 +#undef XFIX_P_0_541 +#undef XFIX_P_0_765 +#undef XFIX_N_0_899 +#undef XFIX_P_1_175 +#undef XFIX_P_1_501 +#undef XFIX_N_1_847 +#undef XFIX_N_1_961 +#undef XFIX_P_2_053 +#undef XFIX_N_2_562 +#undef XFIX_P_3_072 + +/*****************************************************************************/ + +/* + * jsimd_fdct_ifast_neon + * + * This function contains a fast, not so accurate integer implementation of + * the forward DCT (Discrete Cosine Transform). It uses the same calculations + * and produces exactly the same output as IJG''s original 'jpeg_fdct_ifast' + * function from jfdctfst.c + * + * TODO: can be combined with 'jsimd_convsamp_neon' to get + * rid of a bunch of VLD1.16 instructions + */ + +#undef XFIX_0_541196100 +#define XFIX_0_382683433 v0.h[0] +#define XFIX_0_541196100 v0.h[1] +#define XFIX_0_707106781 v0.h[2] +#define XFIX_1_306562965 v0.h[3] + +.balign 16 +Ljsimd_fdct_ifast_neon_consts: + .short (98 * 128) /* XFIX_0_382683433 */ + .short (139 * 128) /* XFIX_0_541196100 */ + .short (181 * 128) /* XFIX_0_707106781 */ + .short (334 * 128 - 256 * 128) /* XFIX_1_306562965 */ + +asm_function jsimd_fdct_ifast_neon + + DATA .req x0 + TMP .req x9 + + /* Load constants */ + adr TMP, Ljsimd_fdct_ifast_neon_consts + ld1 {v0.4h}, [TMP] + + /* Load all DATA into NEON registers with the following allocation: + * 0 1 2 3 | 4 5 6 7 + * ---------+-------- + * 0 | d16 | d17 | v0.8h + * 1 | d18 | d19 | q9 + * 2 | d20 | d21 | q10 + * 3 | d22 | d23 | q11 + * 4 | d24 | d25 | q12 + * 5 | d26 | d27 | q13 + * 6 | d28 | d29 | q14 + * 7 | d30 | d31 | q15 + */ + + ld1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 + ld1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] + mov TMP, #2 + sub DATA, DATA, #64 +1: + /* Transpose */ + transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v1, v2, v3, v4 + subs TMP, TMP, #1 + /* 1-D FDCT */ + add v4.8h, v19.8h, v20.8h + sub v20.8h, v19.8h, v20.8h + sub v28.8h, v18.8h, v21.8h + add v18.8h, v18.8h, v21.8h + sub v29.8h, v17.8h, v22.8h + add v17.8h, v17.8h, v22.8h + sub v21.8h, v16.8h, v23.8h + add v16.8h, v16.8h, v23.8h + sub v6.8h, v17.8h, v18.8h + sub v7.8h, v16.8h, v4.8h + add v5.8h, v17.8h, v18.8h + add v6.8h, v6.8h, v7.8h + add v4.8h, v16.8h, v4.8h + sqdmulh v6.8h, v6.8h, XFIX_0_707106781 + add v19.8h, v20.8h, v28.8h + add v16.8h, v4.8h, v5.8h + sub v20.8h, v4.8h, v5.8h + add v5.8h, v28.8h, v29.8h + add v29.8h, v29.8h, v21.8h + sqdmulh v5.8h, v5.8h, XFIX_0_707106781 + sub v28.8h, v19.8h, v29.8h + add v18.8h, v7.8h, v6.8h + sqdmulh v28.8h, v28.8h, XFIX_0_382683433 + sub v22.8h, v7.8h, v6.8h + sqdmulh v19.8h, v19.8h, XFIX_0_541196100 + sqdmulh v7.8h, v29.8h, XFIX_1_306562965 + add v6.8h, v21.8h, v5.8h + sub v5.8h, v21.8h, v5.8h + add v29.8h, v29.8h, v28.8h + add v19.8h, v19.8h, v28.8h + add v29.8h, v29.8h, v7.8h + add v21.8h, v5.8h, v19.8h + sub v19.8h, v5.8h, v19.8h + add v17.8h, v6.8h, v29.8h + sub v23.8h, v6.8h, v29.8h + + b.ne 1b + + /* store results */ + st1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 + st1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] + + br x30 + + .unreq DATA + .unreq TMP +#undef XFIX_0_382683433 +#undef XFIX_0_541196100 +#undef XFIX_0_707106781 +#undef XFIX_1_306562965 + +/*****************************************************************************/ + +/* + * GLOBAL(void) + * jsimd_quantize_neon (JCOEFPTR coef_block, DCTELEM * divisors, + * DCTELEM * workspace); + * + */ +asm_function jsimd_quantize_neon + + COEF_BLOCK .req x0 + DIVISORS .req x1 + WORKSPACE .req x2 + + RECIPROCAL .req DIVISORS + CORRECTION .req x9 + SHIFT .req x10 + LOOP_COUNT .req x11 + + mov LOOP_COUNT, #2 + add CORRECTION, DIVISORS, #(64 * 2) + add SHIFT, DIVISORS, #(64 * 6) +1: + subs LOOP_COUNT, LOOP_COUNT, #1 + ld1 {v0.8h, v1.8h, v2.8h, v3.8h}, [WORKSPACE], 64 + ld1 {v4.8h, v5.8h, v6.8h, v7.8h}, [CORRECTION], 64 + abs v20.8h, v0.8h + abs v21.8h, v1.8h + abs v22.8h, v2.8h + abs v23.8h, v3.8h + ld1 {v28.8h, v29.8h, v30.8h, v31.8h}, [RECIPROCAL], 64 + add v20.8h, v20.8h, v4.8h /* add correction */ + add v21.8h, v21.8h, v5.8h + add v22.8h, v22.8h, v6.8h + add v23.8h, v23.8h, v7.8h + umull v4.4s, v20.4h, v28.4h /* multiply by reciprocal */ + umull2 v16.4s, v20.8h, v28.8h + umull v5.4s, v21.4h, v29.4h + umull2 v17.4s, v21.8h, v29.8h + umull v6.4s, v22.4h, v30.4h /* multiply by reciprocal */ + umull2 v18.4s, v22.8h, v30.8h + umull v7.4s, v23.4h, v31.4h + umull2 v19.4s, v23.8h, v31.8h + ld1 {v24.8h, v25.8h, v26.8h, v27.8h}, [SHIFT], 64 + shrn v4.4h, v4.4s, #16 + shrn v5.4h, v5.4s, #16 + shrn v6.4h, v6.4s, #16 + shrn v7.4h, v7.4s, #16 + shrn2 v4.8h, v16.4s, #16 + shrn2 v5.8h, v17.4s, #16 + shrn2 v6.8h, v18.4s, #16 + shrn2 v7.8h, v19.4s, #16 + neg v24.8h, v24.8h + neg v25.8h, v25.8h + neg v26.8h, v26.8h + neg v27.8h, v27.8h + sshr v0.8h, v0.8h, #15 /* extract sign */ + sshr v1.8h, v1.8h, #15 + sshr v2.8h, v2.8h, #15 + sshr v3.8h, v3.8h, #15 + ushl v4.8h, v4.8h, v24.8h /* shift */ + ushl v5.8h, v5.8h, v25.8h + ushl v6.8h, v6.8h, v26.8h + ushl v7.8h, v7.8h, v27.8h + + eor v4.16b, v4.16b, v0.16b /* restore sign */ + eor v5.16b, v5.16b, v1.16b + eor v6.16b, v6.16b, v2.16b + eor v7.16b, v7.16b, v3.16b + sub v4.8h, v4.8h, v0.8h + sub v5.8h, v5.8h, v1.8h + sub v6.8h, v6.8h, v2.8h + sub v7.8h, v7.8h, v3.8h + st1 {v4.8h, v5.8h, v6.8h, v7.8h}, [COEF_BLOCK], 64 + + b.ne 1b + + br x30 /* return */ + + .unreq COEF_BLOCK + .unreq DIVISORS + .unreq WORKSPACE + .unreq RECIPROCAL + .unreq CORRECTION + .unreq SHIFT + .unreq LOOP_COUNT + +/*****************************************************************************/ + +/* + * Downsample pixel values of a single component. + * This version handles the common case of 2:1 horizontal and 1:1 vertical, + * without smoothing. + * + * GLOBAL(void) + * jsimd_h2v1_downsample_neon (JDIMENSION image_width, int max_v_samp_factor, + * JDIMENSION v_samp_factor, JDIMENSION width_blocks, + * JSAMPARRAY input_data, JSAMPARRAY output_data); + */ + +.balign 16 +Ljsimd_h2v1_downsample_neon_consts: + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E /* diff 0, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F /* diff 0, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E /* diff 1, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0E /* diff 1, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D /* diff 2, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0D /* diff 2, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0C /* diff 3, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0C, 0x0C /* diff 3, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0B, 0x0B /* diff 4, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0B, 0x0B /* diff 4, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0A, 0x0A /* diff 5, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0A, 0x0A, 0x0A /* diff 5, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x09, 0x09, 0x09 /* diff 6, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x09, 0x09, 0x09 /* diff 6, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x08, 0x08, 0x08 /* diff 7, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x08, 0x08, 0x08, 0x08 /* diff 7, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x07, 0x07, 0x07, 0x07 /* diff 8, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x07, 0x07, 0x07, 0x07 /* diff 8, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9, even */ + .byte 0x01, 0x03, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9, odd */ + .byte 0x00, 0x02, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10, even */ + .byte 0x01, 0x03, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10, odd */ + .byte 0x00, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11, even */ + .byte 0x01, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11, odd */ + .byte 0x00, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12, even */ + .byte 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12, odd */ + .byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13, even */ + .byte 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13, odd */ + .byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14, even */ + .byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14, odd */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15, even */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15, odd */ + +asm_function jsimd_h2v1_downsample_neon + IMAGE_WIDTH .req x0 + MAX_V_SAMP .req x1 + V_SAMP .req x2 + BLOCK_WIDTH .req x3 + INPUT_DATA .req x4 + OUTPUT_DATA .req x5 + OUTPTR .req x9 + INPTR .req x10 + TMP1 .req x11 + TMP2 .req x12 + TMP3 .req x13 + TMPDUP .req w15 + + mov TMPDUP, #0x10000 + lsl TMP2, BLOCK_WIDTH, #4 + sub TMP2, TMP2, IMAGE_WIDTH + adr TMP3, Ljsimd_h2v1_downsample_neon_consts + add TMP3, TMP3, TMP2, lsl #4 + dup v16.4s, TMPDUP + ld1 {v18.8b, v19.8b}, [TMP3] + +1: /* row loop */ + ldr INPTR, [INPUT_DATA], #8 + ldr OUTPTR, [OUTPUT_DATA], #8 + subs TMP1, BLOCK_WIDTH, #1 + b.eq 3f +2: /* columns */ + ld2 {v0.8b, v1.8b}, [INPTR], #16 + subs TMP1, TMP1, #1 + uaddl v2.8h, v0.8b, v1.8b + add v2.8h, v2.8h, v16.8h + shrn v2.8b, v2.8h, #1 + st1 {v2.8b}, [OUTPTR], #8 + b.ne 2b +3: /* last columns */ + ld1 {v0.16b}, [INPTR] + subs V_SAMP, V_SAMP, #1 + /* expand right */ + tbl v2.8b, {v0.16b}, v18.8b + tbl v3.8b, {v0.16b}, v19.8b + uaddl v2.8h, v2.8b, v3.8b + add v2.8h, v2.8h, v16.8h + shrn v2.8b, v2.8h, #1 + st1 {v2.8b}, [OUTPTR], #8 + b.ne 1b + + br x30 + + .unreq IMAGE_WIDTH + .unreq MAX_V_SAMP + .unreq V_SAMP + .unreq BLOCK_WIDTH + .unreq INPUT_DATA + .unreq OUTPUT_DATA + .unreq OUTPTR + .unreq INPTR + .unreq TMP1 + .unreq TMP2 + .unreq TMP3 + .unreq TMPDUP + +/*****************************************************************************/ + +/* + * Downsample pixel values of a single component. + * This version handles the common case of 2:1 horizontal and 2:1 vertical, + * without smoothing. + * + * GLOBAL(void) + * jsimd_h2v2_downsample_neon (JDIMENSION image_width, int max_v_samp_factor, + * JDIMENSION v_samp_factor, JDIMENSION width_blocks, + * JSAMPARRAY input_data, JSAMPARRAY output_data); + */ + +.balign 16 +Ljsimd_h2v2_downsample_neon_consts: + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E /* diff 0, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F /* diff 0, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E /* diff 1, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0E /* diff 1, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D /* diff 2, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0D /* diff 2, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0C /* diff 3, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0C, 0x0C /* diff 3, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0B, 0x0B /* diff 4, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0B, 0x0B /* diff 4, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0A, 0x0A /* diff 5, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0A, 0x0A, 0x0A /* diff 5, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x09, 0x09, 0x09 /* diff 6, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x09, 0x09, 0x09 /* diff 6, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x08, 0x08, 0x08 /* diff 7, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x08, 0x08, 0x08, 0x08 /* diff 7, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x07, 0x07, 0x07, 0x07 /* diff 8, even */ + .byte 0x01, 0x03, 0x05, 0x07, 0x07, 0x07, 0x07, 0x07 /* diff 8, odd */ + .byte 0x00, 0x02, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9, even */ + .byte 0x01, 0x03, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9, odd */ + .byte 0x00, 0x02, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10, even */ + .byte 0x01, 0x03, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10, odd */ + .byte 0x00, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11, even */ + .byte 0x01, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11, odd */ + .byte 0x00, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12, even */ + .byte 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12, odd */ + .byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13, even */ + .byte 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13, odd */ + .byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14, even */ + .byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14, odd */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15, even */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15, odd */ + +asm_function jsimd_h2v2_downsample_neon + IMAGE_WIDTH .req x0 + MAX_V_SAMP .req x1 + V_SAMP .req x2 + BLOCK_WIDTH .req x3 + INPUT_DATA .req x4 + OUTPUT_DATA .req x5 + OUTPTR .req x9 + INPTR0 .req x10 + INPTR1 .req x14 + TMP1 .req x11 + TMP2 .req x12 + TMP3 .req x13 + TMPDUP .req w15 + + mov TMPDUP, #1 + lsl TMP2, BLOCK_WIDTH, #4 + lsl TMPDUP, TMPDUP, #17 + sub TMP2, TMP2, IMAGE_WIDTH + adr TMP3, Ljsimd_h2v2_downsample_neon_consts + orr TMPDUP, TMPDUP, #1 + add TMP3, TMP3, TMP2, lsl #4 + dup v16.4s, TMPDUP + ld1 {v18.8b, v19.8b}, [TMP3] + +1: /* row loop */ + ldr INPTR0, [INPUT_DATA], #8 + ldr OUTPTR, [OUTPUT_DATA], #8 + ldr INPTR1, [INPUT_DATA], #8 + subs TMP1, BLOCK_WIDTH, #1 + b.eq 3f +2: /* columns */ + ld2 {v0.8b, v1.8b}, [INPTR0], #16 + ld2 {v2.8b, v3.8b}, [INPTR1], #16 + subs TMP1, TMP1, #1 + uaddl v4.8h, v0.8b, v1.8b + uaddl v6.8h, v2.8b, v3.8b + add v4.8h, v4.8h, v6.8h + add v4.8h, v4.8h, v16.8h + shrn v4.8b, v4.8h, #2 + st1 {v4.8b}, [OUTPTR], #8 + b.ne 2b +3: /* last columns */ + ld1 {v0.16b}, [INPTR0] + ld1 {v1.16b}, [INPTR1] + subs V_SAMP, V_SAMP, #1 + /* expand right */ + tbl v4.8b, {v0.16b}, v18.8b + tbl v5.8b, {v0.16b}, v19.8b + tbl v6.8b, {v1.16b}, v18.8b + tbl v7.8b, {v1.16b}, v19.8b + uaddl v4.8h, v4.8b, v5.8b + uaddl v6.8h, v6.8b, v7.8b + add v4.8h, v4.8h, v6.8h + add v4.8h, v4.8h, v16.8h + shrn v4.8b, v4.8h, #2 + st1 {v4.8b}, [OUTPTR], #8 + b.ne 1b + + br x30 + + .unreq IMAGE_WIDTH + .unreq MAX_V_SAMP + .unreq V_SAMP + .unreq BLOCK_WIDTH + .unreq INPUT_DATA + .unreq OUTPUT_DATA + .unreq OUTPTR + .unreq INPTR0 + .unreq INPTR1 + .unreq TMP1 + .unreq TMP2 + .unreq TMP3 + .unreq TMPDUP From e8aa5fa9349016c2eb5e05d01e16a8c47f7b68c8 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 15 Jan 2016 13:15:54 -0600 Subject: [PATCH 087/140] Add JSIMD_NOHUFFENC environment variable for ARM Useful in regression/performance testing --- ChangeLog.txt | 4 +++- simd/jsimd_arm.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 379cfbd8..6f1660ab 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -69,7 +69,9 @@ setting the JSIMD_NOHUFFENC environment variable to 1. [13] Added SIMD acceleration for Huffman encoding on NEON-capable ARM 32-bit platforms. This speeds up the compression of full-color JPEGs by about 30% on -average. +average. For the purposes of benchmarking or regression testing, +SIMD-accelerated Huffman encoding can be disabled by setting the +JSIMD_NOHUFFENC environment variable to 1. [14] Completed the ARM 64-bit (ARMv8) NEON SIMD implementation. 64-bit ARM now has SIMD coverage for all of the algorithms that are covered in the 32-bit diff --git a/simd/jsimd_arm.c b/simd/jsimd_arm.c index 635cbd70..0cf5ae5d 100644 --- a/simd/jsimd_arm.c +++ b/simd/jsimd_arm.c @@ -27,6 +27,7 @@ #include static unsigned int simd_support = ~0; +static unsigned int simd_huffman = 1; #if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) @@ -128,6 +129,9 @@ init_simd (void) env = getenv("JSIMD_FORCENONE"); if ((env != NULL) && (strcmp(env, "1") == 0)) simd_support = 0; + env = getenv("JSIMD_NOHUFFENC"); + if ((env != NULL) && (strcmp(env, "1") == 0)) + simd_huffman = 0; } GLOBAL(int) @@ -707,7 +711,7 @@ jsimd_can_huff_encode_one_block (void) if (sizeof(JCOEF) != 2) return 0; - if (simd_support & JSIMD_ARM_NEON) + if (simd_support & JSIMD_ARM_NEON && simd_huffman) return 1; return 0; From d38b4f21ec5baabb448cd9ffa078fa9150d54af2 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 16 Jan 2016 01:53:32 -0600 Subject: [PATCH 088/140] Optimize ARM64 SIMD code for Cavium ThunderX Per @ssvb: ThunderX is an ARM64 chip that dedicates most of its transistor real estate to providing 48 cores, so each core is not as fast as a result. Each core is dual-issue & in-order for scalar instructions and has only a single-issue half-width NEON unit, so the peak throughput is one 128-bit instruction per 2 cycles. So careful instruction scheduling is important. Furthermore, ThunderX has an extremely slow implementation of ld2 and ld3, so this commit implements the equivalent of those instructions using ld1. Compression speedup relative to libjpeg-turbo 1.4.2: 48-core ThunderX (RunAbove ARM Cloud), Linux, 64-bit: 58-85% (avg. 74%) relative to jpeg-6b: 1.75-2.14x (avg. 1.95x) Refer to #49 and #51 for discussion. Closes #51. This commit also wordsmiths the ChangeLog entry (the ARMv8 SIMD implementation is "complete" only for compression-- it still lacks some decompression algorithms, as does the ARMv7 implementation.) Based on: https://github.com/mayeut/libjpeg-turbo/commit/9405b5fd031558113bdfeae193a2b14baa589a75 which is based on: https://github.com/libjpeg-turbo/libjpeg-turbo/commit/f561944ff70adef65bb36212913bd28e6a2926d6 https://github.com/libjpeg-turbo/libjpeg-turbo/commit/962c8ab21feb3d7fc2a7a1ec8d26f6b985bbb86f --- ChangeLog.txt | 11 +- simd/jsimd_arm64_neon.S | 358 ++++++++++++++++++---------------------- 2 files changed, 164 insertions(+), 205 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6f1660ab..cb59c2ef 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -73,12 +73,11 @@ average. For the purposes of benchmarking or regression testing, SIMD-accelerated Huffman encoding can be disabled by setting the JSIMD_NOHUFFENC environment variable to 1. -[14] Completed the ARM 64-bit (ARMv8) NEON SIMD implementation. 64-bit ARM -now has SIMD coverage for all of the algorithms that are covered in the 32-bit -(ARMv7) implementation, except for h2v1 (4:2:2) fancy upsampling. -Additionally, the ARM 64-bit SIMD implementation now accelerates the slow -integer forward DCT and h2v2 & h2v1 downsampling algorithms, which are not -accelerated in the 32-bit implementation. +[14] Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used +compression algorithms (including the slow integer forward DCT and h2v2 & h2v1 +downsampling algorithms, which are not accelerated in the 32-bit NEON +implementation.) This speeds up the overall 64-bit compression performance by +about 2x on ARMv8 processors. 1.4.2 diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index 040386d5..936c69a7 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -6,8 +6,9 @@ * Author: Siarhei Siamashka * Copyright (C) 2013-2014, Linaro Limited * Author: Ragesh Radhakrishnan - * Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. + * Copyright (C) 2014-2016, D. R. Commander. All Rights Reserved. * Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. + * Copyright (C) 2016, Siarhei Siamashka. All Rights Reserved. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -1938,10 +1939,50 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, . .endif .endm +#if __APPLE__ +/* TODO: expand this to include other devices that are known not to have a slow + * ld3 implementation. */ +#define LD3_IS_FAST +#endif + .macro do_load bpp, size .if \bpp == 24 .if \size == 8 +#ifdef LD3_IS_FAST ld3 {v10.8b, v11.8b, v12.8b}, [RGB], #24 +#else + ld1 {v10.b}[0], [RGB], #1 + ld1 {v11.b}[0], [RGB], #1 + ld1 {v12.b}[0], [RGB], #1 + + ld1 {v10.b}[1], [RGB], #1 + ld1 {v11.b}[1], [RGB], #1 + ld1 {v12.b}[1], [RGB], #1 + + ld1 {v10.b}[2], [RGB], #1 + ld1 {v11.b}[2], [RGB], #1 + ld1 {v12.b}[2], [RGB], #1 + + ld1 {v10.b}[3], [RGB], #1 + ld1 {v11.b}[3], [RGB], #1 + ld1 {v12.b}[3], [RGB], #1 + + ld1 {v10.b}[4], [RGB], #1 + ld1 {v11.b}[4], [RGB], #1 + ld1 {v12.b}[4], [RGB], #1 + + ld1 {v10.b}[5], [RGB], #1 + ld1 {v11.b}[5], [RGB], #1 + ld1 {v12.b}[5], [RGB], #1 + + ld1 {v10.b}[6], [RGB], #1 + ld1 {v11.b}[6], [RGB], #1 + ld1 {v12.b}[6], [RGB], #1 + + ld1 {v10.b}[7], [RGB], #1 + ld1 {v11.b}[7], [RGB], #1 + ld1 {v12.b}[7], [RGB], #1 +#endif prfm pldl1keep, [RGB, #128] .elseif \size == 4 ld3 {v10.b, v11.b, v12.b}[0], [RGB], #3 @@ -1985,46 +2026,40 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, . */ .macro do_rgb_to_yuv_stage1 - ushll v4.8h, v1\r_offs\().8b, #0 /* r = { d4, d5 } */ - ushll v6.8h, v1\g_offs\().8b, #0 /* g = { d6, d7 } */ - ushll v8.8h, v1\b_offs\().8b, #0 /* b = { d8, d9 } */ - ins v5.d[0], v4.d[1] - ins v7.d[0], v6.d[1] - ins v9.d[0], v8.d[1] + ushll v4.8h, v1\r_offs\().8b, #0 /* r = v4 */ + ushll v6.8h, v1\g_offs\().8b, #0 /* g = v6 */ + ushll v8.8h, v1\b_offs\().8b, #0 /* b = v8 */ rev64 v18.4s, v1.4s rev64 v26.4s, v1.4s rev64 v28.4s, v1.4s rev64 v30.4s, v1.4s umull v14.4s, v4.4h, v0.h[0] - umull v16.4s, v5.4h, v0.h[0] + umull2 v16.4s, v4.8h, v0.h[0] umlsl v18.4s, v4.4h, v0.h[3] - umlsl v26.4s, v5.4h, v0.h[3] + umlsl2 v26.4s, v4.8h, v0.h[3] umlal v28.4s, v4.4h, v0.h[5] - umlal v30.4s, v5.4h, v0.h[5] + umlal2 v30.4s, v4.8h, v0.h[5] umlal v14.4s, v6.4h, v0.h[1] - umlal v16.4s, v7.4h, v0.h[1] + umlal2 v16.4s, v6.8h, v0.h[1] umlsl v18.4s, v6.4h, v0.h[4] - umlsl v26.4s, v7.4h, v0.h[4] + umlsl2 v26.4s, v6.8h, v0.h[4] umlsl v28.4s, v6.4h, v0.h[6] - umlsl v30.4s, v7.4h, v0.h[6] + umlsl2 v30.4s, v6.8h, v0.h[6] umlal v14.4s, v8.4h, v0.h[2] - umlal v16.4s, v9.4h, v0.h[2] + umlal2 v16.4s, v8.8h, v0.h[2] umlal v18.4s, v8.4h, v0.h[5] - umlal v26.4s, v9.4h, v0.h[5] + umlal2 v26.4s, v8.8h, v0.h[5] umlsl v28.4s, v8.4h, v0.h[7] - umlsl v30.4s, v9.4h, v0.h[7] + umlsl2 v30.4s, v8.8h, v0.h[7] .endm .macro do_rgb_to_yuv_stage2 rshrn v20.4h, v14.4s, #16 - rshrn v21.4h, v16.4s, #16 shrn v22.4h, v18.4s, #16 - shrn v23.4h, v26.4s, #16 shrn v24.4h, v28.4s, #16 - shrn v25.4h, v30.4s, #16 - ins v20.d[1], v21.d[0] - ins v22.d[1], v23.d[0] - ins v24.d[1], v25.d[0] + rshrn2 v20.8h, v16.4s, #16 + shrn2 v22.8h, v26.4s, #16 + shrn2 v24.8h, v30.4s, #16 xtn v20.8b, v20.8h /* v20 = y */ xtn v21.8b, v22.8h /* v21 = u */ xtn v22.8b, v24.8h /* v22 = v */ @@ -2035,51 +2070,15 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, . do_rgb_to_yuv_stage2 .endm +/* TODO: expand macros and interleave instructions if some in-order + * ARM64 processor actually can dual-issue LOAD/STORE with ALU */ .macro do_rgb_to_yuv_stage2_store_load_stage1 - rshrn v20.4h, v14.4s, #16 - rshrn v21.4h, v16.4s, #16 - shrn v22.4h, v18.4s, #16 - rev64 v18.4s, v1.4s - shrn v23.4h, v26.4s, #16 - ins v20.d[1], v21.d[0] - rev64 v26.4s, v1.4s - shrn v24.4h, v28.4s, #16 - shrn v25.4h, v30.4s, #16 - ins v22.d[1], v23.d[0] + do_rgb_to_yuv_stage2 do_load \bpp, 8 - xtn v20.8b, v20.8h /* dv0 = y */ - ins v24.d[1], v25.d[0] - ushll v4.8h, v1\r_offs\().8b, #0 /* r = { v4.8h } */ - xtn v21.8b, v22.8h /* v21 = u */ - ushll v6.8h, v1\g_offs\().8b, #0 /* g = { v6.8h } */ - ushll v8.8h, v1\b_offs\().8b, #0 /* b = { v8.8h } */ - xtn v22.8b, v24.8h /* v22 = v */ - ins v5.d[0], v4.d[1] - ins v7.d[0], v6.d[1] - ins v9.d[0], v8.d[1] - st1 {v20.8b}, [Y], #8 - umull v14.4s, v4.4h, v0.h[0] - umull v16.4s, v5.4h, v0.h[0] - umlsl v18.4s, v4.4h, v0.h[3] - umlal v14.4s, v6.4h, v0.h[1] - umlal v16.4s, v7.4h, v0.h[1] - umlsl v18.4s, v6.4h, v0.h[4] - umlal v14.4s, v8.4h, v0.h[2] - umlal v16.4s, v9.4h, v0.h[2] - umlal v18.4s, v8.4h, v0.h[5] - rev64 v28.4s, v1.4s - rev64 v30.4s, v1.4s - st1 {v21.8b}, [U], #8 - umlsl v26.4s, v5.4h, v0.h[3] - umlal v28.4s, v4.4h, v0.h[5] - umlal v30.4s, v5.4h, v0.h[5] - st1 {v22.8b}, [V], #8 - umlsl v26.4s, v7.4h, v0.h[4] - umlsl v28.4s, v6.4h, v0.h[6] - umlsl v30.4s, v7.4h, v0.h[6] - umlal v26.4s, v9.4h, v0.h[5] - umlsl v28.4s, v8.4h, v0.h[7] - umlsl v30.4s, v9.4h, v0.h[7] + st1 {v20.8b}, [Y], #8 + st1 {v21.8b}, [U], #8 + st1 {v22.8b}, [V], #8 + do_rgb_to_yuv_stage1 .endm .balign 16 @@ -2852,39 +2851,39 @@ asm_function jsimd_quantize_neon */ .balign 16 -Ljsimd_h2v1_downsample_neon_consts: - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E /* diff 0, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F /* diff 0, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E /* diff 1, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0E /* diff 1, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D /* diff 2, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0D /* diff 2, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0C /* diff 3, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0C, 0x0C /* diff 3, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0B, 0x0B /* diff 4, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0B, 0x0B /* diff 4, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0A, 0x0A /* diff 5, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0A, 0x0A, 0x0A /* diff 5, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x09, 0x09, 0x09 /* diff 6, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x09, 0x09, 0x09 /* diff 6, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x08, 0x08, 0x08 /* diff 7, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x08, 0x08, 0x08, 0x08 /* diff 7, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x07, 0x07, 0x07, 0x07 /* diff 8, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x07, 0x07, 0x07, 0x07 /* diff 8, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9, even */ - .byte 0x01, 0x03, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9, odd */ - .byte 0x00, 0x02, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10, even */ - .byte 0x01, 0x03, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10, odd */ - .byte 0x00, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11, even */ - .byte 0x01, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11, odd */ - .byte 0x00, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12, even */ - .byte 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12, odd */ - .byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13, even */ - .byte 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13, odd */ - .byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14, even */ - .byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14, odd */ - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15, even */ - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15, odd */ +Ljsimd_h2_downsample_neon_consts: + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F /* diff 0 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0E /* diff 1 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0D, 0x0D /* diff 2 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C /* diff 3 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B /* diff 4 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A /* diff 5 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 /* diff 6 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 /* diff 7 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 /* diff 8 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, \ + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, \ + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, \ + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, \ + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12 */ + .byte 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, \ + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13 */ + .byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, \ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14 */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15 */ asm_function jsimd_h2v1_downsample_neon IMAGE_WIDTH .req x0 @@ -2900,40 +2899,39 @@ asm_function jsimd_h2v1_downsample_neon TMP3 .req x13 TMPDUP .req w15 - mov TMPDUP, #0x10000 - lsl TMP2, BLOCK_WIDTH, #4 - sub TMP2, TMP2, IMAGE_WIDTH - adr TMP3, Ljsimd_h2v1_downsample_neon_consts - add TMP3, TMP3, TMP2, lsl #4 - dup v16.4s, TMPDUP - ld1 {v18.8b, v19.8b}, [TMP3] + mov TMPDUP, #0x10000 + lsl TMP2, BLOCK_WIDTH, #4 + sub TMP2, TMP2, IMAGE_WIDTH + adr TMP3, Ljsimd_h2_downsample_neon_consts + add TMP3, TMP3, TMP2, lsl #4 + dup v16.4s, TMPDUP + ld1 {v18.16b}, [TMP3] 1: /* row loop */ - ldr INPTR, [INPUT_DATA], #8 - ldr OUTPTR, [OUTPUT_DATA], #8 - subs TMP1, BLOCK_WIDTH, #1 - b.eq 3f + ldr INPTR, [INPUT_DATA], #8 + ldr OUTPTR, [OUTPUT_DATA], #8 + subs TMP1, BLOCK_WIDTH, #1 + b.eq 3f 2: /* columns */ - ld2 {v0.8b, v1.8b}, [INPTR], #16 - subs TMP1, TMP1, #1 - uaddl v2.8h, v0.8b, v1.8b - add v2.8h, v2.8h, v16.8h - shrn v2.8b, v2.8h, #1 - st1 {v2.8b}, [OUTPTR], #8 - b.ne 2b + ld1 {v0.16b}, [INPTR], #16 + mov v4.16b, v16.16b + subs TMP1, TMP1, #1 + uadalp v4.8h, v0.16b + shrn v6.8b, v4.8h, #1 + st1 {v6.8b}, [OUTPTR], #8 + b.ne 2b 3: /* last columns */ - ld1 {v0.16b}, [INPTR] - subs V_SAMP, V_SAMP, #1 + ld1 {v0.16b}, [INPTR] + mov v4.16b, v16.16b + subs V_SAMP, V_SAMP, #1 /* expand right */ - tbl v2.8b, {v0.16b}, v18.8b - tbl v3.8b, {v0.16b}, v19.8b - uaddl v2.8h, v2.8b, v3.8b - add v2.8h, v2.8h, v16.8h - shrn v2.8b, v2.8h, #1 - st1 {v2.8b}, [OUTPTR], #8 - b.ne 1b + tbl v2.16b, {v0.16b}, v18.16b + uadalp v4.8h, v2.16b + shrn v6.8b, v4.8h, #1 + st1 {v6.8b}, [OUTPTR], #8 + b.ne 1b - br x30 + br x30 .unreq IMAGE_WIDTH .unreq MAX_V_SAMP @@ -2962,40 +2960,6 @@ asm_function jsimd_h2v1_downsample_neon */ .balign 16 -Ljsimd_h2v2_downsample_neon_consts: - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E /* diff 0, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F /* diff 0, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E /* diff 1, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0E /* diff 1, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D /* diff 2, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0D /* diff 2, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0C /* diff 3, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0C, 0x0C /* diff 3, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0B, 0x0B /* diff 4, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0B, 0x0B /* diff 4, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0A, 0x0A /* diff 5, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x0A, 0x0A, 0x0A /* diff 5, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x09, 0x09, 0x09 /* diff 6, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x09, 0x09, 0x09, 0x09 /* diff 6, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x08, 0x08, 0x08, 0x08 /* diff 7, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x08, 0x08, 0x08, 0x08 /* diff 7, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x07, 0x07, 0x07, 0x07 /* diff 8, even */ - .byte 0x01, 0x03, 0x05, 0x07, 0x07, 0x07, 0x07, 0x07 /* diff 8, odd */ - .byte 0x00, 0x02, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9, even */ - .byte 0x01, 0x03, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9, odd */ - .byte 0x00, 0x02, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10, even */ - .byte 0x01, 0x03, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10, odd */ - .byte 0x00, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11, even */ - .byte 0x01, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11, odd */ - .byte 0x00, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12, even */ - .byte 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12, odd */ - .byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13, even */ - .byte 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13, odd */ - .byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14, even */ - .byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14, odd */ - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15, even */ - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15, odd */ - asm_function jsimd_h2v2_downsample_neon IMAGE_WIDTH .req x0 MAX_V_SAMP .req x1 @@ -3011,51 +2975,47 @@ asm_function jsimd_h2v2_downsample_neon TMP3 .req x13 TMPDUP .req w15 - mov TMPDUP, #1 - lsl TMP2, BLOCK_WIDTH, #4 - lsl TMPDUP, TMPDUP, #17 - sub TMP2, TMP2, IMAGE_WIDTH - adr TMP3, Ljsimd_h2v2_downsample_neon_consts - orr TMPDUP, TMPDUP, #1 - add TMP3, TMP3, TMP2, lsl #4 - dup v16.4s, TMPDUP - ld1 {v18.8b, v19.8b}, [TMP3] + mov TMPDUP, #1 + lsl TMP2, BLOCK_WIDTH, #4 + lsl TMPDUP, TMPDUP, #17 + sub TMP2, TMP2, IMAGE_WIDTH + adr TMP3, Ljsimd_h2_downsample_neon_consts + orr TMPDUP, TMPDUP, #1 + add TMP3, TMP3, TMP2, lsl #4 + dup v16.4s, TMPDUP + ld1 {v18.16b}, [TMP3] 1: /* row loop */ - ldr INPTR0, [INPUT_DATA], #8 - ldr OUTPTR, [OUTPUT_DATA], #8 - ldr INPTR1, [INPUT_DATA], #8 - subs TMP1, BLOCK_WIDTH, #1 - b.eq 3f + ldr INPTR0, [INPUT_DATA], #8 + ldr OUTPTR, [OUTPUT_DATA], #8 + ldr INPTR1, [INPUT_DATA], #8 + subs TMP1, BLOCK_WIDTH, #1 + b.eq 3f 2: /* columns */ - ld2 {v0.8b, v1.8b}, [INPTR0], #16 - ld2 {v2.8b, v3.8b}, [INPTR1], #16 - subs TMP1, TMP1, #1 - uaddl v4.8h, v0.8b, v1.8b - uaddl v6.8h, v2.8b, v3.8b - add v4.8h, v4.8h, v6.8h - add v4.8h, v4.8h, v16.8h - shrn v4.8b, v4.8h, #2 - st1 {v4.8b}, [OUTPTR], #8 - b.ne 2b + ld1 {v0.16b}, [INPTR0], #16 + ld1 {v1.16b}, [INPTR1], #16 + mov v4.16b, v16.16b + subs TMP1, TMP1, #1 + uadalp v4.8h, v0.16b + uadalp v4.8h, v1.16b + shrn v6.8b, v4.8h, #2 + st1 {v6.8b}, [OUTPTR], #8 + b.ne 2b 3: /* last columns */ - ld1 {v0.16b}, [INPTR0] - ld1 {v1.16b}, [INPTR1] - subs V_SAMP, V_SAMP, #1 + ld1 {v0.16b}, [INPTR0], #16 + ld1 {v1.16b}, [INPTR1], #16 + mov v4.16b, v16.16b + subs V_SAMP, V_SAMP, #1 /* expand right */ - tbl v4.8b, {v0.16b}, v18.8b - tbl v5.8b, {v0.16b}, v19.8b - tbl v6.8b, {v1.16b}, v18.8b - tbl v7.8b, {v1.16b}, v19.8b - uaddl v4.8h, v4.8b, v5.8b - uaddl v6.8h, v6.8b, v7.8b - add v4.8h, v4.8h, v6.8h - add v4.8h, v4.8h, v16.8h - shrn v4.8b, v4.8h, #2 - st1 {v4.8b}, [OUTPTR], #8 - b.ne 1b + tbl v2.16b, {v0.16b}, v18.16b + tbl v3.16b, {v1.16b}, v18.16b + uadalp v4.8h, v2.16b + uadalp v4.8h, v3.16b + shrn v6.8b, v4.8h, #2 + st1 {v6.8b}, [OUTPTR], #8 + b.ne 1b - br x30 + br x30 .unreq IMAGE_WIDTH .unreq MAX_V_SAMP From 8af3f8a9cb165a8cc7e2bf0ef2747dc54e8052ec Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 18 Jan 2016 16:40:07 -0600 Subject: [PATCH 089/140] Provide pkg-config (.pc) scripts This allows a project to use PKG_CHECK_MODULES() in its configure.ac file to easily check for the presence of libjpeg-turbo and modify the compiler/linker flags accordingly. Note that if a project relies solely on pkg-config to check for libjpeg-turbo, then it will not be possible to build that project using libjpeg or an earlier version of libjpeg-turbo. Closes #53 Based on: https://github.com/cberner/libjpeg-turbo/commit/496713871939b550d00005b4042420da41641a0a --- ChangeLog.txt | 5 +++++ Makefile.am | 2 ++ configure.ac | 4 ++++ release/libjpeg-turbo.spec.in | 2 ++ release/libjpeg.pc.in | 10 ++++++++++ release/libturbojpeg.pc.in | 10 ++++++++++ 6 files changed, 33 insertions(+) create mode 100644 release/libjpeg.pc.in create mode 100644 release/libturbojpeg.pc.in diff --git a/ChangeLog.txt b/ChangeLog.txt index cb59c2ef..a0e39d10 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -79,6 +79,11 @@ downsampling algorithms, which are not accelerated in the 32-bit NEON implementation.) This speeds up the overall 64-bit compression performance by about 2x on ARMv8 processors. +[15] pkg-config (.pc) scripts are now included for both the libjpeg and +TurboJPEG API libraries on Un*x systems. Note that if a project's build system +relies on these scripts, then it will not be possible to build that project +with libjpeg or with a prior version of libjpeg-turbo. + 1.4.2 ===== diff --git a/Makefile.am b/Makefile.am index e70ae698..16b84211 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,8 @@ endif nodist_include_HEADERS = jconfig.h +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = pkgscripts/libjpeg.pc pkgscripts/libturbojpeg.pc HDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \ jpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h \ diff --git a/configure.ac b/configure.ac index 97ed115a..6be99fed 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,8 @@ AC_ARG_WITH([build-date], [Use custom build string to enable reproducible builds [BUILD="$with_build_date"], [BUILD=`date +%Y%m%d`]) +PKG_PROG_PKG_CONFIG + # When the prefix is /opt/libjpeg-turbo, we assume that an "official" binary is # being created, and thus we install things into specific locations. @@ -576,6 +578,8 @@ AC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in]) AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in]) AC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in]) AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in]) +AC_CONFIG_FILES([pkgscripts/libjpeg.pc:release/libjpeg.pc.in]) +AC_CONFIG_FILES([pkgscripts/libturbojpeg.pc:release/libturbojpeg.pc.in]) if test "x$with_turbojpeg" != "xno"; then AC_CONFIG_FILES([tjbenchtest]) fi diff --git a/release/libjpeg-turbo.spec.in b/release/libjpeg-turbo.spec.in index 03d75d16..3e0dfa2e 100644 --- a/release/libjpeg-turbo.spec.in +++ b/release/libjpeg-turbo.spec.in @@ -124,10 +124,12 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@ %{_libdir}/libjpeg.so %{_libdir}/libjpeg.a +%{_libdir}/pkgconfig/libjpeg.pc %{_libdir}/libturbojpeg.so.0.1.0 %{_libdir}/libturbojpeg.so.0 %{_libdir}/libturbojpeg.so %{_libdir}/libturbojpeg.a +%{_libdir}/pkgconfig/libturbojpeg.pc %dir %{_includedir} %{_includedir}/jconfig.h %{_includedir}/jerror.h diff --git a/release/libjpeg.pc.in b/release/libjpeg.pc.in new file mode 100644 index 00000000..40795f77 --- /dev/null +++ b/release/libjpeg.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libjpeg +Description: A SIMD-accelerated JPEG codec that provides the libjpeg API +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -ljpeg +Cflags: -I${includedir} diff --git a/release/libturbojpeg.pc.in b/release/libturbojpeg.pc.in new file mode 100644 index 00000000..7d4b656c --- /dev/null +++ b/release/libturbojpeg.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libturbojpeg +Description: A SIMD-accelerated JPEG codec that provides the TurboJPEG API +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lturbojpeg +Cflags: -I${includedir} From 31280613821c659d5f6afe828d5e6fcf2ad0c18e Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 1 Feb 2016 11:03:39 -0600 Subject: [PATCH 090/140] TJBench: Fix segfault on Android For whatever reason, the "write" global variable in tjbench.c was overriding the linkage with the write() system function. This may have affected other platforms as well but was not known to. --- tjbench.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tjbench.c b/tjbench.c index 036d631e..81b36f63 100644 --- a/tjbench.c +++ b/tjbench.c @@ -46,7 +46,7 @@ #define _throwbmp(m) _throw(m, bmpgeterr()) int flags=TJFLAG_NOREALLOC, componly=0, decomponly=0, doyuv=0, quiet=0, - dotile=0, pf=TJPF_BGR, yuvpad=1, warmup=1, write=1; + dotile=0, pf=TJPF_BGR, yuvpad=1, warmup=1, dowrite=1; char *ext="ppm"; const char *pixFormatStr[TJ_NUMPF]= { @@ -214,7 +214,7 @@ int decomp(unsigned char *srcbuf, unsigned char **jpegbuf, } } - if (!write) goto bailout; + if (!dowrite) goto bailout; if(sf.num!=1 || sf.denom!=1) snprintf(sizestr, 20, "%d_%d", sf.num, sf.denom); @@ -425,7 +425,7 @@ int fullTest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual, printf(" Output bit stream: %f Megabits/sec\n", (double)totaljpegsize*8./1000000.*(double)iter/elapsed); } - if(tilew==w && tileh==h && write) + if(tilew==w && tileh==h && dowrite) { snprintf(tempstr, 1024, "%s_%s_Q%d.jpg", filename, subName[subsamp], jpegqual); @@ -911,7 +911,7 @@ int main(int argc, char *argv[]) } } if(!strcasecmp(argv[i], "-componly")) componly=1; - if(!strcasecmp(argv[i], "-nowrite")) write=0; + if(!strcasecmp(argv[i], "-nowrite")) dowrite=0; } } From 6c3fc97b1a1ed3c57ea6d3a779553d595b70e0e6 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 1 Feb 2016 11:12:22 -0600 Subject: [PATCH 091/140] Update Android build instr. for ARMv8, PIE, etc. * Include information on how to do a 64-bit ARMv8 build with the latest NDK * Suggest -fPIE and -pie as default CFLAGS (required for android-16 and later. * Remove -fstrict-aliasing flag (-Wall already includes it) --- BUILDING.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 94ee1409..9075c183 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -414,18 +414,25 @@ a general recipe script that can be modified for your specific needs. # Set these variables to suit your needs NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk} BUILD_PLATFORM={the platform name for the NDK package you installed-- - for example, "windows-x86" or "linux-x86_64"} - TOOLCHAIN_VERSION={"4.6", "4.8", etc. This corresponds to a toolchain - directory under ${NDK_PATH}/toolchains/.} + for example, "windows-x86" or "linux-x86_64" or "darwin-x86_64"} + TOOLCHAIN_VERSION={"4.8", "4.9", "clang3.5", etc. This corresponds to a + toolchain directory under ${NDK_PATH}/toolchains/.} ANDROID_VERSION={The minimum version of Android to support-- for example, - "9", "19", etc.} + "16", "19", etc. "21" or later is required for a 64-bit build.} + # 32-bit ARMv7 build HOST=arm-linux-androideabi - TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM} SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm - ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include" ANDROID_CFLAGS="-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \ - -fstrict-aliasing --sysroot=${SYSROOT}" + --sysroot=${SYSROOT}" + + # 64-bit ARMv8 build + HOST=aarch64-linux-android + SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm64 + ANDROID_CFLAGS="--sysroot=${SYSROOT}" + + TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM} + ANDROID_INCLUDES="-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include" export CPP=${TOOLCHAIN}/bin/${HOST}-cpp export AR=${TOOLCHAIN}/bin/${HOST}-ar export AS=${TOOLCHAIN}/bin/${HOST}-as @@ -437,11 +444,14 @@ a general recipe script that can be modified for your specific needs. export STRIP=${TOOLCHAIN}/bin/${HOST}-strip cd {build_directory} sh {source_directory}/configure --host=${HOST} \ - CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3" \ + CFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3 -fPIE" \ CPPFLAGS="${ANDROID_INCLUDES} ${ANDROID_CFLAGS}" \ - LDFLAGS="${ANDROID_CFLAGS}" --with-simd ${1+"$@"} + LDFLAGS="${ANDROID_CFLAGS} -pie" --with-simd ${1+"$@"} make +If building for Android 4.0.x (API level < 16) or earlier, remove `-fPIE` from +`CFLAGS` and `-pie` from `LDFLAGS`. + Building on Windows (Visual C++ or MinGW) ========================================= From cb49bb00d9240475eb57976de1b7351f4e3f81ad Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 2 Feb 2016 23:10:27 -0600 Subject: [PATCH 092/140] Opt. ARM64 SIMD decompr. for in-order pipelines Decompression speedup relative to libjpeg-turbo 1.4.2 (ISLOW IDCT): 48-core ThunderX (RunAbove ARM Cloud), Linux, 64-bit: 60-113% (avg. 86%) Cortex-A53 (Nexus 5X), Android, 64-bit: 6.8-27% (avg. 14%) Cortex-A57 (Nexus 5X), Android, 64-bit: 2.0-14% (avg. 6.8%) Decompression speedup relative to libjpeg-turbo 1.4.2 (IFAST IDCT): 48-core ThunderX (RunAbove ARM Cloud), Linux, 64-bit: 51-98% (avg. 75%) Minimal speedup (1-5%) observed on iPhone 5S (Cortex-A7) NOTE: This commit avoids the st3 instruction for non-Android and non-Apple builds, which may cause a performance regression against libjpeg-turbo 1.4.x on ARM64 systems that are running plain Linux. Since ThunderX is the only platform known to suffer from slow ld3 and st3 instructions, it is probably better to check for the CPU type at run time and disable ld3/st3 only if ThunderX is detected. This commit also enables the use of ld3 on Android platforms, which should be a safe bet, at least for now. This speeds up compression on the afore-mentioned Nexus Cortex-A53 by 5.5-19% (avg. 12%) and on the Nexus Cortex-A57 by 1.2-14% (avg. 6.3%), relative to the previous commits. This commit also removes unnecessary macros. Refer to #52 for discussion. Closes #52. Based on: https://github.com/mayeut/libjpeg-turbo/commit/6bad905034e6e73b33ebf07a74a6b72f58319f62 https://github.com/mayeut/libjpeg-turbo/commit/488dd7bf1726e2f6af6e9294ccf77b729fec1f20 https://github.com/mayeut/libjpeg-turbo/commit/4f4d057c1fb31d643536e6effb46a5946e15c465 https://github.com/mayeut/libjpeg-turbo/commit/d3198afc43450989a4fc63d2dcbe3272c8a0a3c1 --- simd/jsimd_arm64_neon.S | 1598 +++++++++++++++++++-------------------- 1 file changed, 762 insertions(+), 836 deletions(-) diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index 936c69a7..5acb7134 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -122,7 +122,6 @@ _\fname: trn2 \l5\().2d, \t0\().2d, \l5\().2d .endm - #define CENTERJSAMPLE 128 /*****************************************************************************/ @@ -135,626 +134,603 @@ _\fname: * JSAMPARRAY output_buf, JDIMENSION output_col) */ -#define FIX_0_298631336 (2446) -#define FIX_0_390180644 (3196) -#define FIX_0_541196100 (4433) -#define FIX_0_765366865 (6270) -#define FIX_0_899976223 (7373) -#define FIX_1_175875602 (9633) -#define FIX_1_501321110 (12299) -#define FIX_1_847759065 (15137) -#define FIX_1_961570560 (16069) -#define FIX_2_053119869 (16819) -#define FIX_2_562915447 (20995) -#define FIX_3_072711026 (25172) +#define CENTERJSAMPLE 128 +#define CONST_BITS 13 +#define PASS1_BITS 2 -#define FIX_1_175875602_MINUS_1_961570560 (FIX_1_175875602 - FIX_1_961570560) -#define FIX_1_175875602_MINUS_0_390180644 (FIX_1_175875602 - FIX_0_390180644) -#define FIX_0_541196100_MINUS_1_847759065 (FIX_0_541196100 - FIX_1_847759065) -#define FIX_3_072711026_MINUS_2_562915447 (FIX_3_072711026 - FIX_2_562915447) -#define FIX_0_298631336_MINUS_0_899976223 (FIX_0_298631336 - FIX_0_899976223) -#define FIX_1_501321110_MINUS_0_899976223 (FIX_1_501321110 - FIX_0_899976223) -#define FIX_2_053119869_MINUS_2_562915447 (FIX_2_053119869 - FIX_2_562915447) -#define FIX_0_541196100_PLUS_0_765366865 (FIX_0_541196100 + FIX_0_765366865) - -/* - * Reference SIMD-friendly 1-D ISLOW iDCT C implementation. - * Uses some ideas from the comments in 'simd/jiss2int-64.asm' - */ -#define REF_1D_IDCT(xrow0, xrow1, xrow2, xrow3, xrow4, xrow5, xrow6, xrow7) \ -{ \ - DCTELEM row0, row1, row2, row3, row4, row5, row6, row7; \ - JLONG q1, q2, q3, q4, q5, q6, q7; \ - JLONG tmp11_plus_tmp2, tmp11_minus_tmp2; \ - \ - /* 1-D iDCT input data */ \ - row0 = xrow0; \ - row1 = xrow1; \ - row2 = xrow2; \ - row3 = xrow3; \ - row4 = xrow4; \ - row5 = xrow5; \ - row6 = xrow6; \ - row7 = xrow7; \ - \ - q5 = row7 + row3; \ - q4 = row5 + row1; \ - q6 = MULTIPLY(q5, FIX_1_175875602_MINUS_1_961570560) + \ - MULTIPLY(q4, FIX_1_175875602); \ - q7 = MULTIPLY(q5, FIX_1_175875602) + \ - MULTIPLY(q4, FIX_1_175875602_MINUS_0_390180644); \ - q2 = MULTIPLY(row2, FIX_0_541196100) + \ - MULTIPLY(row6, FIX_0_541196100_MINUS_1_847759065); \ - q4 = q6; \ - q3 = ((JLONG) row0 - (JLONG) row4) << 13; \ - q6 += MULTIPLY(row5, -FIX_2_562915447) + \ - MULTIPLY(row3, FIX_3_072711026_MINUS_2_562915447); \ - /* now we can use q1 (reloadable constants have been used up) */ \ - q1 = q3 + q2; \ - q4 += MULTIPLY(row7, FIX_0_298631336_MINUS_0_899976223) + \ - MULTIPLY(row1, -FIX_0_899976223); \ - q5 = q7; \ - q1 = q1 + q6; \ - q7 += MULTIPLY(row7, -FIX_0_899976223) + \ - MULTIPLY(row1, FIX_1_501321110_MINUS_0_899976223); \ - \ - /* (tmp11 + tmp2) has been calculated (out_row1 before descale) */ \ - tmp11_plus_tmp2 = q1; \ - row1 = 0; \ - \ - q1 = q1 - q6; \ - q5 += MULTIPLY(row5, FIX_2_053119869_MINUS_2_562915447) + \ - MULTIPLY(row3, -FIX_2_562915447); \ - q1 = q1 - q6; \ - q6 = MULTIPLY(row2, FIX_0_541196100_PLUS_0_765366865) + \ - MULTIPLY(row6, FIX_0_541196100); \ - q3 = q3 - q2; \ - \ - /* (tmp11 - tmp2) has been calculated (out_row6 before descale) */ \ - tmp11_minus_tmp2 = q1; \ - \ - q1 = ((JLONG) row0 + (JLONG) row4) << 13; \ - q2 = q1 + q6; \ - q1 = q1 - q6; \ - \ - /* pick up the results */ \ - tmp0 = q4; \ - tmp1 = q5; \ - tmp2 = (tmp11_plus_tmp2 - tmp11_minus_tmp2) / 2; \ - tmp3 = q7; \ - tmp10 = q2; \ - tmp11 = (tmp11_plus_tmp2 + tmp11_minus_tmp2) / 2; \ - tmp12 = q3; \ - tmp13 = q1; \ -} - -#define XFIX_0_899976223 v0.h[0] -#define XFIX_0_541196100 v0.h[1] -#define XFIX_2_562915447 v0.h[2] -#define XFIX_0_298631336_MINUS_0_899976223 v0.h[3] -#define XFIX_1_501321110_MINUS_0_899976223 v1.h[0] -#define XFIX_2_053119869_MINUS_2_562915447 v1.h[1] -#define XFIX_0_541196100_PLUS_0_765366865 v1.h[2] -#define XFIX_1_175875602 v1.h[3] -#define XFIX_1_175875602_MINUS_0_390180644 v2.h[0] -#define XFIX_0_541196100_MINUS_1_847759065 v2.h[1] -#define XFIX_3_072711026_MINUS_2_562915447 v2.h[2] -#define XFIX_1_175875602_MINUS_1_961570560 v2.h[3] +#define F_0_298 2446 /* FIX(0.298631336) */ +#define F_0_390 3196 /* FIX(0.390180644) */ +#define F_0_541 4433 /* FIX(0.541196100) */ +#define F_0_765 6270 /* FIX(0.765366865) */ +#define F_0_899 7373 /* FIX(0.899976223) */ +#define F_1_175 9633 /* FIX(1.175875602) */ +#define F_1_501 12299 /* FIX(1.501321110) */ +#define F_1_847 15137 /* FIX(1.847759065) */ +#define F_1_961 16069 /* FIX(1.961570560) */ +#define F_2_053 16819 /* FIX(2.053119869) */ +#define F_2_562 20995 /* FIX(2.562915447) */ +#define F_3_072 25172 /* FIX(3.072711026) */ .balign 16 Ljsimd_idct_islow_neon_consts: - .short FIX_0_899976223 /* d0[0] */ - .short FIX_0_541196100 /* d0[1] */ - .short FIX_2_562915447 /* d0[2] */ - .short FIX_0_298631336_MINUS_0_899976223 /* d0[3] */ - .short FIX_1_501321110_MINUS_0_899976223 /* d1[0] */ - .short FIX_2_053119869_MINUS_2_562915447 /* d1[1] */ - .short FIX_0_541196100_PLUS_0_765366865 /* d1[2] */ - .short FIX_1_175875602 /* d1[3] */ - /* reloadable constants */ - .short FIX_1_175875602_MINUS_0_390180644 /* d2[0] */ - .short FIX_0_541196100_MINUS_1_847759065 /* d2[1] */ - .short FIX_3_072711026_MINUS_2_562915447 /* d2[2] */ - .short FIX_1_175875602_MINUS_1_961570560 /* d2[3] */ + .short F_0_298 + .short -F_0_390 + .short F_0_541 + .short F_0_765 + .short - F_0_899 + .short F_1_175 + .short F_1_501 + .short - F_1_847 + .short - F_1_961 + .short F_2_053 + .short - F_2_562 + .short F_3_072 + .short 0 /* padding */ + .short 0 + .short 0 + .short 0 + +#undef F_0_298 +#undef F_0_390 +#undef F_0_541 +#undef F_0_765 +#undef F_0_899 +#undef F_1_175 +#undef F_1_501 +#undef F_1_847 +#undef F_1_961 +#undef F_2_053 +#undef F_2_562 +#undef F_3_072 + +#define XFIX_P_0_298 v0.h[0] +#define XFIX_N_0_390 v0.h[1] +#define XFIX_P_0_541 v0.h[2] +#define XFIX_P_0_765 v0.h[3] +#define XFIX_N_0_899 v0.h[4] +#define XFIX_P_1_175 v0.h[5] +#define XFIX_P_1_501 v0.h[6] +#define XFIX_N_1_847 v0.h[7] +#define XFIX_N_1_961 v1.h[0] +#define XFIX_P_2_053 v1.h[1] +#define XFIX_N_2_562 v1.h[2] +#define XFIX_P_3_072 v1.h[3] asm_function jsimd_idct_islow_neon - DCT_TABLE .req x0 COEF_BLOCK .req x1 OUTPUT_BUF .req x2 OUTPUT_COL .req x3 TMP1 .req x0 TMP2 .req x1 - TMP3 .req x2 - TMP4 .req x15 + TMP3 .req x9 + TMP4 .req x10 + TMP5 .req x11 + TMP6 .req x12 + TMP7 .req x13 + TMP8 .req x14 - ROW0L .req v16 - ROW0R .req v17 - ROW1L .req v18 - ROW1R .req v19 - ROW2L .req v20 - ROW2R .req v21 - ROW3L .req v22 - ROW3R .req v23 - ROW4L .req v24 - ROW4R .req v25 - ROW5L .req v26 - ROW5R .req v27 - ROW6L .req v28 - ROW6R .req v29 - ROW7L .req v30 - ROW7R .req v31 - /* Save all NEON registers and x15 (32 NEON registers * 8 bytes + 16) */ - sub sp, sp, 272 - str x15, [sp], 16 + sub sp, sp, #64 adr x15, Ljsimd_idct_islow_neon_consts - st1 {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32 - st1 {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32 - st1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 - st1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 - st1 {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32 - st1 {v20.8b, v21.8b, v22.8b, v23.8b}, [sp], 32 - st1 {v24.8b, v25.8b, v26.8b, v27.8b}, [sp], 32 - st1 {v28.8b, v29.8b, v30.8b, v31.8b}, [sp], 32 - ld1 {v16.4h, v17.4h, v18.4h, v19.4h}, [COEF_BLOCK], 32 - ld1 {v0.4h, v1.4h, v2.4h, v3.4h}, [DCT_TABLE], 32 - ld1 {v20.4h, v21.4h, v22.4h, v23.4h}, [COEF_BLOCK], 32 - mul v16.4h, v16.4h, v0.4h - mul v17.4h, v17.4h, v1.4h - ins v16.d[1], v17.d[0] /* 128 bit q8 */ - ld1 {v4.4h, v5.4h, v6.4h, v7.4h}, [DCT_TABLE], 32 - mul v18.4h, v18.4h, v2.4h - mul v19.4h, v19.4h, v3.4h - ins v18.d[1], v19.d[0] /* 128 bit q9 */ - ld1 {v24.4h, v25.4h, v26.4h, v27.4h}, [COEF_BLOCK], 32 - mul v20.4h, v20.4h, v4.4h - mul v21.4h, v21.4h, v5.4h - ins v20.d[1], v21.d[0] /* 128 bit q10 */ - ld1 {v0.4h, v1.4h, v2.4h, v3.4h}, [DCT_TABLE], 32 - mul v22.4h, v22.4h, v6.4h - mul v23.4h, v23.4h, v7.4h - ins v22.d[1], v23.d[0] /* 128 bit q11 */ - ld1 {v28.4h, v29.4h, v30.4h, v31.4h}, [COEF_BLOCK] - mul v24.4h, v24.4h, v0.4h - mul v25.4h, v25.4h, v1.4h - ins v24.d[1], v25.d[0] /* 128 bit q12 */ - ld1 {v4.4h, v5.4h, v6.4h, v7.4h}, [DCT_TABLE], 32 - mul v28.4h, v28.4h, v4.4h - mul v29.4h, v29.4h, v5.4h - ins v28.d[1], v29.d[0] /* 128 bit q14 */ - mul v26.4h, v26.4h, v2.4h - mul v27.4h, v27.4h, v3.4h - ins v26.d[1], v27.d[0] /* 128 bit q13 */ - ld1 {v0.4h, v1.4h, v2.4h, v3.4h}, [x15] /* load constants */ - add x15, x15, #16 - mul v30.4h, v30.4h, v6.4h - mul v31.4h, v31.4h, v7.4h - ins v30.d[1], v31.d[0] /* 128 bit q15 */ - /* Go to the bottom of the stack */ - sub sp, sp, 352 - stp x4, x5, [sp], 16 - st1 {v8.4h, v9.4h, v10.4h, v11.4h}, [sp], 32 /* save NEON registers */ - st1 {v12.4h, v13.4h, v14.4h, v15.4h}, [sp], 32 - /* 1-D IDCT, pass 1, left 4x8 half */ - add v4.4h, ROW7L.4h, ROW3L.4h - add v5.4h, ROW5L.4h, ROW1L.4h - smull v12.4s, v4.4h, XFIX_1_175875602_MINUS_1_961570560 - smlal v12.4s, v5.4h, XFIX_1_175875602 - smull v14.4s, v4.4h, XFIX_1_175875602 - /* Check for the zero coefficients in the right 4x8 half */ - smlal v14.4s, v5.4h, XFIX_1_175875602_MINUS_0_390180644 - ssubl v6.4s, ROW0L.4h, ROW4L.4h - ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 1 * 8))] - smull v4.4s, ROW2L.4h, XFIX_0_541196100 - smlal v4.4s, ROW6L.4h, XFIX_0_541196100_MINUS_1_847759065 - orr x0, x4, x5 - mov v8.16b, v12.16b - smlsl v12.4s, ROW5L.4h, XFIX_2_562915447 - ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 2 * 8))] - smlal v12.4s, ROW3L.4h, XFIX_3_072711026_MINUS_2_562915447 - shl v6.4s, v6.4s, #13 - orr x0, x0, x4 - smlsl v8.4s, ROW1L.4h, XFIX_0_899976223 - orr x0, x0 , x5 - add v2.4s, v6.4s, v4.4s - ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 3 * 8))] - mov v10.16b, v14.16b - add v2.4s, v2.4s, v12.4s - orr x0, x0, x4 - smlsl v14.4s, ROW7L.4h, XFIX_0_899976223 - orr x0, x0, x5 - smlal v14.4s, ROW1L.4h, XFIX_1_501321110_MINUS_0_899976223 - rshrn ROW1L.4h, v2.4s, #11 - ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 4 * 8))] - sub v2.4s, v2.4s, v12.4s - smlal v10.4s, ROW5L.4h, XFIX_2_053119869_MINUS_2_562915447 - orr x0, x0, x4 - smlsl v10.4s, ROW3L.4h, XFIX_2_562915447 - orr x0, x0, x5 - sub v2.4s, v2.4s, v12.4s - smull v12.4s, ROW2L.4h, XFIX_0_541196100_PLUS_0_765366865 - ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 5 * 8))] - smlal v12.4s, ROW6L.4h, XFIX_0_541196100 - sub v6.4s, v6.4s, v4.4s - orr x0, x0, x4 - rshrn ROW6L.4h, v2.4s, #11 - orr x0, x0, x5 - add v2.4s, v6.4s, v10.4s - ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 6 * 8))] - sub v6.4s, v6.4s, v10.4s - saddl v10.4s, ROW0L.4h, ROW4L.4h - orr x0, x0, x4 - rshrn ROW2L.4h, v2.4s, #11 - orr x0, x0, x5 - rshrn ROW5L.4h, v6.4s, #11 - ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 7 * 8))] - shl v10.4s, v10.4s, #13 - smlal v8.4s, ROW7L.4h, XFIX_0_298631336_MINUS_0_899976223 - orr x0, x0, x4 - add v4.4s, v10.4s, v12.4s - orr x0, x0, x5 - cmp x0, #0 /* orrs instruction removed */ - sub v2.4s, v10.4s, v12.4s - add v12.4s, v4.4s, v14.4s - ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 0 * 8))] - sub v4.4s, v4.4s, v14.4s - add v10.4s, v2.4s, v8.4s - orr x0, x4, x5 - sub v6.4s, v2.4s, v8.4s - /* pop {x4, x5} */ - sub sp, sp, 80 - ldp x4, x5, [sp], 16 - rshrn ROW7L.4h, v4.4s, #11 - rshrn ROW3L.4h, v10.4s, #11 - rshrn ROW0L.4h, v12.4s, #11 - rshrn ROW4L.4h, v6.4s, #11 + st1 { v8.8b, v9.8b, v10.8b, v11.8b}, [sp], #32 + st1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], #32 + ld1 { v0.8h, v1.8h}, [x15] + ld1 { v2.8h, v3.8h, v4.8h, v5.8h}, [COEF_BLOCK], #64 + ld1 {v18.8h, v19.8h, v20.8h, v21.8h}, [DCT_TABLE], #64 + ld1 { v6.8h, v7.8h, v8.8h, v9.8h}, [COEF_BLOCK], #64 + ld1 {v22.8h, v23.8h, v24.8h, v25.8h}, [DCT_TABLE], #64 - b.eq 3f /* Go to do some special handling for the sparse right 4x8 half */ + cmeq v16.8h, v3.8h, #0 + cmeq v26.8h, v4.8h, #0 + cmeq v27.8h, v5.8h, #0 + cmeq v28.8h, v6.8h, #0 + cmeq v29.8h, v7.8h, #0 + cmeq v30.8h, v8.8h, #0 + cmeq v31.8h, v9.8h, #0 - /* 1-D IDCT, pass 1, right 4x8 half */ - ld1 {v2.4h}, [x15] /* reload constants */ - add v10.4h, ROW7R.4h, ROW3R.4h - add v8.4h, ROW5R.4h, ROW1R.4h - /* Transpose ROW6L <-> ROW7L (v3 available free register) */ - transpose ROW6L, ROW7L, v3, .16b, .4h - smull v12.4s, v10.4h, XFIX_1_175875602_MINUS_1_961570560 - smlal v12.4s, v8.4h, XFIX_1_175875602 - /* Transpose ROW2L <-> ROW3L (v3 available free register) */ - transpose ROW2L, ROW3L, v3, .16b, .4h - smull v14.4s, v10.4h, XFIX_1_175875602 - smlal v14.4s, v8.4h, XFIX_1_175875602_MINUS_0_390180644 - /* Transpose ROW0L <-> ROW1L (v3 available free register) */ - transpose ROW0L, ROW1L, v3, .16b, .4h - ssubl v6.4s, ROW0R.4h, ROW4R.4h - smull v4.4s, ROW2R.4h, XFIX_0_541196100 - smlal v4.4s, ROW6R.4h, XFIX_0_541196100_MINUS_1_847759065 - /* Transpose ROW4L <-> ROW5L (v3 available free register) */ - transpose ROW4L, ROW5L, v3, .16b, .4h - mov v8.16b, v12.16b - smlsl v12.4s, ROW5R.4h, XFIX_2_562915447 - smlal v12.4s, ROW3R.4h, XFIX_3_072711026_MINUS_2_562915447 - /* Transpose ROW1L <-> ROW3L (v3 available free register) */ - transpose ROW1L, ROW3L, v3, .16b, .2s - shl v6.4s, v6.4s, #13 - smlsl v8.4s, ROW1R.4h, XFIX_0_899976223 - /* Transpose ROW4L <-> ROW6L (v3 available free register) */ - transpose ROW4L, ROW6L, v3, .16b, .2s - add v2.4s, v6.4s, v4.4s - mov v10.16b, v14.16b - add v2.4s, v2.4s, v12.4s - /* Transpose ROW0L <-> ROW2L (v3 available free register) */ - transpose ROW0L, ROW2L, v3, .16b, .2s - smlsl v14.4s, ROW7R.4h, XFIX_0_899976223 - smlal v14.4s, ROW1R.4h, XFIX_1_501321110_MINUS_0_899976223 - rshrn ROW1R.4h, v2.4s, #11 - /* Transpose ROW5L <-> ROW7L (v3 available free register) */ - transpose ROW5L, ROW7L, v3, .16b, .2s - sub v2.4s, v2.4s, v12.4s - smlal v10.4s, ROW5R.4h, XFIX_2_053119869_MINUS_2_562915447 - smlsl v10.4s, ROW3R.4h, XFIX_2_562915447 - sub v2.4s, v2.4s, v12.4s - smull v12.4s, ROW2R.4h, XFIX_0_541196100_PLUS_0_765366865 - smlal v12.4s, ROW6R.4h, XFIX_0_541196100 - sub v6.4s, v6.4s, v4.4s - rshrn ROW6R.4h, v2.4s, #11 - add v2.4s, v6.4s, v10.4s - sub v6.4s, v6.4s, v10.4s - saddl v10.4s, ROW0R.4h, ROW4R.4h - rshrn ROW2R.4h, v2.4s, #11 - rshrn ROW5R.4h, v6.4s, #11 - shl v10.4s, v10.4s, #13 - smlal v8.4s, ROW7R.4h, XFIX_0_298631336_MINUS_0_899976223 - add v4.4s, v10.4s, v12.4s - sub v2.4s, v10.4s, v12.4s - add v12.4s, v4.4s, v14.4s - sub v4.4s, v4.4s, v14.4s - add v10.4s, v2.4s, v8.4s - sub v6.4s, v2.4s, v8.4s - rshrn ROW7R.4h, v4.4s, #11 - rshrn ROW3R.4h, v10.4s, #11 - rshrn ROW0R.4h, v12.4s, #11 - rshrn ROW4R.4h, v6.4s, #11 - /* Transpose right 4x8 half */ - transpose ROW6R, ROW7R, v3, .16b, .4h - transpose ROW2R, ROW3R, v3, .16b, .4h - transpose ROW0R, ROW1R, v3, .16b, .4h - transpose ROW4R, ROW5R, v3, .16b, .4h - transpose ROW1R, ROW3R, v3, .16b, .2s - transpose ROW4R, ROW6R, v3, .16b, .2s - transpose ROW0R, ROW2R, v3, .16b, .2s - transpose ROW5R, ROW7R, v3, .16b, .2s + and v10.16b, v16.16b, v26.16b + and v11.16b, v27.16b, v28.16b + and v12.16b, v29.16b, v30.16b + and v13.16b, v31.16b, v10.16b + and v14.16b, v11.16b, v12.16b + mul v2.8h, v2.8h, v18.8h + and v15.16b, v13.16b, v14.16b + shl v10.8h, v2.8h, #(PASS1_BITS) + sqxtn v16.8b, v15.8h + mov TMP1, v16.d[0] + sub sp, sp, #64 + mvn TMP2, TMP1 -1: /* 1-D IDCT, pass 2 (normal variant), left 4x8 half */ - ld1 {v2.4h}, [x15] /* reload constants */ - smull v12.4S, ROW1R.4h, XFIX_1_175875602 /* ROW5L.4h <-> ROW1R.4h */ - smlal v12.4s, ROW1L.4h, XFIX_1_175875602 - smlal v12.4s, ROW3R.4h, XFIX_1_175875602_MINUS_1_961570560 /* ROW7L.4h <-> ROW3R.4h */ - smlal v12.4s, ROW3L.4h, XFIX_1_175875602_MINUS_1_961570560 - smull v14.4s, ROW3R.4h, XFIX_1_175875602 /* ROW7L.4h <-> ROW3R.4h */ - smlal v14.4s, ROW3L.4h, XFIX_1_175875602 - smlal v14.4s, ROW1R.4h, XFIX_1_175875602_MINUS_0_390180644 /* ROW5L.4h <-> ROW1R.4h */ - smlal v14.4s, ROW1L.4h, XFIX_1_175875602_MINUS_0_390180644 - ssubl v6.4s, ROW0L.4h, ROW0R.4h /* ROW4L.4h <-> ROW0R.4h */ - smull v4.4s, ROW2L.4h, XFIX_0_541196100 - smlal v4.4s, ROW2R.4h, XFIX_0_541196100_MINUS_1_847759065 /* ROW6L.4h <-> ROW2R.4h */ - mov v8.16b, v12.16b - smlsl v12.4s, ROW1R.4h, XFIX_2_562915447 /* ROW5L.4h <-> ROW1R.4h */ - smlal v12.4s, ROW3L.4h, XFIX_3_072711026_MINUS_2_562915447 - shl v6.4s, v6.4s, #13 - smlsl v8.4s, ROW1L.4h, XFIX_0_899976223 - add v2.4s, v6.4s, v4.4s - mov v10.16b, v14.16b - add v2.4s, v2.4s, v12.4s - smlsl v14.4s, ROW3R.4h, XFIX_0_899976223 /* ROW7L.4h <-> ROW3R.4h */ - smlal v14.4s, ROW1L.4h, XFIX_1_501321110_MINUS_0_899976223 - shrn ROW1L.4h, v2.4s, #16 - sub v2.4s, v2.4s, v12.4s - smlal v10.4s, ROW1R.4h, XFIX_2_053119869_MINUS_2_562915447 /* ROW5L.4h <-> ROW1R.4h */ - smlsl v10.4s, ROW3L.4h, XFIX_2_562915447 - sub v2.4s, v2.4s, v12.4s - smull v12.4s, ROW2L.4h, XFIX_0_541196100_PLUS_0_765366865 - smlal v12.4s, ROW2R.4h, XFIX_0_541196100 /* ROW6L.4h <-> ROW2R.4h */ - sub v6.4s, v6.4s, v4.4s - shrn ROW2R.4h, v2.4s, #16 /* ROW6L.4h <-> ROW2R.4h */ - add v2.4s, v6.4s, v10.4s - sub v6.4s, v6.4s, v10.4s - saddl v10.4s, ROW0L.4h, ROW0R.4h /* ROW4L.4h <-> ROW0R.4h */ - shrn ROW2L.4h, v2.4s, #16 - shrn ROW1R.4h, v6.4s, #16 /* ROW5L.4h <-> ROW1R.4h */ - shl v10.4s, v10.4s, #13 - smlal v8.4s, ROW3R.4h, XFIX_0_298631336_MINUS_0_899976223 /* ROW7L.4h <-> ROW3R.4h */ - add v4.4s, v10.4s, v12.4s - sub v2.4s, v10.4s, v12.4s - add v12.4s, v4.4s, v14.4s - sub v4.4s, v4.4s, v14.4s - add v10.4s, v2.4s, v8.4s - sub v6.4s, v2.4s, v8.4s - shrn ROW3R.4h, v4.4s, #16 /* ROW7L.4h <-> ROW3R.4h */ - shrn ROW3L.4h, v10.4s, #16 - shrn ROW0L.4h, v12.4s, #16 - shrn ROW0R.4h, v6.4s, #16 /* ROW4L.4h <-> ROW0R.4h */ - /* 1-D IDCT, pass 2, right 4x8 half */ - ld1 {v2.4h}, [x15] /* reload constants */ - smull v12.4s, ROW5R.4h, XFIX_1_175875602 - smlal v12.4s, ROW5L.4h, XFIX_1_175875602 /* ROW5L.4h <-> ROW1R.4h */ - smlal v12.4s, ROW7R.4h, XFIX_1_175875602_MINUS_1_961570560 - smlal v12.4s, ROW7L.4h, XFIX_1_175875602_MINUS_1_961570560 /* ROW7L.4h <-> ROW3R.4h */ - smull v14.4s, ROW7R.4h, XFIX_1_175875602 - smlal v14.4s, ROW7L.4h, XFIX_1_175875602 /* ROW7L.4h <-> ROW3R.4h */ - smlal v14.4s, ROW5R.4h, XFIX_1_175875602_MINUS_0_390180644 - smlal v14.4s, ROW5L.4h, XFIX_1_175875602_MINUS_0_390180644 /* ROW5L.4h <-> ROW1R.4h */ - ssubl v6.4s, ROW4L.4h, ROW4R.4h /* ROW4L.4h <-> ROW0R.4h */ - smull v4.4s, ROW6L.4h, XFIX_0_541196100 /* ROW6L.4h <-> ROW2R.4h */ - smlal v4.4s, ROW6R.4h, XFIX_0_541196100_MINUS_1_847759065 - mov v8.16b, v12.16b - smlsl v12.4s, ROW5R.4h, XFIX_2_562915447 - smlal v12.4s, ROW7L.4h, XFIX_3_072711026_MINUS_2_562915447 /* ROW7L.4h <-> ROW3R.4h */ - shl v6.4s, v6.4s, #13 - smlsl v8.4s, ROW5L.4h, XFIX_0_899976223 /* ROW5L.4h <-> ROW1R.4h */ - add v2.4s, v6.4s, v4.4s - mov v10.16b, v14.16b - add v2.4s, v2.4s, v12.4s - smlsl v14.4s, ROW7R.4h, XFIX_0_899976223 - smlal v14.4s, ROW5L.4h, XFIX_1_501321110_MINUS_0_899976223 /* ROW5L.4h <-> ROW1R.4h */ - shrn ROW5L.4h, v2.4s, #16 /* ROW5L.4h <-> ROW1R.4h */ - sub v2.4s, v2.4s, v12.4s - smlal v10.4s, ROW5R.4h, XFIX_2_053119869_MINUS_2_562915447 - smlsl v10.4s, ROW7L.4h, XFIX_2_562915447 /* ROW7L.4h <-> ROW3R.4h */ - sub v2.4s, v2.4s, v12.4s - smull v12.4s, ROW6L.4h, XFIX_0_541196100_PLUS_0_765366865 /* ROW6L.4h <-> ROW2R.4h */ - smlal v12.4s, ROW6R.4h, XFIX_0_541196100 - sub v6.4s, v6.4s, v4.4s - shrn ROW6R.4h, v2.4s, #16 - add v2.4s, v6.4s, v10.4s - sub v6.4s, v6.4s, v10.4s - saddl v10.4s, ROW4L.4h, ROW4R.4h /* ROW4L.4h <-> ROW0R.4h */ - shrn ROW6L.4h, v2.4s, #16 /* ROW6L.4h <-> ROW2R.4h */ - shrn ROW5R.4h, v6.4s, #16 - shl v10.4s, v10.4s, #13 - smlal v8.4s, ROW7R.4h, XFIX_0_298631336_MINUS_0_899976223 - add v4.4s, v10.4s, v12.4s - sub v2.4s, v10.4s, v12.4s - add v12.4s, v4.4s, v14.4s - sub v4.4s, v4.4s, v14.4s - add v10.4s, v2.4s, v8.4s - sub v6.4s, v2.4s, v8.4s - shrn ROW7R.4h, v4.4s, #16 - shrn ROW7L.4h, v10.4s, #16 /* ROW7L.4h <-> ROW3R.4h */ - shrn ROW4L.4h, v12.4s, #16 /* ROW4L.4h <-> ROW0R.4h */ - shrn ROW4R.4h, v6.4s, #16 + cbnz TMP2, 2f + /* case all AC coeffs are zeros */ + dup v2.2d, v10.d[0] + dup v6.2d, v10.d[1] + mov v3.16b, v2.16b + mov v7.16b, v6.16b + mov v4.16b, v2.16b + mov v8.16b, v6.16b + mov v5.16b, v2.16b + mov v9.16b, v6.16b +1: + /* for this transpose, we should organise data like this: + * 00, 01, 02, 03, 40, 41, 42, 43 + * 10, 11, 12, 13, 50, 51, 52, 53 + * 20, 21, 22, 23, 60, 61, 62, 63 + * 30, 31, 32, 33, 70, 71, 72, 73 + * 04, 05, 06, 07, 44, 45, 46, 47 + * 14, 15, 16, 17, 54, 55, 56, 57 + * 24, 25, 26, 27, 64, 65, 66, 67 + * 34, 35, 36, 37, 74, 75, 76, 77 + */ + trn1 v28.8h, v2.8h, v3.8h + trn1 v29.8h, v4.8h, v5.8h + trn1 v30.8h, v6.8h, v7.8h + trn1 v31.8h, v8.8h, v9.8h + trn2 v16.8h, v2.8h, v3.8h + trn2 v17.8h, v4.8h, v5.8h + trn2 v18.8h, v6.8h, v7.8h + trn2 v19.8h, v8.8h, v9.8h + trn1 v2.4s, v28.4s, v29.4s + trn1 v6.4s, v30.4s, v31.4s + trn1 v3.4s, v16.4s, v17.4s + trn1 v7.4s, v18.4s, v19.4s + trn2 v4.4s, v28.4s, v29.4s + trn2 v8.4s, v30.4s, v31.4s + trn2 v5.4s, v16.4s, v17.4s + trn2 v9.4s, v18.4s, v19.4s + /* Even part: reverse the even part of the forward DCT. */ + add v18.8h, v4.8h, v8.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ + add v22.8h, v2.8h, v6.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull2 v19.4s, v18.8h, XFIX_P_0_541 /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sub v26.8h, v2.8h, v6.8h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sshll2 v23.4s, v22.8h, #(CONST_BITS) /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + mov v21.16b, v19.16b /* tmp3 = z1 */ + mov v20.16b, v18.16b /* tmp3 = z1 */ + smlal2 v19.4s, v8.8h, XFIX_N_1_847 /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + smlal v18.4s, v8.4h, XFIX_N_1_847 /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + sshll2 v27.4s, v26.8h, #(CONST_BITS) /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + smlal2 v21.4s, v4.8h, XFIX_P_0_765 /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + smlal v20.4s, v4.4h, XFIX_P_0_765 /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + sshll v22.4s, v22.4h, #(CONST_BITS) /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + sshll v26.4s, v26.4h, #(CONST_BITS) /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + add v2.4s, v22.4s, v20.4s /* tmp10l tmp10 = tmp0 + tmp3; */ + sub v6.4s, v22.4s, v20.4s /* tmp13l tmp13 = tmp0 - tmp3; */ + add v8.4s, v26.4s, v18.4s /* tmp11l tmp11 = tmp1 + tmp2; */ + sub v4.4s, v26.4s, v18.4s /* tmp12l tmp12 = tmp1 - tmp2; */ + add v28.4s, v23.4s, v21.4s /* tmp10h tmp10 = tmp0 + tmp3; */ + sub v31.4s, v23.4s, v21.4s /* tmp13h tmp13 = tmp0 - tmp3; */ + add v29.4s, v27.4s, v19.4s /* tmp11h tmp11 = tmp1 + tmp2; */ + sub v30.4s, v27.4s, v19.4s /* tmp12h tmp12 = tmp1 - tmp2; */ -2: /* Descale to 8-bit and range limit */ - ins v16.d[1], v17.d[0] - ins v18.d[1], v19.d[0] - ins v20.d[1], v21.d[0] - ins v22.d[1], v23.d[0] - sqrshrn v16.8b, v16.8h, #2 - sqrshrn2 v16.16b, v18.8h, #2 - sqrshrn v18.8b, v20.8h, #2 - sqrshrn2 v18.16b, v22.8h, #2 + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ - /* vpop {v8.4h - d15.4h} */ /* restore NEON registers */ - ld1 {v8.4h, v9.4h, v10.4h, v11.4h}, [sp], 32 - ld1 {v12.4h, v13.4h, v14.4h, v15.4h}, [sp], 32 - ins v24.d[1], v25.d[0] + add v22.8h, v9.8h, v5.8h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v24.8h, v7.8h, v3.8h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v18.8h, v9.8h, v3.8h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v20.8h, v7.8h, v5.8h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v26.8h, v22.8h, v24.8h /* z5 = z3 + z4 */ - sqrshrn v20.8b, v24.8h, #2 - /* Transpose the final 8-bit samples and do signed->unsigned conversion */ - /* trn1 v16.8h, v16.8h, v18.8h */ - transpose v16, v18, v3, .16b, .8h - ins v26.d[1], v27.d[0] - ins v28.d[1], v29.d[0] - ins v30.d[1], v31.d[0] - sqrshrn2 v20.16b, v26.8h, #2 - sqrshrn v22.8b, v28.8h, #2 + smull2 v11.4s, v9.8h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull2 v13.4s, v7.8h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull2 v15.4s, v5.8h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull2 v17.4s, v3.8h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull2 v27.4s, v26.8h, XFIX_P_1_175 /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull2 v23.4s, v22.8h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull2 v25.4s, v24.8h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull2 v19.4s, v18.8h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull2 v21.4s, v20.8h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + + smull v10.4s, v9.4h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull v12.4s, v7.4h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull v14.4s, v5.4h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull v16.4s, v3.4h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull v26.4s, v26.4h, XFIX_P_1_175 /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull v22.4s, v22.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull v24.4s, v24.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull v18.4s, v18.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull v20.4s, v20.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + + add v23.4s, v23.4s, v27.4s /* z3 += z5 */ + add v22.4s, v22.4s, v26.4s /* z3 += z5 */ + add v25.4s, v25.4s, v27.4s /* z4 += z5 */ + add v24.4s, v24.4s, v26.4s /* z4 += z5 */ + + add v11.4s, v11.4s, v19.4s /* tmp0 += z1 */ + add v10.4s, v10.4s, v18.4s /* tmp0 += z1 */ + add v13.4s, v13.4s, v21.4s /* tmp1 += z2 */ + add v12.4s, v12.4s, v20.4s /* tmp1 += z2 */ + add v15.4s, v15.4s, v21.4s /* tmp2 += z2 */ + add v14.4s, v14.4s, v20.4s /* tmp2 += z2 */ + add v17.4s, v17.4s, v19.4s /* tmp3 += z1 */ + add v16.4s, v16.4s, v18.4s /* tmp3 += z1 */ + + add v11.4s, v11.4s, v23.4s /* tmp0 += z3 */ + add v10.4s, v10.4s, v22.4s /* tmp0 += z3 */ + add v13.4s, v13.4s, v25.4s /* tmp1 += z4 */ + add v12.4s, v12.4s, v24.4s /* tmp1 += z4 */ + add v17.4s, v17.4s, v25.4s /* tmp3 += z4 */ + add v16.4s, v16.4s, v24.4s /* tmp3 += z4 */ + add v15.4s, v15.4s, v23.4s /* tmp2 += z3 */ + add v14.4s, v14.4s, v22.4s /* tmp2 += z3 */ + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + add v18.4s, v2.4s, v16.4s /* tmp10 + tmp3 */ + add v19.4s, v28.4s, v17.4s /* tmp10 + tmp3 */ + sub v20.4s, v2.4s, v16.4s /* tmp10 - tmp3 */ + sub v21.4s, v28.4s, v17.4s /* tmp10 - tmp3 */ + add v22.4s, v8.4s, v14.4s /* tmp11 + tmp2 */ + add v23.4s, v29.4s, v15.4s /* tmp11 + tmp2 */ + sub v24.4s, v8.4s, v14.4s /* tmp11 - tmp2 */ + sub v25.4s, v29.4s, v15.4s /* tmp11 - tmp2 */ + add v26.4s, v4.4s, v12.4s /* tmp12 + tmp1 */ + add v27.4s, v30.4s, v13.4s /* tmp12 + tmp1 */ + sub v28.4s, v4.4s, v12.4s /* tmp12 - tmp1 */ + sub v29.4s, v30.4s, v13.4s /* tmp12 - tmp1 */ + add v14.4s, v6.4s, v10.4s /* tmp13 + tmp0 */ + add v15.4s, v31.4s, v11.4s /* tmp13 + tmp0 */ + sub v16.4s, v6.4s, v10.4s /* tmp13 - tmp0 */ + sub v17.4s, v31.4s, v11.4s /* tmp13 - tmp0 */ + + shrn v2.4h, v18.4s, #16 /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) */ + shrn v9.4h, v20.4s, #16 /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3) */ + shrn v3.4h, v22.4s, #16 /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3) */ + shrn v8.4h, v24.4s, #16 /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3) */ + shrn v4.4h, v26.4s, #16 /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3) */ + shrn v7.4h, v28.4s, #16 /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3) */ + shrn v5.4h, v14.4s, #16 /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3) */ + shrn v6.4h, v16.4s, #16 /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) */ + shrn2 v2.8h, v19.4s, #16 /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) */ + shrn2 v9.8h, v21.4s, #16 /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3) */ + shrn2 v3.8h, v23.4s, #16 /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3) */ + shrn2 v8.8h, v25.4s, #16 /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3) */ + shrn2 v4.8h, v27.4s, #16 /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3) */ + shrn2 v7.8h, v29.4s, #16 /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3) */ + shrn2 v5.8h, v15.4s, #16 /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3) */ + shrn2 v6.8h, v17.4s, #16 /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) */ movi v0.16b, #(CENTERJSAMPLE) - sqrshrn2 v22.16b, v30.8h, #2 - transpose_single v16, v17, v3, .d, .8b - transpose_single v18, v19, v3, .d, .8b - add v16.8b, v16.8b, v0.8b - add v17.8b, v17.8b, v0.8b - add v18.8b, v18.8b, v0.8b - add v19.8b, v19.8b, v0.8b - transpose v20, v22, v3, .16b, .8h +/* Prepare pointers (dual-issue with NEON instructions) */ + ldp TMP1, TMP2, [OUTPUT_BUF], 16 + sqrshrn v28.8b, v2.8h, #(CONST_BITS+PASS1_BITS+3-16) + ldp TMP3, TMP4, [OUTPUT_BUF], 16 + sqrshrn v29.8b, v3.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP1, TMP1, OUTPUT_COL + sqrshrn v30.8b, v4.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP2, TMP2, OUTPUT_COL + sqrshrn v31.8b, v5.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP3, TMP3, OUTPUT_COL + sqrshrn2 v28.16b, v6.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP4, TMP4, OUTPUT_COL + sqrshrn2 v29.16b, v7.8h, #(CONST_BITS+PASS1_BITS+3-16) + ldp TMP5, TMP6, [OUTPUT_BUF], 16 + sqrshrn2 v30.16b, v8.8h, #(CONST_BITS+PASS1_BITS+3-16) + ldp TMP7, TMP8, [OUTPUT_BUF], 16 + sqrshrn2 v31.16b, v9.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP5, TMP5, OUTPUT_COL + add v16.16b, v28.16b, v0.16b + add TMP6, TMP6, OUTPUT_COL + add v18.16b, v29.16b, v0.16b + add TMP7, TMP7, OUTPUT_COL + add v20.16b, v30.16b, v0.16b + add TMP8, TMP8, OUTPUT_COL + add v22.16b, v31.16b, v0.16b + + /* Transpose the final 8-bit samples */ + trn1 v28.16b, v16.16b, v18.16b + trn1 v30.16b, v20.16b, v22.16b + trn2 v29.16b, v16.16b, v18.16b + trn2 v31.16b, v20.16b, v22.16b + + trn1 v16.8h, v28.8h, v30.8h + trn2 v18.8h, v28.8h, v30.8h + trn1 v20.8h, v29.8h, v31.8h + trn2 v22.8h, v29.8h, v31.8h + + uzp1 v28.4s, v16.4s, v18.4s + uzp2 v30.4s, v16.4s, v18.4s + uzp1 v29.4s, v20.4s, v22.4s + uzp2 v31.4s, v20.4s, v22.4s + /* Store results to the output buffer */ - ldp TMP1, TMP2, [OUTPUT_BUF], 16 - add TMP1, TMP1, OUTPUT_COL - add TMP2, TMP2, OUTPUT_COL - st1 {v16.8b}, [TMP1] - transpose_single v20, v21, v3, .d, .8b - st1 {v17.8b}, [TMP2] - ldp TMP1, TMP2, [OUTPUT_BUF], 16 - add TMP1, TMP1, OUTPUT_COL - add TMP2, TMP2, OUTPUT_COL - st1 {v18.8b}, [TMP1] - add v20.8b, v20.8b, v0.8b - add v21.8b, v21.8b, v0.8b - st1 {v19.8b}, [TMP2] - ldp TMP1, TMP2, [OUTPUT_BUF], 16 - ldp TMP3, TMP4, [OUTPUT_BUF] - add TMP1, TMP1, OUTPUT_COL - add TMP2, TMP2, OUTPUT_COL - add TMP3, TMP3, OUTPUT_COL - add TMP4, TMP4, OUTPUT_COL - transpose_single v22, v23, v3, .d, .8b - st1 {v20.8b}, [TMP1] - add v22.8b, v22.8b, v0.8b - add v23.8b, v23.8b, v0.8b - st1 {v21.8b}, [TMP2] - st1 {v22.8b}, [TMP3] - st1 {v23.8b}, [TMP4] - ldr x15, [sp], 16 - ld1 {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32 - ld1 {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32 - ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 - ld1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 - ld1 {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32 - ld1 {v20.8b, v21.8b, v22.8b, v23.8b}, [sp], 32 - ld1 {v24.8b, v25.8b, v26.8b, v27.8b}, [sp], 32 - ld1 {v28.8b, v29.8b, v30.8b, v31.8b}, [sp], 32 + st1 {v28.d}[0], [TMP1] + st1 {v29.d}[0], [TMP2] + st1 {v28.d}[1], [TMP3] + st1 {v29.d}[1], [TMP4] + st1 {v30.d}[0], [TMP5] + st1 {v31.d}[0], [TMP6] + st1 {v30.d}[1], [TMP7] + st1 {v31.d}[1], [TMP8] + ld1 { v8.8b, v9.8b, v10.8b, v11.8b}, [sp], #32 + ld1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], #32 blr x30 -3: /* Left 4x8 half is done, right 4x8 half contains mostly zeros */ +.balign 16 +2: + mul v3.8h, v3.8h, v19.8h + mul v4.8h, v4.8h, v20.8h + mul v5.8h, v5.8h, v21.8h + add TMP4, xzr, TMP2, LSL #32 + mul v6.8h, v6.8h, v22.8h + mul v7.8h, v7.8h, v23.8h + adds TMP3, xzr, TMP2, LSR #32 + mul v8.8h, v8.8h, v24.8h + mul v9.8h, v9.8h, v25.8h + b.ne 3f + /* Right AC coef is zero */ + dup v15.2d, v10.d[1] + /* Even part: reverse the even part of the forward DCT. */ + add v18.4h, v4.4h, v8.4h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ + add v22.4h, v2.4h, v6.4h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + sub v26.4h, v2.4h, v6.4h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sshll v22.4s, v22.4h, #(CONST_BITS) /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + mov v20.16b, v18.16b /* tmp3 = z1 */ + sshll v26.4s, v26.4h, #(CONST_BITS) /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + smlal v18.4s, v8.4h, XFIX_N_1_847 /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + smlal v20.4s, v4.4h, XFIX_P_0_765 /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + add v2.4s, v22.4s, v20.4s /* tmp10l tmp10 = tmp0 + tmp3; */ + sub v6.4s, v22.4s, v20.4s /* tmp13l tmp13 = tmp0 - tmp3; */ + add v8.4s, v26.4s, v18.4s /* tmp11l tmp11 = tmp1 + tmp2; */ + sub v4.4s, v26.4s, v18.4s /* tmp12l tmp12 = tmp1 - tmp2; */ - /* Transpose left 4x8 half */ - transpose ROW6L, ROW7L, v3, .16b, .4h - transpose ROW2L, ROW3L, v3, .16b, .4h - transpose ROW0L, ROW1L, v3, .16b, .4h - transpose ROW4L, ROW5L, v3, .16b, .4h - shl ROW0R.4h, ROW0R.4h, #2 /* PASS1_BITS */ - transpose ROW1L, ROW3L, v3, .16b, .2s - transpose ROW4L, ROW6L, v3, .16b, .2s - transpose ROW0L, ROW2L, v3, .16b, .2s - transpose ROW5L, ROW7L, v3, .16b, .2s - cmp x0, #0 - b.eq 4f /* Right 4x8 half has all zeros, go to 'sparse' second pass */ + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ - /* Only row 0 is non-zero for the right 4x8 half */ - dup ROW1R.4h, ROW0R.h[1] - dup ROW2R.4h, ROW0R.h[2] - dup ROW3R.4h, ROW0R.h[3] - dup ROW4R.4h, ROW0R.h[0] - dup ROW5R.4h, ROW0R.h[1] - dup ROW6R.4h, ROW0R.h[2] - dup ROW7R.4h, ROW0R.h[3] - dup ROW0R.4h, ROW0R.h[0] - b 1b /* Go to 'normal' second pass */ + add v22.4h, v9.4h, v5.4h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v24.4h, v7.4h, v3.4h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v18.4h, v9.4h, v3.4h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v20.4h, v7.4h, v5.4h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v26.4h, v22.4h, v24.4h /* z5 = z3 + z4 */ -4: /* 1-D IDCT, pass 2 (sparse variant with zero rows 4-7), left 4x8 half */ - ld1 {v2.4h}, [x15] /* reload constants */ - smull v12.4s, ROW1L.4h, XFIX_1_175875602 - smlal v12.4s, ROW3L.4h, XFIX_1_175875602_MINUS_1_961570560 - smull v14.4s, ROW3L.4h, XFIX_1_175875602 - smlal v14.4s, ROW1L.4h, XFIX_1_175875602_MINUS_0_390180644 - smull v4.4s, ROW2L.4h, XFIX_0_541196100 - sshll v6.4s, ROW0L.4h, #13 - mov v8.16b, v12.16b - smlal v12.4s, ROW3L.4h, XFIX_3_072711026_MINUS_2_562915447 - smlsl v8.4s, ROW1L.4h, XFIX_0_899976223 - add v2.4s, v6.4s, v4.4s - mov v10.16b, v14.16b - smlal v14.4s, ROW1L.4h, XFIX_1_501321110_MINUS_0_899976223 - add v2.4s, v2.4s, v12.4s - add v12.4s, v12.4s, v12.4s - smlsl v10.4s, ROW3L.4h, XFIX_2_562915447 - shrn ROW1L.4h, v2.4s, #16 - sub v2.4s, v2.4s, v12.4s - smull v12.4s, ROW2L.4h, XFIX_0_541196100_PLUS_0_765366865 - sub v6.4s, v6.4s, v4.4s - shrn ROW2R.4h, v2.4s, #16 /* ROW6L.4h <-> ROW2R.4h */ - add v2.4s, v6.4s, v10.4s - sub v6.4s, v6.4s, v10.4s - sshll v10.4s, ROW0L.4h, #13 - shrn ROW2L.4h, v2.4s, #16 - shrn ROW1R.4h, v6.4s, #16 /* ROW5L.4h <-> ROW1R.4h */ - add v4.4s, v10.4s, v12.4s - sub v2.4s, v10.4s, v12.4s - add v12.4s, v4.4s, v14.4s - sub v4.4s, v4.4s, v14.4s - add v10.4s, v2.4s, v8.4s - sub v6.4s, v2.4s, v8.4s - shrn ROW3R.4h, v4.4s, #16 /* ROW7L.4h <-> ROW3R.4h */ - shrn ROW3L.4h, v10.4s, #16 - shrn ROW0L.4h, v12.4s, #16 - shrn ROW0R.4h, v6.4s, #16 /* ROW4L.4h <-> ROW0R.4h */ - /* 1-D IDCT, pass 2 (sparse variant with zero rows 4-7), right 4x8 half */ - ld1 {v2.4h}, [x15] /* reload constants */ - smull v12.4s, ROW5L.4h, XFIX_1_175875602 - smlal v12.4s, ROW7L.4h, XFIX_1_175875602_MINUS_1_961570560 - smull v14.4s, ROW7L.4h, XFIX_1_175875602 - smlal v14.4s, ROW5L.4h, XFIX_1_175875602_MINUS_0_390180644 - smull v4.4s, ROW6L.4h, XFIX_0_541196100 - sshll v6.4s, ROW4L.4h, #13 - mov v8.16b, v12.16b - smlal v12.4s, ROW7L.4h, XFIX_3_072711026_MINUS_2_562915447 - smlsl v8.4s, ROW5L.4h, XFIX_0_899976223 - add v2.4s, v6.4s, v4.4s - mov v10.16b, v14.16b - smlal v14.4s, ROW5L.4h, XFIX_1_501321110_MINUS_0_899976223 - add v2.4s, v2.4s, v12.4s - add v12.4s, v12.4s, v12.4s - smlsl v10.4s, ROW7L.4h, XFIX_2_562915447 - shrn ROW5L.4h, v2.4s, #16 /* ROW5L.4h <-> ROW1R.4h */ - sub v2.4s, v2.4s, v12.4s - smull v12.4s, ROW6L.4h, XFIX_0_541196100_PLUS_0_765366865 - sub v6.4s, v6.4s, v4.4s - shrn ROW6R.4h, v2.4s, #16 - add v2.4s, v6.4s, v10.4s - sub v6.4s, v6.4s, v10.4s - sshll v10.4s, ROW4L.4h, #13 - shrn ROW6L.4h, v2.4s, #16 /* ROW6L.4h <-> ROW2R.4h */ - shrn ROW5R.4h, v6.4s, #16 - add v4.4s, v10.4s, v12.4s - sub v2.4s, v10.4s, v12.4s - add v12.4s, v4.4s, v14.4s - sub v4.4s, v4.4s, v14.4s - add v10.4s, v2.4s, v8.4s - sub v6.4s, v2.4s, v8.4s - shrn ROW7R.4h, v4.4s, #16 - shrn ROW7L.4h, v10.4s, #16 /* ROW7L.4h <-> ROW3R.4h */ - shrn ROW4L.4h, v12.4s, #16 /* ROW4L.4h <-> ROW0R.4h */ - shrn ROW4R.4h, v6.4s, #16 - b 2b /* Go to epilogue */ + smull v10.4s, v9.4h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull v12.4s, v7.4h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull v14.4s, v5.4h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull v16.4s, v3.4h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull v26.4s, v26.4h, XFIX_P_1_175 /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull v22.4s, v22.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull v24.4s, v24.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull v18.4s, v18.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull v20.4s, v20.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + + add v22.4s, v22.4s, v26.4s /* z3 += z5 */ + add v24.4s, v24.4s, v26.4s /* z4 += z5 */ + + add v10.4s, v10.4s, v18.4s /* tmp0 += z1 */ + add v12.4s, v12.4s, v20.4s /* tmp1 += z2 */ + add v14.4s, v14.4s, v20.4s /* tmp2 += z2 */ + add v16.4s, v16.4s, v18.4s /* tmp3 += z1 */ + + add v10.4s, v10.4s, v22.4s /* tmp0 += z3 */ + add v12.4s, v12.4s, v24.4s /* tmp1 += z4 */ + add v16.4s, v16.4s, v24.4s /* tmp3 += z4 */ + add v14.4s, v14.4s, v22.4s /* tmp2 += z3 */ + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + add v18.4s, v2.4s, v16.4s /* tmp10 + tmp3 */ + sub v20.4s, v2.4s, v16.4s /* tmp10 - tmp3 */ + add v22.4s, v8.4s, v14.4s /* tmp11 + tmp2 */ + sub v24.4s, v8.4s, v14.4s /* tmp11 - tmp2 */ + add v26.4s, v4.4s, v12.4s /* tmp12 + tmp1 */ + sub v28.4s, v4.4s, v12.4s /* tmp12 - tmp1 */ + add v14.4s, v6.4s, v10.4s /* tmp13 + tmp0 */ + sub v16.4s, v6.4s, v10.4s /* tmp13 - tmp0 */ + + rshrn v2.4h, v18.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ + rshrn v3.4h, v22.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ + rshrn v4.4h, v26.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ + rshrn v5.4h, v14.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v2.8h, v16.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v3.8h, v28.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ + rshrn2 v4.8h, v24.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ + rshrn2 v5.8h, v20.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ + mov v6.16b, v15.16b + mov v7.16b, v15.16b + mov v8.16b, v15.16b + mov v9.16b, v15.16b + b 1b + +.balign 16 +3: + cbnz TMP4, 4f + /* Left AC coef is zero */ + dup v14.2d, v10.d[0] + /* Even part: reverse the even part of the forward DCT. */ + add v18.8h, v4.8h, v8.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ + add v22.8h, v2.8h, v6.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull2 v19.4s, v18.8h, XFIX_P_0_541 /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sub v26.8h, v2.8h, v6.8h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + sshll2 v23.4s, v22.8h, #(CONST_BITS) /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + mov v21.16b, v19.16b /* tmp3 = z1 */ + smlal2 v19.4s, v8.8h, XFIX_N_1_847 /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + sshll2 v27.4s, v26.8h, #(CONST_BITS) /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + smlal2 v21.4s, v4.8h, XFIX_P_0_765 /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + add v28.4s, v23.4s, v21.4s /* tmp10h tmp10 = tmp0 + tmp3; */ + sub v31.4s, v23.4s, v21.4s /* tmp13h tmp13 = tmp0 - tmp3; */ + add v29.4s, v27.4s, v19.4s /* tmp11h tmp11 = tmp1 + tmp2; */ + sub v30.4s, v27.4s, v19.4s /* tmp12h tmp12 = tmp1 - tmp2; */ + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + add v22.8h, v9.8h, v5.8h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v24.8h, v7.8h, v3.8h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v18.8h, v9.8h, v3.8h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v20.8h, v7.8h, v5.8h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v26.8h, v22.8h, v24.8h /* z5 = z3 + z4 */ + + smull2 v11.4s, v9.8h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull2 v13.4s, v7.8h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull2 v15.4s, v5.8h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull2 v17.4s, v3.8h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull2 v27.4s, v26.8h, XFIX_P_1_175 /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull2 v23.4s, v22.8h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull2 v25.4s, v24.8h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull2 v19.4s, v18.8h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull2 v21.4s, v20.8h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + + add v23.4s, v23.4s, v27.4s /* z3 += z5 */ + add v22.4s, v22.4s, v26.4s /* z3 += z5 */ + add v25.4s, v25.4s, v27.4s /* z4 += z5 */ + add v24.4s, v24.4s, v26.4s /* z4 += z5 */ + + add v11.4s, v11.4s, v19.4s /* tmp0 += z1 */ + add v13.4s, v13.4s, v21.4s /* tmp1 += z2 */ + add v15.4s, v15.4s, v21.4s /* tmp2 += z2 */ + add v17.4s, v17.4s, v19.4s /* tmp3 += z1 */ + + add v11.4s, v11.4s, v23.4s /* tmp0 += z3 */ + add v13.4s, v13.4s, v25.4s /* tmp1 += z4 */ + add v17.4s, v17.4s, v25.4s /* tmp3 += z4 */ + add v15.4s, v15.4s, v23.4s /* tmp2 += z3 */ + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + add v19.4s, v28.4s, v17.4s /* tmp10 + tmp3 */ + sub v21.4s, v28.4s, v17.4s /* tmp10 - tmp3 */ + add v23.4s, v29.4s, v15.4s /* tmp11 + tmp2 */ + sub v25.4s, v29.4s, v15.4s /* tmp11 - tmp2 */ + add v27.4s, v30.4s, v13.4s /* tmp12 + tmp1 */ + sub v29.4s, v30.4s, v13.4s /* tmp12 - tmp1 */ + add v15.4s, v31.4s, v11.4s /* tmp13 + tmp0 */ + sub v17.4s, v31.4s, v11.4s /* tmp13 - tmp0 */ + + mov v2.16b, v14.16b + mov v3.16b, v14.16b + mov v4.16b, v14.16b + mov v5.16b, v14.16b + rshrn v6.4h, v19.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ + rshrn v7.4h, v23.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ + rshrn v8.4h, v27.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ + rshrn v9.4h, v15.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v6.8h, v17.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v7.8h, v29.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ + rshrn2 v8.8h, v25.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ + rshrn2 v9.8h, v21.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ + b 1b + +.balign 16 +4: + /* "No" AC coef is zero */ + /* Even part: reverse the even part of the forward DCT. */ + add v18.8h, v4.8h, v8.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ + add v22.8h, v2.8h, v6.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull2 v19.4s, v18.8h, XFIX_P_0_541 /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sub v26.8h, v2.8h, v6.8h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sshll2 v23.4s, v22.8h, #(CONST_BITS) /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + mov v21.16b, v19.16b /* tmp3 = z1 */ + mov v20.16b, v18.16b /* tmp3 = z1 */ + smlal2 v19.4s, v8.8h, XFIX_N_1_847 /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + smlal v18.4s, v8.4h, XFIX_N_1_847 /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + sshll2 v27.4s, v26.8h, #(CONST_BITS) /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + smlal2 v21.4s, v4.8h, XFIX_P_0_765 /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + smlal v20.4s, v4.4h, XFIX_P_0_765 /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + sshll v22.4s, v22.4h, #(CONST_BITS) /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + sshll v26.4s, v26.4h, #(CONST_BITS) /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + add v2.4s, v22.4s, v20.4s /* tmp10l tmp10 = tmp0 + tmp3; */ + sub v6.4s, v22.4s, v20.4s /* tmp13l tmp13 = tmp0 - tmp3; */ + add v8.4s, v26.4s, v18.4s /* tmp11l tmp11 = tmp1 + tmp2; */ + sub v4.4s, v26.4s, v18.4s /* tmp12l tmp12 = tmp1 - tmp2; */ + add v28.4s, v23.4s, v21.4s /* tmp10h tmp10 = tmp0 + tmp3; */ + sub v31.4s, v23.4s, v21.4s /* tmp13h tmp13 = tmp0 - tmp3; */ + add v29.4s, v27.4s, v19.4s /* tmp11h tmp11 = tmp1 + tmp2; */ + sub v30.4s, v27.4s, v19.4s /* tmp12h tmp12 = tmp1 - tmp2; */ + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + add v22.8h, v9.8h, v5.8h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v24.8h, v7.8h, v3.8h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v18.8h, v9.8h, v3.8h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v20.8h, v7.8h, v5.8h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v26.8h, v22.8h, v24.8h /* z5 = z3 + z4 */ + + smull2 v11.4s, v9.8h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull2 v13.4s, v7.8h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull2 v15.4s, v5.8h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull2 v17.4s, v3.8h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull2 v27.4s, v26.8h, XFIX_P_1_175 /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull2 v23.4s, v22.8h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull2 v25.4s, v24.8h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull2 v19.4s, v18.8h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull2 v21.4s, v20.8h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + + smull v10.4s, v9.4h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull v12.4s, v7.4h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull v14.4s, v5.4h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull v16.4s, v3.4h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull v26.4s, v26.4h, XFIX_P_1_175 /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull v22.4s, v22.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull v24.4s, v24.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull v18.4s, v18.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull v20.4s, v20.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + + add v23.4s, v23.4s, v27.4s /* z3 += z5 */ + add v22.4s, v22.4s, v26.4s /* z3 += z5 */ + add v25.4s, v25.4s, v27.4s /* z4 += z5 */ + add v24.4s, v24.4s, v26.4s /* z4 += z5 */ + + add v11.4s, v11.4s, v19.4s /* tmp0 += z1 */ + add v10.4s, v10.4s, v18.4s /* tmp0 += z1 */ + add v13.4s, v13.4s, v21.4s /* tmp1 += z2 */ + add v12.4s, v12.4s, v20.4s /* tmp1 += z2 */ + add v15.4s, v15.4s, v21.4s /* tmp2 += z2 */ + add v14.4s, v14.4s, v20.4s /* tmp2 += z2 */ + add v17.4s, v17.4s, v19.4s /* tmp3 += z1 */ + add v16.4s, v16.4s, v18.4s /* tmp3 += z1 */ + + add v11.4s, v11.4s, v23.4s /* tmp0 += z3 */ + add v10.4s, v10.4s, v22.4s /* tmp0 += z3 */ + add v13.4s, v13.4s, v25.4s /* tmp1 += z4 */ + add v12.4s, v12.4s, v24.4s /* tmp1 += z4 */ + add v17.4s, v17.4s, v25.4s /* tmp3 += z4 */ + add v16.4s, v16.4s, v24.4s /* tmp3 += z4 */ + add v15.4s, v15.4s, v23.4s /* tmp2 += z3 */ + add v14.4s, v14.4s, v22.4s /* tmp2 += z3 */ + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + add v18.4s, v2.4s, v16.4s /* tmp10 + tmp3 */ + add v19.4s, v28.4s, v17.4s /* tmp10 + tmp3 */ + sub v20.4s, v2.4s, v16.4s /* tmp10 - tmp3 */ + sub v21.4s, v28.4s, v17.4s /* tmp10 - tmp3 */ + add v22.4s, v8.4s, v14.4s /* tmp11 + tmp2 */ + add v23.4s, v29.4s, v15.4s /* tmp11 + tmp2 */ + sub v24.4s, v8.4s, v14.4s /* tmp11 - tmp2 */ + sub v25.4s, v29.4s, v15.4s /* tmp11 - tmp2 */ + add v26.4s, v4.4s, v12.4s /* tmp12 + tmp1 */ + add v27.4s, v30.4s, v13.4s /* tmp12 + tmp1 */ + sub v28.4s, v4.4s, v12.4s /* tmp12 - tmp1 */ + sub v29.4s, v30.4s, v13.4s /* tmp12 - tmp1 */ + add v14.4s, v6.4s, v10.4s /* tmp13 + tmp0 */ + add v15.4s, v31.4s, v11.4s /* tmp13 + tmp0 */ + sub v16.4s, v6.4s, v10.4s /* tmp13 - tmp0 */ + sub v17.4s, v31.4s, v11.4s /* tmp13 - tmp0 */ + + rshrn v2.4h, v18.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ + rshrn v3.4h, v22.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ + rshrn v4.4h, v26.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ + rshrn v5.4h, v14.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ + rshrn v6.4h, v19.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ + rshrn v7.4h, v23.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ + rshrn v8.4h, v27.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ + rshrn v9.4h, v15.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v2.8h, v16.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v3.8h, v28.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ + rshrn2 v4.8h, v24.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ + rshrn2 v5.8h, v20.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ + rshrn2 v6.8h, v17.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v7.8h, v29.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ + rshrn2 v8.8h, v25.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ + rshrn2 v9.8h, v21.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ + b 1b .unreq DCT_TABLE .unreq COEF_BLOCK @@ -764,23 +740,26 @@ asm_function jsimd_idct_islow_neon .unreq TMP2 .unreq TMP3 .unreq TMP4 + .unreq TMP5 + .unreq TMP6 + .unreq TMP7 + .unreq TMP8 - .unreq ROW0L - .unreq ROW0R - .unreq ROW1L - .unreq ROW1R - .unreq ROW2L - .unreq ROW2R - .unreq ROW3L - .unreq ROW3R - .unreq ROW4L - .unreq ROW4R - .unreq ROW5L - .unreq ROW5R - .unreq ROW6L - .unreq ROW6R - .unreq ROW7L - .unreq ROW7R +#undef CENTERJSAMPLE +#undef CONST_BITS +#undef PASS1_BITS +#undef XFIX_P_0_298 +#undef XFIX_N_0_390 +#undef XFIX_P_0_541 +#undef XFIX_P_0_765 +#undef XFIX_N_0_899 +#undef XFIX_P_1_175 +#undef XFIX_P_1_501 +#undef XFIX_N_1_847 +#undef XFIX_N_1_961 +#undef XFIX_P_2_053 +#undef XFIX_N_2_562 +#undef XFIX_P_3_072 /*****************************************************************************/ @@ -821,261 +800,182 @@ asm_function jsimd_idct_ifast_neon OUTPUT_COL .req x3 TMP1 .req x0 TMP2 .req x1 - TMP3 .req x2 - TMP4 .req x22 - TMP5 .req x23 + TMP3 .req x9 + TMP4 .req x10 + TMP5 .req x11 + TMP6 .req x12 + TMP7 .req x13 + TMP8 .req x14 /* Load and dequantize coefficients into NEON registers * with the following allocation: * 0 1 2 3 | 4 5 6 7 * ---------+-------- - * 0 | d16 | d17 ( v8.8h ) - * 1 | d18 | d19 ( v9.8h ) - * 2 | d20 | d21 ( v10.8h ) - * 3 | d22 | d23 ( v11.8h ) - * 4 | d24 | d25 ( v12.8h ) - * 5 | d26 | d27 ( v13.8h ) - * 6 | d28 | d29 ( v14.8h ) - * 7 | d30 | d31 ( v15.8h ) + * 0 | d16 | d17 ( v16.8h ) + * 1 | d18 | d19 ( v17.8h ) + * 2 | d20 | d21 ( v18.8h ) + * 3 | d22 | d23 ( v19.8h ) + * 4 | d24 | d25 ( v20.8h ) + * 5 | d26 | d27 ( v21.8h ) + * 6 | d28 | d29 ( v22.8h ) + * 7 | d30 | d31 ( v23.8h ) */ /* Save NEON registers used in fast IDCT */ - sub sp, sp, #176 - stp x22, x23, [sp], 16 - adr x23, Ljsimd_idct_ifast_neon_consts - st1 {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32 - st1 {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32 - st1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 - st1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 - st1 {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32 - ld1 {v8.8h, v9.8h}, [COEF_BLOCK], 32 + adr TMP5, Ljsimd_idct_ifast_neon_consts + ld1 {v16.8h, v17.8h}, [COEF_BLOCK], 32 ld1 {v0.8h, v1.8h}, [DCT_TABLE], 32 - ld1 {v10.8h, v11.8h}, [COEF_BLOCK], 32 - mul v8.8h, v8.8h, v0.8h + ld1 {v18.8h, v19.8h}, [COEF_BLOCK], 32 + mul v16.8h, v16.8h, v0.8h ld1 {v2.8h, v3.8h}, [DCT_TABLE], 32 - mul v9.8h, v9.8h, v1.8h - ld1 {v12.8h, v13.8h}, [COEF_BLOCK], 32 - mul v10.8h, v10.8h, v2.8h + mul v17.8h, v17.8h, v1.8h + ld1 {v20.8h, v21.8h}, [COEF_BLOCK], 32 + mul v18.8h, v18.8h, v2.8h ld1 {v0.8h, v1.8h}, [DCT_TABLE], 32 - mul v11.8h, v11.8h, v3.8h - ld1 {v14.8h, v15.8h}, [COEF_BLOCK], 32 - mul v12.8h, v12.8h, v0.8h + mul v19.8h, v19.8h, v3.8h + ld1 {v22.8h, v23.8h}, [COEF_BLOCK], 32 + mul v20.8h, v20.8h, v0.8h ld1 {v2.8h, v3.8h}, [DCT_TABLE], 32 - mul v14.8h, v14.8h, v2.8h - mul v13.8h, v13.8h, v1.8h - ld1 {v0.4h}, [x23] /* load constants */ - mul v15.8h, v15.8h, v3.8h + mul v22.8h, v22.8h, v2.8h + mul v21.8h, v21.8h, v1.8h + ld1 {v0.4h}, [TMP5] /* load constants */ + mul v23.8h, v23.8h, v3.8h /* 1-D IDCT, pass 1 */ - sub v2.8h, v10.8h, v14.8h - add v14.8h, v10.8h, v14.8h - sub v1.8h, v11.8h, v13.8h - add v13.8h, v11.8h, v13.8h - sub v5.8h, v9.8h, v15.8h - add v15.8h, v9.8h, v15.8h + sub v2.8h, v18.8h, v22.8h + add v22.8h, v18.8h, v22.8h + sub v1.8h, v19.8h, v21.8h + add v21.8h, v19.8h, v21.8h + sub v5.8h, v17.8h, v23.8h + add v23.8h, v17.8h, v23.8h sqdmulh v4.8h, v2.8h, XFIX_1_414213562 sqdmulh v6.8h, v1.8h, XFIX_2_613125930 add v3.8h, v1.8h, v1.8h sub v1.8h, v5.8h, v1.8h - add v10.8h, v2.8h, v4.8h + add v18.8h, v2.8h, v4.8h sqdmulh v4.8h, v1.8h, XFIX_1_847759065 - sub v2.8h, v15.8h, v13.8h + sub v2.8h, v23.8h, v21.8h add v3.8h, v3.8h, v6.8h sqdmulh v6.8h, v2.8h, XFIX_1_414213562 add v1.8h, v1.8h, v4.8h sqdmulh v4.8h, v5.8h, XFIX_1_082392200 - sub v10.8h, v10.8h, v14.8h + sub v18.8h, v18.8h, v22.8h add v2.8h, v2.8h, v6.8h - sub v6.8h, v8.8h, v12.8h - add v12.8h, v8.8h, v12.8h - add v9.8h, v5.8h, v4.8h - add v5.8h, v6.8h, v10.8h - sub v10.8h, v6.8h, v10.8h - add v6.8h, v15.8h, v13.8h - add v8.8h, v12.8h, v14.8h + sub v6.8h, v16.8h, v20.8h + add v20.8h, v16.8h, v20.8h + add v17.8h, v5.8h, v4.8h + add v5.8h, v6.8h, v18.8h + sub v18.8h, v6.8h, v18.8h + add v6.8h, v23.8h, v21.8h + add v16.8h, v20.8h, v22.8h sub v3.8h, v6.8h, v3.8h - sub v12.8h, v12.8h, v14.8h + sub v20.8h, v20.8h, v22.8h sub v3.8h, v3.8h, v1.8h - sub v1.8h, v9.8h, v1.8h + sub v1.8h, v17.8h, v1.8h add v2.8h, v3.8h, v2.8h - sub v15.8h, v8.8h, v6.8h + sub v23.8h, v16.8h, v6.8h add v1.8h, v1.8h, v2.8h - add v8.8h, v8.8h, v6.8h - add v14.8h, v5.8h, v3.8h - sub v9.8h, v5.8h, v3.8h - sub v13.8h, v10.8h, v2.8h - add v10.8h, v10.8h, v2.8h - /* Transpose q8-q9 */ - mov v18.16b, v8.16b - trn1 v8.8h, v8.8h, v9.8h - trn2 v9.8h, v18.8h, v9.8h - sub v11.8h, v12.8h, v1.8h - /* Transpose q14-q15 */ - mov v18.16b, v14.16b - trn1 v14.8h, v14.8h, v15.8h - trn2 v15.8h, v18.8h, v15.8h - add v12.8h, v12.8h, v1.8h - /* Transpose q10-q11 */ - mov v18.16b, v10.16b - trn1 v10.8h, v10.8h, v11.8h - trn2 v11.8h, v18.8h, v11.8h - /* Transpose q12-q13 */ - mov v18.16b, v12.16b - trn1 v12.8h, v12.8h, v13.8h - trn2 v13.8h, v18.8h, v13.8h - /* Transpose q9-q11 */ - mov v18.16b, v9.16b - trn1 v9.4s, v9.4s, v11.4s - trn2 v11.4s, v18.4s, v11.4s - /* Transpose q12-q14 */ - mov v18.16b, v12.16b - trn1 v12.4s, v12.4s, v14.4s - trn2 v14.4s, v18.4s, v14.4s - /* Transpose q8-q10 */ - mov v18.16b, v8.16b - trn1 v8.4s, v8.4s, v10.4s - trn2 v10.4s, v18.4s, v10.4s - /* Transpose q13-q15 */ - mov v18.16b, v13.16b - trn1 v13.4s, v13.4s, v15.4s - trn2 v15.4s, v18.4s, v15.4s - /* vswp v14.4h, v10-MSB.4h */ - umov x22, v14.d[0] - ins v14.d[0], v10.d[1] - ins v10.d[1], x22 - /* vswp v13.4h, v9MSB.4h */ - - umov x22, v13.d[0] - ins v13.d[0], v9.d[1] - ins v9.d[1], x22 + add v16.8h, v16.8h, v6.8h + add v22.8h, v5.8h, v3.8h + sub v17.8h, v5.8h, v3.8h + sub v21.8h, v18.8h, v2.8h + add v18.8h, v18.8h, v2.8h + sub v19.8h, v20.8h, v1.8h + add v20.8h, v20.8h, v1.8h + transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v28, v29, v30, v31 /* 1-D IDCT, pass 2 */ - sub v2.8h, v10.8h, v14.8h - /* vswp v15.4h, v11MSB.4h */ - umov x22, v15.d[0] - ins v15.d[0], v11.d[1] - ins v11.d[1], x22 - add v14.8h, v10.8h, v14.8h - /* vswp v12.4h, v8-MSB.4h */ - umov x22, v12.d[0] - ins v12.d[0], v8.d[1] - ins v8.d[1], x22 - sub v1.8h, v11.8h, v13.8h - add v13.8h, v11.8h, v13.8h - sub v5.8h, v9.8h, v15.8h - add v15.8h, v9.8h, v15.8h + sub v2.8h, v18.8h, v22.8h + add v22.8h, v18.8h, v22.8h + sub v1.8h, v19.8h, v21.8h + add v21.8h, v19.8h, v21.8h + sub v5.8h, v17.8h, v23.8h + add v23.8h, v17.8h, v23.8h sqdmulh v4.8h, v2.8h, XFIX_1_414213562 sqdmulh v6.8h, v1.8h, XFIX_2_613125930 add v3.8h, v1.8h, v1.8h sub v1.8h, v5.8h, v1.8h - add v10.8h, v2.8h, v4.8h + add v18.8h, v2.8h, v4.8h sqdmulh v4.8h, v1.8h, XFIX_1_847759065 - sub v2.8h, v15.8h, v13.8h + sub v2.8h, v23.8h, v21.8h add v3.8h, v3.8h, v6.8h sqdmulh v6.8h, v2.8h, XFIX_1_414213562 add v1.8h, v1.8h, v4.8h sqdmulh v4.8h, v5.8h, XFIX_1_082392200 - sub v10.8h, v10.8h, v14.8h + sub v18.8h, v18.8h, v22.8h add v2.8h, v2.8h, v6.8h - sub v6.8h, v8.8h, v12.8h - add v12.8h, v8.8h, v12.8h - add v9.8h, v5.8h, v4.8h - add v5.8h, v6.8h, v10.8h - sub v10.8h, v6.8h, v10.8h - add v6.8h, v15.8h, v13.8h - add v8.8h, v12.8h, v14.8h + sub v6.8h, v16.8h, v20.8h + add v20.8h, v16.8h, v20.8h + add v17.8h, v5.8h, v4.8h + add v5.8h, v6.8h, v18.8h + sub v18.8h, v6.8h, v18.8h + add v6.8h, v23.8h, v21.8h + add v16.8h, v20.8h, v22.8h sub v3.8h, v6.8h, v3.8h - sub v12.8h, v12.8h, v14.8h + sub v20.8h, v20.8h, v22.8h sub v3.8h, v3.8h, v1.8h - sub v1.8h, v9.8h, v1.8h + sub v1.8h, v17.8h, v1.8h add v2.8h, v3.8h, v2.8h - sub v15.8h, v8.8h, v6.8h + sub v23.8h, v16.8h, v6.8h add v1.8h, v1.8h, v2.8h - add v8.8h, v8.8h, v6.8h - add v14.8h, v5.8h, v3.8h - sub v9.8h, v5.8h, v3.8h - sub v13.8h, v10.8h, v2.8h - add v10.8h, v10.8h, v2.8h - sub v11.8h, v12.8h, v1.8h - add v12.8h, v12.8h, v1.8h + add v16.8h, v16.8h, v6.8h + add v22.8h, v5.8h, v3.8h + sub v17.8h, v5.8h, v3.8h + sub v21.8h, v18.8h, v2.8h + add v18.8h, v18.8h, v2.8h + sub v19.8h, v20.8h, v1.8h + add v20.8h, v20.8h, v1.8h /* Descale to 8-bit and range limit */ movi v0.16b, #0x80 - sqshrn v8.8b, v8.8h, #5 - sqshrn2 v8.16b, v9.8h, #5 - sqshrn v9.8b, v10.8h, #5 - sqshrn2 v9.16b, v11.8h, #5 - sqshrn v10.8b, v12.8h, #5 - sqshrn2 v10.16b, v13.8h, #5 - sqshrn v11.8b, v14.8h, #5 - sqshrn2 v11.16b, v15.8h, #5 - add v8.16b, v8.16b, v0.16b - add v9.16b, v9.16b, v0.16b - add v10.16b, v10.16b, v0.16b - add v11.16b, v11.16b, v0.16b + /* Prepare pointers (dual-issue with NEON instructions) */ + ldp TMP1, TMP2, [OUTPUT_BUF], 16 + sqshrn v28.8b, v16.8h, #5 + ldp TMP3, TMP4, [OUTPUT_BUF], 16 + sqshrn v29.8b, v17.8h, #5 + add TMP1, TMP1, OUTPUT_COL + sqshrn v30.8b, v18.8h, #5 + add TMP2, TMP2, OUTPUT_COL + sqshrn v31.8b, v19.8h, #5 + add TMP3, TMP3, OUTPUT_COL + sqshrn2 v28.16b, v20.8h, #5 + add TMP4, TMP4, OUTPUT_COL + sqshrn2 v29.16b, v21.8h, #5 + ldp TMP5, TMP6, [OUTPUT_BUF], 16 + sqshrn2 v30.16b, v22.8h, #5 + ldp TMP7, TMP8, [OUTPUT_BUF], 16 + sqshrn2 v31.16b, v23.8h, #5 + add TMP5, TMP5, OUTPUT_COL + add v16.16b, v28.16b, v0.16b + add TMP6, TMP6, OUTPUT_COL + add v18.16b, v29.16b, v0.16b + add TMP7, TMP7, OUTPUT_COL + add v20.16b, v30.16b, v0.16b + add TMP8, TMP8, OUTPUT_COL + add v22.16b, v31.16b, v0.16b + /* Transpose the final 8-bit samples */ - /* Transpose q8-q9 */ - mov v18.16b, v8.16b - trn1 v8.8h, v8.8h, v9.8h - trn2 v9.8h, v18.8h, v9.8h - /* Transpose q10-q11 */ - mov v18.16b, v10.16b - trn1 v10.8h, v10.8h, v11.8h - trn2 v11.8h, v18.8h, v11.8h - /* Transpose q8-q10 */ - mov v18.16b, v8.16b - trn1 v8.4s, v8.4s, v10.4s - trn2 v10.4s, v18.4s, v10.4s - /* Transpose q9-q11 */ - mov v18.16b, v9.16b - trn1 v9.4s, v9.4s, v11.4s - trn2 v11.4s, v18.4s, v11.4s - /* make copy */ - ins v17.d[0], v8.d[1] - /* Transpose d16-d17-msb */ - mov v18.16b, v8.16b - trn1 v8.8b, v8.8b, v17.8b - trn2 v17.8b, v18.8b, v17.8b - /* make copy */ - ins v19.d[0], v9.d[1] - mov v18.16b, v9.16b - trn1 v9.8b, v9.8b, v19.8b - trn2 v19.8b, v18.8b, v19.8b + trn1 v28.16b, v16.16b, v18.16b + trn1 v30.16b, v20.16b, v22.16b + trn2 v29.16b, v16.16b, v18.16b + trn2 v31.16b, v20.16b, v22.16b + + trn1 v16.8h, v28.8h, v30.8h + trn2 v18.8h, v28.8h, v30.8h + trn1 v20.8h, v29.8h, v31.8h + trn2 v22.8h, v29.8h, v31.8h + + uzp1 v28.4s, v16.4s, v18.4s + uzp2 v30.4s, v16.4s, v18.4s + uzp1 v29.4s, v20.4s, v22.4s + uzp2 v31.4s, v20.4s, v22.4s + /* Store results to the output buffer */ - ldp TMP1, TMP2, [OUTPUT_BUF], 16 - add TMP1, TMP1, OUTPUT_COL - add TMP2, TMP2, OUTPUT_COL - st1 {v8.8b}, [TMP1] - st1 {v17.8b}, [TMP2] - ldp TMP1, TMP2, [OUTPUT_BUF], 16 - add TMP1, TMP1, OUTPUT_COL - add TMP2, TMP2, OUTPUT_COL - st1 {v9.8b}, [TMP1] - /* make copy */ - ins v7.d[0], v10.d[1] - mov v18.16b, v10.16b - trn1 v10.8b, v10.8b, v7.8b - trn2 v7.8b, v18.8b, v7.8b - st1 {v19.8b}, [TMP2] - ldp TMP1, TMP2, [OUTPUT_BUF], 16 - ldp TMP4, TMP5, [OUTPUT_BUF], 16 - add TMP1, TMP1, OUTPUT_COL - add TMP2, TMP2, OUTPUT_COL - add TMP4, TMP4, OUTPUT_COL - add TMP5, TMP5, OUTPUT_COL - st1 {v10.8b}, [TMP1] - /* make copy */ - ins v16.d[0], v11.d[1] - mov v18.16b, v11.16b - trn1 v11.8b, v11.8b, v16.8b - trn2 v16.8b, v18.8b, v16.8b - st1 {v7.8b}, [TMP2] - st1 {v11.8b}, [TMP4] - st1 {v16.8b}, [TMP5] - sub sp, sp, #176 - ldp x22, x23, [sp], 16 - ld1 {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32 - ld1 {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32 - ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 - ld1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 - ld1 {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32 + st1 {v28.d}[0], [TMP1] + st1 {v29.d}[0], [TMP2] + st1 {v28.d}[1], [TMP3] + st1 {v29.d}[1], [TMP4] + st1 {v30.d}[0], [TMP5] + st1 {v31.d}[0], [TMP6] + st1 {v30.d}[1], [TMP7] + st1 {v31.d}[1], [TMP8] blr x30 .unreq DCT_TABLE @@ -1087,6 +987,9 @@ asm_function jsimd_idct_ifast_neon .unreq TMP3 .unreq TMP4 .unreq TMP5 + .unreq TMP6 + .unreq TMP7 + .unreq TMP8 /*****************************************************************************/ @@ -1540,6 +1443,11 @@ asm_function jsimd_idct_2x2_neon * Colorspace conversion YCbCr -> RGB */ +#if defined(__APPLE__) || defined(__ANDROID__) +/* TODO: expand this to include other devices that are known not to have a slow + * ld3 implementation. */ +#define ST3_IS_FAST +#endif .macro do_load size .if \size == 8 @@ -1581,7 +1489,41 @@ asm_function jsimd_idct_2x2_neon .macro do_store bpp, size .if \bpp == 24 .if \size == 8 +#ifdef ST3_IS_FAST st3 {v10.8b, v11.8b, v12.8b}, [RGB], 24 +#else + st1 {v10.b}[0], [RGB], #1 + st1 {v11.b}[0], [RGB], #1 + st1 {v12.b}[0], [RGB], #1 + + st1 {v10.b}[1], [RGB], #1 + st1 {v11.b}[1], [RGB], #1 + st1 {v12.b}[1], [RGB], #1 + + st1 {v10.b}[2], [RGB], #1 + st1 {v11.b}[2], [RGB], #1 + st1 {v12.b}[2], [RGB], #1 + + st1 {v10.b}[3], [RGB], #1 + st1 {v11.b}[3], [RGB], #1 + st1 {v12.b}[3], [RGB], #1 + + st1 {v10.b}[4], [RGB], #1 + st1 {v11.b}[4], [RGB], #1 + st1 {v12.b}[4], [RGB], #1 + + st1 {v10.b}[5], [RGB], #1 + st1 {v11.b}[5], [RGB], #1 + st1 {v12.b}[5], [RGB], #1 + + st1 {v10.b}[6], [RGB], #1 + st1 {v11.b}[6], [RGB], #1 + st1 {v12.b}[6], [RGB], #1 + + st1 {v10.b}[7], [RGB], #1 + st1 {v11.b}[7], [RGB], #1 + st1 {v12.b}[7], [RGB], #1 +#endif .elseif \size == 4 st3 {v10.b, v11.b, v12.b}[0], [RGB], 3 st3 {v10.b, v11.b, v12.b}[1], [RGB], 3 @@ -1939,7 +1881,7 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, . .endif .endm -#if __APPLE__ +#if defined(__APPLE__) || defined(__ANDROID__) /* TODO: expand this to include other devices that are known not to have a slow * ld3 implementation. */ #define LD3_IS_FAST @@ -2298,7 +2240,6 @@ asm_function jsimd_convsamp_neon #define DESCALE_P1 (CONST_BITS-PASS1_BITS) #define DESCALE_P2 (CONST_BITS+PASS1_BITS) -#if CONST_BITS == 13 #define F_0_298 2446 /* FIX(0.298631336) */ #define F_0_390 3196 /* FIX(0.390180644) */ #define F_0_541 4433 /* FIX(0.541196100) */ @@ -2311,21 +2252,6 @@ asm_function jsimd_convsamp_neon #define F_2_053 16819 /* FIX(2.053119869) */ #define F_2_562 20995 /* FIX(2.562915447) */ #define F_3_072 25172 /* FIX(3.072711026) */ -#else -#define DESCALE(x,n) (((x)+(1<<((n)-1)))>>(n)) -#define F_0_298 DESCALE( 320652955, 30-CONST_BITS) /* FIX(0.298631336) */ -#define F_0_390 DESCALE( 418953276, 30-CONST_BITS) /* FIX(0.390180644) */ -#define F_0_541 DESCALE( 581104887, 30-CONST_BITS) /* FIX(0.541196100) */ -#define F_0_765 DESCALE( 821806413, 30-CONST_BITS) /* FIX(0.765366865) */ -#define F_0_899 DESCALE( 966342111, 30-CONST_BITS) /* FIX(0.899976223) */ -#define F_1_175 DESCALE(1262586813, 30-CONST_BITS) /* FIX(1.175875602) */ -#define F_1_501 DESCALE(1612031267, 30-CONST_BITS) /* FIX(1.501321110) */ -#define F_1_847 DESCALE(1984016188, 30-CONST_BITS) /* FIX(1.847759065) */ -#define F_1_961 DESCALE(2106220350, 30-CONST_BITS) /* FIX(1.961570560) */ -#define F_2_053 DESCALE(2204520673, 30-CONST_BITS) /* FIX(2.053119869) */ -#define F_2_562 DESCALE(2751909506, 30-CONST_BITS) /* FIX(2.562915447) */ -#define F_3_072 DESCALE(3299298341, 30-CONST_BITS) /* FIX(3.072711026) */ -#endif .balign 16 Ljsimd_fdct_islow_neon_consts: From cf888486d10e3888bacac9c193c607f051042802 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 2 Feb 2016 23:17:06 -0600 Subject: [PATCH 093/140] Use consistent formatting in ARM NEON SIMD code There aren't really any best practices to follow here. I tried as best as I could to adopt a standard that would ease any future maintenance burdens. The basic tenets of that standard are: * Assembly instructions always start on Column 5, and operands always start on Column 21, except: - The instruction and operand can be indented (usually by 2 spaces) to indicate a separate instruction stream. - If the instruction is within an enclosing .if block in a macro, it should always be indented relative to the .if block. * Comments are placed with an eye toward readability. There are always at least 2 spaces between the end of a line of code and the associated in-line comment. Where it made sense, I tried to line up the comments in blocks, and some were shifted right to avoid overlap with neighboring instruction lines. Not an exact science. * Assembler directives and macros use 2-space indenting rules. .if blocks are indented relative to the macro, and code within the .if blocks is indented relative to the .if directive. * No extraneous spaces between operands. Lining up the operands vertically did not really improve readability-- personally, I think it made it worse, since my eye would tend to lose its place in the uniform columns of characters. Also, code with a lot of vertical alignment is really hard to maintain, since changing one line could necessitate changing a bunch of other lines to avoid spoiling the alignment. * No extraneous spaces in #defines or other directives. In general, the only extraneous spaces (other than indenting spaces) are between: - Instructions and operands - Operands and in-line comments This standard should be more or less in keeping with other formatting standards used within the project. --- simd/jsimd_arm64_neon.S | 2837 ++++++++++++++++++++------------------- simd/jsimd_arm_neon.S | 2542 +++++++++++++++++------------------ 2 files changed, 2693 insertions(+), 2686 deletions(-) diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index 5acb7134..c13a8593 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -28,7 +28,7 @@ */ #if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */ +.section .note.GNU-stack, "", %progbits /* mark stack as non-executable */ #endif .text @@ -55,73 +55,74 @@ _\fname: .endm /* Transpose elements of single 128 bit registers */ -.macro transpose_single x0,x1,xi,xilen,literal - ins \xi\xilen[0], \x0\xilen[0] - ins \x1\xilen[0], \x0\xilen[1] - trn1 \x0\literal, \x0\literal, \x1\literal - trn2 \x1\literal, \xi\literal, \x1\literal +.macro transpose_single x0, x1, xi, xilen, literal + ins \xi\xilen[0], \x0\xilen[0] + ins \x1\xilen[0], \x0\xilen[1] + trn1 \x0\literal, \x0\literal, \x1\literal + trn2 \x1\literal, \xi\literal, \x1\literal .endm /* Transpose elements of 2 differnet registers */ -.macro transpose x0,x1,xi,xilen,literal - mov \xi\xilen, \x0\xilen - trn1 \x0\literal, \x0\literal, \x1\literal - trn2 \x1\literal, \xi\literal, \x1\literal +.macro transpose x0, x1, xi, xilen, literal + mov \xi\xilen, \x0\xilen + trn1 \x0\literal, \x0\literal, \x1\literal + trn2 \x1\literal, \xi\literal, \x1\literal .endm /* Transpose a block of 4x4 coefficients in four 64-bit registers */ -.macro transpose_4x4_32 x0,x0len x1,x1len x2,x2len x3,x3len,xi,xilen - mov \xi\xilen, \x0\xilen - trn1 \x0\x0len, \x0\x0len, \x2\x2len - trn2 \x2\x2len, \xi\x0len, \x2\x2len - mov \xi\xilen, \x1\xilen - trn1 \x1\x1len, \x1\x1len, \x3\x3len - trn2 \x3\x3len, \xi\x1len, \x3\x3len +.macro transpose_4x4_32 x0, x0len, x1, x1len, x2, x2len, x3, x3len, xi, xilen + mov \xi\xilen, \x0\xilen + trn1 \x0\x0len, \x0\x0len, \x2\x2len + trn2 \x2\x2len, \xi\x0len, \x2\x2len + mov \xi\xilen, \x1\xilen + trn1 \x1\x1len, \x1\x1len, \x3\x3len + trn2 \x3\x3len, \xi\x1len, \x3\x3len .endm -.macro transpose_4x4_16 x0,x0len x1,x1len, x2,x2len, x3,x3len,xi,xilen - mov \xi\xilen, \x0\xilen - trn1 \x0\x0len, \x0\x0len, \x1\x1len - trn2 \x1\x2len, \xi\x0len, \x1\x2len - mov \xi\xilen, \x2\xilen - trn1 \x2\x2len, \x2\x2len, \x3\x3len - trn2 \x3\x2len, \xi\x1len, \x3\x3len +.macro transpose_4x4_16 x0, x0len, x1, x1len, x2, x2len, x3, x3len, xi, xilen + mov \xi\xilen, \x0\xilen + trn1 \x0\x0len, \x0\x0len, \x1\x1len + trn2 \x1\x2len, \xi\x0len, \x1\x2len + mov \xi\xilen, \x2\xilen + trn1 \x2\x2len, \x2\x2len, \x3\x3len + trn2 \x3\x2len, \xi\x1len, \x3\x3len .endm -.macro transpose_4x4 x0, x1, x2, x3,x5 - transpose_4x4_16 \x0,.4h, \x1,.4h, \x2,.4h,\x3,.4h,\x5,.16b - transpose_4x4_32 \x0,.2s, \x1,.2s, \x2,.2s,\x3,.2s,\x5,.16b +.macro transpose_4x4 x0, x1, x2, x3, x5 + transpose_4x4_16 \x0, .4h, \x1, .4h, \x2, .4h, \x3, .4h, \x5, .16b + transpose_4x4_32 \x0, .2s, \x1, .2s, \x2, .2s, \x3, .2s, \x5, .16b .endm .macro transpose_8x8 l0, l1, l2, l3, l4, l5, l6, l7, t0, t1, t2, t3 - trn1 \t0\().8h, \l0\().8h, \l1\().8h - trn1 \t1\().8h, \l2\().8h, \l3\().8h - trn1 \t2\().8h, \l4\().8h, \l5\().8h - trn1 \t3\().8h, \l6\().8h, \l7\().8h - trn2 \l1\().8h, \l0\().8h, \l1\().8h - trn2 \l3\().8h, \l2\().8h, \l3\().8h - trn2 \l5\().8h, \l4\().8h, \l5\().8h - trn2 \l7\().8h, \l6\().8h, \l7\().8h + trn1 \t0\().8h, \l0\().8h, \l1\().8h + trn1 \t1\().8h, \l2\().8h, \l3\().8h + trn1 \t2\().8h, \l4\().8h, \l5\().8h + trn1 \t3\().8h, \l6\().8h, \l7\().8h + trn2 \l1\().8h, \l0\().8h, \l1\().8h + trn2 \l3\().8h, \l2\().8h, \l3\().8h + trn2 \l5\().8h, \l4\().8h, \l5\().8h + trn2 \l7\().8h, \l6\().8h, \l7\().8h - trn1 \l4\().4s, \t2\().4s, \t3\().4s - trn2 \t3\().4s, \t2\().4s, \t3\().4s - trn1 \t2\().4s, \t0\().4s, \t1\().4s - trn2 \l2\().4s, \t0\().4s, \t1\().4s - trn1 \t0\().4s, \l1\().4s, \l3\().4s - trn2 \l3\().4s, \l1\().4s, \l3\().4s - trn2 \t1\().4s, \l5\().4s, \l7\().4s - trn1 \l5\().4s, \l5\().4s, \l7\().4s + trn1 \l4\().4s, \t2\().4s, \t3\().4s + trn2 \t3\().4s, \t2\().4s, \t3\().4s + trn1 \t2\().4s, \t0\().4s, \t1\().4s + trn2 \l2\().4s, \t0\().4s, \t1\().4s + trn1 \t0\().4s, \l1\().4s, \l3\().4s + trn2 \l3\().4s, \l1\().4s, \l3\().4s + trn2 \t1\().4s, \l5\().4s, \l7\().4s + trn1 \l5\().4s, \l5\().4s, \l7\().4s - trn2 \l6\().2d, \l2\().2d, \t3\().2d - trn1 \l0\().2d, \t2\().2d, \l4\().2d - trn1 \l1\().2d, \t0\().2d, \l5\().2d - trn2 \l7\().2d, \l3\().2d, \t1\().2d - trn1 \l2\().2d, \l2\().2d, \t3\().2d - trn2 \l4\().2d, \t2\().2d, \l4\().2d - trn1 \l3\().2d, \l3\().2d, \t1\().2d - trn2 \l5\().2d, \t0\().2d, \l5\().2d + trn2 \l6\().2d, \l2\().2d, \t3\().2d + trn1 \l0\().2d, \t2\().2d, \l4\().2d + trn1 \l1\().2d, \t0\().2d, \l5\().2d + trn2 \l7\().2d, \l3\().2d, \t1\().2d + trn1 \l2\().2d, \l2\().2d, \t3\().2d + trn2 \l4\().2d, \t2\().2d, \l4\().2d + trn1 \l3\().2d, \l3\().2d, \t1\().2d + trn2 \l5\().2d, \t0\().2d, \l5\().2d .endm + #define CENTERJSAMPLE 128 /*****************************************************************************/ @@ -134,41 +135,40 @@ _\fname: * JSAMPARRAY output_buf, JDIMENSION output_col) */ -#define CENTERJSAMPLE 128 -#define CONST_BITS 13 -#define PASS1_BITS 2 +#define CONST_BITS 13 +#define PASS1_BITS 2 -#define F_0_298 2446 /* FIX(0.298631336) */ -#define F_0_390 3196 /* FIX(0.390180644) */ -#define F_0_541 4433 /* FIX(0.541196100) */ -#define F_0_765 6270 /* FIX(0.765366865) */ -#define F_0_899 7373 /* FIX(0.899976223) */ -#define F_1_175 9633 /* FIX(1.175875602) */ -#define F_1_501 12299 /* FIX(1.501321110) */ -#define F_1_847 15137 /* FIX(1.847759065) */ -#define F_1_961 16069 /* FIX(1.961570560) */ -#define F_2_053 16819 /* FIX(2.053119869) */ -#define F_2_562 20995 /* FIX(2.562915447) */ -#define F_3_072 25172 /* FIX(3.072711026) */ +#define F_0_298 2446 /* FIX(0.298631336) */ +#define F_0_390 3196 /* FIX(0.390180644) */ +#define F_0_541 4433 /* FIX(0.541196100) */ +#define F_0_765 6270 /* FIX(0.765366865) */ +#define F_0_899 7373 /* FIX(0.899976223) */ +#define F_1_175 9633 /* FIX(1.175875602) */ +#define F_1_501 12299 /* FIX(1.501321110) */ +#define F_1_847 15137 /* FIX(1.847759065) */ +#define F_1_961 16069 /* FIX(1.961570560) */ +#define F_2_053 16819 /* FIX(2.053119869) */ +#define F_2_562 20995 /* FIX(2.562915447) */ +#define F_3_072 25172 /* FIX(3.072711026) */ .balign 16 Ljsimd_idct_islow_neon_consts: - .short F_0_298 - .short -F_0_390 - .short F_0_541 - .short F_0_765 - .short - F_0_899 - .short F_1_175 - .short F_1_501 - .short - F_1_847 - .short - F_1_961 - .short F_2_053 - .short - F_2_562 - .short F_3_072 - .short 0 /* padding */ - .short 0 - .short 0 - .short 0 + .short F_0_298 + .short -F_0_390 + .short F_0_541 + .short F_0_765 + .short - F_0_899 + .short F_1_175 + .short F_1_501 + .short - F_1_847 + .short - F_1_961 + .short F_2_053 + .short - F_2_562 + .short F_3_072 + .short 0 /* padding */ + .short 0 + .short 0 + .short 0 #undef F_0_298 #undef F_0_390 @@ -212,45 +212,45 @@ asm_function jsimd_idct_islow_neon sub sp, sp, #64 adr x15, Ljsimd_idct_islow_neon_consts - st1 { v8.8b, v9.8b, v10.8b, v11.8b}, [sp], #32 + st1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], #32 st1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], #32 - ld1 { v0.8h, v1.8h}, [x15] - ld1 { v2.8h, v3.8h, v4.8h, v5.8h}, [COEF_BLOCK], #64 - ld1 {v18.8h, v19.8h, v20.8h, v21.8h}, [DCT_TABLE], #64 - ld1 { v6.8h, v7.8h, v8.8h, v9.8h}, [COEF_BLOCK], #64 - ld1 {v22.8h, v23.8h, v24.8h, v25.8h}, [DCT_TABLE], #64 + ld1 {v0.8h, v1.8h}, [x15] + ld1 {v2.8h, v3.8h, v4.8h, v5.8h}, [COEF_BLOCK], #64 + ld1 {v18.8h, v19.8h, v20.8h, v21.8h}, [DCT_TABLE], #64 + ld1 {v6.8h, v7.8h, v8.8h, v9.8h}, [COEF_BLOCK], #64 + ld1 {v22.8h, v23.8h, v24.8h, v25.8h}, [DCT_TABLE], #64 - cmeq v16.8h, v3.8h, #0 - cmeq v26.8h, v4.8h, #0 - cmeq v27.8h, v5.8h, #0 - cmeq v28.8h, v6.8h, #0 - cmeq v29.8h, v7.8h, #0 - cmeq v30.8h, v8.8h, #0 - cmeq v31.8h, v9.8h, #0 + cmeq v16.8h, v3.8h, #0 + cmeq v26.8h, v4.8h, #0 + cmeq v27.8h, v5.8h, #0 + cmeq v28.8h, v6.8h, #0 + cmeq v29.8h, v7.8h, #0 + cmeq v30.8h, v8.8h, #0 + cmeq v31.8h, v9.8h, #0 - and v10.16b, v16.16b, v26.16b - and v11.16b, v27.16b, v28.16b - and v12.16b, v29.16b, v30.16b - and v13.16b, v31.16b, v10.16b - and v14.16b, v11.16b, v12.16b - mul v2.8h, v2.8h, v18.8h - and v15.16b, v13.16b, v14.16b - shl v10.8h, v2.8h, #(PASS1_BITS) - sqxtn v16.8b, v15.8h - mov TMP1, v16.d[0] - sub sp, sp, #64 - mvn TMP2, TMP1 + and v10.16b, v16.16b, v26.16b + and v11.16b, v27.16b, v28.16b + and v12.16b, v29.16b, v30.16b + and v13.16b, v31.16b, v10.16b + and v14.16b, v11.16b, v12.16b + mul v2.8h, v2.8h, v18.8h + and v15.16b, v13.16b, v14.16b + shl v10.8h, v2.8h, #(PASS1_BITS) + sqxtn v16.8b, v15.8h + mov TMP1, v16.d[0] + sub sp, sp, #64 + mvn TMP2, TMP1 - cbnz TMP2, 2f + cbnz TMP2, 2f /* case all AC coeffs are zeros */ - dup v2.2d, v10.d[0] - dup v6.2d, v10.d[1] - mov v3.16b, v2.16b - mov v7.16b, v6.16b - mov v4.16b, v2.16b - mov v8.16b, v6.16b - mov v5.16b, v2.16b - mov v9.16b, v6.16b + dup v2.2d, v10.d[0] + dup v6.2d, v10.d[1] + mov v3.16b, v2.16b + mov v7.16b, v6.16b + mov v4.16b, v2.16b + mov v8.16b, v6.16b + mov v5.16b, v2.16b + mov v9.16b, v6.16b 1: /* for this transpose, we should organise data like this: * 00, 01, 02, 03, 40, 41, 42, 43 @@ -262,177 +262,177 @@ asm_function jsimd_idct_islow_neon * 24, 25, 26, 27, 64, 65, 66, 67 * 34, 35, 36, 37, 74, 75, 76, 77 */ - trn1 v28.8h, v2.8h, v3.8h - trn1 v29.8h, v4.8h, v5.8h - trn1 v30.8h, v6.8h, v7.8h - trn1 v31.8h, v8.8h, v9.8h - trn2 v16.8h, v2.8h, v3.8h - trn2 v17.8h, v4.8h, v5.8h - trn2 v18.8h, v6.8h, v7.8h - trn2 v19.8h, v8.8h, v9.8h - trn1 v2.4s, v28.4s, v29.4s - trn1 v6.4s, v30.4s, v31.4s - trn1 v3.4s, v16.4s, v17.4s - trn1 v7.4s, v18.4s, v19.4s - trn2 v4.4s, v28.4s, v29.4s - trn2 v8.4s, v30.4s, v31.4s - trn2 v5.4s, v16.4s, v17.4s - trn2 v9.4s, v18.4s, v19.4s + trn1 v28.8h, v2.8h, v3.8h + trn1 v29.8h, v4.8h, v5.8h + trn1 v30.8h, v6.8h, v7.8h + trn1 v31.8h, v8.8h, v9.8h + trn2 v16.8h, v2.8h, v3.8h + trn2 v17.8h, v4.8h, v5.8h + trn2 v18.8h, v6.8h, v7.8h + trn2 v19.8h, v8.8h, v9.8h + trn1 v2.4s, v28.4s, v29.4s + trn1 v6.4s, v30.4s, v31.4s + trn1 v3.4s, v16.4s, v17.4s + trn1 v7.4s, v18.4s, v19.4s + trn2 v4.4s, v28.4s, v29.4s + trn2 v8.4s, v30.4s, v31.4s + trn2 v5.4s, v16.4s, v17.4s + trn2 v9.4s, v18.4s, v19.4s /* Even part: reverse the even part of the forward DCT. */ - add v18.8h, v4.8h, v8.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ - add v22.8h, v2.8h, v6.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ - smull2 v19.4s, v18.8h, XFIX_P_0_541 /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ - sub v26.8h, v2.8h, v6.8h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ - smull v18.4s, v18.4h, XFIX_P_0_541 /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ - sshll2 v23.4s, v22.8h, #(CONST_BITS) /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ - mov v21.16b, v19.16b /* tmp3 = z1 */ - mov v20.16b, v18.16b /* tmp3 = z1 */ - smlal2 v19.4s, v8.8h, XFIX_N_1_847 /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ - smlal v18.4s, v8.4h, XFIX_N_1_847 /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ - sshll2 v27.4s, v26.8h, #(CONST_BITS) /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ - smlal2 v21.4s, v4.8h, XFIX_P_0_765 /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ - smlal v20.4s, v4.4h, XFIX_P_0_765 /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ - sshll v22.4s, v22.4h, #(CONST_BITS) /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ - sshll v26.4s, v26.4h, #(CONST_BITS) /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ - add v2.4s, v22.4s, v20.4s /* tmp10l tmp10 = tmp0 + tmp3; */ - sub v6.4s, v22.4s, v20.4s /* tmp13l tmp13 = tmp0 - tmp3; */ - add v8.4s, v26.4s, v18.4s /* tmp11l tmp11 = tmp1 + tmp2; */ - sub v4.4s, v26.4s, v18.4s /* tmp12l tmp12 = tmp1 - tmp2; */ - add v28.4s, v23.4s, v21.4s /* tmp10h tmp10 = tmp0 + tmp3; */ - sub v31.4s, v23.4s, v21.4s /* tmp13h tmp13 = tmp0 - tmp3; */ - add v29.4s, v27.4s, v19.4s /* tmp11h tmp11 = tmp1 + tmp2; */ - sub v30.4s, v27.4s, v19.4s /* tmp12h tmp12 = tmp1 - tmp2; */ + add v18.8h, v4.8h, v8.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ + add v22.8h, v2.8h, v6.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull2 v19.4s, v18.8h, XFIX_P_0_541 /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sub v26.8h, v2.8h, v6.8h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sshll2 v23.4s, v22.8h, #(CONST_BITS) /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + mov v21.16b, v19.16b /* tmp3 = z1 */ + mov v20.16b, v18.16b /* tmp3 = z1 */ + smlal2 v19.4s, v8.8h, XFIX_N_1_847 /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + smlal v18.4s, v8.4h, XFIX_N_1_847 /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + sshll2 v27.4s, v26.8h, #(CONST_BITS) /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + smlal2 v21.4s, v4.8h, XFIX_P_0_765 /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + smlal v20.4s, v4.4h, XFIX_P_0_765 /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + sshll v22.4s, v22.4h, #(CONST_BITS) /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + sshll v26.4s, v26.4h, #(CONST_BITS) /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + add v2.4s, v22.4s, v20.4s /* tmp10l tmp10 = tmp0 + tmp3; */ + sub v6.4s, v22.4s, v20.4s /* tmp13l tmp13 = tmp0 - tmp3; */ + add v8.4s, v26.4s, v18.4s /* tmp11l tmp11 = tmp1 + tmp2; */ + sub v4.4s, v26.4s, v18.4s /* tmp12l tmp12 = tmp1 - tmp2; */ + add v28.4s, v23.4s, v21.4s /* tmp10h tmp10 = tmp0 + tmp3; */ + sub v31.4s, v23.4s, v21.4s /* tmp13h tmp13 = tmp0 - tmp3; */ + add v29.4s, v27.4s, v19.4s /* tmp11h tmp11 = tmp1 + tmp2; */ + sub v30.4s, v27.4s, v19.4s /* tmp12h tmp12 = tmp1 - tmp2; */ /* Odd part per figure 8; the matrix is unitary and hence its * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. */ - add v22.8h, v9.8h, v5.8h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ - add v24.8h, v7.8h, v3.8h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ - add v18.8h, v9.8h, v3.8h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ - add v20.8h, v7.8h, v5.8h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ - add v26.8h, v22.8h, v24.8h /* z5 = z3 + z4 */ + add v22.8h, v9.8h, v5.8h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v24.8h, v7.8h, v3.8h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v18.8h, v9.8h, v3.8h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v20.8h, v7.8h, v5.8h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v26.8h, v22.8h, v24.8h /* z5 = z3 + z4 */ - smull2 v11.4s, v9.8h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ - smull2 v13.4s, v7.8h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ - smull2 v15.4s, v5.8h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ - smull2 v17.4s, v3.8h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ - smull2 v27.4s, v26.8h, XFIX_P_1_175 /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ - smull2 v23.4s, v22.8h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ - smull2 v25.4s, v24.8h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ - smull2 v19.4s, v18.8h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ - smull2 v21.4s, v20.8h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + smull2 v11.4s, v9.8h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull2 v13.4s, v7.8h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull2 v15.4s, v5.8h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull2 v17.4s, v3.8h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull2 v27.4s, v26.8h, XFIX_P_1_175 /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull2 v23.4s, v22.8h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull2 v25.4s, v24.8h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull2 v19.4s, v18.8h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull2 v21.4s, v20.8h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ - smull v10.4s, v9.4h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ - smull v12.4s, v7.4h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ - smull v14.4s, v5.4h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ - smull v16.4s, v3.4h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ - smull v26.4s, v26.4h, XFIX_P_1_175 /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ - smull v22.4s, v22.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ - smull v24.4s, v24.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ - smull v18.4s, v18.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ - smull v20.4s, v20.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + smull v10.4s, v9.4h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull v12.4s, v7.4h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull v14.4s, v5.4h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull v16.4s, v3.4h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull v26.4s, v26.4h, XFIX_P_1_175 /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull v22.4s, v22.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull v24.4s, v24.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull v18.4s, v18.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull v20.4s, v20.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ - add v23.4s, v23.4s, v27.4s /* z3 += z5 */ - add v22.4s, v22.4s, v26.4s /* z3 += z5 */ - add v25.4s, v25.4s, v27.4s /* z4 += z5 */ - add v24.4s, v24.4s, v26.4s /* z4 += z5 */ + add v23.4s, v23.4s, v27.4s /* z3 += z5 */ + add v22.4s, v22.4s, v26.4s /* z3 += z5 */ + add v25.4s, v25.4s, v27.4s /* z4 += z5 */ + add v24.4s, v24.4s, v26.4s /* z4 += z5 */ - add v11.4s, v11.4s, v19.4s /* tmp0 += z1 */ - add v10.4s, v10.4s, v18.4s /* tmp0 += z1 */ - add v13.4s, v13.4s, v21.4s /* tmp1 += z2 */ - add v12.4s, v12.4s, v20.4s /* tmp1 += z2 */ - add v15.4s, v15.4s, v21.4s /* tmp2 += z2 */ - add v14.4s, v14.4s, v20.4s /* tmp2 += z2 */ - add v17.4s, v17.4s, v19.4s /* tmp3 += z1 */ - add v16.4s, v16.4s, v18.4s /* tmp3 += z1 */ + add v11.4s, v11.4s, v19.4s /* tmp0 += z1 */ + add v10.4s, v10.4s, v18.4s /* tmp0 += z1 */ + add v13.4s, v13.4s, v21.4s /* tmp1 += z2 */ + add v12.4s, v12.4s, v20.4s /* tmp1 += z2 */ + add v15.4s, v15.4s, v21.4s /* tmp2 += z2 */ + add v14.4s, v14.4s, v20.4s /* tmp2 += z2 */ + add v17.4s, v17.4s, v19.4s /* tmp3 += z1 */ + add v16.4s, v16.4s, v18.4s /* tmp3 += z1 */ - add v11.4s, v11.4s, v23.4s /* tmp0 += z3 */ - add v10.4s, v10.4s, v22.4s /* tmp0 += z3 */ - add v13.4s, v13.4s, v25.4s /* tmp1 += z4 */ - add v12.4s, v12.4s, v24.4s /* tmp1 += z4 */ - add v17.4s, v17.4s, v25.4s /* tmp3 += z4 */ - add v16.4s, v16.4s, v24.4s /* tmp3 += z4 */ - add v15.4s, v15.4s, v23.4s /* tmp2 += z3 */ - add v14.4s, v14.4s, v22.4s /* tmp2 += z3 */ + add v11.4s, v11.4s, v23.4s /* tmp0 += z3 */ + add v10.4s, v10.4s, v22.4s /* tmp0 += z3 */ + add v13.4s, v13.4s, v25.4s /* tmp1 += z4 */ + add v12.4s, v12.4s, v24.4s /* tmp1 += z4 */ + add v17.4s, v17.4s, v25.4s /* tmp3 += z4 */ + add v16.4s, v16.4s, v24.4s /* tmp3 += z4 */ + add v15.4s, v15.4s, v23.4s /* tmp2 += z3 */ + add v14.4s, v14.4s, v22.4s /* tmp2 += z3 */ /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - add v18.4s, v2.4s, v16.4s /* tmp10 + tmp3 */ - add v19.4s, v28.4s, v17.4s /* tmp10 + tmp3 */ - sub v20.4s, v2.4s, v16.4s /* tmp10 - tmp3 */ - sub v21.4s, v28.4s, v17.4s /* tmp10 - tmp3 */ - add v22.4s, v8.4s, v14.4s /* tmp11 + tmp2 */ - add v23.4s, v29.4s, v15.4s /* tmp11 + tmp2 */ - sub v24.4s, v8.4s, v14.4s /* tmp11 - tmp2 */ - sub v25.4s, v29.4s, v15.4s /* tmp11 - tmp2 */ - add v26.4s, v4.4s, v12.4s /* tmp12 + tmp1 */ - add v27.4s, v30.4s, v13.4s /* tmp12 + tmp1 */ - sub v28.4s, v4.4s, v12.4s /* tmp12 - tmp1 */ - sub v29.4s, v30.4s, v13.4s /* tmp12 - tmp1 */ - add v14.4s, v6.4s, v10.4s /* tmp13 + tmp0 */ - add v15.4s, v31.4s, v11.4s /* tmp13 + tmp0 */ - sub v16.4s, v6.4s, v10.4s /* tmp13 - tmp0 */ - sub v17.4s, v31.4s, v11.4s /* tmp13 - tmp0 */ + add v18.4s, v2.4s, v16.4s /* tmp10 + tmp3 */ + add v19.4s, v28.4s, v17.4s /* tmp10 + tmp3 */ + sub v20.4s, v2.4s, v16.4s /* tmp10 - tmp3 */ + sub v21.4s, v28.4s, v17.4s /* tmp10 - tmp3 */ + add v22.4s, v8.4s, v14.4s /* tmp11 + tmp2 */ + add v23.4s, v29.4s, v15.4s /* tmp11 + tmp2 */ + sub v24.4s, v8.4s, v14.4s /* tmp11 - tmp2 */ + sub v25.4s, v29.4s, v15.4s /* tmp11 - tmp2 */ + add v26.4s, v4.4s, v12.4s /* tmp12 + tmp1 */ + add v27.4s, v30.4s, v13.4s /* tmp12 + tmp1 */ + sub v28.4s, v4.4s, v12.4s /* tmp12 - tmp1 */ + sub v29.4s, v30.4s, v13.4s /* tmp12 - tmp1 */ + add v14.4s, v6.4s, v10.4s /* tmp13 + tmp0 */ + add v15.4s, v31.4s, v11.4s /* tmp13 + tmp0 */ + sub v16.4s, v6.4s, v10.4s /* tmp13 - tmp0 */ + sub v17.4s, v31.4s, v11.4s /* tmp13 - tmp0 */ - shrn v2.4h, v18.4s, #16 /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) */ - shrn v9.4h, v20.4s, #16 /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3) */ - shrn v3.4h, v22.4s, #16 /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3) */ - shrn v8.4h, v24.4s, #16 /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3) */ - shrn v4.4h, v26.4s, #16 /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3) */ - shrn v7.4h, v28.4s, #16 /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3) */ - shrn v5.4h, v14.4s, #16 /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3) */ - shrn v6.4h, v16.4s, #16 /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) */ - shrn2 v2.8h, v19.4s, #16 /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) */ - shrn2 v9.8h, v21.4s, #16 /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3) */ - shrn2 v3.8h, v23.4s, #16 /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3) */ - shrn2 v8.8h, v25.4s, #16 /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3) */ - shrn2 v4.8h, v27.4s, #16 /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3) */ - shrn2 v7.8h, v29.4s, #16 /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3) */ - shrn2 v5.8h, v15.4s, #16 /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3) */ - shrn2 v6.8h, v17.4s, #16 /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) */ - movi v0.16b, #(CENTERJSAMPLE) -/* Prepare pointers (dual-issue with NEON instructions) */ - ldp TMP1, TMP2, [OUTPUT_BUF], 16 - sqrshrn v28.8b, v2.8h, #(CONST_BITS+PASS1_BITS+3-16) - ldp TMP3, TMP4, [OUTPUT_BUF], 16 - sqrshrn v29.8b, v3.8h, #(CONST_BITS+PASS1_BITS+3-16) - add TMP1, TMP1, OUTPUT_COL - sqrshrn v30.8b, v4.8h, #(CONST_BITS+PASS1_BITS+3-16) - add TMP2, TMP2, OUTPUT_COL - sqrshrn v31.8b, v5.8h, #(CONST_BITS+PASS1_BITS+3-16) - add TMP3, TMP3, OUTPUT_COL - sqrshrn2 v28.16b, v6.8h, #(CONST_BITS+PASS1_BITS+3-16) - add TMP4, TMP4, OUTPUT_COL - sqrshrn2 v29.16b, v7.8h, #(CONST_BITS+PASS1_BITS+3-16) - ldp TMP5, TMP6, [OUTPUT_BUF], 16 - sqrshrn2 v30.16b, v8.8h, #(CONST_BITS+PASS1_BITS+3-16) - ldp TMP7, TMP8, [OUTPUT_BUF], 16 - sqrshrn2 v31.16b, v9.8h, #(CONST_BITS+PASS1_BITS+3-16) - add TMP5, TMP5, OUTPUT_COL - add v16.16b, v28.16b, v0.16b - add TMP6, TMP6, OUTPUT_COL - add v18.16b, v29.16b, v0.16b - add TMP7, TMP7, OUTPUT_COL - add v20.16b, v30.16b, v0.16b - add TMP8, TMP8, OUTPUT_COL - add v22.16b, v31.16b, v0.16b + shrn v2.4h, v18.4s, #16 /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) */ + shrn v9.4h, v20.4s, #16 /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3) */ + shrn v3.4h, v22.4s, #16 /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3) */ + shrn v8.4h, v24.4s, #16 /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3) */ + shrn v4.4h, v26.4s, #16 /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3) */ + shrn v7.4h, v28.4s, #16 /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3) */ + shrn v5.4h, v14.4s, #16 /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3) */ + shrn v6.4h, v16.4s, #16 /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) */ + shrn2 v2.8h, v19.4s, #16 /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) */ + shrn2 v9.8h, v21.4s, #16 /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3) */ + shrn2 v3.8h, v23.4s, #16 /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3) */ + shrn2 v8.8h, v25.4s, #16 /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3) */ + shrn2 v4.8h, v27.4s, #16 /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3) */ + shrn2 v7.8h, v29.4s, #16 /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3) */ + shrn2 v5.8h, v15.4s, #16 /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3) */ + shrn2 v6.8h, v17.4s, #16 /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) */ + movi v0.16b, #(CENTERJSAMPLE) + /* Prepare pointers (dual-issue with NEON instructions) */ + ldp TMP1, TMP2, [OUTPUT_BUF], 16 + sqrshrn v28.8b, v2.8h, #(CONST_BITS+PASS1_BITS+3-16) + ldp TMP3, TMP4, [OUTPUT_BUF], 16 + sqrshrn v29.8b, v3.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP1, TMP1, OUTPUT_COL + sqrshrn v30.8b, v4.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP2, TMP2, OUTPUT_COL + sqrshrn v31.8b, v5.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP3, TMP3, OUTPUT_COL + sqrshrn2 v28.16b, v6.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP4, TMP4, OUTPUT_COL + sqrshrn2 v29.16b, v7.8h, #(CONST_BITS+PASS1_BITS+3-16) + ldp TMP5, TMP6, [OUTPUT_BUF], 16 + sqrshrn2 v30.16b, v8.8h, #(CONST_BITS+PASS1_BITS+3-16) + ldp TMP7, TMP8, [OUTPUT_BUF], 16 + sqrshrn2 v31.16b, v9.8h, #(CONST_BITS+PASS1_BITS+3-16) + add TMP5, TMP5, OUTPUT_COL + add v16.16b, v28.16b, v0.16b + add TMP6, TMP6, OUTPUT_COL + add v18.16b, v29.16b, v0.16b + add TMP7, TMP7, OUTPUT_COL + add v20.16b, v30.16b, v0.16b + add TMP8, TMP8, OUTPUT_COL + add v22.16b, v31.16b, v0.16b /* Transpose the final 8-bit samples */ - trn1 v28.16b, v16.16b, v18.16b - trn1 v30.16b, v20.16b, v22.16b - trn2 v29.16b, v16.16b, v18.16b - trn2 v31.16b, v20.16b, v22.16b + trn1 v28.16b, v16.16b, v18.16b + trn1 v30.16b, v20.16b, v22.16b + trn2 v29.16b, v16.16b, v18.16b + trn2 v31.16b, v20.16b, v22.16b - trn1 v16.8h, v28.8h, v30.8h - trn2 v18.8h, v28.8h, v30.8h - trn1 v20.8h, v29.8h, v31.8h - trn2 v22.8h, v29.8h, v31.8h + trn1 v16.8h, v28.8h, v30.8h + trn2 v18.8h, v28.8h, v30.8h + trn1 v20.8h, v29.8h, v31.8h + trn2 v22.8h, v29.8h, v31.8h - uzp1 v28.4s, v16.4s, v18.4s - uzp2 v30.4s, v16.4s, v18.4s - uzp1 v29.4s, v20.4s, v22.4s - uzp2 v31.4s, v20.4s, v22.4s + uzp1 v28.4s, v16.4s, v18.4s + uzp2 v30.4s, v16.4s, v18.4s + uzp1 v29.4s, v20.4s, v22.4s + uzp2 v31.4s, v20.4s, v22.4s /* Store results to the output buffer */ st1 {v28.d}[0], [TMP1] @@ -443,294 +443,294 @@ asm_function jsimd_idct_islow_neon st1 {v31.d}[0], [TMP6] st1 {v30.d}[1], [TMP7] st1 {v31.d}[1], [TMP8] - ld1 { v8.8b, v9.8b, v10.8b, v11.8b}, [sp], #32 + ld1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], #32 ld1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], #32 blr x30 .balign 16 2: - mul v3.8h, v3.8h, v19.8h - mul v4.8h, v4.8h, v20.8h - mul v5.8h, v5.8h, v21.8h - add TMP4, xzr, TMP2, LSL #32 - mul v6.8h, v6.8h, v22.8h - mul v7.8h, v7.8h, v23.8h - adds TMP3, xzr, TMP2, LSR #32 - mul v8.8h, v8.8h, v24.8h - mul v9.8h, v9.8h, v25.8h - b.ne 3f + mul v3.8h, v3.8h, v19.8h + mul v4.8h, v4.8h, v20.8h + mul v5.8h, v5.8h, v21.8h + add TMP4, xzr, TMP2, LSL #32 + mul v6.8h, v6.8h, v22.8h + mul v7.8h, v7.8h, v23.8h + adds TMP3, xzr, TMP2, LSR #32 + mul v8.8h, v8.8h, v24.8h + mul v9.8h, v9.8h, v25.8h + b.ne 3f /* Right AC coef is zero */ dup v15.2d, v10.d[1] /* Even part: reverse the even part of the forward DCT. */ - add v18.4h, v4.4h, v8.4h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ - add v22.4h, v2.4h, v6.4h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ - sub v26.4h, v2.4h, v6.4h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ - smull v18.4s, v18.4h, XFIX_P_0_541 /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ - sshll v22.4s, v22.4h, #(CONST_BITS) /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ - mov v20.16b, v18.16b /* tmp3 = z1 */ - sshll v26.4s, v26.4h, #(CONST_BITS) /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ - smlal v18.4s, v8.4h, XFIX_N_1_847 /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ - smlal v20.4s, v4.4h, XFIX_P_0_765 /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ - add v2.4s, v22.4s, v20.4s /* tmp10l tmp10 = tmp0 + tmp3; */ - sub v6.4s, v22.4s, v20.4s /* tmp13l tmp13 = tmp0 - tmp3; */ - add v8.4s, v26.4s, v18.4s /* tmp11l tmp11 = tmp1 + tmp2; */ - sub v4.4s, v26.4s, v18.4s /* tmp12l tmp12 = tmp1 - tmp2; */ + add v18.4h, v4.4h, v8.4h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ + add v22.4h, v2.4h, v6.4h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + sub v26.4h, v2.4h, v6.4h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sshll v22.4s, v22.4h, #(CONST_BITS) /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + mov v20.16b, v18.16b /* tmp3 = z1 */ + sshll v26.4s, v26.4h, #(CONST_BITS) /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + smlal v18.4s, v8.4h, XFIX_N_1_847 /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + smlal v20.4s, v4.4h, XFIX_P_0_765 /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + add v2.4s, v22.4s, v20.4s /* tmp10l tmp10 = tmp0 + tmp3; */ + sub v6.4s, v22.4s, v20.4s /* tmp13l tmp13 = tmp0 - tmp3; */ + add v8.4s, v26.4s, v18.4s /* tmp11l tmp11 = tmp1 + tmp2; */ + sub v4.4s, v26.4s, v18.4s /* tmp12l tmp12 = tmp1 - tmp2; */ /* Odd part per figure 8; the matrix is unitary and hence its * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. */ - add v22.4h, v9.4h, v5.4h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ - add v24.4h, v7.4h, v3.4h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ - add v18.4h, v9.4h, v3.4h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ - add v20.4h, v7.4h, v5.4h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ - add v26.4h, v22.4h, v24.4h /* z5 = z3 + z4 */ + add v22.4h, v9.4h, v5.4h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v24.4h, v7.4h, v3.4h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v18.4h, v9.4h, v3.4h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v20.4h, v7.4h, v5.4h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v26.4h, v22.4h, v24.4h /* z5 = z3 + z4 */ - smull v10.4s, v9.4h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ - smull v12.4s, v7.4h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ - smull v14.4s, v5.4h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ - smull v16.4s, v3.4h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ - smull v26.4s, v26.4h, XFIX_P_1_175 /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ - smull v22.4s, v22.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ - smull v24.4s, v24.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ - smull v18.4s, v18.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ - smull v20.4s, v20.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + smull v10.4s, v9.4h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull v12.4s, v7.4h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull v14.4s, v5.4h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull v16.4s, v3.4h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull v26.4s, v26.4h, XFIX_P_1_175 /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull v22.4s, v22.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull v24.4s, v24.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull v18.4s, v18.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull v20.4s, v20.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ - add v22.4s, v22.4s, v26.4s /* z3 += z5 */ - add v24.4s, v24.4s, v26.4s /* z4 += z5 */ + add v22.4s, v22.4s, v26.4s /* z3 += z5 */ + add v24.4s, v24.4s, v26.4s /* z4 += z5 */ - add v10.4s, v10.4s, v18.4s /* tmp0 += z1 */ - add v12.4s, v12.4s, v20.4s /* tmp1 += z2 */ - add v14.4s, v14.4s, v20.4s /* tmp2 += z2 */ - add v16.4s, v16.4s, v18.4s /* tmp3 += z1 */ + add v10.4s, v10.4s, v18.4s /* tmp0 += z1 */ + add v12.4s, v12.4s, v20.4s /* tmp1 += z2 */ + add v14.4s, v14.4s, v20.4s /* tmp2 += z2 */ + add v16.4s, v16.4s, v18.4s /* tmp3 += z1 */ - add v10.4s, v10.4s, v22.4s /* tmp0 += z3 */ - add v12.4s, v12.4s, v24.4s /* tmp1 += z4 */ - add v16.4s, v16.4s, v24.4s /* tmp3 += z4 */ - add v14.4s, v14.4s, v22.4s /* tmp2 += z3 */ + add v10.4s, v10.4s, v22.4s /* tmp0 += z3 */ + add v12.4s, v12.4s, v24.4s /* tmp1 += z4 */ + add v16.4s, v16.4s, v24.4s /* tmp3 += z4 */ + add v14.4s, v14.4s, v22.4s /* tmp2 += z3 */ /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - add v18.4s, v2.4s, v16.4s /* tmp10 + tmp3 */ - sub v20.4s, v2.4s, v16.4s /* tmp10 - tmp3 */ - add v22.4s, v8.4s, v14.4s /* tmp11 + tmp2 */ - sub v24.4s, v8.4s, v14.4s /* tmp11 - tmp2 */ - add v26.4s, v4.4s, v12.4s /* tmp12 + tmp1 */ - sub v28.4s, v4.4s, v12.4s /* tmp12 - tmp1 */ - add v14.4s, v6.4s, v10.4s /* tmp13 + tmp0 */ - sub v16.4s, v6.4s, v10.4s /* tmp13 - tmp0 */ + add v18.4s, v2.4s, v16.4s /* tmp10 + tmp3 */ + sub v20.4s, v2.4s, v16.4s /* tmp10 - tmp3 */ + add v22.4s, v8.4s, v14.4s /* tmp11 + tmp2 */ + sub v24.4s, v8.4s, v14.4s /* tmp11 - tmp2 */ + add v26.4s, v4.4s, v12.4s /* tmp12 + tmp1 */ + sub v28.4s, v4.4s, v12.4s /* tmp12 - tmp1 */ + add v14.4s, v6.4s, v10.4s /* tmp13 + tmp0 */ + sub v16.4s, v6.4s, v10.4s /* tmp13 - tmp0 */ - rshrn v2.4h, v18.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ - rshrn v3.4h, v22.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ - rshrn v4.4h, v26.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ - rshrn v5.4h, v14.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ - rshrn2 v2.8h, v16.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ - rshrn2 v3.8h, v28.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ - rshrn2 v4.8h, v24.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ - rshrn2 v5.8h, v20.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ - mov v6.16b, v15.16b - mov v7.16b, v15.16b - mov v8.16b, v15.16b - mov v9.16b, v15.16b - b 1b + rshrn v2.4h, v18.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ + rshrn v3.4h, v22.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ + rshrn v4.4h, v26.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ + rshrn v5.4h, v14.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v2.8h, v16.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v3.8h, v28.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ + rshrn2 v4.8h, v24.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ + rshrn2 v5.8h, v20.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ + mov v6.16b, v15.16b + mov v7.16b, v15.16b + mov v8.16b, v15.16b + mov v9.16b, v15.16b + b 1b .balign 16 3: - cbnz TMP4, 4f + cbnz TMP4, 4f /* Left AC coef is zero */ dup v14.2d, v10.d[0] /* Even part: reverse the even part of the forward DCT. */ - add v18.8h, v4.8h, v8.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ - add v22.8h, v2.8h, v6.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ - smull2 v19.4s, v18.8h, XFIX_P_0_541 /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ - sub v26.8h, v2.8h, v6.8h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ - sshll2 v23.4s, v22.8h, #(CONST_BITS) /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ - mov v21.16b, v19.16b /* tmp3 = z1 */ - smlal2 v19.4s, v8.8h, XFIX_N_1_847 /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ - sshll2 v27.4s, v26.8h, #(CONST_BITS) /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ - smlal2 v21.4s, v4.8h, XFIX_P_0_765 /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ - add v28.4s, v23.4s, v21.4s /* tmp10h tmp10 = tmp0 + tmp3; */ - sub v31.4s, v23.4s, v21.4s /* tmp13h tmp13 = tmp0 - tmp3; */ - add v29.4s, v27.4s, v19.4s /* tmp11h tmp11 = tmp1 + tmp2; */ - sub v30.4s, v27.4s, v19.4s /* tmp12h tmp12 = tmp1 - tmp2; */ + add v18.8h, v4.8h, v8.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ + add v22.8h, v2.8h, v6.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull2 v19.4s, v18.8h, XFIX_P_0_541 /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sub v26.8h, v2.8h, v6.8h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + sshll2 v23.4s, v22.8h, #(CONST_BITS) /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + mov v21.16b, v19.16b /* tmp3 = z1 */ + smlal2 v19.4s, v8.8h, XFIX_N_1_847 /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + sshll2 v27.4s, v26.8h, #(CONST_BITS) /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + smlal2 v21.4s, v4.8h, XFIX_P_0_765 /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + add v28.4s, v23.4s, v21.4s /* tmp10h tmp10 = tmp0 + tmp3; */ + sub v31.4s, v23.4s, v21.4s /* tmp13h tmp13 = tmp0 - tmp3; */ + add v29.4s, v27.4s, v19.4s /* tmp11h tmp11 = tmp1 + tmp2; */ + sub v30.4s, v27.4s, v19.4s /* tmp12h tmp12 = tmp1 - tmp2; */ /* Odd part per figure 8; the matrix is unitary and hence its * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. */ - add v22.8h, v9.8h, v5.8h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ - add v24.8h, v7.8h, v3.8h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ - add v18.8h, v9.8h, v3.8h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ - add v20.8h, v7.8h, v5.8h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ - add v26.8h, v22.8h, v24.8h /* z5 = z3 + z4 */ + add v22.8h, v9.8h, v5.8h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v24.8h, v7.8h, v3.8h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v18.8h, v9.8h, v3.8h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v20.8h, v7.8h, v5.8h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v26.8h, v22.8h, v24.8h /* z5 = z3 + z4 */ - smull2 v11.4s, v9.8h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ - smull2 v13.4s, v7.8h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ - smull2 v15.4s, v5.8h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ - smull2 v17.4s, v3.8h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ - smull2 v27.4s, v26.8h, XFIX_P_1_175 /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ - smull2 v23.4s, v22.8h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ - smull2 v25.4s, v24.8h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ - smull2 v19.4s, v18.8h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ - smull2 v21.4s, v20.8h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + smull2 v11.4s, v9.8h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull2 v13.4s, v7.8h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull2 v15.4s, v5.8h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull2 v17.4s, v3.8h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull2 v27.4s, v26.8h, XFIX_P_1_175 /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull2 v23.4s, v22.8h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull2 v25.4s, v24.8h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull2 v19.4s, v18.8h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull2 v21.4s, v20.8h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ - add v23.4s, v23.4s, v27.4s /* z3 += z5 */ - add v22.4s, v22.4s, v26.4s /* z3 += z5 */ - add v25.4s, v25.4s, v27.4s /* z4 += z5 */ - add v24.4s, v24.4s, v26.4s /* z4 += z5 */ + add v23.4s, v23.4s, v27.4s /* z3 += z5 */ + add v22.4s, v22.4s, v26.4s /* z3 += z5 */ + add v25.4s, v25.4s, v27.4s /* z4 += z5 */ + add v24.4s, v24.4s, v26.4s /* z4 += z5 */ - add v11.4s, v11.4s, v19.4s /* tmp0 += z1 */ - add v13.4s, v13.4s, v21.4s /* tmp1 += z2 */ - add v15.4s, v15.4s, v21.4s /* tmp2 += z2 */ - add v17.4s, v17.4s, v19.4s /* tmp3 += z1 */ + add v11.4s, v11.4s, v19.4s /* tmp0 += z1 */ + add v13.4s, v13.4s, v21.4s /* tmp1 += z2 */ + add v15.4s, v15.4s, v21.4s /* tmp2 += z2 */ + add v17.4s, v17.4s, v19.4s /* tmp3 += z1 */ - add v11.4s, v11.4s, v23.4s /* tmp0 += z3 */ - add v13.4s, v13.4s, v25.4s /* tmp1 += z4 */ - add v17.4s, v17.4s, v25.4s /* tmp3 += z4 */ - add v15.4s, v15.4s, v23.4s /* tmp2 += z3 */ + add v11.4s, v11.4s, v23.4s /* tmp0 += z3 */ + add v13.4s, v13.4s, v25.4s /* tmp1 += z4 */ + add v17.4s, v17.4s, v25.4s /* tmp3 += z4 */ + add v15.4s, v15.4s, v23.4s /* tmp2 += z3 */ /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - add v19.4s, v28.4s, v17.4s /* tmp10 + tmp3 */ - sub v21.4s, v28.4s, v17.4s /* tmp10 - tmp3 */ - add v23.4s, v29.4s, v15.4s /* tmp11 + tmp2 */ - sub v25.4s, v29.4s, v15.4s /* tmp11 - tmp2 */ - add v27.4s, v30.4s, v13.4s /* tmp12 + tmp1 */ - sub v29.4s, v30.4s, v13.4s /* tmp12 - tmp1 */ - add v15.4s, v31.4s, v11.4s /* tmp13 + tmp0 */ - sub v17.4s, v31.4s, v11.4s /* tmp13 - tmp0 */ + add v19.4s, v28.4s, v17.4s /* tmp10 + tmp3 */ + sub v21.4s, v28.4s, v17.4s /* tmp10 - tmp3 */ + add v23.4s, v29.4s, v15.4s /* tmp11 + tmp2 */ + sub v25.4s, v29.4s, v15.4s /* tmp11 - tmp2 */ + add v27.4s, v30.4s, v13.4s /* tmp12 + tmp1 */ + sub v29.4s, v30.4s, v13.4s /* tmp12 - tmp1 */ + add v15.4s, v31.4s, v11.4s /* tmp13 + tmp0 */ + sub v17.4s, v31.4s, v11.4s /* tmp13 - tmp0 */ - mov v2.16b, v14.16b - mov v3.16b, v14.16b - mov v4.16b, v14.16b - mov v5.16b, v14.16b - rshrn v6.4h, v19.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ - rshrn v7.4h, v23.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ - rshrn v8.4h, v27.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ - rshrn v9.4h, v15.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ - rshrn2 v6.8h, v17.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ - rshrn2 v7.8h, v29.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ - rshrn2 v8.8h, v25.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ - rshrn2 v9.8h, v21.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ - b 1b + mov v2.16b, v14.16b + mov v3.16b, v14.16b + mov v4.16b, v14.16b + mov v5.16b, v14.16b + rshrn v6.4h, v19.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ + rshrn v7.4h, v23.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ + rshrn v8.4h, v27.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ + rshrn v9.4h, v15.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v6.8h, v17.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v7.8h, v29.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ + rshrn2 v8.8h, v25.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ + rshrn2 v9.8h, v21.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ + b 1b .balign 16 4: /* "No" AC coef is zero */ /* Even part: reverse the even part of the forward DCT. */ - add v18.8h, v4.8h, v8.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ - add v22.8h, v2.8h, v6.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ - smull2 v19.4s, v18.8h, XFIX_P_0_541 /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ - sub v26.8h, v2.8h, v6.8h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ - smull v18.4s, v18.4h, XFIX_P_0_541 /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ - sshll2 v23.4s, v22.8h, #(CONST_BITS) /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ - mov v21.16b, v19.16b /* tmp3 = z1 */ - mov v20.16b, v18.16b /* tmp3 = z1 */ - smlal2 v19.4s, v8.8h, XFIX_N_1_847 /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ - smlal v18.4s, v8.4h, XFIX_N_1_847 /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ - sshll2 v27.4s, v26.8h, #(CONST_BITS) /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ - smlal2 v21.4s, v4.8h, XFIX_P_0_765 /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ - smlal v20.4s, v4.4h, XFIX_P_0_765 /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ - sshll v22.4s, v22.4h, #(CONST_BITS) /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ - sshll v26.4s, v26.4h, #(CONST_BITS) /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ - add v2.4s, v22.4s, v20.4s /* tmp10l tmp10 = tmp0 + tmp3; */ - sub v6.4s, v22.4s, v20.4s /* tmp13l tmp13 = tmp0 - tmp3; */ - add v8.4s, v26.4s, v18.4s /* tmp11l tmp11 = tmp1 + tmp2; */ - sub v4.4s, v26.4s, v18.4s /* tmp12l tmp12 = tmp1 - tmp2; */ - add v28.4s, v23.4s, v21.4s /* tmp10h tmp10 = tmp0 + tmp3; */ - sub v31.4s, v23.4s, v21.4s /* tmp13h tmp13 = tmp0 - tmp3; */ - add v29.4s, v27.4s, v19.4s /* tmp11h tmp11 = tmp1 + tmp2; */ - sub v30.4s, v27.4s, v19.4s /* tmp12h tmp12 = tmp1 - tmp2; */ + add v18.8h, v4.8h, v8.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */ + add v22.8h, v2.8h, v6.8h /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull2 v19.4s, v18.8h, XFIX_P_0_541 /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sub v26.8h, v2.8h, v6.8h /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */ + sshll2 v23.4s, v22.8h, #(CONST_BITS) /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + mov v21.16b, v19.16b /* tmp3 = z1 */ + mov v20.16b, v18.16b /* tmp3 = z1 */ + smlal2 v19.4s, v8.8h, XFIX_N_1_847 /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + smlal v18.4s, v8.4h, XFIX_N_1_847 /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */ + sshll2 v27.4s, v26.8h, #(CONST_BITS) /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + smlal2 v21.4s, v4.8h, XFIX_P_0_765 /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + smlal v20.4s, v4.4h, XFIX_P_0_765 /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */ + sshll v22.4s, v22.4h, #(CONST_BITS) /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */ + sshll v26.4s, v26.4h, #(CONST_BITS) /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */ + add v2.4s, v22.4s, v20.4s /* tmp10l tmp10 = tmp0 + tmp3; */ + sub v6.4s, v22.4s, v20.4s /* tmp13l tmp13 = tmp0 - tmp3; */ + add v8.4s, v26.4s, v18.4s /* tmp11l tmp11 = tmp1 + tmp2; */ + sub v4.4s, v26.4s, v18.4s /* tmp12l tmp12 = tmp1 - tmp2; */ + add v28.4s, v23.4s, v21.4s /* tmp10h tmp10 = tmp0 + tmp3; */ + sub v31.4s, v23.4s, v21.4s /* tmp13h tmp13 = tmp0 - tmp3; */ + add v29.4s, v27.4s, v19.4s /* tmp11h tmp11 = tmp1 + tmp2; */ + sub v30.4s, v27.4s, v19.4s /* tmp12h tmp12 = tmp1 - tmp2; */ /* Odd part per figure 8; the matrix is unitary and hence its * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. */ - add v22.8h, v9.8h, v5.8h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ - add v24.8h, v7.8h, v3.8h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ - add v18.8h, v9.8h, v3.8h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ - add v20.8h, v7.8h, v5.8h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ - add v26.8h, v22.8h, v24.8h /* z5 = z3 + z4 */ + add v22.8h, v9.8h, v5.8h /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v24.8h, v7.8h, v3.8h /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v18.8h, v9.8h, v3.8h /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */ + add v20.8h, v7.8h, v5.8h /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */ + add v26.8h, v22.8h, v24.8h /* z5 = z3 + z4 */ - smull2 v11.4s, v9.8h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ - smull2 v13.4s, v7.8h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ - smull2 v15.4s, v5.8h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ - smull2 v17.4s, v3.8h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ - smull2 v27.4s, v26.8h, XFIX_P_1_175 /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ - smull2 v23.4s, v22.8h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ - smull2 v25.4s, v24.8h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ - smull2 v19.4s, v18.8h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ - smull2 v21.4s, v20.8h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + smull2 v11.4s, v9.8h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull2 v13.4s, v7.8h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull2 v15.4s, v5.8h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull2 v17.4s, v3.8h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull2 v27.4s, v26.8h, XFIX_P_1_175 /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull2 v23.4s, v22.8h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull2 v25.4s, v24.8h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull2 v19.4s, v18.8h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull2 v21.4s, v20.8h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ - smull v10.4s, v9.4h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ - smull v12.4s, v7.4h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ - smull v14.4s, v5.4h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ - smull v16.4s, v3.4h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ - smull v26.4s, v26.4h, XFIX_P_1_175 /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ - smull v22.4s, v22.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ - smull v24.4s, v24.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ - smull v18.4s, v18.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ - smull v20.4s, v20.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ + smull v10.4s, v9.4h, XFIX_P_0_298 /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */ + smull v12.4s, v7.4h, XFIX_P_2_053 /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */ + smull v14.4s, v5.4h, XFIX_P_3_072 /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */ + smull v16.4s, v3.4h, XFIX_P_1_501 /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */ + smull v26.4s, v26.4h, XFIX_P_1_175 /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */ + smull v22.4s, v22.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560) */ + smull v24.4s, v24.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644) */ + smull v18.4s, v18.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223) */ + smull v20.4s, v20.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447) */ - add v23.4s, v23.4s, v27.4s /* z3 += z5 */ - add v22.4s, v22.4s, v26.4s /* z3 += z5 */ - add v25.4s, v25.4s, v27.4s /* z4 += z5 */ - add v24.4s, v24.4s, v26.4s /* z4 += z5 */ + add v23.4s, v23.4s, v27.4s /* z3 += z5 */ + add v22.4s, v22.4s, v26.4s /* z3 += z5 */ + add v25.4s, v25.4s, v27.4s /* z4 += z5 */ + add v24.4s, v24.4s, v26.4s /* z4 += z5 */ - add v11.4s, v11.4s, v19.4s /* tmp0 += z1 */ - add v10.4s, v10.4s, v18.4s /* tmp0 += z1 */ - add v13.4s, v13.4s, v21.4s /* tmp1 += z2 */ - add v12.4s, v12.4s, v20.4s /* tmp1 += z2 */ - add v15.4s, v15.4s, v21.4s /* tmp2 += z2 */ - add v14.4s, v14.4s, v20.4s /* tmp2 += z2 */ - add v17.4s, v17.4s, v19.4s /* tmp3 += z1 */ - add v16.4s, v16.4s, v18.4s /* tmp3 += z1 */ + add v11.4s, v11.4s, v19.4s /* tmp0 += z1 */ + add v10.4s, v10.4s, v18.4s /* tmp0 += z1 */ + add v13.4s, v13.4s, v21.4s /* tmp1 += z2 */ + add v12.4s, v12.4s, v20.4s /* tmp1 += z2 */ + add v15.4s, v15.4s, v21.4s /* tmp2 += z2 */ + add v14.4s, v14.4s, v20.4s /* tmp2 += z2 */ + add v17.4s, v17.4s, v19.4s /* tmp3 += z1 */ + add v16.4s, v16.4s, v18.4s /* tmp3 += z1 */ - add v11.4s, v11.4s, v23.4s /* tmp0 += z3 */ - add v10.4s, v10.4s, v22.4s /* tmp0 += z3 */ - add v13.4s, v13.4s, v25.4s /* tmp1 += z4 */ - add v12.4s, v12.4s, v24.4s /* tmp1 += z4 */ - add v17.4s, v17.4s, v25.4s /* tmp3 += z4 */ - add v16.4s, v16.4s, v24.4s /* tmp3 += z4 */ - add v15.4s, v15.4s, v23.4s /* tmp2 += z3 */ - add v14.4s, v14.4s, v22.4s /* tmp2 += z3 */ + add v11.4s, v11.4s, v23.4s /* tmp0 += z3 */ + add v10.4s, v10.4s, v22.4s /* tmp0 += z3 */ + add v13.4s, v13.4s, v25.4s /* tmp1 += z4 */ + add v12.4s, v12.4s, v24.4s /* tmp1 += z4 */ + add v17.4s, v17.4s, v25.4s /* tmp3 += z4 */ + add v16.4s, v16.4s, v24.4s /* tmp3 += z4 */ + add v15.4s, v15.4s, v23.4s /* tmp2 += z3 */ + add v14.4s, v14.4s, v22.4s /* tmp2 += z3 */ /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - add v18.4s, v2.4s, v16.4s /* tmp10 + tmp3 */ - add v19.4s, v28.4s, v17.4s /* tmp10 + tmp3 */ - sub v20.4s, v2.4s, v16.4s /* tmp10 - tmp3 */ - sub v21.4s, v28.4s, v17.4s /* tmp10 - tmp3 */ - add v22.4s, v8.4s, v14.4s /* tmp11 + tmp2 */ - add v23.4s, v29.4s, v15.4s /* tmp11 + tmp2 */ - sub v24.4s, v8.4s, v14.4s /* tmp11 - tmp2 */ - sub v25.4s, v29.4s, v15.4s /* tmp11 - tmp2 */ - add v26.4s, v4.4s, v12.4s /* tmp12 + tmp1 */ - add v27.4s, v30.4s, v13.4s /* tmp12 + tmp1 */ - sub v28.4s, v4.4s, v12.4s /* tmp12 - tmp1 */ - sub v29.4s, v30.4s, v13.4s /* tmp12 - tmp1 */ - add v14.4s, v6.4s, v10.4s /* tmp13 + tmp0 */ - add v15.4s, v31.4s, v11.4s /* tmp13 + tmp0 */ - sub v16.4s, v6.4s, v10.4s /* tmp13 - tmp0 */ - sub v17.4s, v31.4s, v11.4s /* tmp13 - tmp0 */ + add v18.4s, v2.4s, v16.4s /* tmp10 + tmp3 */ + add v19.4s, v28.4s, v17.4s /* tmp10 + tmp3 */ + sub v20.4s, v2.4s, v16.4s /* tmp10 - tmp3 */ + sub v21.4s, v28.4s, v17.4s /* tmp10 - tmp3 */ + add v22.4s, v8.4s, v14.4s /* tmp11 + tmp2 */ + add v23.4s, v29.4s, v15.4s /* tmp11 + tmp2 */ + sub v24.4s, v8.4s, v14.4s /* tmp11 - tmp2 */ + sub v25.4s, v29.4s, v15.4s /* tmp11 - tmp2 */ + add v26.4s, v4.4s, v12.4s /* tmp12 + tmp1 */ + add v27.4s, v30.4s, v13.4s /* tmp12 + tmp1 */ + sub v28.4s, v4.4s, v12.4s /* tmp12 - tmp1 */ + sub v29.4s, v30.4s, v13.4s /* tmp12 - tmp1 */ + add v14.4s, v6.4s, v10.4s /* tmp13 + tmp0 */ + add v15.4s, v31.4s, v11.4s /* tmp13 + tmp0 */ + sub v16.4s, v6.4s, v10.4s /* tmp13 - tmp0 */ + sub v17.4s, v31.4s, v11.4s /* tmp13 - tmp0 */ - rshrn v2.4h, v18.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ - rshrn v3.4h, v22.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ - rshrn v4.4h, v26.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ - rshrn v5.4h, v14.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ - rshrn v6.4h, v19.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ - rshrn v7.4h, v23.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ - rshrn v8.4h, v27.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ - rshrn v9.4h, v15.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ - rshrn2 v2.8h, v16.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ - rshrn2 v3.8h, v28.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ - rshrn2 v4.8h, v24.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ - rshrn2 v5.8h, v20.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ - rshrn2 v6.8h, v17.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ - rshrn2 v7.8h, v29.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ - rshrn2 v8.8h, v25.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ - rshrn2 v9.8h, v21.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ - b 1b + rshrn v2.4h, v18.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ + rshrn v3.4h, v22.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ + rshrn v4.4h, v26.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ + rshrn v5.4h, v14.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ + rshrn v6.4h, v19.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */ + rshrn v7.4h, v23.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */ + rshrn v8.4h, v27.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */ + rshrn v9.4h, v15.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v2.8h, v16.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v3.8h, v28.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ + rshrn2 v4.8h, v24.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ + rshrn2 v5.8h, v20.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ + rshrn2 v6.8h, v17.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */ + rshrn2 v7.8h, v29.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */ + rshrn2 v8.8h, v25.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */ + rshrn2 v9.8h, v21.4s, #(CONST_BITS-PASS1_BITS) /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */ + b 1b .unreq DCT_TABLE .unreq COEF_BLOCK @@ -787,10 +787,10 @@ asm_function jsimd_idct_islow_neon .balign 16 Ljsimd_idct_ifast_neon_consts: - .short (277 * 128 - 256 * 128) /* XFIX_1_082392200 */ - .short (362 * 128 - 256 * 128) /* XFIX_1_414213562 */ - .short (473 * 128 - 256 * 128) /* XFIX_1_847759065 */ - .short (669 * 128 - 512 * 128) /* XFIX_2_613125930 */ + .short (277 * 128 - 256 * 128) /* XFIX_1_082392200 */ + .short (362 * 128 - 256 * 128) /* XFIX_1_414213562 */ + .short (473 * 128 - 256 * 128) /* XFIX_1_847759065 */ + .short (669 * 128 - 512 * 128) /* XFIX_2_613125930 */ asm_function jsimd_idct_ifast_neon @@ -811,8 +811,8 @@ asm_function jsimd_idct_ifast_neon * with the following allocation: * 0 1 2 3 | 4 5 6 7 * ---------+-------- - * 0 | d16 | d17 ( v16.8h ) - * 1 | d18 | d19 ( v17.8h ) + * 0 | d16 | d17 ( v16.8h ) + * 1 | d18 | d19 ( v17.8h ) * 2 | d20 | d21 ( v18.8h ) * 3 | d22 | d23 ( v19.8h ) * 4 | d24 | d25 ( v20.8h ) @@ -825,9 +825,9 @@ asm_function jsimd_idct_ifast_neon ld1 {v16.8h, v17.8h}, [COEF_BLOCK], 32 ld1 {v0.8h, v1.8h}, [DCT_TABLE], 32 ld1 {v18.8h, v19.8h}, [COEF_BLOCK], 32 - mul v16.8h, v16.8h, v0.8h + mul v16.8h, v16.8h, v0.8h ld1 {v2.8h, v3.8h}, [DCT_TABLE], 32 - mul v17.8h, v17.8h, v1.8h + mul v17.8h, v17.8h, v1.8h ld1 {v20.8h, v21.8h}, [COEF_BLOCK], 32 mul v18.8h, v18.8h, v2.8h ld1 {v0.8h, v1.8h}, [DCT_TABLE], 32 @@ -837,135 +837,135 @@ asm_function jsimd_idct_ifast_neon ld1 {v2.8h, v3.8h}, [DCT_TABLE], 32 mul v22.8h, v22.8h, v2.8h mul v21.8h, v21.8h, v1.8h - ld1 {v0.4h}, [TMP5] /* load constants */ + ld1 {v0.4h}, [TMP5] /* load constants */ mul v23.8h, v23.8h, v3.8h /* 1-D IDCT, pass 1 */ - sub v2.8h, v18.8h, v22.8h - add v22.8h, v18.8h, v22.8h - sub v1.8h, v19.8h, v21.8h - add v21.8h, v19.8h, v21.8h - sub v5.8h, v17.8h, v23.8h - add v23.8h, v17.8h, v23.8h - sqdmulh v4.8h, v2.8h, XFIX_1_414213562 - sqdmulh v6.8h, v1.8h, XFIX_2_613125930 - add v3.8h, v1.8h, v1.8h - sub v1.8h, v5.8h, v1.8h - add v18.8h, v2.8h, v4.8h - sqdmulh v4.8h, v1.8h, XFIX_1_847759065 - sub v2.8h, v23.8h, v21.8h - add v3.8h, v3.8h, v6.8h - sqdmulh v6.8h, v2.8h, XFIX_1_414213562 - add v1.8h, v1.8h, v4.8h - sqdmulh v4.8h, v5.8h, XFIX_1_082392200 - sub v18.8h, v18.8h, v22.8h - add v2.8h, v2.8h, v6.8h - sub v6.8h, v16.8h, v20.8h - add v20.8h, v16.8h, v20.8h - add v17.8h, v5.8h, v4.8h - add v5.8h, v6.8h, v18.8h - sub v18.8h, v6.8h, v18.8h - add v6.8h, v23.8h, v21.8h - add v16.8h, v20.8h, v22.8h - sub v3.8h, v6.8h, v3.8h - sub v20.8h, v20.8h, v22.8h - sub v3.8h, v3.8h, v1.8h - sub v1.8h, v17.8h, v1.8h - add v2.8h, v3.8h, v2.8h - sub v23.8h, v16.8h, v6.8h - add v1.8h, v1.8h, v2.8h - add v16.8h, v16.8h, v6.8h - add v22.8h, v5.8h, v3.8h - sub v17.8h, v5.8h, v3.8h - sub v21.8h, v18.8h, v2.8h - add v18.8h, v18.8h, v2.8h - sub v19.8h, v20.8h, v1.8h - add v20.8h, v20.8h, v1.8h + sub v2.8h, v18.8h, v22.8h + add v22.8h, v18.8h, v22.8h + sub v1.8h, v19.8h, v21.8h + add v21.8h, v19.8h, v21.8h + sub v5.8h, v17.8h, v23.8h + add v23.8h, v17.8h, v23.8h + sqdmulh v4.8h, v2.8h, XFIX_1_414213562 + sqdmulh v6.8h, v1.8h, XFIX_2_613125930 + add v3.8h, v1.8h, v1.8h + sub v1.8h, v5.8h, v1.8h + add v18.8h, v2.8h, v4.8h + sqdmulh v4.8h, v1.8h, XFIX_1_847759065 + sub v2.8h, v23.8h, v21.8h + add v3.8h, v3.8h, v6.8h + sqdmulh v6.8h, v2.8h, XFIX_1_414213562 + add v1.8h, v1.8h, v4.8h + sqdmulh v4.8h, v5.8h, XFIX_1_082392200 + sub v18.8h, v18.8h, v22.8h + add v2.8h, v2.8h, v6.8h + sub v6.8h, v16.8h, v20.8h + add v20.8h, v16.8h, v20.8h + add v17.8h, v5.8h, v4.8h + add v5.8h, v6.8h, v18.8h + sub v18.8h, v6.8h, v18.8h + add v6.8h, v23.8h, v21.8h + add v16.8h, v20.8h, v22.8h + sub v3.8h, v6.8h, v3.8h + sub v20.8h, v20.8h, v22.8h + sub v3.8h, v3.8h, v1.8h + sub v1.8h, v17.8h, v1.8h + add v2.8h, v3.8h, v2.8h + sub v23.8h, v16.8h, v6.8h + add v1.8h, v1.8h, v2.8h + add v16.8h, v16.8h, v6.8h + add v22.8h, v5.8h, v3.8h + sub v17.8h, v5.8h, v3.8h + sub v21.8h, v18.8h, v2.8h + add v18.8h, v18.8h, v2.8h + sub v19.8h, v20.8h, v1.8h + add v20.8h, v20.8h, v1.8h transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v28, v29, v30, v31 /* 1-D IDCT, pass 2 */ - sub v2.8h, v18.8h, v22.8h - add v22.8h, v18.8h, v22.8h - sub v1.8h, v19.8h, v21.8h - add v21.8h, v19.8h, v21.8h - sub v5.8h, v17.8h, v23.8h - add v23.8h, v17.8h, v23.8h - sqdmulh v4.8h, v2.8h, XFIX_1_414213562 - sqdmulh v6.8h, v1.8h, XFIX_2_613125930 - add v3.8h, v1.8h, v1.8h - sub v1.8h, v5.8h, v1.8h - add v18.8h, v2.8h, v4.8h - sqdmulh v4.8h, v1.8h, XFIX_1_847759065 - sub v2.8h, v23.8h, v21.8h - add v3.8h, v3.8h, v6.8h - sqdmulh v6.8h, v2.8h, XFIX_1_414213562 - add v1.8h, v1.8h, v4.8h - sqdmulh v4.8h, v5.8h, XFIX_1_082392200 - sub v18.8h, v18.8h, v22.8h - add v2.8h, v2.8h, v6.8h - sub v6.8h, v16.8h, v20.8h - add v20.8h, v16.8h, v20.8h - add v17.8h, v5.8h, v4.8h - add v5.8h, v6.8h, v18.8h - sub v18.8h, v6.8h, v18.8h - add v6.8h, v23.8h, v21.8h - add v16.8h, v20.8h, v22.8h - sub v3.8h, v6.8h, v3.8h - sub v20.8h, v20.8h, v22.8h - sub v3.8h, v3.8h, v1.8h - sub v1.8h, v17.8h, v1.8h - add v2.8h, v3.8h, v2.8h - sub v23.8h, v16.8h, v6.8h - add v1.8h, v1.8h, v2.8h - add v16.8h, v16.8h, v6.8h - add v22.8h, v5.8h, v3.8h - sub v17.8h, v5.8h, v3.8h - sub v21.8h, v18.8h, v2.8h - add v18.8h, v18.8h, v2.8h - sub v19.8h, v20.8h, v1.8h - add v20.8h, v20.8h, v1.8h + sub v2.8h, v18.8h, v22.8h + add v22.8h, v18.8h, v22.8h + sub v1.8h, v19.8h, v21.8h + add v21.8h, v19.8h, v21.8h + sub v5.8h, v17.8h, v23.8h + add v23.8h, v17.8h, v23.8h + sqdmulh v4.8h, v2.8h, XFIX_1_414213562 + sqdmulh v6.8h, v1.8h, XFIX_2_613125930 + add v3.8h, v1.8h, v1.8h + sub v1.8h, v5.8h, v1.8h + add v18.8h, v2.8h, v4.8h + sqdmulh v4.8h, v1.8h, XFIX_1_847759065 + sub v2.8h, v23.8h, v21.8h + add v3.8h, v3.8h, v6.8h + sqdmulh v6.8h, v2.8h, XFIX_1_414213562 + add v1.8h, v1.8h, v4.8h + sqdmulh v4.8h, v5.8h, XFIX_1_082392200 + sub v18.8h, v18.8h, v22.8h + add v2.8h, v2.8h, v6.8h + sub v6.8h, v16.8h, v20.8h + add v20.8h, v16.8h, v20.8h + add v17.8h, v5.8h, v4.8h + add v5.8h, v6.8h, v18.8h + sub v18.8h, v6.8h, v18.8h + add v6.8h, v23.8h, v21.8h + add v16.8h, v20.8h, v22.8h + sub v3.8h, v6.8h, v3.8h + sub v20.8h, v20.8h, v22.8h + sub v3.8h, v3.8h, v1.8h + sub v1.8h, v17.8h, v1.8h + add v2.8h, v3.8h, v2.8h + sub v23.8h, v16.8h, v6.8h + add v1.8h, v1.8h, v2.8h + add v16.8h, v16.8h, v6.8h + add v22.8h, v5.8h, v3.8h + sub v17.8h, v5.8h, v3.8h + sub v21.8h, v18.8h, v2.8h + add v18.8h, v18.8h, v2.8h + sub v19.8h, v20.8h, v1.8h + add v20.8h, v20.8h, v1.8h /* Descale to 8-bit and range limit */ - movi v0.16b, #0x80 + movi v0.16b, #0x80 /* Prepare pointers (dual-issue with NEON instructions) */ - ldp TMP1, TMP2, [OUTPUT_BUF], 16 - sqshrn v28.8b, v16.8h, #5 - ldp TMP3, TMP4, [OUTPUT_BUF], 16 - sqshrn v29.8b, v17.8h, #5 - add TMP1, TMP1, OUTPUT_COL - sqshrn v30.8b, v18.8h, #5 - add TMP2, TMP2, OUTPUT_COL - sqshrn v31.8b, v19.8h, #5 - add TMP3, TMP3, OUTPUT_COL - sqshrn2 v28.16b, v20.8h, #5 - add TMP4, TMP4, OUTPUT_COL - sqshrn2 v29.16b, v21.8h, #5 - ldp TMP5, TMP6, [OUTPUT_BUF], 16 - sqshrn2 v30.16b, v22.8h, #5 - ldp TMP7, TMP8, [OUTPUT_BUF], 16 - sqshrn2 v31.16b, v23.8h, #5 - add TMP5, TMP5, OUTPUT_COL - add v16.16b, v28.16b, v0.16b - add TMP6, TMP6, OUTPUT_COL - add v18.16b, v29.16b, v0.16b - add TMP7, TMP7, OUTPUT_COL - add v20.16b, v30.16b, v0.16b - add TMP8, TMP8, OUTPUT_COL - add v22.16b, v31.16b, v0.16b + ldp TMP1, TMP2, [OUTPUT_BUF], 16 + sqshrn v28.8b, v16.8h, #5 + ldp TMP3, TMP4, [OUTPUT_BUF], 16 + sqshrn v29.8b, v17.8h, #5 + add TMP1, TMP1, OUTPUT_COL + sqshrn v30.8b, v18.8h, #5 + add TMP2, TMP2, OUTPUT_COL + sqshrn v31.8b, v19.8h, #5 + add TMP3, TMP3, OUTPUT_COL + sqshrn2 v28.16b, v20.8h, #5 + add TMP4, TMP4, OUTPUT_COL + sqshrn2 v29.16b, v21.8h, #5 + ldp TMP5, TMP6, [OUTPUT_BUF], 16 + sqshrn2 v30.16b, v22.8h, #5 + ldp TMP7, TMP8, [OUTPUT_BUF], 16 + sqshrn2 v31.16b, v23.8h, #5 + add TMP5, TMP5, OUTPUT_COL + add v16.16b, v28.16b, v0.16b + add TMP6, TMP6, OUTPUT_COL + add v18.16b, v29.16b, v0.16b + add TMP7, TMP7, OUTPUT_COL + add v20.16b, v30.16b, v0.16b + add TMP8, TMP8, OUTPUT_COL + add v22.16b, v31.16b, v0.16b /* Transpose the final 8-bit samples */ - trn1 v28.16b, v16.16b, v18.16b - trn1 v30.16b, v20.16b, v22.16b - trn2 v29.16b, v16.16b, v18.16b - trn2 v31.16b, v20.16b, v22.16b + trn1 v28.16b, v16.16b, v18.16b + trn1 v30.16b, v20.16b, v22.16b + trn2 v29.16b, v16.16b, v18.16b + trn2 v31.16b, v20.16b, v22.16b - trn1 v16.8h, v28.8h, v30.8h - trn2 v18.8h, v28.8h, v30.8h - trn1 v20.8h, v29.8h, v31.8h - trn2 v22.8h, v29.8h, v31.8h + trn1 v16.8h, v28.8h, v30.8h + trn2 v18.8h, v28.8h, v30.8h + trn1 v20.8h, v29.8h, v31.8h + trn2 v22.8h, v29.8h, v31.8h - uzp1 v28.4s, v16.4s, v18.4s - uzp2 v30.4s, v16.4s, v18.4s - uzp1 v29.4s, v20.4s, v22.4s - uzp2 v31.4s, v20.4s, v22.4s + uzp1 v28.4s, v16.4s, v18.4s + uzp2 v30.4s, v16.4s, v18.4s + uzp1 v29.4s, v20.4s, v22.4s + uzp2 v31.4s, v20.4s, v22.4s /* Store results to the output buffer */ st1 {v28.d}[0], [TMP1] @@ -1014,81 +1014,80 @@ asm_function jsimd_idct_ifast_neon #define CONST_BITS 13 -#define FIX_0_211164243 (1730) /* FIX(0.211164243) */ -#define FIX_0_509795579 (4176) /* FIX(0.509795579) */ -#define FIX_0_601344887 (4926) /* FIX(0.601344887) */ -#define FIX_0_720959822 (5906) /* FIX(0.720959822) */ -#define FIX_0_765366865 (6270) /* FIX(0.765366865) */ -#define FIX_0_850430095 (6967) /* FIX(0.850430095) */ -#define FIX_0_899976223 (7373) /* FIX(0.899976223) */ -#define FIX_1_061594337 (8697) /* FIX(1.061594337) */ -#define FIX_1_272758580 (10426) /* FIX(1.272758580) */ -#define FIX_1_451774981 (11893) /* FIX(1.451774981) */ -#define FIX_1_847759065 (15137) /* FIX(1.847759065) */ -#define FIX_2_172734803 (17799) /* FIX(2.172734803) */ -#define FIX_2_562915447 (20995) /* FIX(2.562915447) */ -#define FIX_3_624509785 (29692) /* FIX(3.624509785) */ +#define FIX_0_211164243 (1730) /* FIX(0.211164243) */ +#define FIX_0_509795579 (4176) /* FIX(0.509795579) */ +#define FIX_0_601344887 (4926) /* FIX(0.601344887) */ +#define FIX_0_720959822 (5906) /* FIX(0.720959822) */ +#define FIX_0_765366865 (6270) /* FIX(0.765366865) */ +#define FIX_0_850430095 (6967) /* FIX(0.850430095) */ +#define FIX_0_899976223 (7373) /* FIX(0.899976223) */ +#define FIX_1_061594337 (8697) /* FIX(1.061594337) */ +#define FIX_1_272758580 (10426) /* FIX(1.272758580) */ +#define FIX_1_451774981 (11893) /* FIX(1.451774981) */ +#define FIX_1_847759065 (15137) /* FIX(1.847759065) */ +#define FIX_2_172734803 (17799) /* FIX(2.172734803) */ +#define FIX_2_562915447 (20995) /* FIX(2.562915447) */ +#define FIX_3_624509785 (29692) /* FIX(3.624509785) */ .balign 16 Ljsimd_idct_4x4_neon_consts: - .short FIX_1_847759065 /* v0.h[0] */ - .short -FIX_0_765366865 /* v0.h[1] */ - .short -FIX_0_211164243 /* v0.h[2] */ - .short FIX_1_451774981 /* v0.h[3] */ - .short -FIX_2_172734803 /* d1[0] */ - .short FIX_1_061594337 /* d1[1] */ - .short -FIX_0_509795579 /* d1[2] */ - .short -FIX_0_601344887 /* d1[3] */ - .short FIX_0_899976223 /* v2.h[0] */ - .short FIX_2_562915447 /* v2.h[1] */ - .short 1 << (CONST_BITS+1) /* v2.h[2] */ - .short 0 /* v2.h[3] */ + .short FIX_1_847759065 /* v0.h[0] */ + .short -FIX_0_765366865 /* v0.h[1] */ + .short -FIX_0_211164243 /* v0.h[2] */ + .short FIX_1_451774981 /* v0.h[3] */ + .short -FIX_2_172734803 /* d1[0] */ + .short FIX_1_061594337 /* d1[1] */ + .short -FIX_0_509795579 /* d1[2] */ + .short -FIX_0_601344887 /* d1[3] */ + .short FIX_0_899976223 /* v2.h[0] */ + .short FIX_2_562915447 /* v2.h[1] */ + .short 1 << (CONST_BITS+1) /* v2.h[2] */ + .short 0 /* v2.h[3] */ .macro idct_helper x4, x6, x8, x10, x12, x14, x16, shift, y26, y27, y28, y29 - smull v28.4s, \x4, v2.h[2] - smlal v28.4s, \x8, v0.h[0] - smlal v28.4s, \x14, v0.h[1] + smull v28.4s, \x4, v2.h[2] + smlal v28.4s, \x8, v0.h[0] + smlal v28.4s, \x14, v0.h[1] - smull v26.4s, \x16, v1.h[2] - smlal v26.4s, \x12, v1.h[3] - smlal v26.4s, \x10, v2.h[0] - smlal v26.4s, \x6, v2.h[1] + smull v26.4s, \x16, v1.h[2] + smlal v26.4s, \x12, v1.h[3] + smlal v26.4s, \x10, v2.h[0] + smlal v26.4s, \x6, v2.h[1] - smull v30.4s, \x4, v2.h[2] - smlsl v30.4s, \x8, v0.h[0] - smlsl v30.4s, \x14, v0.h[1] + smull v30.4s, \x4, v2.h[2] + smlsl v30.4s, \x8, v0.h[0] + smlsl v30.4s, \x14, v0.h[1] - smull v24.4s, \x16, v0.h[2] - smlal v24.4s, \x12, v0.h[3] - smlal v24.4s, \x10, v1.h[0] - smlal v24.4s, \x6, v1.h[1] + smull v24.4s, \x16, v0.h[2] + smlal v24.4s, \x12, v0.h[3] + smlal v24.4s, \x10, v1.h[0] + smlal v24.4s, \x6, v1.h[1] add v20.4s, v28.4s, v26.4s sub v28.4s, v28.4s, v26.4s -.if \shift > 16 + .if \shift > 16 srshr v20.4s, v20.4s, #\shift srshr v28.4s, v28.4s, #\shift - xtn \y26, v20.4s - xtn \y29, v28.4s -.else - rshrn \y26, v20.4s, #\shift - rshrn \y29, v28.4s, #\shift -.endif + xtn \y26, v20.4s + xtn \y29, v28.4s + .else + rshrn \y26, v20.4s, #\shift + rshrn \y29, v28.4s, #\shift + .endif add v20.4s, v30.4s, v24.4s sub v30.4s, v30.4s, v24.4s -.if \shift > 16 + .if \shift > 16 srshr v20.4s, v20.4s, #\shift srshr v30.4s, v30.4s, #\shift - xtn \y27, v20.4s - xtn \y28, v30.4s -.else - rshrn \y27, v20.4s, #\shift - rshrn \y28, v30.4s, #\shift -.endif - + xtn \y27, v20.4s + xtn \y28, v30.4s + .else + rshrn \y27, v20.4s, #\shift + rshrn \y28, v30.4s, #\shift + .endif .endm asm_function jsimd_idct_4x4_neon @@ -1138,39 +1137,43 @@ asm_function jsimd_idct_4x4_neon ld1 {v18.4h, v19.4h, v20.4h, v21.4h}, [DCT_TABLE], 32 mul v4.4h, v4.4h, v18.4h mul v5.4h, v5.4h, v19.4h - ins v4.d[1], v5.d[0] /* 128 bit q4 */ + ins v4.d[1], v5.d[0] /* 128 bit q4 */ ld1 {v22.4h, v23.4h, v24.4h, v25.4h}, [DCT_TABLE], 32 mul v6.4h, v6.4h, v20.4h mul v7.4h, v7.4h, v21.4h - ins v6.d[1], v7.d[0] /* 128 bit q6 */ + ins v6.d[1], v7.d[0] /* 128 bit q6 */ mul v8.4h, v8.4h, v22.4h mul v9.4h, v9.4h, v23.4h - ins v8.d[1], v9.d[0] /* 128 bit q8 */ + ins v8.d[1], v9.d[0] /* 128 bit q8 */ add DCT_TABLE, DCT_TABLE, #16 ld1 {v26.4h, v27.4h, v28.4h, v29.4h}, [DCT_TABLE], 32 mul v10.4h, v10.4h, v24.4h mul v11.4h, v11.4h, v25.4h - ins v10.d[1], v11.d[0] /* 128 bit q10 */ + ins v10.d[1], v11.d[0] /* 128 bit q10 */ mul v12.4h, v12.4h, v26.4h mul v13.4h, v13.4h, v27.4h - ins v12.d[1], v13.d[0] /* 128 bit q12 */ + ins v12.d[1], v13.d[0] /* 128 bit q12 */ ld1 {v30.4h, v31.4h}, [DCT_TABLE], 16 mul v14.4h, v14.4h, v28.4h mul v15.4h, v15.4h, v29.4h - ins v14.d[1], v15.d[0] /* 128 bit q14 */ + ins v14.d[1], v15.d[0] /* 128 bit q14 */ mul v16.4h, v16.4h, v30.4h mul v17.4h, v17.4h, v31.4h - ins v16.d[1], v17.d[0] /* 128 bit q16 */ + ins v16.d[1], v17.d[0] /* 128 bit q16 */ /* Pass 1 */ - idct_helper v4.4h, v6.4h, v8.4h, v10.4h, v12.4h, v14.4h, v16.4h, 12, v4.4h, v6.4h, v8.4h, v10.4h + idct_helper v4.4h, v6.4h, v8.4h, v10.4h, v12.4h, v14.4h, v16.4h, 12, \ + v4.4h, v6.4h, v8.4h, v10.4h transpose_4x4 v4, v6, v8, v10, v3 ins v10.d[1], v11.d[0] - idct_helper v5.4h, v7.4h, v9.4h, v11.4h, v13.4h, v15.4h, v17.4h, 12, v5.4h, v7.4h, v9.4h, v11.4h + idct_helper v5.4h, v7.4h, v9.4h, v11.4h, v13.4h, v15.4h, v17.4h, 12, \ + v5.4h, v7.4h, v9.4h, v11.4h transpose_4x4 v5, v7, v9, v11, v3 ins v10.d[1], v11.d[0] + /* Pass 2 */ - idct_helper v4.4h, v6.4h, v8.4h, v10.4h, v7.4h, v9.4h, v11.4h, 19, v26.4h, v27.4h, v28.4h, v29.4h + idct_helper v4.4h, v6.4h, v8.4h, v10.4h, v7.4h, v9.4h, v11.4h, 19, \ + v26.4h, v27.4h, v28.4h, v29.4h transpose_4x4 v26, v27, v28, v29, v3 /* Range limit */ @@ -1261,31 +1264,30 @@ asm_function jsimd_idct_4x4_neon .balign 8 Ljsimd_idct_2x2_neon_consts: - .short -FIX_0_720959822 /* v14[0] */ - .short FIX_0_850430095 /* v14[1] */ - .short -FIX_1_272758580 /* v14[2] */ - .short FIX_3_624509785 /* v14[3] */ + .short -FIX_0_720959822 /* v14[0] */ + .short FIX_0_850430095 /* v14[1] */ + .short -FIX_1_272758580 /* v14[2] */ + .short FIX_3_624509785 /* v14[3] */ .macro idct_helper x4, x6, x10, x12, x16, shift, y26, y27 - sshll v15.4s, \x4, #15 - smull v26.4s, \x6, v14.h[3] - smlal v26.4s, \x10, v14.h[2] - smlal v26.4s, \x12, v14.h[1] - smlal v26.4s, \x16, v14.h[0] + sshll v15.4s, \x4, #15 + smull v26.4s, \x6, v14.h[3] + smlal v26.4s, \x10, v14.h[2] + smlal v26.4s, \x12, v14.h[1] + smlal v26.4s, \x16, v14.h[0] - add v20.4s, v15.4s, v26.4s - sub v15.4s, v15.4s, v26.4s - -.if \shift > 16 - srshr v20.4s, v20.4s, #\shift - srshr v15.4s, v15.4s, #\shift - xtn \y26, v20.4s - xtn \y27, v15.4s -.else - rshrn \y26, v20.4s, #\shift - rshrn \y27, v15.4s, #\shift -.endif + add v20.4s, v15.4s, v26.4s + sub v15.4s, v15.4s, v26.4s + .if \shift > 16 + srshr v20.4s, v20.4s, #\shift + srshr v15.4s, v15.4s, #\shift + xtn \y26, v20.4s + xtn \y27, v15.4s + .else + rshrn \y26, v20.4s, #\shift + rshrn \y27, v15.4s, #\shift + .endif .endm asm_function jsimd_idct_2x2_neon @@ -1358,28 +1360,28 @@ asm_function jsimd_idct_2x2_neon /* Pass 1 */ #if 0 idct_helper v4.4h, v6.4h, v10.4h, v12.4h, v16.4h, 13, v4.4h, v6.4h - transpose_4x4 v4.4h, v6.4h, v8.4h, v10.4h + transpose_4x4 v4.4h, v6.4h, v8.4h, v10.4h idct_helper v5.4h, v7.4h, v11.4h, v13.4h, v17.4h, 13, v5.4h, v7.4h - transpose_4x4 v5.4h, v7.4h, v9.4h, v11.4h + transpose_4x4 v5.4h, v7.4h, v9.4h, v11.4h #else - smull v26.4s, v6.4h, v14.h[3] + smull v26.4s, v6.4h, v14.h[3] smlal v26.4s, v10.4h, v14.h[2] smlal v26.4s, v12.4h, v14.h[1] smlal v26.4s, v16.4h, v14.h[0] - smull v24.4s, v7.4h, v14.h[3] + smull v24.4s, v7.4h, v14.h[3] smlal v24.4s, v11.4h, v14.h[2] smlal v24.4s, v13.4h, v14.h[1] smlal v24.4s, v17.4h, v14.h[0] - sshll v15.4s, v4.4h, #15 - sshll v30.4s, v5.4h, #15 + sshll v15.4s, v4.4h, #15 + sshll v30.4s, v5.4h, #15 add v20.4s, v15.4s, v26.4s sub v15.4s, v15.4s, v26.4s - rshrn v4.4h, v20.4s, #13 - rshrn v6.4h, v15.4s, #13 + rshrn v4.4h, v20.4s, #13 + rshrn v6.4h, v15.4s, #13 add v20.4s, v30.4s, v24.4s sub v15.4s, v30.4s, v24.4s - rshrn v5.4h, v20.4s, #13 - rshrn v7.4h, v15.4s, #13 + rshrn v5.4h, v20.4s, #13 + rshrn v7.4h, v15.4s, #13 ins v4.d[1], v5.d[0] ins v6.d[1], v7.d[0] transpose v4, v6, v3, .16b, .8h @@ -1450,125 +1452,125 @@ asm_function jsimd_idct_2x2_neon #endif .macro do_load size - .if \size == 8 - ld1 {v4.8b}, [U], 8 - ld1 {v5.8b}, [V], 8 - ld1 {v0.8b}, [Y], 8 - prfm pldl1keep, [U, #64] - prfm pldl1keep, [V, #64] - prfm pldl1keep, [Y, #64] - .elseif \size == 4 - ld1 {v4.b}[0], [U], 1 - ld1 {v4.b}[1], [U], 1 - ld1 {v4.b}[2], [U], 1 - ld1 {v4.b}[3], [U], 1 - ld1 {v5.b}[0], [V], 1 - ld1 {v5.b}[1], [V], 1 - ld1 {v5.b}[2], [V], 1 - ld1 {v5.b}[3], [V], 1 - ld1 {v0.b}[0], [Y], 1 - ld1 {v0.b}[1], [Y], 1 - ld1 {v0.b}[2], [Y], 1 - ld1 {v0.b}[3], [Y], 1 - .elseif \size == 2 - ld1 {v4.b}[4], [U], 1 - ld1 {v4.b}[5], [U], 1 - ld1 {v5.b}[4], [V], 1 - ld1 {v5.b}[5], [V], 1 - ld1 {v0.b}[4], [Y], 1 - ld1 {v0.b}[5], [Y], 1 - .elseif \size == 1 - ld1 {v4.b}[6], [U], 1 - ld1 {v5.b}[6], [V], 1 - ld1 {v0.b}[6], [Y], 1 - .else - .error unsupported macroblock size - .endif + .if \size == 8 + ld1 {v4.8b}, [U], 8 + ld1 {v5.8b}, [V], 8 + ld1 {v0.8b}, [Y], 8 + prfm pldl1keep, [U, #64] + prfm pldl1keep, [V, #64] + prfm pldl1keep, [Y, #64] + .elseif \size == 4 + ld1 {v4.b}[0], [U], 1 + ld1 {v4.b}[1], [U], 1 + ld1 {v4.b}[2], [U], 1 + ld1 {v4.b}[3], [U], 1 + ld1 {v5.b}[0], [V], 1 + ld1 {v5.b}[1], [V], 1 + ld1 {v5.b}[2], [V], 1 + ld1 {v5.b}[3], [V], 1 + ld1 {v0.b}[0], [Y], 1 + ld1 {v0.b}[1], [Y], 1 + ld1 {v0.b}[2], [Y], 1 + ld1 {v0.b}[3], [Y], 1 + .elseif \size == 2 + ld1 {v4.b}[4], [U], 1 + ld1 {v4.b}[5], [U], 1 + ld1 {v5.b}[4], [V], 1 + ld1 {v5.b}[5], [V], 1 + ld1 {v0.b}[4], [Y], 1 + ld1 {v0.b}[5], [Y], 1 + .elseif \size == 1 + ld1 {v4.b}[6], [U], 1 + ld1 {v5.b}[6], [V], 1 + ld1 {v0.b}[6], [Y], 1 + .else + .error unsupported macroblock size + .endif .endm .macro do_store bpp, size - .if \bpp == 24 - .if \size == 8 + .if \bpp == 24 + .if \size == 8 #ifdef ST3_IS_FAST - st3 {v10.8b, v11.8b, v12.8b}, [RGB], 24 + st3 {v10.8b, v11.8b, v12.8b}, [RGB], 24 #else - st1 {v10.b}[0], [RGB], #1 - st1 {v11.b}[0], [RGB], #1 - st1 {v12.b}[0], [RGB], #1 + st1 {v10.b}[0], [RGB], #1 + st1 {v11.b}[0], [RGB], #1 + st1 {v12.b}[0], [RGB], #1 - st1 {v10.b}[1], [RGB], #1 - st1 {v11.b}[1], [RGB], #1 - st1 {v12.b}[1], [RGB], #1 + st1 {v10.b}[1], [RGB], #1 + st1 {v11.b}[1], [RGB], #1 + st1 {v12.b}[1], [RGB], #1 - st1 {v10.b}[2], [RGB], #1 - st1 {v11.b}[2], [RGB], #1 - st1 {v12.b}[2], [RGB], #1 + st1 {v10.b}[2], [RGB], #1 + st1 {v11.b}[2], [RGB], #1 + st1 {v12.b}[2], [RGB], #1 - st1 {v10.b}[3], [RGB], #1 - st1 {v11.b}[3], [RGB], #1 - st1 {v12.b}[3], [RGB], #1 + st1 {v10.b}[3], [RGB], #1 + st1 {v11.b}[3], [RGB], #1 + st1 {v12.b}[3], [RGB], #1 - st1 {v10.b}[4], [RGB], #1 - st1 {v11.b}[4], [RGB], #1 - st1 {v12.b}[4], [RGB], #1 + st1 {v10.b}[4], [RGB], #1 + st1 {v11.b}[4], [RGB], #1 + st1 {v12.b}[4], [RGB], #1 - st1 {v10.b}[5], [RGB], #1 - st1 {v11.b}[5], [RGB], #1 - st1 {v12.b}[5], [RGB], #1 + st1 {v10.b}[5], [RGB], #1 + st1 {v11.b}[5], [RGB], #1 + st1 {v12.b}[5], [RGB], #1 - st1 {v10.b}[6], [RGB], #1 - st1 {v11.b}[6], [RGB], #1 - st1 {v12.b}[6], [RGB], #1 + st1 {v10.b}[6], [RGB], #1 + st1 {v11.b}[6], [RGB], #1 + st1 {v12.b}[6], [RGB], #1 - st1 {v10.b}[7], [RGB], #1 - st1 {v11.b}[7], [RGB], #1 - st1 {v12.b}[7], [RGB], #1 + st1 {v10.b}[7], [RGB], #1 + st1 {v11.b}[7], [RGB], #1 + st1 {v12.b}[7], [RGB], #1 #endif - .elseif \size == 4 - st3 {v10.b, v11.b, v12.b}[0], [RGB], 3 - st3 {v10.b, v11.b, v12.b}[1], [RGB], 3 - st3 {v10.b, v11.b, v12.b}[2], [RGB], 3 - st3 {v10.b, v11.b, v12.b}[3], [RGB], 3 - .elseif \size == 2 - st3 {v10.b, v11.b, v12.b}[4], [RGB], 3 - st3 {v10.b, v11.b, v12.b}[5], [RGB], 3 - .elseif \size == 1 - st3 {v10.b, v11.b, v12.b}[6], [RGB], 3 - .else - .error unsupported macroblock size - .endif - .elseif \bpp == 32 - .if \size == 8 - st4 {v10.8b, v11.8b, v12.8b, v13.8b}, [RGB], 32 - .elseif \size == 4 - st4 {v10.b, v11.b, v12.b, v13.b}[0], [RGB], 4 - st4 {v10.b, v11.b, v12.b, v13.b}[1], [RGB], 4 - st4 {v10.b, v11.b, v12.b, v13.b}[2], [RGB], 4 - st4 {v10.b, v11.b, v12.b, v13.b}[3], [RGB], 4 - .elseif \size == 2 - st4 {v10.b, v11.b, v12.b, v13.b}[4], [RGB], 4 - st4 {v10.b, v11.b, v12.b, v13.b}[5], [RGB], 4 - .elseif \size == 1 - st4 {v10.b, v11.b, v12.b, v13.b}[6], [RGB], 4 - .else - .error unsupported macroblock size - .endif - .elseif \bpp==16 - .if \size == 8 - st1 {v25.8h}, [RGB],16 - .elseif \size == 4 - st1 {v25.4h}, [RGB],8 - .elseif \size == 2 - st1 {v25.h}[4], [RGB],2 - st1 {v25.h}[5], [RGB],2 - .elseif \size == 1 - st1 {v25.h}[6], [RGB],2 - .else - .error unsupported macroblock size - .endif - .else - .error unsupported bpp + .elseif \size == 4 + st3 {v10.b, v11.b, v12.b}[0], [RGB], 3 + st3 {v10.b, v11.b, v12.b}[1], [RGB], 3 + st3 {v10.b, v11.b, v12.b}[2], [RGB], 3 + st3 {v10.b, v11.b, v12.b}[3], [RGB], 3 + .elseif \size == 2 + st3 {v10.b, v11.b, v12.b}[4], [RGB], 3 + st3 {v10.b, v11.b, v12.b}[5], [RGB], 3 + .elseif \size == 1 + st3 {v10.b, v11.b, v12.b}[6], [RGB], 3 + .else + .error unsupported macroblock size .endif + .elseif \bpp == 32 + .if \size == 8 + st4 {v10.8b, v11.8b, v12.8b, v13.8b}, [RGB], 32 + .elseif \size == 4 + st4 {v10.b, v11.b, v12.b, v13.b}[0], [RGB], 4 + st4 {v10.b, v11.b, v12.b, v13.b}[1], [RGB], 4 + st4 {v10.b, v11.b, v12.b, v13.b}[2], [RGB], 4 + st4 {v10.b, v11.b, v12.b, v13.b}[3], [RGB], 4 + .elseif \size == 2 + st4 {v10.b, v11.b, v12.b, v13.b}[4], [RGB], 4 + st4 {v10.b, v11.b, v12.b, v13.b}[5], [RGB], 4 + .elseif \size == 1 + st4 {v10.b, v11.b, v12.b, v13.b}[6], [RGB], 4 + .else + .error unsupported macroblock size + .endif + .elseif \bpp==16 + .if \size == 8 + st1 {v25.8h}, [RGB], 16 + .elseif \size == 4 + st1 {v25.4h}, [RGB], 8 + .elseif \size == 2 + st1 {v25.h}[4], [RGB], 2 + st1 {v25.h}[5], [RGB], 2 + .elseif \size == 1 + st1 {v25.h}[6], [RGB], 2 + .else + .error unsupported macroblock size + .endif + .else + .error unsupported bpp + .endif .endm .macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, rsize, g_offs, gsize, b_offs, bsize, defsize @@ -1578,92 +1580,91 @@ asm_function jsimd_idct_2x2_neon */ .macro do_yuv_to_rgb_stage1 - uaddw v6.8h, v2.8h, v4.8b /* q3 = u - 128 */ - uaddw v8.8h, v2.8h, v5.8b /* q2 = v - 128 */ - smull v20.4s, v6.4h, v1.h[1] /* multiply by -11277 */ - smlal v20.4s, v8.4h, v1.h[2] /* multiply by -23401 */ - smull2 v22.4s, v6.8h, v1.h[1] /* multiply by -11277 */ - smlal2 v22.4s, v8.8h, v1.h[2] /* multiply by -23401 */ - smull v24.4s, v8.4h, v1.h[0] /* multiply by 22971 */ - smull2 v26.4s, v8.8h, v1.h[0] /* multiply by 22971 */ - smull v28.4s, v6.4h, v1.h[3] /* multiply by 29033 */ - smull2 v30.4s, v6.8h, v1.h[3] /* multiply by 29033 */ + uaddw v6.8h, v2.8h, v4.8b /* q3 = u - 128 */ + uaddw v8.8h, v2.8h, v5.8b /* q2 = v - 128 */ + smull v20.4s, v6.4h, v1.h[1] /* multiply by -11277 */ + smlal v20.4s, v8.4h, v1.h[2] /* multiply by -23401 */ + smull2 v22.4s, v6.8h, v1.h[1] /* multiply by -11277 */ + smlal2 v22.4s, v8.8h, v1.h[2] /* multiply by -23401 */ + smull v24.4s, v8.4h, v1.h[0] /* multiply by 22971 */ + smull2 v26.4s, v8.8h, v1.h[0] /* multiply by 22971 */ + smull v28.4s, v6.4h, v1.h[3] /* multiply by 29033 */ + smull2 v30.4s, v6.8h, v1.h[3] /* multiply by 29033 */ .endm .macro do_yuv_to_rgb_stage2 - rshrn v20.4h, v20.4s, #15 - rshrn2 v20.8h, v22.4s, #15 - rshrn v24.4h, v24.4s, #14 - rshrn2 v24.8h, v26.4s, #14 - rshrn v28.4h, v28.4s, #14 - rshrn2 v28.8h, v30.4s, #14 - uaddw v20.8h, v20.8h, v0.8b - uaddw v24.8h, v24.8h, v0.8b - uaddw v28.8h, v28.8h, v0.8b -.if \bpp != 16 - sqxtun v1\g_offs\defsize, v20.8h - sqxtun v1\r_offs\defsize, v24.8h - sqxtun v1\b_offs\defsize, v28.8h -.else - sqshlu v21.8h, v20.8h, #8 - sqshlu v25.8h, v24.8h, #8 - sqshlu v29.8h, v28.8h, #8 - sri v25.8h, v21.8h, #5 - sri v25.8h, v29.8h, #11 -.endif - + rshrn v20.4h, v20.4s, #15 + rshrn2 v20.8h, v22.4s, #15 + rshrn v24.4h, v24.4s, #14 + rshrn2 v24.8h, v26.4s, #14 + rshrn v28.4h, v28.4s, #14 + rshrn2 v28.8h, v30.4s, #14 + uaddw v20.8h, v20.8h, v0.8b + uaddw v24.8h, v24.8h, v0.8b + uaddw v28.8h, v28.8h, v0.8b + .if \bpp != 16 + sqxtun v1\g_offs\defsize, v20.8h + sqxtun v1\r_offs\defsize, v24.8h + sqxtun v1\b_offs\defsize, v28.8h + .else + sqshlu v21.8h, v20.8h, #8 + sqshlu v25.8h, v24.8h, #8 + sqshlu v29.8h, v28.8h, #8 + sri v25.8h, v21.8h, #5 + sri v25.8h, v29.8h, #11 + .endif .endm .macro do_yuv_to_rgb_stage2_store_load_stage1 - rshrn v20.4h, v20.4s, #15 - rshrn v24.4h, v24.4s, #14 - rshrn v28.4h, v28.4s, #14 - ld1 {v4.8b}, [U], 8 - rshrn2 v20.8h, v22.4s, #15 - rshrn2 v24.8h, v26.4s, #14 - rshrn2 v28.8h, v30.4s, #14 - ld1 {v5.8b}, [V], 8 - uaddw v20.8h, v20.8h, v0.8b - uaddw v24.8h, v24.8h, v0.8b - uaddw v28.8h, v28.8h, v0.8b -.if \bpp != 16 /**************** rgb24/rgb32 *********************************/ - sqxtun v1\g_offs\defsize, v20.8h - ld1 {v0.8b}, [Y], 8 - sqxtun v1\r_offs\defsize, v24.8h - prfm pldl1keep, [U, #64] - prfm pldl1keep, [V, #64] - prfm pldl1keep, [Y, #64] - sqxtun v1\b_offs\defsize, v28.8h - uaddw v6.8h, v2.8h, v4.8b /* v6.16b = u - 128 */ - uaddw v8.8h, v2.8h, v5.8b /* q2 = v - 128 */ - smull v20.4s, v6.4h, v1.h[1] /* multiply by -11277 */ - smlal v20.4s, v8.4h, v1.h[2] /* multiply by -23401 */ - smull2 v22.4s, v6.8h, v1.h[1] /* multiply by -11277 */ - smlal2 v22.4s, v8.8h, v1.h[2] /* multiply by -23401 */ - smull v24.4s, v8.4h, v1.h[0] /* multiply by 22971 */ - smull2 v26.4s, v8.8h, v1.h[0] /* multiply by 22971 */ -.else /**************************** rgb565 ***********************************/ - sqshlu v21.8h, v20.8h, #8 - sqshlu v25.8h, v24.8h, #8 - sqshlu v29.8h, v28.8h, #8 - uaddw v6.8h, v2.8h, v4.8b /* v6.16b = u - 128 */ - uaddw v8.8h, v2.8h, v5.8b /* q2 = v - 128 */ - ld1 {v0.8b}, [Y], 8 - smull v20.4s, v6.4h, v1.h[1] /* multiply by -11277 */ - smlal v20.4s, v8.4h, v1.h[2] /* multiply by -23401 */ - smull2 v22.4s, v6.8h, v1.h[1] /* multiply by -11277 */ - smlal2 v22.4s, v8.8h, v1.h[2] /* multiply by -23401 */ - sri v25.8h, v21.8h, #5 - smull v24.4s, v8.4h, v1.h[0] /* multiply by 22971 */ - smull2 v26.4s, v8.8h, v1.h[0] /* multiply by 22971 */ - prfm pldl1keep, [U, #64] - prfm pldl1keep, [V, #64] - prfm pldl1keep, [Y, #64] - sri v25.8h, v29.8h, #11 -.endif - do_store \bpp, 8 - smull v28.4s, v6.4h, v1.h[3] /* multiply by 29033 */ - smull2 v30.4s, v6.8h, v1.h[3] /* multiply by 29033 */ + rshrn v20.4h, v20.4s, #15 + rshrn v24.4h, v24.4s, #14 + rshrn v28.4h, v28.4s, #14 + ld1 {v4.8b}, [U], 8 + rshrn2 v20.8h, v22.4s, #15 + rshrn2 v24.8h, v26.4s, #14 + rshrn2 v28.8h, v30.4s, #14 + ld1 {v5.8b}, [V], 8 + uaddw v20.8h, v20.8h, v0.8b + uaddw v24.8h, v24.8h, v0.8b + uaddw v28.8h, v28.8h, v0.8b + .if \bpp != 16 /**************** rgb24/rgb32 ******************************/ + sqxtun v1\g_offs\defsize, v20.8h + ld1 {v0.8b}, [Y], 8 + sqxtun v1\r_offs\defsize, v24.8h + prfm pldl1keep, [U, #64] + prfm pldl1keep, [V, #64] + prfm pldl1keep, [Y, #64] + sqxtun v1\b_offs\defsize, v28.8h + uaddw v6.8h, v2.8h, v4.8b /* v6.16b = u - 128 */ + uaddw v8.8h, v2.8h, v5.8b /* q2 = v - 128 */ + smull v20.4s, v6.4h, v1.h[1] /* multiply by -11277 */ + smlal v20.4s, v8.4h, v1.h[2] /* multiply by -23401 */ + smull2 v22.4s, v6.8h, v1.h[1] /* multiply by -11277 */ + smlal2 v22.4s, v8.8h, v1.h[2] /* multiply by -23401 */ + smull v24.4s, v8.4h, v1.h[0] /* multiply by 22971 */ + smull2 v26.4s, v8.8h, v1.h[0] /* multiply by 22971 */ + .else /**************************** rgb565 ********************************/ + sqshlu v21.8h, v20.8h, #8 + sqshlu v25.8h, v24.8h, #8 + sqshlu v29.8h, v28.8h, #8 + uaddw v6.8h, v2.8h, v4.8b /* v6.16b = u - 128 */ + uaddw v8.8h, v2.8h, v5.8b /* q2 = v - 128 */ + ld1 {v0.8b}, [Y], 8 + smull v20.4s, v6.4h, v1.h[1] /* multiply by -11277 */ + smlal v20.4s, v8.4h, v1.h[2] /* multiply by -23401 */ + smull2 v22.4s, v6.8h, v1.h[1] /* multiply by -11277 */ + smlal2 v22.4s, v8.8h, v1.h[2] /* multiply by -23401 */ + sri v25.8h, v21.8h, #5 + smull v24.4s, v8.4h, v1.h[0] /* multiply by 22971 */ + smull2 v26.4s, v8.8h, v1.h[0] /* multiply by 22971 */ + prfm pldl1keep, [U, #64] + prfm pldl1keep, [V, #64] + prfm pldl1keep, [Y, #64] + sri v25.8h, v29.8h, #11 + .endif + do_store \bpp, 8 + smull v28.4s, v6.4h, v1.h[3] /* multiply by 29033 */ + smull2 v30.4s, v6.8h, v1.h[3] /* multiply by 29033 */ .endm .macro do_yuv_to_rgb @@ -1677,10 +1678,10 @@ asm_function jsimd_idct_2x2_neon .balign 16 Ljsimd_ycc_\colorid\()_neon_consts: - .short 0, 0, 0, 0 - .short 22971, -11277, -23401, 29033 - .short -128, -128, -128, -128 - .short -128, -128, -128, -128 + .short 0, 0, 0, 0 + .short 22971, -11277, -23401, 29033 + .short -128, -128, -128, -128 + .short -128, -128, -128, -128 asm_function jsimd_ycc_\colorid\()_convert_neon OUTPUT_WIDTH .req x0 @@ -1701,8 +1702,10 @@ asm_function jsimd_ycc_\colorid\()_convert_neon sub sp, sp, 336 str x15, [sp], 16 + /* Load constants to d1, d2, d3 (v0.4h is just used for padding) */ adr x15, Ljsimd_ycc_\colorid\()_neon_consts + /* Save NEON registers */ st1 {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32 st1 {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32 @@ -1821,19 +1824,22 @@ asm_function jsimd_ycc_\colorid\()_convert_neon .purgem do_yuv_to_rgb_stage1 .purgem do_yuv_to_rgb_stage2 .purgem do_yuv_to_rgb_stage2_store_load_stage1 + .endm -/*--------------------------------- id ----- bpp R rsize G gsize B bsize defsize */ -generate_jsimd_ycc_rgb_convert_neon extrgb, 24, 0, .4h, 1, .4h, 2, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, .4h, 1, .4h, 2, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, .4h, 1, .4h, 0, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, .4h, 2, .4h, 1, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, .4h, 2, .4h, 3, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b +/*--------------------------------- id ----- bpp R rsize G gsize B bsize defsize */ +generate_jsimd_ycc_rgb_convert_neon extrgb, 24, 0, .4h, 1, .4h, 2, .4h, .8b +generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h, .8b +generate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, .4h, 1, .4h, 2, .4h, .8b +generate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, .4h, 1, .4h, 0, .4h, .8b +generate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, .4h, 2, .4h, 1, .4h, .8b +generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, .4h, 2, .4h, 3, .4h, .8b +generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b + .purgem do_load .purgem do_store + /*****************************************************************************/ /* @@ -1848,37 +1854,37 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, . */ .macro do_store size - .if \size == 8 - st1 {v20.8b}, [Y], #8 - st1 {v21.8b}, [U], #8 - st1 {v22.8b}, [V], #8 - .elseif \size == 4 - st1 {v20.b}[0], [Y], #1 - st1 {v20.b}[1], [Y], #1 - st1 {v20.b}[2], [Y], #1 - st1 {v20.b}[3], [Y], #1 - st1 {v21.b}[0], [U], #1 - st1 {v21.b}[1], [U], #1 - st1 {v21.b}[2], [U], #1 - st1 {v21.b}[3], [U], #1 - st1 {v22.b}[0], [V], #1 - st1 {v22.b}[1], [V], #1 - st1 {v22.b}[2], [V], #1 - st1 {v22.b}[3], [V], #1 - .elseif \size == 2 - st1 {v20.b}[4], [Y], #1 - st1 {v20.b}[5], [Y], #1 - st1 {v21.b}[4], [U], #1 - st1 {v21.b}[5], [U], #1 - st1 {v22.b}[4], [V], #1 - st1 {v22.b}[5], [V], #1 - .elseif \size == 1 - st1 {v20.b}[6], [Y], #1 - st1 {v21.b}[6], [U], #1 - st1 {v22.b}[6], [V], #1 - .else - .error unsupported macroblock size - .endif + .if \size == 8 + st1 {v20.8b}, [Y], #8 + st1 {v21.8b}, [U], #8 + st1 {v22.8b}, [V], #8 + .elseif \size == 4 + st1 {v20.b}[0], [Y], #1 + st1 {v20.b}[1], [Y], #1 + st1 {v20.b}[2], [Y], #1 + st1 {v20.b}[3], [Y], #1 + st1 {v21.b}[0], [U], #1 + st1 {v21.b}[1], [U], #1 + st1 {v21.b}[2], [U], #1 + st1 {v21.b}[3], [U], #1 + st1 {v22.b}[0], [V], #1 + st1 {v22.b}[1], [V], #1 + st1 {v22.b}[2], [V], #1 + st1 {v22.b}[3], [V], #1 + .elseif \size == 2 + st1 {v20.b}[4], [Y], #1 + st1 {v20.b}[5], [Y], #1 + st1 {v21.b}[4], [U], #1 + st1 {v21.b}[5], [U], #1 + st1 {v22.b}[4], [V], #1 + st1 {v22.b}[5], [V], #1 + .elseif \size == 1 + st1 {v20.b}[6], [Y], #1 + st1 {v21.b}[6], [U], #1 + st1 {v22.b}[6], [V], #1 + .else + .error unsupported macroblock size + .endif .endm #if defined(__APPLE__) || defined(__ANDROID__) @@ -1888,77 +1894,77 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, . #endif .macro do_load bpp, size - .if \bpp == 24 - .if \size == 8 + .if \bpp == 24 + .if \size == 8 #ifdef LD3_IS_FAST - ld3 {v10.8b, v11.8b, v12.8b}, [RGB], #24 + ld3 {v10.8b, v11.8b, v12.8b}, [RGB], #24 #else - ld1 {v10.b}[0], [RGB], #1 - ld1 {v11.b}[0], [RGB], #1 - ld1 {v12.b}[0], [RGB], #1 + ld1 {v10.b}[0], [RGB], #1 + ld1 {v11.b}[0], [RGB], #1 + ld1 {v12.b}[0], [RGB], #1 - ld1 {v10.b}[1], [RGB], #1 - ld1 {v11.b}[1], [RGB], #1 - ld1 {v12.b}[1], [RGB], #1 + ld1 {v10.b}[1], [RGB], #1 + ld1 {v11.b}[1], [RGB], #1 + ld1 {v12.b}[1], [RGB], #1 - ld1 {v10.b}[2], [RGB], #1 - ld1 {v11.b}[2], [RGB], #1 - ld1 {v12.b}[2], [RGB], #1 + ld1 {v10.b}[2], [RGB], #1 + ld1 {v11.b}[2], [RGB], #1 + ld1 {v12.b}[2], [RGB], #1 - ld1 {v10.b}[3], [RGB], #1 - ld1 {v11.b}[3], [RGB], #1 - ld1 {v12.b}[3], [RGB], #1 + ld1 {v10.b}[3], [RGB], #1 + ld1 {v11.b}[3], [RGB], #1 + ld1 {v12.b}[3], [RGB], #1 - ld1 {v10.b}[4], [RGB], #1 - ld1 {v11.b}[4], [RGB], #1 - ld1 {v12.b}[4], [RGB], #1 + ld1 {v10.b}[4], [RGB], #1 + ld1 {v11.b}[4], [RGB], #1 + ld1 {v12.b}[4], [RGB], #1 - ld1 {v10.b}[5], [RGB], #1 - ld1 {v11.b}[5], [RGB], #1 - ld1 {v12.b}[5], [RGB], #1 + ld1 {v10.b}[5], [RGB], #1 + ld1 {v11.b}[5], [RGB], #1 + ld1 {v12.b}[5], [RGB], #1 - ld1 {v10.b}[6], [RGB], #1 - ld1 {v11.b}[6], [RGB], #1 - ld1 {v12.b}[6], [RGB], #1 + ld1 {v10.b}[6], [RGB], #1 + ld1 {v11.b}[6], [RGB], #1 + ld1 {v12.b}[6], [RGB], #1 - ld1 {v10.b}[7], [RGB], #1 - ld1 {v11.b}[7], [RGB], #1 - ld1 {v12.b}[7], [RGB], #1 + ld1 {v10.b}[7], [RGB], #1 + ld1 {v11.b}[7], [RGB], #1 + ld1 {v12.b}[7], [RGB], #1 #endif - prfm pldl1keep, [RGB, #128] - .elseif \size == 4 - ld3 {v10.b, v11.b, v12.b}[0], [RGB], #3 - ld3 {v10.b, v11.b, v12.b}[1], [RGB], #3 - ld3 {v10.b, v11.b, v12.b}[2], [RGB], #3 - ld3 {v10.b, v11.b, v12.b}[3], [RGB], #3 - .elseif \size == 2 - ld3 {v10.b, v11.b, v12.b}[4], [RGB], #3 - ld3 {v10.b, v11.b, v12.b}[5], [RGB], #3 - .elseif \size == 1 - ld3 {v10.b, v11.b, v12.b}[6], [RGB], #3 - .else - .error unsupported macroblock size - .endif - .elseif \bpp == 32 - .if \size == 8 - ld4 {v10.8b, v11.8b, v12.8b, v13.8b}, [RGB], #32 - prfm pldl1keep, [RGB, #128] - .elseif \size == 4 - ld4 {v10.b, v11.b, v12.b, v13.b}[0], [RGB], #4 - ld4 {v10.b, v11.b, v12.b, v13.b}[1], [RGB], #4 - ld4 {v10.b, v11.b, v12.b, v13.b}[2], [RGB], #4 - ld4 {v10.b, v11.b, v12.b, v13.b}[3], [RGB], #4 - .elseif \size == 2 - ld4 {v10.b, v11.b, v12.b, v13.b}[4], [RGB], #4 - ld4 {v10.b, v11.b, v12.b, v13.b}[5], [RGB], #4 - .elseif \size == 1 - ld4 {v10.b, v11.b, v12.b, v13.b}[6], [RGB], #4 - .else - .error unsupported macroblock size - .endif + prfm pldl1keep, [RGB, #128] + .elseif \size == 4 + ld3 {v10.b, v11.b, v12.b}[0], [RGB], #3 + ld3 {v10.b, v11.b, v12.b}[1], [RGB], #3 + ld3 {v10.b, v11.b, v12.b}[2], [RGB], #3 + ld3 {v10.b, v11.b, v12.b}[3], [RGB], #3 + .elseif \size == 2 + ld3 {v10.b, v11.b, v12.b}[4], [RGB], #3 + ld3 {v10.b, v11.b, v12.b}[5], [RGB], #3 + .elseif \size == 1 + ld3 {v10.b, v11.b, v12.b}[6], [RGB], #3 .else - .error unsupported bpp + .error unsupported macroblock size .endif + .elseif \bpp == 32 + .if \size == 8 + ld4 {v10.8b, v11.8b, v12.8b, v13.8b}, [RGB], #32 + prfm pldl1keep, [RGB, #128] + .elseif \size == 4 + ld4 {v10.b, v11.b, v12.b, v13.b}[0], [RGB], #4 + ld4 {v10.b, v11.b, v12.b, v13.b}[1], [RGB], #4 + ld4 {v10.b, v11.b, v12.b, v13.b}[2], [RGB], #4 + ld4 {v10.b, v11.b, v12.b, v13.b}[3], [RGB], #4 + .elseif \size == 2 + ld4 {v10.b, v11.b, v12.b, v13.b}[4], [RGB], #4 + ld4 {v10.b, v11.b, v12.b, v13.b}[5], [RGB], #4 + .elseif \size == 1 + ld4 {v10.b, v11.b, v12.b, v13.b}[6], [RGB], #4 + .else + .error unsupported macroblock size + .endif + .else + .error unsupported bpp + .endif .endm .macro generate_jsimd_rgb_ycc_convert_neon colorid, bpp, r_offs, g_offs, b_offs @@ -1968,43 +1974,43 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, . */ .macro do_rgb_to_yuv_stage1 - ushll v4.8h, v1\r_offs\().8b, #0 /* r = v4 */ - ushll v6.8h, v1\g_offs\().8b, #0 /* g = v6 */ - ushll v8.8h, v1\b_offs\().8b, #0 /* b = v8 */ - rev64 v18.4s, v1.4s - rev64 v26.4s, v1.4s - rev64 v28.4s, v1.4s - rev64 v30.4s, v1.4s - umull v14.4s, v4.4h, v0.h[0] - umull2 v16.4s, v4.8h, v0.h[0] - umlsl v18.4s, v4.4h, v0.h[3] - umlsl2 v26.4s, v4.8h, v0.h[3] - umlal v28.4s, v4.4h, v0.h[5] - umlal2 v30.4s, v4.8h, v0.h[5] - umlal v14.4s, v6.4h, v0.h[1] - umlal2 v16.4s, v6.8h, v0.h[1] - umlsl v18.4s, v6.4h, v0.h[4] - umlsl2 v26.4s, v6.8h, v0.h[4] - umlsl v28.4s, v6.4h, v0.h[6] - umlsl2 v30.4s, v6.8h, v0.h[6] - umlal v14.4s, v8.4h, v0.h[2] - umlal2 v16.4s, v8.8h, v0.h[2] - umlal v18.4s, v8.4h, v0.h[5] - umlal2 v26.4s, v8.8h, v0.h[5] - umlsl v28.4s, v8.4h, v0.h[7] - umlsl2 v30.4s, v8.8h, v0.h[7] + ushll v4.8h, v1\r_offs\().8b, #0 /* r = v4 */ + ushll v6.8h, v1\g_offs\().8b, #0 /* g = v6 */ + ushll v8.8h, v1\b_offs\().8b, #0 /* b = v8 */ + rev64 v18.4s, v1.4s + rev64 v26.4s, v1.4s + rev64 v28.4s, v1.4s + rev64 v30.4s, v1.4s + umull v14.4s, v4.4h, v0.h[0] + umull2 v16.4s, v4.8h, v0.h[0] + umlsl v18.4s, v4.4h, v0.h[3] + umlsl2 v26.4s, v4.8h, v0.h[3] + umlal v28.4s, v4.4h, v0.h[5] + umlal2 v30.4s, v4.8h, v0.h[5] + umlal v14.4s, v6.4h, v0.h[1] + umlal2 v16.4s, v6.8h, v0.h[1] + umlsl v18.4s, v6.4h, v0.h[4] + umlsl2 v26.4s, v6.8h, v0.h[4] + umlsl v28.4s, v6.4h, v0.h[6] + umlsl2 v30.4s, v6.8h, v0.h[6] + umlal v14.4s, v8.4h, v0.h[2] + umlal2 v16.4s, v8.8h, v0.h[2] + umlal v18.4s, v8.4h, v0.h[5] + umlal2 v26.4s, v8.8h, v0.h[5] + umlsl v28.4s, v8.4h, v0.h[7] + umlsl2 v30.4s, v8.8h, v0.h[7] .endm .macro do_rgb_to_yuv_stage2 - rshrn v20.4h, v14.4s, #16 - shrn v22.4h, v18.4s, #16 - shrn v24.4h, v28.4s, #16 - rshrn2 v20.8h, v16.4s, #16 - shrn2 v22.8h, v26.4s, #16 - shrn2 v24.8h, v30.4s, #16 - xtn v20.8b, v20.8h /* v20 = y */ - xtn v21.8b, v22.8h /* v21 = u */ - xtn v22.8b, v24.8h /* v22 = v */ + rshrn v20.4h, v14.4s, #16 + shrn v22.4h, v18.4s, #16 + shrn v24.4h, v28.4s, #16 + rshrn2 v20.8h, v16.4s, #16 + shrn2 v22.8h, v26.4s, #16 + shrn2 v24.8h, v30.4s, #16 + xtn v20.8b, v20.8h /* v20 = y */ + xtn v21.8b, v22.8h /* v21 = u */ + xtn v22.8b, v24.8h /* v22 = v */ .endm .macro do_rgb_to_yuv @@ -2016,19 +2022,19 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, . * ARM64 processor actually can dual-issue LOAD/STORE with ALU */ .macro do_rgb_to_yuv_stage2_store_load_stage1 do_rgb_to_yuv_stage2 - do_load \bpp, 8 - st1 {v20.8b}, [Y], #8 - st1 {v21.8b}, [U], #8 - st1 {v22.8b}, [V], #8 + do_load \bpp, 8 + st1 {v20.8b}, [Y], #8 + st1 {v21.8b}, [U], #8 + st1 {v22.8b}, [V], #8 do_rgb_to_yuv_stage1 .endm .balign 16 Ljsimd_\colorid\()_ycc_neon_consts: - .short 19595, 38470, 7471, 11059 - .short 21709, 32768, 27439, 5329 - .short 32767, 128, 32767, 128 - .short 32767, 128, 32767, 128 + .short 19595, 38470, 7471, 11059 + .short 21709, 32768, 27439, 5329 + .short 32767, 128, 32767, 128 + .short 32767, 128, 32767, 128 asm_function jsimd_\colorid\()_ycc_convert_neon OUTPUT_WIDTH .req w0 @@ -2148,6 +2154,7 @@ generate_jsimd_rgb_ycc_convert_neon extxrgb, 32, 1, 2, 3 .purgem do_load .purgem do_store + /*****************************************************************************/ /* @@ -2171,7 +2178,6 @@ asm_function jsimd_convsamp_neon TMP8 .req x4 TMPDUP .req w3 - mov TMPDUP, #128 ldp TMP1, TMP2, [SAMPLE_DATA], 16 ldp TMP3, TMP4, [SAMPLE_DATA], 16 @@ -2234,43 +2240,43 @@ asm_function jsimd_convsamp_neon * rid of a bunch of VLD1.16 instructions */ -#define CONST_BITS 13 -#define PASS1_BITS 2 +#define CONST_BITS 13 +#define PASS1_BITS 2 -#define DESCALE_P1 (CONST_BITS-PASS1_BITS) -#define DESCALE_P2 (CONST_BITS+PASS1_BITS) +#define DESCALE_P1 (CONST_BITS-PASS1_BITS) +#define DESCALE_P2 (CONST_BITS+PASS1_BITS) -#define F_0_298 2446 /* FIX(0.298631336) */ -#define F_0_390 3196 /* FIX(0.390180644) */ -#define F_0_541 4433 /* FIX(0.541196100) */ -#define F_0_765 6270 /* FIX(0.765366865) */ -#define F_0_899 7373 /* FIX(0.899976223) */ -#define F_1_175 9633 /* FIX(1.175875602) */ -#define F_1_501 12299 /* FIX(1.501321110) */ -#define F_1_847 15137 /* FIX(1.847759065) */ -#define F_1_961 16069 /* FIX(1.961570560) */ -#define F_2_053 16819 /* FIX(2.053119869) */ -#define F_2_562 20995 /* FIX(2.562915447) */ -#define F_3_072 25172 /* FIX(3.072711026) */ +#define F_0_298 2446 /* FIX(0.298631336) */ +#define F_0_390 3196 /* FIX(0.390180644) */ +#define F_0_541 4433 /* FIX(0.541196100) */ +#define F_0_765 6270 /* FIX(0.765366865) */ +#define F_0_899 7373 /* FIX(0.899976223) */ +#define F_1_175 9633 /* FIX(1.175875602) */ +#define F_1_501 12299 /* FIX(1.501321110) */ +#define F_1_847 15137 /* FIX(1.847759065) */ +#define F_1_961 16069 /* FIX(1.961570560) */ +#define F_2_053 16819 /* FIX(2.053119869) */ +#define F_2_562 20995 /* FIX(2.562915447) */ +#define F_3_072 25172 /* FIX(3.072711026) */ .balign 16 Ljsimd_fdct_islow_neon_consts: - .short F_0_298 - .short -F_0_390 - .short F_0_541 - .short F_0_765 - .short - F_0_899 - .short F_1_175 - .short F_1_501 - .short - F_1_847 - .short - F_1_961 - .short F_2_053 - .short - F_2_562 - .short F_3_072 - .short 0 /* padding */ - .short 0 - .short 0 - .short 0 + .short F_0_298 + .short -F_0_390 + .short F_0_541 + .short F_0_765 + .short - F_0_899 + .short F_1_175 + .short F_1_501 + .short - F_1_847 + .short - F_1_961 + .short F_2_053 + .short - F_2_562 + .short F_3_072 + .short 0 /* padding */ + .short 0 + .short 0 + .short 0 #undef F_0_298 #undef F_0_390 @@ -2299,17 +2305,17 @@ Ljsimd_fdct_islow_neon_consts: asm_function jsimd_fdct_islow_neon - DATA .req x0 - TMP .req x9 + DATA .req x0 + TMP .req x9 /* Load constants */ - adr TMP, Ljsimd_fdct_islow_neon_consts - ld1 {v0.8h, v1.8h}, [TMP] + adr TMP, Ljsimd_fdct_islow_neon_consts + ld1 {v0.8h, v1.8h}, [TMP] /* Save NEON registers */ - sub sp, sp, #64 - st1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 - st1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 + sub sp, sp, #64 + st1 {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32 + st1 {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32 /* Load all DATA into NEON registers with the following allocation: * 0 1 2 3 | 4 5 6 7 @@ -2324,225 +2330,219 @@ asm_function jsimd_fdct_islow_neon * 7 | d30 | d31 | v23.8h */ - ld1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 - ld1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] - sub DATA, DATA, #64 + ld1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 + ld1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] + sub DATA, DATA, #64 /* Transpose */ - transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v31, v2, v3, v4 + transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v31, v2, v3, v4 /* 1-D FDCT */ - add v24.8h, v16.8h, v23.8h /* tmp0 = dataptr[0] + dataptr[7]; */ - sub v31.8h, v16.8h, v23.8h /* tmp7 = dataptr[0] - dataptr[7]; */ - add v25.8h, v17.8h, v22.8h /* tmp1 = dataptr[1] + dataptr[6]; */ - sub v30.8h, v17.8h, v22.8h /* tmp6 = dataptr[1] - dataptr[6]; */ - add v26.8h, v18.8h, v21.8h /* tmp2 = dataptr[2] + dataptr[5]; */ - sub v29.8h, v18.8h, v21.8h /* tmp5 = dataptr[2] - dataptr[5]; */ - add v27.8h, v19.8h, v20.8h /* tmp3 = dataptr[3] + dataptr[4]; */ - sub v28.8h, v19.8h, v20.8h /* tmp4 = dataptr[3] - dataptr[4]; */ + add v24.8h, v16.8h, v23.8h /* tmp0 = dataptr[0] + dataptr[7]; */ + sub v31.8h, v16.8h, v23.8h /* tmp7 = dataptr[0] - dataptr[7]; */ + add v25.8h, v17.8h, v22.8h /* tmp1 = dataptr[1] + dataptr[6]; */ + sub v30.8h, v17.8h, v22.8h /* tmp6 = dataptr[1] - dataptr[6]; */ + add v26.8h, v18.8h, v21.8h /* tmp2 = dataptr[2] + dataptr[5]; */ + sub v29.8h, v18.8h, v21.8h /* tmp5 = dataptr[2] - dataptr[5]; */ + add v27.8h, v19.8h, v20.8h /* tmp3 = dataptr[3] + dataptr[4]; */ + sub v28.8h, v19.8h, v20.8h /* tmp4 = dataptr[3] - dataptr[4]; */ /* even part */ - add v8.8h, v24.8h, v27.8h /* tmp10 = tmp0 + tmp3; */ - sub v9.8h, v24.8h, v27.8h /* tmp13 = tmp0 - tmp3; */ - add v10.8h, v25.8h, v26.8h /* tmp11 = tmp1 + tmp2; */ - sub v11.8h, v25.8h, v26.8h /* tmp12 = tmp1 - tmp2; */ + add v8.8h, v24.8h, v27.8h /* tmp10 = tmp0 + tmp3; */ + sub v9.8h, v24.8h, v27.8h /* tmp13 = tmp0 - tmp3; */ + add v10.8h, v25.8h, v26.8h /* tmp11 = tmp1 + tmp2; */ + sub v11.8h, v25.8h, v26.8h /* tmp12 = tmp1 - tmp2; */ - add v16.8h, v8.8h, v10.8h /* tmp10 + tmp11 */ - sub v20.8h, v8.8h, v10.8h /* tmp10 - tmp11 */ + add v16.8h, v8.8h, v10.8h /* tmp10 + tmp11 */ + sub v20.8h, v8.8h, v10.8h /* tmp10 - tmp11 */ - add v18.8h, v11.8h, v9.8h /* tmp12 + tmp13 */ + add v18.8h, v11.8h, v9.8h /* tmp12 + tmp13 */ - shl v16.8h, v16.8h, #PASS1_BITS /* dataptr[0] = (DCTELEM) LEFT_SHIFT(tmp10 + tmp11, PASS1_BITS); */ - shl v20.8h, v20.8h, #PASS1_BITS /* dataptr[4] = (DCTELEM) LEFT_SHIFT(tmp10 - tmp11, PASS1_BITS); */ + shl v16.8h, v16.8h, #PASS1_BITS /* dataptr[0] = (DCTELEM) LEFT_SHIFT(tmp10 + tmp11, PASS1_BITS); */ + shl v20.8h, v20.8h, #PASS1_BITS /* dataptr[4] = (DCTELEM) LEFT_SHIFT(tmp10 - tmp11, PASS1_BITS); */ - smull2 v24.4s, v18.8h, XFIX_P_0_541 /* z1 hi = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ - smull v18.4s, v18.4h, XFIX_P_0_541 /* z1 lo = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ - mov v22.16b, v18.16b - mov v25.16b, v24.16b + smull2 v24.4s, v18.8h, XFIX_P_0_541 /* z1 hi = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1 lo = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ + mov v22.16b, v18.16b + mov v25.16b, v24.16b - smlal v18.4s, v9.4h, XFIX_P_0_765 /* lo z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ - smlal2 v24.4s, v9.8h, XFIX_P_0_765 /* hi z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ - smlal v22.4s, v11.4h, XFIX_N_1_847 /* lo z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ - smlal2 v25.4s, v11.8h, XFIX_N_1_847 /* hi z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ + smlal v18.4s, v9.4h, XFIX_P_0_765 /* lo z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ + smlal2 v24.4s, v9.8h, XFIX_P_0_765 /* hi z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ + smlal v22.4s, v11.4h, XFIX_N_1_847 /* lo z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ + smlal2 v25.4s, v11.8h, XFIX_N_1_847 /* hi z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ - rshrn v18.4h, v18.4s, #DESCALE_P1 - rshrn v22.4h, v22.4s, #DESCALE_P1 - rshrn2 v18.8h, v24.4s, #DESCALE_P1 /* dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, XFIX_P_0_765), - CONST_BITS-PASS1_BITS); */ - rshrn2 v22.8h, v25.4s, #DESCALE_P1 /* dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, XFIX_N_1_847), - CONST_BITS-PASS1_BITS); */ + rshrn v18.4h, v18.4s, #DESCALE_P1 + rshrn v22.4h, v22.4s, #DESCALE_P1 + rshrn2 v18.8h, v24.4s, #DESCALE_P1 /* dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, XFIX_P_0_765), CONST_BITS-PASS1_BITS); */ + rshrn2 v22.8h, v25.4s, #DESCALE_P1 /* dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, XFIX_N_1_847), CONST_BITS-PASS1_BITS); */ /* Odd part */ - add v8.8h, v28.8h, v31.8h /* z1 = tmp4 + tmp7; */ - add v9.8h, v29.8h, v30.8h /* z2 = tmp5 + tmp6; */ - add v10.8h, v28.8h, v30.8h /* z3 = tmp4 + tmp6; */ - add v11.8h, v29.8h, v31.8h /* z4 = tmp5 + tmp7; */ - smull v4.4s, v10.4h, XFIX_P_1_175 /* z5 lo = z3 lo * XFIX_P_1_175 */ - smull2 v5.4s, v10.8h, XFIX_P_1_175 - smlal v4.4s, v11.4h, XFIX_P_1_175 /* z5 = MULTIPLY(z3 + z4, FIX_1_175875602); */ - smlal2 v5.4s, v11.8h, XFIX_P_1_175 + add v8.8h, v28.8h, v31.8h /* z1 = tmp4 + tmp7; */ + add v9.8h, v29.8h, v30.8h /* z2 = tmp5 + tmp6; */ + add v10.8h, v28.8h, v30.8h /* z3 = tmp4 + tmp6; */ + add v11.8h, v29.8h, v31.8h /* z4 = tmp5 + tmp7; */ + smull v4.4s, v10.4h, XFIX_P_1_175 /* z5 lo = z3 lo * XFIX_P_1_175 */ + smull2 v5.4s, v10.8h, XFIX_P_1_175 + smlal v4.4s, v11.4h, XFIX_P_1_175 /* z5 = MULTIPLY(z3 + z4, FIX_1_175875602); */ + smlal2 v5.4s, v11.8h, XFIX_P_1_175 - smull2 v24.4s, v28.8h, XFIX_P_0_298 - smull2 v25.4s, v29.8h, XFIX_P_2_053 - smull2 v26.4s, v30.8h, XFIX_P_3_072 - smull2 v27.4s, v31.8h, XFIX_P_1_501 - smull v28.4s, v28.4h, XFIX_P_0_298 /* tmp4 = MULTIPLY(tmp4, FIX_0_298631336); */ - smull v29.4s, v29.4h, XFIX_P_2_053 /* tmp5 = MULTIPLY(tmp5, FIX_2_053119869); */ - smull v30.4s, v30.4h, XFIX_P_3_072 /* tmp6 = MULTIPLY(tmp6, FIX_3_072711026); */ - smull v31.4s, v31.4h, XFIX_P_1_501 /* tmp7 = MULTIPLY(tmp7, FIX_1_501321110); */ + smull2 v24.4s, v28.8h, XFIX_P_0_298 + smull2 v25.4s, v29.8h, XFIX_P_2_053 + smull2 v26.4s, v30.8h, XFIX_P_3_072 + smull2 v27.4s, v31.8h, XFIX_P_1_501 + smull v28.4s, v28.4h, XFIX_P_0_298 /* tmp4 = MULTIPLY(tmp4, FIX_0_298631336); */ + smull v29.4s, v29.4h, XFIX_P_2_053 /* tmp5 = MULTIPLY(tmp5, FIX_2_053119869); */ + smull v30.4s, v30.4h, XFIX_P_3_072 /* tmp6 = MULTIPLY(tmp6, FIX_3_072711026); */ + smull v31.4s, v31.4h, XFIX_P_1_501 /* tmp7 = MULTIPLY(tmp7, FIX_1_501321110); */ - smull2 v12.4s, v8.8h, XFIX_N_0_899 - smull2 v13.4s, v9.8h, XFIX_N_2_562 - smull2 v14.4s, v10.8h, XFIX_N_1_961 - smull2 v15.4s, v11.8h, XFIX_N_0_390 - smull v8.4s, v8.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223); */ - smull v9.4s, v9.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447); */ - smull v10.4s, v10.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560); */ - smull v11.4s, v11.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644); */ + smull2 v12.4s, v8.8h, XFIX_N_0_899 + smull2 v13.4s, v9.8h, XFIX_N_2_562 + smull2 v14.4s, v10.8h, XFIX_N_1_961 + smull2 v15.4s, v11.8h, XFIX_N_0_390 + smull v8.4s, v8.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223); */ + smull v9.4s, v9.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447); */ + smull v10.4s, v10.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560); */ + smull v11.4s, v11.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644); */ - add v10.4s, v10.4s, v4.4s /* z3 += z5 */ - add v14.4s, v14.4s, v5.4s - add v11.4s, v11.4s, v4.4s /* z4 += z5 */ - add v15.4s, v15.4s, v5.4s + add v10.4s, v10.4s, v4.4s /* z3 += z5 */ + add v14.4s, v14.4s, v5.4s + add v11.4s, v11.4s, v4.4s /* z4 += z5 */ + add v15.4s, v15.4s, v5.4s - add v28.4s, v28.4s, v8.4s /* tmp4 += z1 */ - add v24.4s, v24.4s, v12.4s - add v29.4s, v29.4s, v9.4s /* tmp5 += z2 */ - add v25.4s, v25.4s, v13.4s - add v30.4s, v30.4s, v10.4s /* tmp6 += z3 */ - add v26.4s, v26.4s, v14.4s - add v31.4s, v31.4s, v11.4s /* tmp7 += z4 */ - add v27.4s, v27.4s, v15.4s + add v28.4s, v28.4s, v8.4s /* tmp4 += z1 */ + add v24.4s, v24.4s, v12.4s + add v29.4s, v29.4s, v9.4s /* tmp5 += z2 */ + add v25.4s, v25.4s, v13.4s + add v30.4s, v30.4s, v10.4s /* tmp6 += z3 */ + add v26.4s, v26.4s, v14.4s + add v31.4s, v31.4s, v11.4s /* tmp7 += z4 */ + add v27.4s, v27.4s, v15.4s - add v28.4s, v28.4s, v10.4s /* tmp4 += z3 */ - add v24.4s, v24.4s, v14.4s - add v29.4s, v29.4s, v11.4s /* tmp5 += z4 */ - add v25.4s, v25.4s, v15.4s - add v30.4s, v30.4s, v9.4s /* tmp6 += z2 */ - add v26.4s, v26.4s, v13.4s - add v31.4s, v31.4s, v8.4s /* tmp7 += z1 */ - add v27.4s, v27.4s, v12.4s + add v28.4s, v28.4s, v10.4s /* tmp4 += z3 */ + add v24.4s, v24.4s, v14.4s + add v29.4s, v29.4s, v11.4s /* tmp5 += z4 */ + add v25.4s, v25.4s, v15.4s + add v30.4s, v30.4s, v9.4s /* tmp6 += z2 */ + add v26.4s, v26.4s, v13.4s + add v31.4s, v31.4s, v8.4s /* tmp7 += z1 */ + add v27.4s, v27.4s, v12.4s - rshrn v23.4h, v28.4s, #DESCALE_P1 - rshrn v21.4h, v29.4s, #DESCALE_P1 - rshrn v19.4h, v30.4s, #DESCALE_P1 - rshrn v17.4h, v31.4s, #DESCALE_P1 - rshrn2 v23.8h, v24.4s, #DESCALE_P1 /* dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); */ - rshrn2 v21.8h, v25.4s, #DESCALE_P1 /* dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); */ - rshrn2 v19.8h, v26.4s, #DESCALE_P1 /* dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); */ - rshrn2 v17.8h, v27.4s, #DESCALE_P1 /* dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); */ + rshrn v23.4h, v28.4s, #DESCALE_P1 + rshrn v21.4h, v29.4s, #DESCALE_P1 + rshrn v19.4h, v30.4s, #DESCALE_P1 + rshrn v17.4h, v31.4s, #DESCALE_P1 + rshrn2 v23.8h, v24.4s, #DESCALE_P1 /* dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); */ + rshrn2 v21.8h, v25.4s, #DESCALE_P1 /* dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); */ + rshrn2 v19.8h, v26.4s, #DESCALE_P1 /* dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); */ + rshrn2 v17.8h, v27.4s, #DESCALE_P1 /* dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); */ /* Transpose */ - transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v31, v2, v3, v4 + transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v31, v2, v3, v4 /* 1-D FDCT */ - add v24.8h, v16.8h, v23.8h /* tmp0 = dataptr[0] + dataptr[7]; */ - sub v31.8h, v16.8h, v23.8h /* tmp7 = dataptr[0] - dataptr[7]; */ - add v25.8h, v17.8h, v22.8h /* tmp1 = dataptr[1] + dataptr[6]; */ - sub v30.8h, v17.8h, v22.8h /* tmp6 = dataptr[1] - dataptr[6]; */ - add v26.8h, v18.8h, v21.8h /* tmp2 = dataptr[2] + dataptr[5]; */ - sub v29.8h, v18.8h, v21.8h /* tmp5 = dataptr[2] - dataptr[5]; */ - add v27.8h, v19.8h, v20.8h /* tmp3 = dataptr[3] + dataptr[4]; */ - sub v28.8h, v19.8h, v20.8h /* tmp4 = dataptr[3] - dataptr[4]; */ + add v24.8h, v16.8h, v23.8h /* tmp0 = dataptr[0] + dataptr[7]; */ + sub v31.8h, v16.8h, v23.8h /* tmp7 = dataptr[0] - dataptr[7]; */ + add v25.8h, v17.8h, v22.8h /* tmp1 = dataptr[1] + dataptr[6]; */ + sub v30.8h, v17.8h, v22.8h /* tmp6 = dataptr[1] - dataptr[6]; */ + add v26.8h, v18.8h, v21.8h /* tmp2 = dataptr[2] + dataptr[5]; */ + sub v29.8h, v18.8h, v21.8h /* tmp5 = dataptr[2] - dataptr[5]; */ + add v27.8h, v19.8h, v20.8h /* tmp3 = dataptr[3] + dataptr[4]; */ + sub v28.8h, v19.8h, v20.8h /* tmp4 = dataptr[3] - dataptr[4]; */ /* even part */ + add v8.8h, v24.8h, v27.8h /* tmp10 = tmp0 + tmp3; */ + sub v9.8h, v24.8h, v27.8h /* tmp13 = tmp0 - tmp3; */ + add v10.8h, v25.8h, v26.8h /* tmp11 = tmp1 + tmp2; */ + sub v11.8h, v25.8h, v26.8h /* tmp12 = tmp1 - tmp2; */ - add v8.8h, v24.8h, v27.8h /* tmp10 = tmp0 + tmp3; */ - sub v9.8h, v24.8h, v27.8h /* tmp13 = tmp0 - tmp3; */ - add v10.8h, v25.8h, v26.8h /* tmp11 = tmp1 + tmp2; */ - sub v11.8h, v25.8h, v26.8h /* tmp12 = tmp1 - tmp2; */ + add v16.8h, v8.8h, v10.8h /* tmp10 + tmp11 */ + sub v20.8h, v8.8h, v10.8h /* tmp10 - tmp11 */ - add v16.8h, v8.8h, v10.8h /* tmp10 + tmp11 */ - sub v20.8h, v8.8h, v10.8h /* tmp10 - tmp11 */ + add v18.8h, v11.8h, v9.8h /* tmp12 + tmp13 */ - add v18.8h, v11.8h, v9.8h /* tmp12 + tmp13 */ + srshr v16.8h, v16.8h, #PASS1_BITS /* dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); */ + srshr v20.8h, v20.8h, #PASS1_BITS /* dataptr[4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); */ - srshr v16.8h, v16.8h, #PASS1_BITS /* dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); */ - srshr v20.8h, v20.8h, #PASS1_BITS /* dataptr[4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); */ + smull2 v24.4s, v18.8h, XFIX_P_0_541 /* z1 hi = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ + smull v18.4s, v18.4h, XFIX_P_0_541 /* z1 lo = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ + mov v22.16b, v18.16b + mov v25.16b, v24.16b - smull2 v24.4s, v18.8h, XFIX_P_0_541 /* z1 hi = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ - smull v18.4s, v18.4h, XFIX_P_0_541 /* z1 lo = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */ - mov v22.16b, v18.16b - mov v25.16b, v24.16b + smlal v18.4s, v9.4h, XFIX_P_0_765 /* lo z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ + smlal2 v24.4s, v9.8h, XFIX_P_0_765 /* hi z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ + smlal v22.4s, v11.4h, XFIX_N_1_847 /* lo z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ + smlal2 v25.4s, v11.8h, XFIX_N_1_847 /* hi z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ - smlal v18.4s, v9.4h, XFIX_P_0_765 /* lo z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ - smlal2 v24.4s, v9.8h, XFIX_P_0_765 /* hi z1 + MULTIPLY(tmp13, XFIX_P_0_765) */ - smlal v22.4s, v11.4h, XFIX_N_1_847 /* lo z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ - smlal2 v25.4s, v11.8h, XFIX_N_1_847 /* hi z1 + MULTIPLY(tmp12, XFIX_N_1_847) */ - - rshrn v18.4h, v18.4s, #DESCALE_P2 - rshrn v22.4h, v22.4s, #DESCALE_P2 - rshrn2 v18.8h, v24.4s, #DESCALE_P2 /* dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, XFIX_P_0_765), - CONST_BITS-PASS1_BITS); */ - rshrn2 v22.8h, v25.4s, #DESCALE_P2 /* dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, XFIX_N_1_847), - CONST_BITS-PASS1_BITS); */ + rshrn v18.4h, v18.4s, #DESCALE_P2 + rshrn v22.4h, v22.4s, #DESCALE_P2 + rshrn2 v18.8h, v24.4s, #DESCALE_P2 /* dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, XFIX_P_0_765), CONST_BITS-PASS1_BITS); */ + rshrn2 v22.8h, v25.4s, #DESCALE_P2 /* dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, XFIX_N_1_847), CONST_BITS-PASS1_BITS); */ /* Odd part */ + add v8.8h, v28.8h, v31.8h /* z1 = tmp4 + tmp7; */ + add v9.8h, v29.8h, v30.8h /* z2 = tmp5 + tmp6; */ + add v10.8h, v28.8h, v30.8h /* z3 = tmp4 + tmp6; */ + add v11.8h, v29.8h, v31.8h /* z4 = tmp5 + tmp7; */ - add v8.8h, v28.8h, v31.8h /* z1 = tmp4 + tmp7; */ - add v9.8h, v29.8h, v30.8h /* z2 = tmp5 + tmp6; */ - add v10.8h, v28.8h, v30.8h /* z3 = tmp4 + tmp6; */ - add v11.8h, v29.8h, v31.8h /* z4 = tmp5 + tmp7; */ + smull v4.4s, v10.4h, XFIX_P_1_175 /* z5 lo = z3 lo * XFIX_P_1_175 */ + smull2 v5.4s, v10.8h, XFIX_P_1_175 + smlal v4.4s, v11.4h, XFIX_P_1_175 /* z5 = MULTIPLY(z3 + z4, FIX_1_175875602); */ + smlal2 v5.4s, v11.8h, XFIX_P_1_175 - smull v4.4s, v10.4h, XFIX_P_1_175 /* z5 lo = z3 lo * XFIX_P_1_175 */ - smull2 v5.4s, v10.8h, XFIX_P_1_175 - smlal v4.4s, v11.4h, XFIX_P_1_175 /* z5 = MULTIPLY(z3 + z4, FIX_1_175875602); */ - smlal2 v5.4s, v11.8h, XFIX_P_1_175 + smull2 v24.4s, v28.8h, XFIX_P_0_298 + smull2 v25.4s, v29.8h, XFIX_P_2_053 + smull2 v26.4s, v30.8h, XFIX_P_3_072 + smull2 v27.4s, v31.8h, XFIX_P_1_501 + smull v28.4s, v28.4h, XFIX_P_0_298 /* tmp4 = MULTIPLY(tmp4, FIX_0_298631336); */ + smull v29.4s, v29.4h, XFIX_P_2_053 /* tmp5 = MULTIPLY(tmp5, FIX_2_053119869); */ + smull v30.4s, v30.4h, XFIX_P_3_072 /* tmp6 = MULTIPLY(tmp6, FIX_3_072711026); */ + smull v31.4s, v31.4h, XFIX_P_1_501 /* tmp7 = MULTIPLY(tmp7, FIX_1_501321110); */ - smull2 v24.4s, v28.8h, XFIX_P_0_298 - smull2 v25.4s, v29.8h, XFIX_P_2_053 - smull2 v26.4s, v30.8h, XFIX_P_3_072 - smull2 v27.4s, v31.8h, XFIX_P_1_501 - smull v28.4s, v28.4h, XFIX_P_0_298 /* tmp4 = MULTIPLY(tmp4, FIX_0_298631336); */ - smull v29.4s, v29.4h, XFIX_P_2_053 /* tmp5 = MULTIPLY(tmp5, FIX_2_053119869); */ - smull v30.4s, v30.4h, XFIX_P_3_072 /* tmp6 = MULTIPLY(tmp6, FIX_3_072711026); */ - smull v31.4s, v31.4h, XFIX_P_1_501 /* tmp7 = MULTIPLY(tmp7, FIX_1_501321110); */ + smull2 v12.4s, v8.8h, XFIX_N_0_899 + smull2 v13.4s, v9.8h, XFIX_N_2_562 + smull2 v14.4s, v10.8h, XFIX_N_1_961 + smull2 v15.4s, v11.8h, XFIX_N_0_390 + smull v8.4s, v8.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223); */ + smull v9.4s, v9.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447); */ + smull v10.4s, v10.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560); */ + smull v11.4s, v11.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644); */ - smull2 v12.4s, v8.8h, XFIX_N_0_899 - smull2 v13.4s, v9.8h, XFIX_N_2_562 - smull2 v14.4s, v10.8h, XFIX_N_1_961 - smull2 v15.4s, v11.8h, XFIX_N_0_390 - smull v8.4s, v8.4h, XFIX_N_0_899 /* z1 = MULTIPLY(z1, - FIX_0_899976223); */ - smull v9.4s, v9.4h, XFIX_N_2_562 /* z2 = MULTIPLY(z2, - FIX_2_562915447); */ - smull v10.4s, v10.4h, XFIX_N_1_961 /* z3 = MULTIPLY(z3, - FIX_1_961570560); */ - smull v11.4s, v11.4h, XFIX_N_0_390 /* z4 = MULTIPLY(z4, - FIX_0_390180644); */ + add v10.4s, v10.4s, v4.4s + add v14.4s, v14.4s, v5.4s + add v11.4s, v11.4s, v4.4s + add v15.4s, v15.4s, v5.4s - add v10.4s, v10.4s, v4.4s - add v14.4s, v14.4s, v5.4s - add v11.4s, v11.4s, v4.4s - add v15.4s, v15.4s, v5.4s + add v28.4s, v28.4s, v8.4s /* tmp4 += z1 */ + add v24.4s, v24.4s, v12.4s + add v29.4s, v29.4s, v9.4s /* tmp5 += z2 */ + add v25.4s, v25.4s, v13.4s + add v30.4s, v30.4s, v10.4s /* tmp6 += z3 */ + add v26.4s, v26.4s, v14.4s + add v31.4s, v31.4s, v11.4s /* tmp7 += z4 */ + add v27.4s, v27.4s, v15.4s - add v28.4s, v28.4s, v8.4s /* tmp4 += z1 */ - add v24.4s, v24.4s, v12.4s - add v29.4s, v29.4s, v9.4s /* tmp5 += z2 */ - add v25.4s, v25.4s, v13.4s - add v30.4s, v30.4s, v10.4s /* tmp6 += z3 */ - add v26.4s, v26.4s, v14.4s - add v31.4s, v31.4s, v11.4s /* tmp7 += z4 */ - add v27.4s, v27.4s, v15.4s + add v28.4s, v28.4s, v10.4s /* tmp4 += z3 */ + add v24.4s, v24.4s, v14.4s + add v29.4s, v29.4s, v11.4s /* tmp5 += z4 */ + add v25.4s, v25.4s, v15.4s + add v30.4s, v30.4s, v9.4s /* tmp6 += z2 */ + add v26.4s, v26.4s, v13.4s + add v31.4s, v31.4s, v8.4s /* tmp7 += z1 */ + add v27.4s, v27.4s, v12.4s - add v28.4s, v28.4s, v10.4s /* tmp4 += z3 */ - add v24.4s, v24.4s, v14.4s - add v29.4s, v29.4s, v11.4s /* tmp5 += z4 */ - add v25.4s, v25.4s, v15.4s - add v30.4s, v30.4s, v9.4s /* tmp6 += z2 */ - add v26.4s, v26.4s, v13.4s - add v31.4s, v31.4s, v8.4s /* tmp7 += z1 */ - add v27.4s, v27.4s, v12.4s - - rshrn v23.4h, v28.4s, #DESCALE_P2 - rshrn v21.4h, v29.4s, #DESCALE_P2 - rshrn v19.4h, v30.4s, #DESCALE_P2 - rshrn v17.4h, v31.4s, #DESCALE_P2 - rshrn2 v23.8h, v24.4s, #DESCALE_P2 /* dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); */ - rshrn2 v21.8h, v25.4s, #DESCALE_P2 /* dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); */ - rshrn2 v19.8h, v26.4s, #DESCALE_P2 /* dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); */ - rshrn2 v17.8h, v27.4s, #DESCALE_P2 /* dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); */ + rshrn v23.4h, v28.4s, #DESCALE_P2 + rshrn v21.4h, v29.4s, #DESCALE_P2 + rshrn v19.4h, v30.4s, #DESCALE_P2 + rshrn v17.4h, v31.4s, #DESCALE_P2 + rshrn2 v23.8h, v24.4s, #DESCALE_P2 /* dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); */ + rshrn2 v21.8h, v25.4s, #DESCALE_P2 /* dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); */ + rshrn2 v19.8h, v26.4s, #DESCALE_P2 /* dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); */ + rshrn2 v17.8h, v27.4s, #DESCALE_P2 /* dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); */ /* store results */ - st1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 - st1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] + st1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 + st1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] /* Restore NEON registers */ sub sp, sp, #64 @@ -2567,6 +2567,7 @@ asm_function jsimd_fdct_islow_neon #undef XFIX_N_2_562 #undef XFIX_P_3_072 + /*****************************************************************************/ /* @@ -2574,7 +2575,7 @@ asm_function jsimd_fdct_islow_neon * * This function contains a fast, not so accurate integer implementation of * the forward DCT (Discrete Cosine Transform). It uses the same calculations - * and produces exactly the same output as IJG''s original 'jpeg_fdct_ifast' + * and produces exactly the same output as IJG's original 'jpeg_fdct_ifast' * function from jfdctfst.c * * TODO: can be combined with 'jsimd_convsamp_neon' to get @@ -2589,19 +2590,19 @@ asm_function jsimd_fdct_islow_neon .balign 16 Ljsimd_fdct_ifast_neon_consts: - .short (98 * 128) /* XFIX_0_382683433 */ - .short (139 * 128) /* XFIX_0_541196100 */ - .short (181 * 128) /* XFIX_0_707106781 */ - .short (334 * 128 - 256 * 128) /* XFIX_1_306562965 */ + .short (98 * 128) /* XFIX_0_382683433 */ + .short (139 * 128) /* XFIX_0_541196100 */ + .short (181 * 128) /* XFIX_0_707106781 */ + .short (334 * 128 - 256 * 128) /* XFIX_1_306562965 */ asm_function jsimd_fdct_ifast_neon - DATA .req x0 - TMP .req x9 + DATA .req x0 + TMP .req x9 /* Load constants */ - adr TMP, Ljsimd_fdct_ifast_neon_consts - ld1 {v0.4h}, [TMP] + adr TMP, Ljsimd_fdct_ifast_neon_consts + ld1 {v0.4h}, [TMP] /* Load all DATA into NEON registers with the following allocation: * 0 1 2 3 | 4 5 6 7 @@ -2616,56 +2617,56 @@ asm_function jsimd_fdct_ifast_neon * 7 | d30 | d31 | q15 */ - ld1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 - ld1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] - mov TMP, #2 - sub DATA, DATA, #64 + ld1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 + ld1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] + mov TMP, #2 + sub DATA, DATA, #64 1: /* Transpose */ - transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v1, v2, v3, v4 - subs TMP, TMP, #1 + transpose_8x8 v16, v17, v18, v19, v20, v21, v22, v23, v1, v2, v3, v4 + subs TMP, TMP, #1 /* 1-D FDCT */ - add v4.8h, v19.8h, v20.8h - sub v20.8h, v19.8h, v20.8h - sub v28.8h, v18.8h, v21.8h - add v18.8h, v18.8h, v21.8h - sub v29.8h, v17.8h, v22.8h - add v17.8h, v17.8h, v22.8h - sub v21.8h, v16.8h, v23.8h - add v16.8h, v16.8h, v23.8h - sub v6.8h, v17.8h, v18.8h - sub v7.8h, v16.8h, v4.8h - add v5.8h, v17.8h, v18.8h - add v6.8h, v6.8h, v7.8h - add v4.8h, v16.8h, v4.8h - sqdmulh v6.8h, v6.8h, XFIX_0_707106781 - add v19.8h, v20.8h, v28.8h - add v16.8h, v4.8h, v5.8h - sub v20.8h, v4.8h, v5.8h - add v5.8h, v28.8h, v29.8h - add v29.8h, v29.8h, v21.8h - sqdmulh v5.8h, v5.8h, XFIX_0_707106781 - sub v28.8h, v19.8h, v29.8h - add v18.8h, v7.8h, v6.8h - sqdmulh v28.8h, v28.8h, XFIX_0_382683433 - sub v22.8h, v7.8h, v6.8h - sqdmulh v19.8h, v19.8h, XFIX_0_541196100 - sqdmulh v7.8h, v29.8h, XFIX_1_306562965 - add v6.8h, v21.8h, v5.8h - sub v5.8h, v21.8h, v5.8h - add v29.8h, v29.8h, v28.8h - add v19.8h, v19.8h, v28.8h - add v29.8h, v29.8h, v7.8h - add v21.8h, v5.8h, v19.8h - sub v19.8h, v5.8h, v19.8h - add v17.8h, v6.8h, v29.8h - sub v23.8h, v6.8h, v29.8h + add v4.8h, v19.8h, v20.8h + sub v20.8h, v19.8h, v20.8h + sub v28.8h, v18.8h, v21.8h + add v18.8h, v18.8h, v21.8h + sub v29.8h, v17.8h, v22.8h + add v17.8h, v17.8h, v22.8h + sub v21.8h, v16.8h, v23.8h + add v16.8h, v16.8h, v23.8h + sub v6.8h, v17.8h, v18.8h + sub v7.8h, v16.8h, v4.8h + add v5.8h, v17.8h, v18.8h + add v6.8h, v6.8h, v7.8h + add v4.8h, v16.8h, v4.8h + sqdmulh v6.8h, v6.8h, XFIX_0_707106781 + add v19.8h, v20.8h, v28.8h + add v16.8h, v4.8h, v5.8h + sub v20.8h, v4.8h, v5.8h + add v5.8h, v28.8h, v29.8h + add v29.8h, v29.8h, v21.8h + sqdmulh v5.8h, v5.8h, XFIX_0_707106781 + sub v28.8h, v19.8h, v29.8h + add v18.8h, v7.8h, v6.8h + sqdmulh v28.8h, v28.8h, XFIX_0_382683433 + sub v22.8h, v7.8h, v6.8h + sqdmulh v19.8h, v19.8h, XFIX_0_541196100 + sqdmulh v7.8h, v29.8h, XFIX_1_306562965 + add v6.8h, v21.8h, v5.8h + sub v5.8h, v21.8h, v5.8h + add v29.8h, v29.8h, v28.8h + add v19.8h, v19.8h, v28.8h + add v29.8h, v29.8h, v7.8h + add v21.8h, v5.8h, v19.8h + sub v19.8h, v5.8h, v19.8h + add v17.8h, v6.8h, v29.8h + sub v23.8h, v6.8h, v29.8h - b.ne 1b + b.ne 1b /* store results */ - st1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 - st1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] + st1 {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64 + st1 {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA] br x30 @@ -2676,6 +2677,7 @@ asm_function jsimd_fdct_ifast_neon #undef XFIX_0_707106781 #undef XFIX_1_306562965 + /*****************************************************************************/ /* @@ -2732,10 +2734,10 @@ asm_function jsimd_quantize_neon neg v25.8h, v25.8h neg v26.8h, v26.8h neg v27.8h, v27.8h - sshr v0.8h, v0.8h, #15 /* extract sign */ - sshr v1.8h, v1.8h, #15 - sshr v2.8h, v2.8h, #15 - sshr v3.8h, v3.8h, #15 + sshr v0.8h, v0.8h, #15 /* extract sign */ + sshr v1.8h, v1.8h, #15 + sshr v2.8h, v2.8h, #15 + sshr v3.8h, v3.8h, #15 ushl v4.8h, v4.8h, v24.8h /* shift */ ushl v5.8h, v5.8h, v25.8h ushl v6.8h, v6.8h, v26.8h @@ -2763,6 +2765,7 @@ asm_function jsimd_quantize_neon .unreq SHIFT .unreq LOOP_COUNT + /*****************************************************************************/ /* @@ -2772,44 +2775,45 @@ asm_function jsimd_quantize_neon * * GLOBAL(void) * jsimd_h2v1_downsample_neon (JDIMENSION image_width, int max_v_samp_factor, - * JDIMENSION v_samp_factor, JDIMENSION width_blocks, - * JSAMPARRAY input_data, JSAMPARRAY output_data); + * JDIMENSION v_samp_factor, + * JDIMENSION width_blocks, JSAMPARRAY input_data, + * JSAMPARRAY output_data); */ .balign 16 Ljsimd_h2_downsample_neon_consts: - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F /* diff 0 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0E /* diff 1 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0D, 0x0D /* diff 2 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C /* diff 3 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ - 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B /* diff 4 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ - 0x08, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A /* diff 5 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ - 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 /* diff 6 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 /* diff 7 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 /* diff 8 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, \ - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, \ - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, \ - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11 */ - .byte 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, \ - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12 */ - .byte 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, \ - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13 */ - .byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, \ - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14 */ - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F /* diff 0 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0E /* diff 1 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0D, 0x0D /* diff 2 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C /* diff 3 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B /* diff 4 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A /* diff 5 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 /* diff 6 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 /* diff 7 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \ + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 /* diff 8 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, \ + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 /* diff 9 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, \ + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* diff 10 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, \ + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 /* diff 11 */ + .byte 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, \ + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* diff 12 */ + .byte 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, \ + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* diff 13 */ + .byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, \ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* diff 14 */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* diff 15 */ asm_function jsimd_h2v1_downsample_neon IMAGE_WIDTH .req x0 @@ -2825,39 +2829,39 @@ asm_function jsimd_h2v1_downsample_neon TMP3 .req x13 TMPDUP .req w15 - mov TMPDUP, #0x10000 - lsl TMP2, BLOCK_WIDTH, #4 - sub TMP2, TMP2, IMAGE_WIDTH - adr TMP3, Ljsimd_h2_downsample_neon_consts - add TMP3, TMP3, TMP2, lsl #4 - dup v16.4s, TMPDUP - ld1 {v18.16b}, [TMP3] + mov TMPDUP, #0x10000 + lsl TMP2, BLOCK_WIDTH, #4 + sub TMP2, TMP2, IMAGE_WIDTH + adr TMP3, Ljsimd_h2_downsample_neon_consts + add TMP3, TMP3, TMP2, lsl #4 + dup v16.4s, TMPDUP + ld1 {v18.16b}, [TMP3] 1: /* row loop */ - ldr INPTR, [INPUT_DATA], #8 - ldr OUTPTR, [OUTPUT_DATA], #8 - subs TMP1, BLOCK_WIDTH, #1 - b.eq 3f + ldr INPTR, [INPUT_DATA], #8 + ldr OUTPTR, [OUTPUT_DATA], #8 + subs TMP1, BLOCK_WIDTH, #1 + b.eq 3f 2: /* columns */ - ld1 {v0.16b}, [INPTR], #16 - mov v4.16b, v16.16b - subs TMP1, TMP1, #1 - uadalp v4.8h, v0.16b - shrn v6.8b, v4.8h, #1 - st1 {v6.8b}, [OUTPTR], #8 - b.ne 2b + ld1 {v0.16b}, [INPTR], #16 + mov v4.16b, v16.16b + subs TMP1, TMP1, #1 + uadalp v4.8h, v0.16b + shrn v6.8b, v4.8h, #1 + st1 {v6.8b}, [OUTPTR], #8 + b.ne 2b 3: /* last columns */ - ld1 {v0.16b}, [INPTR] - mov v4.16b, v16.16b - subs V_SAMP, V_SAMP, #1 + ld1 {v0.16b}, [INPTR] + mov v4.16b, v16.16b + subs V_SAMP, V_SAMP, #1 /* expand right */ - tbl v2.16b, {v0.16b}, v18.16b - uadalp v4.8h, v2.16b - shrn v6.8b, v4.8h, #1 - st1 {v6.8b}, [OUTPTR], #8 - b.ne 1b + tbl v2.16b, {v0.16b}, v18.16b + uadalp v4.8h, v2.16b + shrn v6.8b, v4.8h, #1 + st1 {v6.8b}, [OUTPTR], #8 + b.ne 1b - br x30 + br x30 .unreq IMAGE_WIDTH .unreq MAX_V_SAMP @@ -2872,6 +2876,7 @@ asm_function jsimd_h2v1_downsample_neon .unreq TMP3 .unreq TMPDUP + /*****************************************************************************/ /* @@ -2901,47 +2906,47 @@ asm_function jsimd_h2v2_downsample_neon TMP3 .req x13 TMPDUP .req w15 - mov TMPDUP, #1 - lsl TMP2, BLOCK_WIDTH, #4 - lsl TMPDUP, TMPDUP, #17 - sub TMP2, TMP2, IMAGE_WIDTH - adr TMP3, Ljsimd_h2_downsample_neon_consts - orr TMPDUP, TMPDUP, #1 - add TMP3, TMP3, TMP2, lsl #4 - dup v16.4s, TMPDUP - ld1 {v18.16b}, [TMP3] + mov TMPDUP, #1 + lsl TMP2, BLOCK_WIDTH, #4 + lsl TMPDUP, TMPDUP, #17 + sub TMP2, TMP2, IMAGE_WIDTH + adr TMP3, Ljsimd_h2_downsample_neon_consts + orr TMPDUP, TMPDUP, #1 + add TMP3, TMP3, TMP2, lsl #4 + dup v16.4s, TMPDUP + ld1 {v18.16b}, [TMP3] 1: /* row loop */ - ldr INPTR0, [INPUT_DATA], #8 - ldr OUTPTR, [OUTPUT_DATA], #8 - ldr INPTR1, [INPUT_DATA], #8 - subs TMP1, BLOCK_WIDTH, #1 - b.eq 3f + ldr INPTR0, [INPUT_DATA], #8 + ldr OUTPTR, [OUTPUT_DATA], #8 + ldr INPTR1, [INPUT_DATA], #8 + subs TMP1, BLOCK_WIDTH, #1 + b.eq 3f 2: /* columns */ - ld1 {v0.16b}, [INPTR0], #16 - ld1 {v1.16b}, [INPTR1], #16 - mov v4.16b, v16.16b - subs TMP1, TMP1, #1 - uadalp v4.8h, v0.16b - uadalp v4.8h, v1.16b - shrn v6.8b, v4.8h, #2 - st1 {v6.8b}, [OUTPTR], #8 - b.ne 2b + ld1 {v0.16b}, [INPTR0], #16 + ld1 {v1.16b}, [INPTR1], #16 + mov v4.16b, v16.16b + subs TMP1, TMP1, #1 + uadalp v4.8h, v0.16b + uadalp v4.8h, v1.16b + shrn v6.8b, v4.8h, #2 + st1 {v6.8b}, [OUTPTR], #8 + b.ne 2b 3: /* last columns */ - ld1 {v0.16b}, [INPTR0], #16 - ld1 {v1.16b}, [INPTR1], #16 - mov v4.16b, v16.16b - subs V_SAMP, V_SAMP, #1 + ld1 {v0.16b}, [INPTR0], #16 + ld1 {v1.16b}, [INPTR1], #16 + mov v4.16b, v16.16b + subs V_SAMP, V_SAMP, #1 /* expand right */ - tbl v2.16b, {v0.16b}, v18.16b - tbl v3.16b, {v1.16b}, v18.16b - uadalp v4.8h, v2.16b - uadalp v4.8h, v3.16b - shrn v6.8b, v4.8h, #2 - st1 {v6.8b}, [OUTPTR], #8 - b.ne 1b + tbl v2.16b, {v0.16b}, v18.16b + tbl v3.16b, {v1.16b}, v18.16b + uadalp v4.8h, v2.16b + uadalp v4.8h, v3.16b + shrn v6.8b, v4.8h, #2 + st1 {v6.8b}, [OUTPTR], #8 + b.ne 1b - br x30 + br x30 .unreq IMAGE_WIDTH .unreq MAX_V_SAMP diff --git a/simd/jsimd_arm_neon.S b/simd/jsimd_arm_neon.S index ecbdea8a..c63e5136 100644 --- a/simd/jsimd_arm_neon.S +++ b/simd/jsimd_arm_neon.S @@ -27,7 +27,7 @@ */ #if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */ +.section .note.GNU-stack, "", %progbits /* mark stack as non-executable */ #endif .text @@ -59,10 +59,10 @@ _\fname: /* Transpose a block of 4x4 coefficients in four 64-bit registers */ .macro transpose_4x4 x0, x1, x2, x3 - vtrn.16 \x0, \x1 - vtrn.16 \x2, \x3 - vtrn.32 \x0, \x2 - vtrn.32 \x1, \x3 + vtrn.16 \x0, \x1 + vtrn.16 \x2, \x3 + vtrn.32 \x0, \x2 + vtrn.32 \x1, \x3 .endm @@ -78,18 +78,18 @@ _\fname: * JSAMPARRAY output_buf, JDIMENSION output_col) */ -#define FIX_0_298631336 (2446) -#define FIX_0_390180644 (3196) -#define FIX_0_541196100 (4433) -#define FIX_0_765366865 (6270) -#define FIX_0_899976223 (7373) -#define FIX_1_175875602 (9633) -#define FIX_1_501321110 (12299) -#define FIX_1_847759065 (15137) -#define FIX_1_961570560 (16069) -#define FIX_2_053119869 (16819) -#define FIX_2_562915447 (20995) -#define FIX_3_072711026 (25172) +#define FIX_0_298631336 (2446) +#define FIX_0_390180644 (3196) +#define FIX_0_541196100 (4433) +#define FIX_0_765366865 (6270) +#define FIX_0_899976223 (7373) +#define FIX_1_175875602 (9633) +#define FIX_1_501321110 (12299) +#define FIX_1_847759065 (15137) +#define FIX_1_961570560 (16069) +#define FIX_2_053119869 (16819) +#define FIX_2_562915447 (20995) +#define FIX_3_072711026 (25172) #define FIX_1_175875602_MINUS_1_961570560 (FIX_1_175875602 - FIX_1_961570560) #define FIX_1_175875602_MINUS_0_390180644 (FIX_1_175875602 - FIX_0_390180644) @@ -171,34 +171,34 @@ _\fname: tmp13 = q1; \ } -#define XFIX_0_899976223 d0[0] -#define XFIX_0_541196100 d0[1] -#define XFIX_2_562915447 d0[2] -#define XFIX_0_298631336_MINUS_0_899976223 d0[3] -#define XFIX_1_501321110_MINUS_0_899976223 d1[0] -#define XFIX_2_053119869_MINUS_2_562915447 d1[1] -#define XFIX_0_541196100_PLUS_0_765366865 d1[2] -#define XFIX_1_175875602 d1[3] -#define XFIX_1_175875602_MINUS_0_390180644 d2[0] -#define XFIX_0_541196100_MINUS_1_847759065 d2[1] -#define XFIX_3_072711026_MINUS_2_562915447 d2[2] -#define XFIX_1_175875602_MINUS_1_961570560 d2[3] +#define XFIX_0_899976223 d0[0] +#define XFIX_0_541196100 d0[1] +#define XFIX_2_562915447 d0[2] +#define XFIX_0_298631336_MINUS_0_899976223 d0[3] +#define XFIX_1_501321110_MINUS_0_899976223 d1[0] +#define XFIX_2_053119869_MINUS_2_562915447 d1[1] +#define XFIX_0_541196100_PLUS_0_765366865 d1[2] +#define XFIX_1_175875602 d1[3] +#define XFIX_1_175875602_MINUS_0_390180644 d2[0] +#define XFIX_0_541196100_MINUS_1_847759065 d2[1] +#define XFIX_3_072711026_MINUS_2_562915447 d2[2] +#define XFIX_1_175875602_MINUS_1_961570560 d2[3] .balign 16 jsimd_idct_islow_neon_consts: - .short FIX_0_899976223 /* d0[0] */ - .short FIX_0_541196100 /* d0[1] */ - .short FIX_2_562915447 /* d0[2] */ - .short FIX_0_298631336_MINUS_0_899976223 /* d0[3] */ - .short FIX_1_501321110_MINUS_0_899976223 /* d1[0] */ - .short FIX_2_053119869_MINUS_2_562915447 /* d1[1] */ - .short FIX_0_541196100_PLUS_0_765366865 /* d1[2] */ - .short FIX_1_175875602 /* d1[3] */ - /* reloadable constants */ - .short FIX_1_175875602_MINUS_0_390180644 /* d2[0] */ - .short FIX_0_541196100_MINUS_1_847759065 /* d2[1] */ - .short FIX_3_072711026_MINUS_2_562915447 /* d2[2] */ - .short FIX_1_175875602_MINUS_1_961570560 /* d2[3] */ + .short FIX_0_899976223 /* d0[0] */ + .short FIX_0_541196100 /* d0[1] */ + .short FIX_2_562915447 /* d0[2] */ + .short FIX_0_298631336_MINUS_0_899976223 /* d0[3] */ + .short FIX_1_501321110_MINUS_0_899976223 /* d1[0] */ + .short FIX_2_053119869_MINUS_2_562915447 /* d1[1] */ + .short FIX_0_541196100_PLUS_0_765366865 /* d1[2] */ + .short FIX_1_175875602 /* d1[3] */ + /* reloadable constants */ + .short FIX_1_175875602_MINUS_0_390180644 /* d2[0] */ + .short FIX_0_541196100_MINUS_1_847759065 /* d2[1] */ + .short FIX_3_072711026_MINUS_2_562915447 /* d2[2] */ + .short FIX_1_175875602_MINUS_1_961570560 /* d2[3] */ asm_function jsimd_idct_islow_neon @@ -257,140 +257,141 @@ asm_function jsimd_idct_islow_neon vld1.16 {d4, d5, d6, d7}, [DCT_TABLE, :128]! vmul.s16 q14, q14, q2 vmul.s16 q13, q13, q1 - vld1.16 {d0, d1, d2, d3}, [ip, :128] /* load constants */ + vld1.16 {d0, d1, d2, d3}, [ip, :128] /* load constants */ add ip, ip, #16 vmul.s16 q15, q15, q3 - vpush {d8-d15} /* save NEON registers */ + vpush {d8-d15} /* save NEON registers */ /* 1-D IDCT, pass 1, left 4x8 half */ - vadd.s16 d4, ROW7L, ROW3L - vadd.s16 d5, ROW5L, ROW1L - vmull.s16 q6, d4, XFIX_1_175875602_MINUS_1_961570560 - vmlal.s16 q6, d5, XFIX_1_175875602 - vmull.s16 q7, d4, XFIX_1_175875602 + vadd.s16 d4, ROW7L, ROW3L + vadd.s16 d5, ROW5L, ROW1L + vmull.s16 q6, d4, XFIX_1_175875602_MINUS_1_961570560 + vmlal.s16 q6, d5, XFIX_1_175875602 + vmull.s16 q7, d4, XFIX_1_175875602 /* Check for the zero coefficients in the right 4x8 half */ push {r4, r5} - vmlal.s16 q7, d5, XFIX_1_175875602_MINUS_0_390180644 - vsubl.s16 q3, ROW0L, ROW4L - ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 1 * 8))] - vmull.s16 q2, ROW2L, XFIX_0_541196100 - vmlal.s16 q2, ROW6L, XFIX_0_541196100_MINUS_1_847759065 - orr r0, r4, r5 - vmov q4, q6 - vmlsl.s16 q6, ROW5L, XFIX_2_562915447 - ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 2 * 8))] - vmlal.s16 q6, ROW3L, XFIX_3_072711026_MINUS_2_562915447 - vshl.s32 q3, q3, #13 - orr r0, r0, r4 - vmlsl.s16 q4, ROW1L, XFIX_0_899976223 - orr r0, r0, r5 - vadd.s32 q1, q3, q2 - ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 3 * 8))] - vmov q5, q7 - vadd.s32 q1, q1, q6 - orr r0, r0, r4 - vmlsl.s16 q7, ROW7L, XFIX_0_899976223 - orr r0, r0, r5 - vmlal.s16 q7, ROW1L, XFIX_1_501321110_MINUS_0_899976223 - vrshrn.s32 ROW1L, q1, #11 - ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 4 * 8))] - vsub.s32 q1, q1, q6 - vmlal.s16 q5, ROW5L, XFIX_2_053119869_MINUS_2_562915447 - orr r0, r0, r4 - vmlsl.s16 q5, ROW3L, XFIX_2_562915447 - orr r0, r0, r5 - vsub.s32 q1, q1, q6 - vmull.s16 q6, ROW2L, XFIX_0_541196100_PLUS_0_765366865 - ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 5 * 8))] - vmlal.s16 q6, ROW6L, XFIX_0_541196100 - vsub.s32 q3, q3, q2 - orr r0, r0, r4 - vrshrn.s32 ROW6L, q1, #11 - orr r0, r0, r5 - vadd.s32 q1, q3, q5 - ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 6 * 8))] - vsub.s32 q3, q3, q5 - vaddl.s16 q5, ROW0L, ROW4L - orr r0, r0, r4 - vrshrn.s32 ROW2L, q1, #11 - orr r0, r0, r5 - vrshrn.s32 ROW5L, q3, #11 - ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 7 * 8))] - vshl.s32 q5, q5, #13 - vmlal.s16 q4, ROW7L, XFIX_0_298631336_MINUS_0_899976223 - orr r0, r0, r4 - vadd.s32 q2, q5, q6 - orrs r0, r0, r5 - vsub.s32 q1, q5, q6 - vadd.s32 q6, q2, q7 - ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 0 * 8))] - vsub.s32 q2, q2, q7 - vadd.s32 q5, q1, q4 - orr r0, r4, r5 - vsub.s32 q3, q1, q4 + vmlal.s16 q7, d5, XFIX_1_175875602_MINUS_0_390180644 + vsubl.s16 q3, ROW0L, ROW4L + ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 1 * 8))] + vmull.s16 q2, ROW2L, XFIX_0_541196100 + vmlal.s16 q2, ROW6L, XFIX_0_541196100_MINUS_1_847759065 + orr r0, r4, r5 + vmov q4, q6 + vmlsl.s16 q6, ROW5L, XFIX_2_562915447 + ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 2 * 8))] + vmlal.s16 q6, ROW3L, XFIX_3_072711026_MINUS_2_562915447 + vshl.s32 q3, q3, #13 + orr r0, r0, r4 + vmlsl.s16 q4, ROW1L, XFIX_0_899976223 + orr r0, r0, r5 + vadd.s32 q1, q3, q2 + ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 3 * 8))] + vmov q5, q7 + vadd.s32 q1, q1, q6 + orr r0, r0, r4 + vmlsl.s16 q7, ROW7L, XFIX_0_899976223 + orr r0, r0, r5 + vmlal.s16 q7, ROW1L, XFIX_1_501321110_MINUS_0_899976223 + vrshrn.s32 ROW1L, q1, #11 + ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 4 * 8))] + vsub.s32 q1, q1, q6 + vmlal.s16 q5, ROW5L, XFIX_2_053119869_MINUS_2_562915447 + orr r0, r0, r4 + vmlsl.s16 q5, ROW3L, XFIX_2_562915447 + orr r0, r0, r5 + vsub.s32 q1, q1, q6 + vmull.s16 q6, ROW2L, XFIX_0_541196100_PLUS_0_765366865 + ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 5 * 8))] + vmlal.s16 q6, ROW6L, XFIX_0_541196100 + vsub.s32 q3, q3, q2 + orr r0, r0, r4 + vrshrn.s32 ROW6L, q1, #11 + orr r0, r0, r5 + vadd.s32 q1, q3, q5 + ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 6 * 8))] + vsub.s32 q3, q3, q5 + vaddl.s16 q5, ROW0L, ROW4L + orr r0, r0, r4 + vrshrn.s32 ROW2L, q1, #11 + orr r0, r0, r5 + vrshrn.s32 ROW5L, q3, #11 + ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 7 * 8))] + vshl.s32 q5, q5, #13 + vmlal.s16 q4, ROW7L, XFIX_0_298631336_MINUS_0_899976223 + orr r0, r0, r4 + vadd.s32 q2, q5, q6 + orrs r0, r0, r5 + vsub.s32 q1, q5, q6 + vadd.s32 q6, q2, q7 + ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 0 * 8))] + vsub.s32 q2, q2, q7 + vadd.s32 q5, q1, q4 + orr r0, r4, r5 + vsub.s32 q3, q1, q4 pop {r4, r5} - vrshrn.s32 ROW7L, q2, #11 - vrshrn.s32 ROW3L, q5, #11 - vrshrn.s32 ROW0L, q6, #11 - vrshrn.s32 ROW4L, q3, #11 + vrshrn.s32 ROW7L, q2, #11 + vrshrn.s32 ROW3L, q5, #11 + vrshrn.s32 ROW0L, q6, #11 + vrshrn.s32 ROW4L, q3, #11 - beq 3f /* Go to do some special handling for the sparse right 4x8 half */ + beq 3f /* Go to do some special handling for the sparse + right 4x8 half */ /* 1-D IDCT, pass 1, right 4x8 half */ - vld1.s16 {d2}, [ip, :64] /* reload constants */ - vadd.s16 d10, ROW7R, ROW3R - vadd.s16 d8, ROW5R, ROW1R + vld1.s16 {d2}, [ip, :64] /* reload constants */ + vadd.s16 d10, ROW7R, ROW3R + vadd.s16 d8, ROW5R, ROW1R /* Transpose left 4x8 half */ vtrn.16 ROW6L, ROW7L - vmull.s16 q6, d10, XFIX_1_175875602_MINUS_1_961570560 - vmlal.s16 q6, d8, XFIX_1_175875602 + vmull.s16 q6, d10, XFIX_1_175875602_MINUS_1_961570560 + vmlal.s16 q6, d8, XFIX_1_175875602 vtrn.16 ROW2L, ROW3L - vmull.s16 q7, d10, XFIX_1_175875602 - vmlal.s16 q7, d8, XFIX_1_175875602_MINUS_0_390180644 + vmull.s16 q7, d10, XFIX_1_175875602 + vmlal.s16 q7, d8, XFIX_1_175875602_MINUS_0_390180644 vtrn.16 ROW0L, ROW1L - vsubl.s16 q3, ROW0R, ROW4R - vmull.s16 q2, ROW2R, XFIX_0_541196100 - vmlal.s16 q2, ROW6R, XFIX_0_541196100_MINUS_1_847759065 + vsubl.s16 q3, ROW0R, ROW4R + vmull.s16 q2, ROW2R, XFIX_0_541196100 + vmlal.s16 q2, ROW6R, XFIX_0_541196100_MINUS_1_847759065 vtrn.16 ROW4L, ROW5L - vmov q4, q6 - vmlsl.s16 q6, ROW5R, XFIX_2_562915447 - vmlal.s16 q6, ROW3R, XFIX_3_072711026_MINUS_2_562915447 + vmov q4, q6 + vmlsl.s16 q6, ROW5R, XFIX_2_562915447 + vmlal.s16 q6, ROW3R, XFIX_3_072711026_MINUS_2_562915447 vtrn.32 ROW1L, ROW3L - vshl.s32 q3, q3, #13 - vmlsl.s16 q4, ROW1R, XFIX_0_899976223 + vshl.s32 q3, q3, #13 + vmlsl.s16 q4, ROW1R, XFIX_0_899976223 vtrn.32 ROW4L, ROW6L - vadd.s32 q1, q3, q2 - vmov q5, q7 - vadd.s32 q1, q1, q6 + vadd.s32 q1, q3, q2 + vmov q5, q7 + vadd.s32 q1, q1, q6 vtrn.32 ROW0L, ROW2L - vmlsl.s16 q7, ROW7R, XFIX_0_899976223 - vmlal.s16 q7, ROW1R, XFIX_1_501321110_MINUS_0_899976223 - vrshrn.s32 ROW1R, q1, #11 + vmlsl.s16 q7, ROW7R, XFIX_0_899976223 + vmlal.s16 q7, ROW1R, XFIX_1_501321110_MINUS_0_899976223 + vrshrn.s32 ROW1R, q1, #11 vtrn.32 ROW5L, ROW7L - vsub.s32 q1, q1, q6 - vmlal.s16 q5, ROW5R, XFIX_2_053119869_MINUS_2_562915447 - vmlsl.s16 q5, ROW3R, XFIX_2_562915447 - vsub.s32 q1, q1, q6 - vmull.s16 q6, ROW2R, XFIX_0_541196100_PLUS_0_765366865 - vmlal.s16 q6, ROW6R, XFIX_0_541196100 - vsub.s32 q3, q3, q2 - vrshrn.s32 ROW6R, q1, #11 - vadd.s32 q1, q3, q5 - vsub.s32 q3, q3, q5 - vaddl.s16 q5, ROW0R, ROW4R - vrshrn.s32 ROW2R, q1, #11 - vrshrn.s32 ROW5R, q3, #11 - vshl.s32 q5, q5, #13 - vmlal.s16 q4, ROW7R, XFIX_0_298631336_MINUS_0_899976223 - vadd.s32 q2, q5, q6 - vsub.s32 q1, q5, q6 - vadd.s32 q6, q2, q7 - vsub.s32 q2, q2, q7 - vadd.s32 q5, q1, q4 - vsub.s32 q3, q1, q4 - vrshrn.s32 ROW7R, q2, #11 - vrshrn.s32 ROW3R, q5, #11 - vrshrn.s32 ROW0R, q6, #11 - vrshrn.s32 ROW4R, q3, #11 + vsub.s32 q1, q1, q6 + vmlal.s16 q5, ROW5R, XFIX_2_053119869_MINUS_2_562915447 + vmlsl.s16 q5, ROW3R, XFIX_2_562915447 + vsub.s32 q1, q1, q6 + vmull.s16 q6, ROW2R, XFIX_0_541196100_PLUS_0_765366865 + vmlal.s16 q6, ROW6R, XFIX_0_541196100 + vsub.s32 q3, q3, q2 + vrshrn.s32 ROW6R, q1, #11 + vadd.s32 q1, q3, q5 + vsub.s32 q3, q3, q5 + vaddl.s16 q5, ROW0R, ROW4R + vrshrn.s32 ROW2R, q1, #11 + vrshrn.s32 ROW5R, q3, #11 + vshl.s32 q5, q5, #13 + vmlal.s16 q4, ROW7R, XFIX_0_298631336_MINUS_0_899976223 + vadd.s32 q2, q5, q6 + vsub.s32 q1, q5, q6 + vadd.s32 q6, q2, q7 + vsub.s32 q2, q2, q7 + vadd.s32 q5, q1, q4 + vsub.s32 q3, q1, q4 + vrshrn.s32 ROW7R, q2, #11 + vrshrn.s32 ROW3R, q5, #11 + vrshrn.s32 ROW0R, q6, #11 + vrshrn.s32 ROW4R, q3, #11 /* Transpose right 4x8 half */ vtrn.16 ROW6R, ROW7R vtrn.16 ROW2R, ROW3R @@ -402,122 +403,122 @@ asm_function jsimd_idct_islow_neon vtrn.32 ROW5R, ROW7R 1: /* 1-D IDCT, pass 2 (normal variant), left 4x8 half */ - vld1.s16 {d2}, [ip, :64] /* reload constants */ - vmull.s16 q6, ROW1R, XFIX_1_175875602 /* ROW5L <-> ROW1R */ - vmlal.s16 q6, ROW1L, XFIX_1_175875602 - vmlal.s16 q6, ROW3R, XFIX_1_175875602_MINUS_1_961570560 /* ROW7L <-> ROW3R */ - vmlal.s16 q6, ROW3L, XFIX_1_175875602_MINUS_1_961570560 - vmull.s16 q7, ROW3R, XFIX_1_175875602 /* ROW7L <-> ROW3R */ - vmlal.s16 q7, ROW3L, XFIX_1_175875602 - vmlal.s16 q7, ROW1R, XFIX_1_175875602_MINUS_0_390180644 /* ROW5L <-> ROW1R */ - vmlal.s16 q7, ROW1L, XFIX_1_175875602_MINUS_0_390180644 - vsubl.s16 q3, ROW0L, ROW0R /* ROW4L <-> ROW0R */ - vmull.s16 q2, ROW2L, XFIX_0_541196100 - vmlal.s16 q2, ROW2R, XFIX_0_541196100_MINUS_1_847759065 /* ROW6L <-> ROW2R */ - vmov q4, q6 - vmlsl.s16 q6, ROW1R, XFIX_2_562915447 /* ROW5L <-> ROW1R */ - vmlal.s16 q6, ROW3L, XFIX_3_072711026_MINUS_2_562915447 - vshl.s32 q3, q3, #13 - vmlsl.s16 q4, ROW1L, XFIX_0_899976223 - vadd.s32 q1, q3, q2 - vmov q5, q7 - vadd.s32 q1, q1, q6 - vmlsl.s16 q7, ROW3R, XFIX_0_899976223 /* ROW7L <-> ROW3R */ - vmlal.s16 q7, ROW1L, XFIX_1_501321110_MINUS_0_899976223 - vshrn.s32 ROW1L, q1, #16 - vsub.s32 q1, q1, q6 - vmlal.s16 q5, ROW1R, XFIX_2_053119869_MINUS_2_562915447 /* ROW5L <-> ROW1R */ - vmlsl.s16 q5, ROW3L, XFIX_2_562915447 - vsub.s32 q1, q1, q6 - vmull.s16 q6, ROW2L, XFIX_0_541196100_PLUS_0_765366865 - vmlal.s16 q6, ROW2R, XFIX_0_541196100 /* ROW6L <-> ROW2R */ - vsub.s32 q3, q3, q2 - vshrn.s32 ROW2R, q1, #16 /* ROW6L <-> ROW2R */ - vadd.s32 q1, q3, q5 - vsub.s32 q3, q3, q5 - vaddl.s16 q5, ROW0L, ROW0R /* ROW4L <-> ROW0R */ - vshrn.s32 ROW2L, q1, #16 - vshrn.s32 ROW1R, q3, #16 /* ROW5L <-> ROW1R */ - vshl.s32 q5, q5, #13 - vmlal.s16 q4, ROW3R, XFIX_0_298631336_MINUS_0_899976223 /* ROW7L <-> ROW3R */ - vadd.s32 q2, q5, q6 - vsub.s32 q1, q5, q6 - vadd.s32 q6, q2, q7 - vsub.s32 q2, q2, q7 - vadd.s32 q5, q1, q4 - vsub.s32 q3, q1, q4 - vshrn.s32 ROW3R, q2, #16 /* ROW7L <-> ROW3R */ - vshrn.s32 ROW3L, q5, #16 - vshrn.s32 ROW0L, q6, #16 - vshrn.s32 ROW0R, q3, #16 /* ROW4L <-> ROW0R */ + vld1.s16 {d2}, [ip, :64] /* reload constants */ + vmull.s16 q6, ROW1R, XFIX_1_175875602 /* ROW5L <-> ROW1R */ + vmlal.s16 q6, ROW1L, XFIX_1_175875602 + vmlal.s16 q6, ROW3R, XFIX_1_175875602_MINUS_1_961570560 /* ROW7L <-> ROW3R */ + vmlal.s16 q6, ROW3L, XFIX_1_175875602_MINUS_1_961570560 + vmull.s16 q7, ROW3R, XFIX_1_175875602 /* ROW7L <-> ROW3R */ + vmlal.s16 q7, ROW3L, XFIX_1_175875602 + vmlal.s16 q7, ROW1R, XFIX_1_175875602_MINUS_0_390180644 /* ROW5L <-> ROW1R */ + vmlal.s16 q7, ROW1L, XFIX_1_175875602_MINUS_0_390180644 + vsubl.s16 q3, ROW0L, ROW0R /* ROW4L <-> ROW0R */ + vmull.s16 q2, ROW2L, XFIX_0_541196100 + vmlal.s16 q2, ROW2R, XFIX_0_541196100_MINUS_1_847759065 /* ROW6L <-> ROW2R */ + vmov q4, q6 + vmlsl.s16 q6, ROW1R, XFIX_2_562915447 /* ROW5L <-> ROW1R */ + vmlal.s16 q6, ROW3L, XFIX_3_072711026_MINUS_2_562915447 + vshl.s32 q3, q3, #13 + vmlsl.s16 q4, ROW1L, XFIX_0_899976223 + vadd.s32 q1, q3, q2 + vmov q5, q7 + vadd.s32 q1, q1, q6 + vmlsl.s16 q7, ROW3R, XFIX_0_899976223 /* ROW7L <-> ROW3R */ + vmlal.s16 q7, ROW1L, XFIX_1_501321110_MINUS_0_899976223 + vshrn.s32 ROW1L, q1, #16 + vsub.s32 q1, q1, q6 + vmlal.s16 q5, ROW1R, XFIX_2_053119869_MINUS_2_562915447 /* ROW5L <-> ROW1R */ + vmlsl.s16 q5, ROW3L, XFIX_2_562915447 + vsub.s32 q1, q1, q6 + vmull.s16 q6, ROW2L, XFIX_0_541196100_PLUS_0_765366865 + vmlal.s16 q6, ROW2R, XFIX_0_541196100 /* ROW6L <-> ROW2R */ + vsub.s32 q3, q3, q2 + vshrn.s32 ROW2R, q1, #16 /* ROW6L <-> ROW2R */ + vadd.s32 q1, q3, q5 + vsub.s32 q3, q3, q5 + vaddl.s16 q5, ROW0L, ROW0R /* ROW4L <-> ROW0R */ + vshrn.s32 ROW2L, q1, #16 + vshrn.s32 ROW1R, q3, #16 /* ROW5L <-> ROW1R */ + vshl.s32 q5, q5, #13 + vmlal.s16 q4, ROW3R, XFIX_0_298631336_MINUS_0_899976223 /* ROW7L <-> ROW3R */ + vadd.s32 q2, q5, q6 + vsub.s32 q1, q5, q6 + vadd.s32 q6, q2, q7 + vsub.s32 q2, q2, q7 + vadd.s32 q5, q1, q4 + vsub.s32 q3, q1, q4 + vshrn.s32 ROW3R, q2, #16 /* ROW7L <-> ROW3R */ + vshrn.s32 ROW3L, q5, #16 + vshrn.s32 ROW0L, q6, #16 + vshrn.s32 ROW0R, q3, #16 /* ROW4L <-> ROW0R */ /* 1-D IDCT, pass 2, right 4x8 half */ - vld1.s16 {d2}, [ip, :64] /* reload constants */ - vmull.s16 q6, ROW5R, XFIX_1_175875602 - vmlal.s16 q6, ROW5L, XFIX_1_175875602 /* ROW5L <-> ROW1R */ - vmlal.s16 q6, ROW7R, XFIX_1_175875602_MINUS_1_961570560 - vmlal.s16 q6, ROW7L, XFIX_1_175875602_MINUS_1_961570560 /* ROW7L <-> ROW3R */ - vmull.s16 q7, ROW7R, XFIX_1_175875602 - vmlal.s16 q7, ROW7L, XFIX_1_175875602 /* ROW7L <-> ROW3R */ - vmlal.s16 q7, ROW5R, XFIX_1_175875602_MINUS_0_390180644 - vmlal.s16 q7, ROW5L, XFIX_1_175875602_MINUS_0_390180644 /* ROW5L <-> ROW1R */ - vsubl.s16 q3, ROW4L, ROW4R /* ROW4L <-> ROW0R */ - vmull.s16 q2, ROW6L, XFIX_0_541196100 /* ROW6L <-> ROW2R */ - vmlal.s16 q2, ROW6R, XFIX_0_541196100_MINUS_1_847759065 - vmov q4, q6 - vmlsl.s16 q6, ROW5R, XFIX_2_562915447 - vmlal.s16 q6, ROW7L, XFIX_3_072711026_MINUS_2_562915447 /* ROW7L <-> ROW3R */ - vshl.s32 q3, q3, #13 - vmlsl.s16 q4, ROW5L, XFIX_0_899976223 /* ROW5L <-> ROW1R */ - vadd.s32 q1, q3, q2 - vmov q5, q7 - vadd.s32 q1, q1, q6 - vmlsl.s16 q7, ROW7R, XFIX_0_899976223 - vmlal.s16 q7, ROW5L, XFIX_1_501321110_MINUS_0_899976223 /* ROW5L <-> ROW1R */ - vshrn.s32 ROW5L, q1, #16 /* ROW5L <-> ROW1R */ - vsub.s32 q1, q1, q6 - vmlal.s16 q5, ROW5R, XFIX_2_053119869_MINUS_2_562915447 - vmlsl.s16 q5, ROW7L, XFIX_2_562915447 /* ROW7L <-> ROW3R */ - vsub.s32 q1, q1, q6 - vmull.s16 q6, ROW6L, XFIX_0_541196100_PLUS_0_765366865 /* ROW6L <-> ROW2R */ - vmlal.s16 q6, ROW6R, XFIX_0_541196100 - vsub.s32 q3, q3, q2 - vshrn.s32 ROW6R, q1, #16 - vadd.s32 q1, q3, q5 - vsub.s32 q3, q3, q5 - vaddl.s16 q5, ROW4L, ROW4R /* ROW4L <-> ROW0R */ - vshrn.s32 ROW6L, q1, #16 /* ROW6L <-> ROW2R */ - vshrn.s32 ROW5R, q3, #16 - vshl.s32 q5, q5, #13 - vmlal.s16 q4, ROW7R, XFIX_0_298631336_MINUS_0_899976223 - vadd.s32 q2, q5, q6 - vsub.s32 q1, q5, q6 - vadd.s32 q6, q2, q7 - vsub.s32 q2, q2, q7 - vadd.s32 q5, q1, q4 - vsub.s32 q3, q1, q4 - vshrn.s32 ROW7R, q2, #16 - vshrn.s32 ROW7L, q5, #16 /* ROW7L <-> ROW3R */ - vshrn.s32 ROW4L, q6, #16 /* ROW4L <-> ROW0R */ - vshrn.s32 ROW4R, q3, #16 + vld1.s16 {d2}, [ip, :64] /* reload constants */ + vmull.s16 q6, ROW5R, XFIX_1_175875602 + vmlal.s16 q6, ROW5L, XFIX_1_175875602 /* ROW5L <-> ROW1R */ + vmlal.s16 q6, ROW7R, XFIX_1_175875602_MINUS_1_961570560 + vmlal.s16 q6, ROW7L, XFIX_1_175875602_MINUS_1_961570560 /* ROW7L <-> ROW3R */ + vmull.s16 q7, ROW7R, XFIX_1_175875602 + vmlal.s16 q7, ROW7L, XFIX_1_175875602 /* ROW7L <-> ROW3R */ + vmlal.s16 q7, ROW5R, XFIX_1_175875602_MINUS_0_390180644 + vmlal.s16 q7, ROW5L, XFIX_1_175875602_MINUS_0_390180644 /* ROW5L <-> ROW1R */ + vsubl.s16 q3, ROW4L, ROW4R /* ROW4L <-> ROW0R */ + vmull.s16 q2, ROW6L, XFIX_0_541196100 /* ROW6L <-> ROW2R */ + vmlal.s16 q2, ROW6R, XFIX_0_541196100_MINUS_1_847759065 + vmov q4, q6 + vmlsl.s16 q6, ROW5R, XFIX_2_562915447 + vmlal.s16 q6, ROW7L, XFIX_3_072711026_MINUS_2_562915447 /* ROW7L <-> ROW3R */ + vshl.s32 q3, q3, #13 + vmlsl.s16 q4, ROW5L, XFIX_0_899976223 /* ROW5L <-> ROW1R */ + vadd.s32 q1, q3, q2 + vmov q5, q7 + vadd.s32 q1, q1, q6 + vmlsl.s16 q7, ROW7R, XFIX_0_899976223 + vmlal.s16 q7, ROW5L, XFIX_1_501321110_MINUS_0_899976223 /* ROW5L <-> ROW1R */ + vshrn.s32 ROW5L, q1, #16 /* ROW5L <-> ROW1R */ + vsub.s32 q1, q1, q6 + vmlal.s16 q5, ROW5R, XFIX_2_053119869_MINUS_2_562915447 + vmlsl.s16 q5, ROW7L, XFIX_2_562915447 /* ROW7L <-> ROW3R */ + vsub.s32 q1, q1, q6 + vmull.s16 q6, ROW6L, XFIX_0_541196100_PLUS_0_765366865 /* ROW6L <-> ROW2R */ + vmlal.s16 q6, ROW6R, XFIX_0_541196100 + vsub.s32 q3, q3, q2 + vshrn.s32 ROW6R, q1, #16 + vadd.s32 q1, q3, q5 + vsub.s32 q3, q3, q5 + vaddl.s16 q5, ROW4L, ROW4R /* ROW4L <-> ROW0R */ + vshrn.s32 ROW6L, q1, #16 /* ROW6L <-> ROW2R */ + vshrn.s32 ROW5R, q3, #16 + vshl.s32 q5, q5, #13 + vmlal.s16 q4, ROW7R, XFIX_0_298631336_MINUS_0_899976223 + vadd.s32 q2, q5, q6 + vsub.s32 q1, q5, q6 + vadd.s32 q6, q2, q7 + vsub.s32 q2, q2, q7 + vadd.s32 q5, q1, q4 + vsub.s32 q3, q1, q4 + vshrn.s32 ROW7R, q2, #16 + vshrn.s32 ROW7L, q5, #16 /* ROW7L <-> ROW3R */ + vshrn.s32 ROW4L, q6, #16 /* ROW4L <-> ROW0R */ + vshrn.s32 ROW4R, q3, #16 2: /* Descale to 8-bit and range limit */ - vqrshrn.s16 d16, q8, #2 - vqrshrn.s16 d17, q9, #2 - vqrshrn.s16 d18, q10, #2 - vqrshrn.s16 d19, q11, #2 - vpop {d8-d15} /* restore NEON registers */ - vqrshrn.s16 d20, q12, #2 + vqrshrn.s16 d16, q8, #2 + vqrshrn.s16 d17, q9, #2 + vqrshrn.s16 d18, q10, #2 + vqrshrn.s16 d19, q11, #2 + vpop {d8-d15} /* restore NEON registers */ + vqrshrn.s16 d20, q12, #2 /* Transpose the final 8-bit samples and do signed->unsigned conversion */ - vtrn.16 q8, q9 - vqrshrn.s16 d21, q13, #2 - vqrshrn.s16 d22, q14, #2 - vmov.u8 q0, #(CENTERJSAMPLE) - vqrshrn.s16 d23, q15, #2 - vtrn.8 d16, d17 - vtrn.8 d18, d19 - vadd.u8 q8, q8, q0 - vadd.u8 q9, q9, q0 - vtrn.16 q10, q11 + vtrn.16 q8, q9 + vqrshrn.s16 d21, q13, #2 + vqrshrn.s16 d22, q14, #2 + vmov.u8 q0, #(CENTERJSAMPLE) + vqrshrn.s16 d23, q15, #2 + vtrn.8 d16, d17 + vtrn.8 d18, d19 + vadd.u8 q8, q8, q0 + vadd.u8 q9, q9, q0 + vtrn.16 q10, q11 /* Store results to the output buffer */ ldmia OUTPUT_BUF!, {TMP1, TMP2} add TMP1, TMP1, OUTPUT_COL @@ -529,7 +530,7 @@ asm_function jsimd_idct_islow_neon add TMP1, TMP1, OUTPUT_COL add TMP2, TMP2, OUTPUT_COL vst1.8 {d18}, [TMP1] - vadd.u8 q10, q10, q0 + vadd.u8 q10, q10, q0 vst1.8 {d19}, [TMP2] ldmia OUTPUT_BUF, {TMP1, TMP2, TMP3, TMP4} add TMP1, TMP1, OUTPUT_COL @@ -538,7 +539,7 @@ asm_function jsimd_idct_islow_neon add TMP4, TMP4, OUTPUT_COL vtrn.8 d22, d23 vst1.8 {d20}, [TMP1] - vadd.u8 q11, q11, q0 + vadd.u8 q11, q11, q0 vst1.8 {d21}, [TMP2] vst1.8 {d22}, [TMP3] vst1.8 {d23}, [TMP4] @@ -551,14 +552,15 @@ asm_function jsimd_idct_islow_neon vtrn.16 ROW2L, ROW3L vtrn.16 ROW0L, ROW1L vtrn.16 ROW4L, ROW5L - vshl.s16 ROW0R, ROW0R, #2 /* PASS1_BITS */ + vshl.s16 ROW0R, ROW0R, #2 /* PASS1_BITS */ vtrn.32 ROW1L, ROW3L vtrn.32 ROW4L, ROW6L vtrn.32 ROW0L, ROW2L vtrn.32 ROW5L, ROW7L cmp r0, #0 - beq 4f /* Right 4x8 half has all zeros, go to 'sparse' second pass */ + beq 4f /* Right 4x8 half has all zeros, go to 'sparse' second + pass */ /* Only row 0 is non-zero for the right 4x8 half */ vdup.s16 ROW1R, ROW0R[1] @@ -569,83 +571,83 @@ asm_function jsimd_idct_islow_neon vdup.s16 ROW6R, ROW0R[2] vdup.s16 ROW7R, ROW0R[3] vdup.s16 ROW0R, ROW0R[0] - b 1b /* Go to 'normal' second pass */ + b 1b /* Go to 'normal' second pass */ 4: /* 1-D IDCT, pass 2 (sparse variant with zero rows 4-7), left 4x8 half */ - vld1.s16 {d2}, [ip, :64] /* reload constants */ - vmull.s16 q6, ROW1L, XFIX_1_175875602 - vmlal.s16 q6, ROW3L, XFIX_1_175875602_MINUS_1_961570560 - vmull.s16 q7, ROW3L, XFIX_1_175875602 - vmlal.s16 q7, ROW1L, XFIX_1_175875602_MINUS_0_390180644 - vmull.s16 q2, ROW2L, XFIX_0_541196100 - vshll.s16 q3, ROW0L, #13 - vmov q4, q6 - vmlal.s16 q6, ROW3L, XFIX_3_072711026_MINUS_2_562915447 - vmlsl.s16 q4, ROW1L, XFIX_0_899976223 - vadd.s32 q1, q3, q2 - vmov q5, q7 - vmlal.s16 q7, ROW1L, XFIX_1_501321110_MINUS_0_899976223 - vadd.s32 q1, q1, q6 - vadd.s32 q6, q6, q6 - vmlsl.s16 q5, ROW3L, XFIX_2_562915447 - vshrn.s32 ROW1L, q1, #16 - vsub.s32 q1, q1, q6 - vmull.s16 q6, ROW2L, XFIX_0_541196100_PLUS_0_765366865 - vsub.s32 q3, q3, q2 - vshrn.s32 ROW2R, q1, #16 /* ROW6L <-> ROW2R */ - vadd.s32 q1, q3, q5 - vsub.s32 q3, q3, q5 - vshll.s16 q5, ROW0L, #13 - vshrn.s32 ROW2L, q1, #16 - vshrn.s32 ROW1R, q3, #16 /* ROW5L <-> ROW1R */ - vadd.s32 q2, q5, q6 - vsub.s32 q1, q5, q6 - vadd.s32 q6, q2, q7 - vsub.s32 q2, q2, q7 - vadd.s32 q5, q1, q4 - vsub.s32 q3, q1, q4 - vshrn.s32 ROW3R, q2, #16 /* ROW7L <-> ROW3R */ - vshrn.s32 ROW3L, q5, #16 - vshrn.s32 ROW0L, q6, #16 - vshrn.s32 ROW0R, q3, #16 /* ROW4L <-> ROW0R */ + vld1.s16 {d2}, [ip, :64] /* reload constants */ + vmull.s16 q6, ROW1L, XFIX_1_175875602 + vmlal.s16 q6, ROW3L, XFIX_1_175875602_MINUS_1_961570560 + vmull.s16 q7, ROW3L, XFIX_1_175875602 + vmlal.s16 q7, ROW1L, XFIX_1_175875602_MINUS_0_390180644 + vmull.s16 q2, ROW2L, XFIX_0_541196100 + vshll.s16 q3, ROW0L, #13 + vmov q4, q6 + vmlal.s16 q6, ROW3L, XFIX_3_072711026_MINUS_2_562915447 + vmlsl.s16 q4, ROW1L, XFIX_0_899976223 + vadd.s32 q1, q3, q2 + vmov q5, q7 + vmlal.s16 q7, ROW1L, XFIX_1_501321110_MINUS_0_899976223 + vadd.s32 q1, q1, q6 + vadd.s32 q6, q6, q6 + vmlsl.s16 q5, ROW3L, XFIX_2_562915447 + vshrn.s32 ROW1L, q1, #16 + vsub.s32 q1, q1, q6 + vmull.s16 q6, ROW2L, XFIX_0_541196100_PLUS_0_765366865 + vsub.s32 q3, q3, q2 + vshrn.s32 ROW2R, q1, #16 /* ROW6L <-> ROW2R */ + vadd.s32 q1, q3, q5 + vsub.s32 q3, q3, q5 + vshll.s16 q5, ROW0L, #13 + vshrn.s32 ROW2L, q1, #16 + vshrn.s32 ROW1R, q3, #16 /* ROW5L <-> ROW1R */ + vadd.s32 q2, q5, q6 + vsub.s32 q1, q5, q6 + vadd.s32 q6, q2, q7 + vsub.s32 q2, q2, q7 + vadd.s32 q5, q1, q4 + vsub.s32 q3, q1, q4 + vshrn.s32 ROW3R, q2, #16 /* ROW7L <-> ROW3R */ + vshrn.s32 ROW3L, q5, #16 + vshrn.s32 ROW0L, q6, #16 + vshrn.s32 ROW0R, q3, #16 /* ROW4L <-> ROW0R */ /* 1-D IDCT, pass 2 (sparse variant with zero rows 4-7), right 4x8 half */ - vld1.s16 {d2}, [ip, :64] /* reload constants */ - vmull.s16 q6, ROW5L, XFIX_1_175875602 - vmlal.s16 q6, ROW7L, XFIX_1_175875602_MINUS_1_961570560 - vmull.s16 q7, ROW7L, XFIX_1_175875602 - vmlal.s16 q7, ROW5L, XFIX_1_175875602_MINUS_0_390180644 - vmull.s16 q2, ROW6L, XFIX_0_541196100 - vshll.s16 q3, ROW4L, #13 - vmov q4, q6 - vmlal.s16 q6, ROW7L, XFIX_3_072711026_MINUS_2_562915447 - vmlsl.s16 q4, ROW5L, XFIX_0_899976223 - vadd.s32 q1, q3, q2 - vmov q5, q7 - vmlal.s16 q7, ROW5L, XFIX_1_501321110_MINUS_0_899976223 - vadd.s32 q1, q1, q6 - vadd.s32 q6, q6, q6 - vmlsl.s16 q5, ROW7L, XFIX_2_562915447 - vshrn.s32 ROW5L, q1, #16 /* ROW5L <-> ROW1R */ - vsub.s32 q1, q1, q6 - vmull.s16 q6, ROW6L, XFIX_0_541196100_PLUS_0_765366865 - vsub.s32 q3, q3, q2 - vshrn.s32 ROW6R, q1, #16 - vadd.s32 q1, q3, q5 - vsub.s32 q3, q3, q5 - vshll.s16 q5, ROW4L, #13 - vshrn.s32 ROW6L, q1, #16 /* ROW6L <-> ROW2R */ - vshrn.s32 ROW5R, q3, #16 - vadd.s32 q2, q5, q6 - vsub.s32 q1, q5, q6 - vadd.s32 q6, q2, q7 - vsub.s32 q2, q2, q7 - vadd.s32 q5, q1, q4 - vsub.s32 q3, q1, q4 - vshrn.s32 ROW7R, q2, #16 - vshrn.s32 ROW7L, q5, #16 /* ROW7L <-> ROW3R */ - vshrn.s32 ROW4L, q6, #16 /* ROW4L <-> ROW0R */ - vshrn.s32 ROW4R, q3, #16 - b 2b /* Go to epilogue */ + vld1.s16 {d2}, [ip, :64] /* reload constants */ + vmull.s16 q6, ROW5L, XFIX_1_175875602 + vmlal.s16 q6, ROW7L, XFIX_1_175875602_MINUS_1_961570560 + vmull.s16 q7, ROW7L, XFIX_1_175875602 + vmlal.s16 q7, ROW5L, XFIX_1_175875602_MINUS_0_390180644 + vmull.s16 q2, ROW6L, XFIX_0_541196100 + vshll.s16 q3, ROW4L, #13 + vmov q4, q6 + vmlal.s16 q6, ROW7L, XFIX_3_072711026_MINUS_2_562915447 + vmlsl.s16 q4, ROW5L, XFIX_0_899976223 + vadd.s32 q1, q3, q2 + vmov q5, q7 + vmlal.s16 q7, ROW5L, XFIX_1_501321110_MINUS_0_899976223 + vadd.s32 q1, q1, q6 + vadd.s32 q6, q6, q6 + vmlsl.s16 q5, ROW7L, XFIX_2_562915447 + vshrn.s32 ROW5L, q1, #16 /* ROW5L <-> ROW1R */ + vsub.s32 q1, q1, q6 + vmull.s16 q6, ROW6L, XFIX_0_541196100_PLUS_0_765366865 + vsub.s32 q3, q3, q2 + vshrn.s32 ROW6R, q1, #16 + vadd.s32 q1, q3, q5 + vsub.s32 q3, q3, q5 + vshll.s16 q5, ROW4L, #13 + vshrn.s32 ROW6L, q1, #16 /* ROW6L <-> ROW2R */ + vshrn.s32 ROW5R, q3, #16 + vadd.s32 q2, q5, q6 + vsub.s32 q1, q5, q6 + vadd.s32 q6, q2, q7 + vsub.s32 q2, q2, q7 + vadd.s32 q5, q1, q4 + vsub.s32 q3, q1, q4 + vshrn.s32 ROW7R, q2, #16 + vshrn.s32 ROW7L, q5, #16 /* ROW7L <-> ROW3R */ + vshrn.s32 ROW4L, q6, #16 /* ROW4L <-> ROW0R */ + vshrn.s32 ROW4R, q3, #16 + b 2b /* Go to epilogue */ .unreq DCT_TABLE .unreq COEF_BLOCK @@ -699,10 +701,10 @@ asm_function jsimd_idct_islow_neon .balign 16 jsimd_idct_ifast_neon_consts: - .short (277 * 128 - 256 * 128) /* XFIX_1_082392200 */ - .short (362 * 128 - 256 * 128) /* XFIX_1_414213562 */ - .short (473 * 128 - 256 * 128) /* XFIX_1_847759065 */ - .short (669 * 128 - 512 * 128) /* XFIX_2_613125930 */ + .short (277 * 128 - 256 * 128) /* XFIX_1_082392200 */ + .short (362 * 128 - 256 * 128) /* XFIX_1_414213562 */ + .short (473 * 128 - 256 * 128) /* XFIX_1_847759065 */ + .short (669 * 128 - 512 * 128) /* XFIX_2_613125930 */ asm_function jsimd_idct_ifast_neon @@ -732,9 +734,9 @@ asm_function jsimd_idct_ifast_neon vld1.16 {d16, d17, d18, d19}, [COEF_BLOCK, :128]! vld1.16 {d0, d1, d2, d3}, [DCT_TABLE, :128]! vld1.16 {d20, d21, d22, d23}, [COEF_BLOCK, :128]! - vmul.s16 q8, q8, q0 + vmul.s16 q8, q8, q0 vld1.16 {d4, d5, d6, d7}, [DCT_TABLE, :128]! - vmul.s16 q9, q9, q1 + vmul.s16 q9, q9, q1 vld1.16 {d24, d25, d26, d27}, [COEF_BLOCK, :128]! vmul.s16 q10, q10, q2 vld1.16 {d0, d1, d2, d3}, [DCT_TABLE, :128]! @@ -744,124 +746,124 @@ asm_function jsimd_idct_ifast_neon vld1.16 {d4, d5, d6, d7}, [DCT_TABLE, :128]! vmul.s16 q14, q14, q2 vmul.s16 q13, q13, q1 - vld1.16 {d0}, [ip, :64] /* load constants */ + vld1.16 {d0}, [ip, :64] /* load constants */ vmul.s16 q15, q15, q3 - vpush {d8-d13} /* save NEON registers */ + vpush {d8-d13} /* save NEON registers */ /* 1-D IDCT, pass 1 */ - vsub.s16 q2, q10, q14 + vsub.s16 q2, q10, q14 vadd.s16 q14, q10, q14 - vsub.s16 q1, q11, q13 + vsub.s16 q1, q11, q13 vadd.s16 q13, q11, q13 - vsub.s16 q5, q9, q15 - vadd.s16 q15, q9, q15 - vqdmulh.s16 q4, q2, XFIX_1_414213562 - vqdmulh.s16 q6, q1, XFIX_2_613125930 - vadd.s16 q3, q1, q1 - vsub.s16 q1, q5, q1 - vadd.s16 q10, q2, q4 - vqdmulh.s16 q4, q1, XFIX_1_847759065 - vsub.s16 q2, q15, q13 - vadd.s16 q3, q3, q6 - vqdmulh.s16 q6, q2, XFIX_1_414213562 - vadd.s16 q1, q1, q4 - vqdmulh.s16 q4, q5, XFIX_1_082392200 + vsub.s16 q5, q9, q15 + vadd.s16 q15, q9, q15 + vqdmulh.s16 q4, q2, XFIX_1_414213562 + vqdmulh.s16 q6, q1, XFIX_2_613125930 + vadd.s16 q3, q1, q1 + vsub.s16 q1, q5, q1 + vadd.s16 q10, q2, q4 + vqdmulh.s16 q4, q1, XFIX_1_847759065 + vsub.s16 q2, q15, q13 + vadd.s16 q3, q3, q6 + vqdmulh.s16 q6, q2, XFIX_1_414213562 + vadd.s16 q1, q1, q4 + vqdmulh.s16 q4, q5, XFIX_1_082392200 vsub.s16 q10, q10, q14 - vadd.s16 q2, q2, q6 - vsub.s16 q6, q8, q12 - vadd.s16 q12, q8, q12 - vadd.s16 q9, q5, q4 - vadd.s16 q5, q6, q10 - vsub.s16 q10, q6, q10 - vadd.s16 q6, q15, q13 - vadd.s16 q8, q12, q14 - vsub.s16 q3, q6, q3 + vadd.s16 q2, q2, q6 + vsub.s16 q6, q8, q12 + vadd.s16 q12, q8, q12 + vadd.s16 q9, q5, q4 + vadd.s16 q5, q6, q10 + vsub.s16 q10, q6, q10 + vadd.s16 q6, q15, q13 + vadd.s16 q8, q12, q14 + vsub.s16 q3, q6, q3 vsub.s16 q12, q12, q14 - vsub.s16 q3, q3, q1 - vsub.s16 q1, q9, q1 - vadd.s16 q2, q3, q2 - vsub.s16 q15, q8, q6 - vadd.s16 q1, q1, q2 - vadd.s16 q8, q8, q6 - vadd.s16 q14, q5, q3 - vsub.s16 q9, q5, q3 + vsub.s16 q3, q3, q1 + vsub.s16 q1, q9, q1 + vadd.s16 q2, q3, q2 + vsub.s16 q15, q8, q6 + vadd.s16 q1, q1, q2 + vadd.s16 q8, q8, q6 + vadd.s16 q14, q5, q3 + vsub.s16 q9, q5, q3 vsub.s16 q13, q10, q2 vadd.s16 q10, q10, q2 /* Transpose */ - vtrn.16 q8, q9 + vtrn.16 q8, q9 vsub.s16 q11, q12, q1 vtrn.16 q14, q15 vadd.s16 q12, q12, q1 vtrn.16 q10, q11 vtrn.16 q12, q13 - vtrn.32 q9, q11 + vtrn.32 q9, q11 vtrn.32 q12, q14 - vtrn.32 q8, q10 + vtrn.32 q8, q10 vtrn.32 q13, q15 vswp d28, d21 vswp d26, d19 /* 1-D IDCT, pass 2 */ - vsub.s16 q2, q10, q14 + vsub.s16 q2, q10, q14 vswp d30, d23 vadd.s16 q14, q10, q14 vswp d24, d17 - vsub.s16 q1, q11, q13 + vsub.s16 q1, q11, q13 vadd.s16 q13, q11, q13 - vsub.s16 q5, q9, q15 - vadd.s16 q15, q9, q15 - vqdmulh.s16 q4, q2, XFIX_1_414213562 - vqdmulh.s16 q6, q1, XFIX_2_613125930 - vadd.s16 q3, q1, q1 - vsub.s16 q1, q5, q1 - vadd.s16 q10, q2, q4 - vqdmulh.s16 q4, q1, XFIX_1_847759065 - vsub.s16 q2, q15, q13 - vadd.s16 q3, q3, q6 - vqdmulh.s16 q6, q2, XFIX_1_414213562 - vadd.s16 q1, q1, q4 - vqdmulh.s16 q4, q5, XFIX_1_082392200 + vsub.s16 q5, q9, q15 + vadd.s16 q15, q9, q15 + vqdmulh.s16 q4, q2, XFIX_1_414213562 + vqdmulh.s16 q6, q1, XFIX_2_613125930 + vadd.s16 q3, q1, q1 + vsub.s16 q1, q5, q1 + vadd.s16 q10, q2, q4 + vqdmulh.s16 q4, q1, XFIX_1_847759065 + vsub.s16 q2, q15, q13 + vadd.s16 q3, q3, q6 + vqdmulh.s16 q6, q2, XFIX_1_414213562 + vadd.s16 q1, q1, q4 + vqdmulh.s16 q4, q5, XFIX_1_082392200 vsub.s16 q10, q10, q14 - vadd.s16 q2, q2, q6 - vsub.s16 q6, q8, q12 - vadd.s16 q12, q8, q12 - vadd.s16 q9, q5, q4 - vadd.s16 q5, q6, q10 - vsub.s16 q10, q6, q10 - vadd.s16 q6, q15, q13 - vadd.s16 q8, q12, q14 - vsub.s16 q3, q6, q3 + vadd.s16 q2, q2, q6 + vsub.s16 q6, q8, q12 + vadd.s16 q12, q8, q12 + vadd.s16 q9, q5, q4 + vadd.s16 q5, q6, q10 + vsub.s16 q10, q6, q10 + vadd.s16 q6, q15, q13 + vadd.s16 q8, q12, q14 + vsub.s16 q3, q6, q3 vsub.s16 q12, q12, q14 - vsub.s16 q3, q3, q1 - vsub.s16 q1, q9, q1 - vadd.s16 q2, q3, q2 - vsub.s16 q15, q8, q6 - vadd.s16 q1, q1, q2 - vadd.s16 q8, q8, q6 - vadd.s16 q14, q5, q3 - vsub.s16 q9, q5, q3 + vsub.s16 q3, q3, q1 + vsub.s16 q1, q9, q1 + vadd.s16 q2, q3, q2 + vsub.s16 q15, q8, q6 + vadd.s16 q1, q1, q2 + vadd.s16 q8, q8, q6 + vadd.s16 q14, q5, q3 + vsub.s16 q9, q5, q3 vsub.s16 q13, q10, q2 - vpop {d8-d13} /* restore NEON registers */ + vpop {d8-d13} /* restore NEON registers */ vadd.s16 q10, q10, q2 vsub.s16 q11, q12, q1 vadd.s16 q12, q12, q1 /* Descale to 8-bit and range limit */ - vmov.u8 q0, #0x80 - vqshrn.s16 d16, q8, #5 - vqshrn.s16 d17, q9, #5 + vmov.u8 q0, #0x80 + vqshrn.s16 d16, q8, #5 + vqshrn.s16 d17, q9, #5 vqshrn.s16 d18, q10, #5 vqshrn.s16 d19, q11, #5 vqshrn.s16 d20, q12, #5 vqshrn.s16 d21, q13, #5 vqshrn.s16 d22, q14, #5 vqshrn.s16 d23, q15, #5 - vadd.u8 q8, q8, q0 - vadd.u8 q9, q9, q0 + vadd.u8 q8, q8, q0 + vadd.u8 q9, q9, q0 vadd.u8 q10, q10, q0 vadd.u8 q11, q11, q0 /* Transpose the final 8-bit samples */ - vtrn.16 q8, q9 + vtrn.16 q8, q9 vtrn.16 q10, q11 - vtrn.32 q8, q10 - vtrn.32 q9, q11 + vtrn.32 q8, q10 + vtrn.32 q9, q11 vtrn.8 d16, d17 vtrn.8 d18, d19 /* Store results to the output buffer */ @@ -920,81 +922,80 @@ asm_function jsimd_idct_ifast_neon #define CONST_BITS 13 -#define FIX_0_211164243 (1730) /* FIX(0.211164243) */ -#define FIX_0_509795579 (4176) /* FIX(0.509795579) */ -#define FIX_0_601344887 (4926) /* FIX(0.601344887) */ -#define FIX_0_720959822 (5906) /* FIX(0.720959822) */ -#define FIX_0_765366865 (6270) /* FIX(0.765366865) */ -#define FIX_0_850430095 (6967) /* FIX(0.850430095) */ -#define FIX_0_899976223 (7373) /* FIX(0.899976223) */ -#define FIX_1_061594337 (8697) /* FIX(1.061594337) */ -#define FIX_1_272758580 (10426) /* FIX(1.272758580) */ -#define FIX_1_451774981 (11893) /* FIX(1.451774981) */ -#define FIX_1_847759065 (15137) /* FIX(1.847759065) */ -#define FIX_2_172734803 (17799) /* FIX(2.172734803) */ -#define FIX_2_562915447 (20995) /* FIX(2.562915447) */ -#define FIX_3_624509785 (29692) /* FIX(3.624509785) */ +#define FIX_0_211164243 (1730) /* FIX(0.211164243) */ +#define FIX_0_509795579 (4176) /* FIX(0.509795579) */ +#define FIX_0_601344887 (4926) /* FIX(0.601344887) */ +#define FIX_0_720959822 (5906) /* FIX(0.720959822) */ +#define FIX_0_765366865 (6270) /* FIX(0.765366865) */ +#define FIX_0_850430095 (6967) /* FIX(0.850430095) */ +#define FIX_0_899976223 (7373) /* FIX(0.899976223) */ +#define FIX_1_061594337 (8697) /* FIX(1.061594337) */ +#define FIX_1_272758580 (10426) /* FIX(1.272758580) */ +#define FIX_1_451774981 (11893) /* FIX(1.451774981) */ +#define FIX_1_847759065 (15137) /* FIX(1.847759065) */ +#define FIX_2_172734803 (17799) /* FIX(2.172734803) */ +#define FIX_2_562915447 (20995) /* FIX(2.562915447) */ +#define FIX_3_624509785 (29692) /* FIX(3.624509785) */ .balign 16 jsimd_idct_4x4_neon_consts: - .short FIX_1_847759065 /* d0[0] */ - .short -FIX_0_765366865 /* d0[1] */ - .short -FIX_0_211164243 /* d0[2] */ - .short FIX_1_451774981 /* d0[3] */ - .short -FIX_2_172734803 /* d1[0] */ - .short FIX_1_061594337 /* d1[1] */ - .short -FIX_0_509795579 /* d1[2] */ - .short -FIX_0_601344887 /* d1[3] */ - .short FIX_0_899976223 /* d2[0] */ - .short FIX_2_562915447 /* d2[1] */ - .short 1 << (CONST_BITS+1) /* d2[2] */ - .short 0 /* d2[3] */ + .short FIX_1_847759065 /* d0[0] */ + .short -FIX_0_765366865 /* d0[1] */ + .short -FIX_0_211164243 /* d0[2] */ + .short FIX_1_451774981 /* d0[3] */ + .short -FIX_2_172734803 /* d1[0] */ + .short FIX_1_061594337 /* d1[1] */ + .short -FIX_0_509795579 /* d1[2] */ + .short -FIX_0_601344887 /* d1[3] */ + .short FIX_0_899976223 /* d2[0] */ + .short FIX_2_562915447 /* d2[1] */ + .short 1 << (CONST_BITS+1) /* d2[2] */ + .short 0 /* d2[3] */ .macro idct_helper x4, x6, x8, x10, x12, x14, x16, shift, y26, y27, y28, y29 - vmull.s16 q14, \x4, d2[2] - vmlal.s16 q14, \x8, d0[0] + vmull.s16 q14, \x4, d2[2] + vmlal.s16 q14, \x8, d0[0] vmlal.s16 q14, \x14, d0[1] vmull.s16 q13, \x16, d1[2] vmlal.s16 q13, \x12, d1[3] vmlal.s16 q13, \x10, d2[0] - vmlal.s16 q13, \x6, d2[1] + vmlal.s16 q13, \x6, d2[1] - vmull.s16 q15, \x4, d2[2] - vmlsl.s16 q15, \x8, d0[0] + vmull.s16 q15, \x4, d2[2] + vmlsl.s16 q15, \x8, d0[0] vmlsl.s16 q15, \x14, d0[1] vmull.s16 q12, \x16, d0[2] vmlal.s16 q12, \x12, d0[3] vmlal.s16 q12, \x10, d1[0] - vmlal.s16 q12, \x6, d1[1] + vmlal.s16 q12, \x6, d1[1] vadd.s32 q10, q14, q13 vsub.s32 q14, q14, q13 -.if \shift > 16 - vrshr.s32 q10, q10, #\shift - vrshr.s32 q14, q14, #\shift + .if \shift > 16 + vrshr.s32 q10, q10, #\shift + vrshr.s32 q14, q14, #\shift vmovn.s32 \y26, q10 vmovn.s32 \y29, q14 -.else + .else vrshrn.s32 \y26, q10, #\shift vrshrn.s32 \y29, q14, #\shift -.endif + .endif vadd.s32 q10, q15, q12 vsub.s32 q15, q15, q12 -.if \shift > 16 - vrshr.s32 q10, q10, #\shift - vrshr.s32 q15, q15, #\shift + .if \shift > 16 + vrshr.s32 q10, q10, #\shift + vrshr.s32 q15, q15, #\shift vmovn.s32 \y27, q10 vmovn.s32 \y28, q15 -.else + .else vrshrn.s32 \y27, q10, #\shift vrshrn.s32 \y28, q15, #\shift -.endif - + .endif .endm asm_function jsimd_idct_4x4_neon @@ -1130,31 +1131,30 @@ asm_function jsimd_idct_4x4_neon .balign 8 jsimd_idct_2x2_neon_consts: - .short -FIX_0_720959822 /* d0[0] */ - .short FIX_0_850430095 /* d0[1] */ - .short -FIX_1_272758580 /* d0[2] */ - .short FIX_3_624509785 /* d0[3] */ + .short -FIX_0_720959822 /* d0[0] */ + .short FIX_0_850430095 /* d0[1] */ + .short -FIX_1_272758580 /* d0[2] */ + .short FIX_3_624509785 /* d0[3] */ .macro idct_helper x4, x6, x10, x12, x16, shift, y26, y27 - vshll.s16 q14, \x4, #15 - vmull.s16 q13, \x6, d0[3] - vmlal.s16 q13, \x10, d0[2] - vmlal.s16 q13, \x12, d0[1] - vmlal.s16 q13, \x16, d0[0] + vshll.s16 q14, \x4, #15 + vmull.s16 q13, \x6, d0[3] + vmlal.s16 q13, \x10, d0[2] + vmlal.s16 q13, \x12, d0[1] + vmlal.s16 q13, \x16, d0[0] - vadd.s32 q10, q14, q13 - vsub.s32 q14, q14, q13 - -.if \shift > 16 - vrshr.s32 q10, q10, #\shift - vrshr.s32 q14, q14, #\shift - vmovn.s32 \y26, q10 - vmovn.s32 \y27, q14 -.else - vrshrn.s32 \y26, q10, #\shift - vrshrn.s32 \y27, q14, #\shift -.endif + vadd.s32 q10, q14, q13 + vsub.s32 q14, q14, q13 + .if \shift > 16 + vrshr.s32 q10, q10, #\shift + vrshr.s32 q14, q14, #\shift + vmovn.s32 \y26, q10 + vmovn.s32 \y27, q14 + .else + vrshrn.s32 \y26, q10, #\shift + vrshrn.s32 \y27, q14, #\shift + .endif .endm asm_function jsimd_idct_2x2_neon @@ -1208,30 +1208,30 @@ asm_function jsimd_idct_2x2_neon /* Pass 1 */ #if 0 idct_helper d4, d6, d10, d12, d16, 13, d4, d6 - transpose_4x4 d4, d6, d8, d10 + transpose_4x4 d4, d6, d8, d10 idct_helper d5, d7, d11, d13, d17, 13, d5, d7 - transpose_4x4 d5, d7, d9, d11 + transpose_4x4 d5, d7, d9, d11 #else - vmull.s16 q13, d6, d0[3] + vmull.s16 q13, d6, d0[3] vmlal.s16 q13, d10, d0[2] vmlal.s16 q13, d12, d0[1] vmlal.s16 q13, d16, d0[0] - vmull.s16 q12, d7, d0[3] + vmull.s16 q12, d7, d0[3] vmlal.s16 q12, d11, d0[2] vmlal.s16 q12, d13, d0[1] vmlal.s16 q12, d17, d0[0] - vshll.s16 q14, d4, #15 - vshll.s16 q15, d5, #15 + vshll.s16 q14, d4, #15 + vshll.s16 q15, d5, #15 vadd.s32 q10, q14, q13 vsub.s32 q14, q14, q13 - vrshrn.s32 d4, q10, #13 - vrshrn.s32 d6, q14, #13 + vrshrn.s32 d4, q10, #13 + vrshrn.s32 d6, q14, #13 vadd.s32 q10, q15, q12 vsub.s32 q14, q15, q12 - vrshrn.s32 d5, q10, #13 - vrshrn.s32 d7, q14, #13 - vtrn.16 q2, q3 - vtrn.32 q3, q5 + vrshrn.s32 d5, q10, #13 + vrshrn.s32 d7, q14, #13 + vtrn.16 q2, q3 + vtrn.32 q3, q5 #endif /* Pass 2 */ @@ -1281,110 +1281,110 @@ asm_function jsimd_idct_2x2_neon .macro do_load size - .if \size == 8 - vld1.8 {d4}, [U, :64]! - vld1.8 {d5}, [V, :64]! - vld1.8 {d0}, [Y, :64]! - pld [U, #64] - pld [V, #64] - pld [Y, #64] - .elseif \size == 4 - vld1.8 {d4[0]}, [U]! - vld1.8 {d4[1]}, [U]! - vld1.8 {d4[2]}, [U]! - vld1.8 {d4[3]}, [U]! - vld1.8 {d5[0]}, [V]! - vld1.8 {d5[1]}, [V]! - vld1.8 {d5[2]}, [V]! - vld1.8 {d5[3]}, [V]! - vld1.8 {d0[0]}, [Y]! - vld1.8 {d0[1]}, [Y]! - vld1.8 {d0[2]}, [Y]! - vld1.8 {d0[3]}, [Y]! - .elseif \size == 2 - vld1.8 {d4[4]}, [U]! - vld1.8 {d4[5]}, [U]! - vld1.8 {d5[4]}, [V]! - vld1.8 {d5[5]}, [V]! - vld1.8 {d0[4]}, [Y]! - vld1.8 {d0[5]}, [Y]! - .elseif \size == 1 - vld1.8 {d4[6]}, [U]! - vld1.8 {d5[6]}, [V]! - vld1.8 {d0[6]}, [Y]! - .else - .error unsupported macroblock size - .endif + .if \size == 8 + vld1.8 {d4}, [U, :64]! + vld1.8 {d5}, [V, :64]! + vld1.8 {d0}, [Y, :64]! + pld [U, #64] + pld [V, #64] + pld [Y, #64] + .elseif \size == 4 + vld1.8 {d4[0]}, [U]! + vld1.8 {d4[1]}, [U]! + vld1.8 {d4[2]}, [U]! + vld1.8 {d4[3]}, [U]! + vld1.8 {d5[0]}, [V]! + vld1.8 {d5[1]}, [V]! + vld1.8 {d5[2]}, [V]! + vld1.8 {d5[3]}, [V]! + vld1.8 {d0[0]}, [Y]! + vld1.8 {d0[1]}, [Y]! + vld1.8 {d0[2]}, [Y]! + vld1.8 {d0[3]}, [Y]! + .elseif \size == 2 + vld1.8 {d4[4]}, [U]! + vld1.8 {d4[5]}, [U]! + vld1.8 {d5[4]}, [V]! + vld1.8 {d5[5]}, [V]! + vld1.8 {d0[4]}, [Y]! + vld1.8 {d0[5]}, [Y]! + .elseif \size == 1 + vld1.8 {d4[6]}, [U]! + vld1.8 {d5[6]}, [V]! + vld1.8 {d0[6]}, [Y]! + .else + .error unsupported macroblock size + .endif .endm .macro do_store bpp, size - .if \bpp == 24 - .if \size == 8 - vst3.8 {d10, d11, d12}, [RGB]! - .elseif \size == 4 - vst3.8 {d10[0], d11[0], d12[0]}, [RGB]! - vst3.8 {d10[1], d11[1], d12[1]}, [RGB]! - vst3.8 {d10[2], d11[2], d12[2]}, [RGB]! - vst3.8 {d10[3], d11[3], d12[3]}, [RGB]! - .elseif \size == 2 - vst3.8 {d10[4], d11[4], d12[4]}, [RGB]! - vst3.8 {d10[5], d11[5], d12[5]}, [RGB]! - .elseif \size == 1 - vst3.8 {d10[6], d11[6], d12[6]}, [RGB]! - .else - .error unsupported macroblock size - .endif - .elseif \bpp == 32 - .if \size == 8 - vst4.8 {d10, d11, d12, d13}, [RGB]! - .elseif \size == 4 - vst4.8 {d10[0], d11[0], d12[0], d13[0]}, [RGB]! - vst4.8 {d10[1], d11[1], d12[1], d13[1]}, [RGB]! - vst4.8 {d10[2], d11[2], d12[2], d13[2]}, [RGB]! - vst4.8 {d10[3], d11[3], d12[3], d13[3]}, [RGB]! - .elseif \size == 2 - vst4.8 {d10[4], d11[4], d12[4], d13[4]}, [RGB]! - vst4.8 {d10[5], d11[5], d12[5], d13[5]}, [RGB]! - .elseif \size == 1 - vst4.8 {d10[6], d11[6], d12[6], d13[6]}, [RGB]! - .else - .error unsupported macroblock size - .endif - .elseif \bpp == 16 - .if \size == 8 - vst1.16 {q15}, [RGB]! - .elseif \size == 4 - vst1.16 {d30}, [RGB]! - .elseif \size == 2 - vst1.16 {d31[0]}, [RGB]! - vst1.16 {d31[1]}, [RGB]! - .elseif \size == 1 - vst1.16 {d31[2]}, [RGB]! - .else - .error unsupported macroblock size - .endif + .if \bpp == 24 + .if \size == 8 + vst3.8 {d10, d11, d12}, [RGB]! + .elseif \size == 4 + vst3.8 {d10[0], d11[0], d12[0]}, [RGB]! + vst3.8 {d10[1], d11[1], d12[1]}, [RGB]! + vst3.8 {d10[2], d11[2], d12[2]}, [RGB]! + vst3.8 {d10[3], d11[3], d12[3]}, [RGB]! + .elseif \size == 2 + vst3.8 {d10[4], d11[4], d12[4]}, [RGB]! + vst3.8 {d10[5], d11[5], d12[5]}, [RGB]! + .elseif \size == 1 + vst3.8 {d10[6], d11[6], d12[6]}, [RGB]! .else - .error unsupported bpp + .error unsupported macroblock size .endif + .elseif \bpp == 32 + .if \size == 8 + vst4.8 {d10, d11, d12, d13}, [RGB]! + .elseif \size == 4 + vst4.8 {d10[0], d11[0], d12[0], d13[0]}, [RGB]! + vst4.8 {d10[1], d11[1], d12[1], d13[1]}, [RGB]! + vst4.8 {d10[2], d11[2], d12[2], d13[2]}, [RGB]! + vst4.8 {d10[3], d11[3], d12[3], d13[3]}, [RGB]! + .elseif \size == 2 + vst4.8 {d10[4], d11[4], d12[4], d13[4]}, [RGB]! + vst4.8 {d10[5], d11[5], d12[5], d13[5]}, [RGB]! + .elseif \size == 1 + vst4.8 {d10[6], d11[6], d12[6], d13[6]}, [RGB]! + .else + .error unsupported macroblock size + .endif + .elseif \bpp == 16 + .if \size == 8 + vst1.16 {q15}, [RGB]! + .elseif \size == 4 + vst1.16 {d30}, [RGB]! + .elseif \size == 2 + vst1.16 {d31[0]}, [RGB]! + vst1.16 {d31[1]}, [RGB]! + .elseif \size == 1 + vst1.16 {d31[2]}, [RGB]! + .else + .error unsupported macroblock size + .endif + .else + .error unsupported bpp + .endif .endm .macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, g_offs, b_offs /* - * 2 stage pipelined YCbCr->RGB conversion + * 2-stage pipelined YCbCr->RGB conversion */ .macro do_yuv_to_rgb_stage1 - vaddw.u8 q3, q1, d4 /* q3 = u - 128 */ - vaddw.u8 q4, q1, d5 /* q2 = v - 128 */ - vmull.s16 q10, d6, d1[1] /* multiply by -11277 */ - vmlal.s16 q10, d8, d1[2] /* multiply by -23401 */ - vmull.s16 q11, d7, d1[1] /* multiply by -11277 */ - vmlal.s16 q11, d9, d1[2] /* multiply by -23401 */ - vmull.s16 q12, d8, d1[0] /* multiply by 22971 */ - vmull.s16 q13, d9, d1[0] /* multiply by 22971 */ - vmull.s16 q14, d6, d1[3] /* multiply by 29033 */ - vmull.s16 q15, d7, d1[3] /* multiply by 29033 */ + vaddw.u8 q3, q1, d4 /* q3 = u - 128 */ + vaddw.u8 q4, q1, d5 /* q2 = v - 128 */ + vmull.s16 q10, d6, d1[1] /* multiply by -11277 */ + vmlal.s16 q10, d8, d1[2] /* multiply by -23401 */ + vmull.s16 q11, d7, d1[1] /* multiply by -11277 */ + vmlal.s16 q11, d9, d1[2] /* multiply by -23401 */ + vmull.s16 q12, d8, d1[0] /* multiply by 22971 */ + vmull.s16 q13, d9, d1[0] /* multiply by 22971 */ + vmull.s16 q14, d6, d1[3] /* multiply by 29033 */ + vmull.s16 q15, d7, d1[3] /* multiply by 29033 */ .endm .macro do_yuv_to_rgb_stage2 @@ -1397,17 +1397,17 @@ asm_function jsimd_idct_2x2_neon vaddw.u8 q11, q10, d0 vaddw.u8 q12, q12, d0 vaddw.u8 q14, q14, d0 -.if \bpp != 16 + .if \bpp != 16 vqmovun.s16 d1\g_offs, q11 vqmovun.s16 d1\r_offs, q12 vqmovun.s16 d1\b_offs, q14 -.else /* rgb565 */ + .else /* rgb565 */ vqshlu.s16 q13, q11, #8 vqshlu.s16 q15, q12, #8 vqshlu.s16 q14, q14, #8 vsri.u16 q15, q13, #5 vsri.u16 q15, q14, #11 -.endif + .endif .endm .macro do_yuv_to_rgb_stage2_store_load_stage1 @@ -1423,27 +1423,27 @@ asm_function jsimd_idct_2x2_neon vrshrn.s32 d28, q14, #14 vld1.8 {d5}, [V, :64]! vrshrn.s32 d29, q15, #14 - vaddw.u8 q3, q1, d4 /* q3 = u - 128 */ - vaddw.u8 q4, q1, d5 /* q2 = v - 128 */ + vaddw.u8 q3, q1, d4 /* q3 = u - 128 */ + vaddw.u8 q4, q1, d5 /* q2 = v - 128 */ vaddw.u8 q11, q10, d0 - vmull.s16 q10, d6, d1[1] /* multiply by -11277 */ - vmlal.s16 q10, d8, d1[2] /* multiply by -23401 */ + vmull.s16 q10, d6, d1[1] /* multiply by -11277 */ + vmlal.s16 q10, d8, d1[2] /* multiply by -23401 */ vaddw.u8 q12, q12, d0 vaddw.u8 q14, q14, d0 -.if \bpp != 16 /**************** rgb24/rgb32 *********************************/ + .if \bpp != 16 /**************** rgb24/rgb32 ******************************/ vqmovun.s16 d1\g_offs, q11 pld [Y, #64] vqmovun.s16 d1\r_offs, q12 vld1.8 {d0}, [Y, :64]! vqmovun.s16 d1\b_offs, q14 - vmull.s16 q11, d7, d1[1] /* multiply by -11277 */ - vmlal.s16 q11, d9, d1[2] /* multiply by -23401 */ + vmull.s16 q11, d7, d1[1] /* multiply by -11277 */ + vmlal.s16 q11, d9, d1[2] /* multiply by -23401 */ do_store \bpp, 8 - vmull.s16 q12, d8, d1[0] /* multiply by 22971 */ - vmull.s16 q13, d9, d1[0] /* multiply by 22971 */ - vmull.s16 q14, d6, d1[3] /* multiply by 29033 */ - vmull.s16 q15, d7, d1[3] /* multiply by 29033 */ -.else /**************************** rgb565 ***********************************/ + vmull.s16 q12, d8, d1[0] /* multiply by 22971 */ + vmull.s16 q13, d9, d1[0] /* multiply by 22971 */ + vmull.s16 q14, d6, d1[3] /* multiply by 29033 */ + vmull.s16 q15, d7, d1[3] /* multiply by 29033 */ + .else /**************************** rgb565 ********************************/ vqshlu.s16 q13, q11, #8 pld [Y, #64] vqshlu.s16 q15, q12, #8 @@ -1458,7 +1458,7 @@ asm_function jsimd_idct_2x2_neon vmull.s16 q14, d6, d1[3] do_store \bpp, 8 vmull.s16 q15, d7, d1[3] -.endif + .endif .endm .macro do_yuv_to_rgb @@ -1472,10 +1472,10 @@ asm_function jsimd_idct_2x2_neon .balign 16 jsimd_ycc_\colorid\()_neon_consts: - .short 0, 0, 0, 0 - .short 22971, -11277, -23401, 29033 - .short -128, -128, -128, -128 - .short -128, -128, -128, -128 + .short 0, 0, 0, 0 + .short 22971, -11277, -23401, 29033 + .short -128, -128, -128, -128 + .short -128, -128, -128, -128 asm_function jsimd_ycc_\colorid\()_convert_neon OUTPUT_WIDTH .req r0 @@ -1620,123 +1620,123 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, 0, 0 */ .macro do_store size - .if \size == 8 - vst1.8 {d20}, [Y]! - vst1.8 {d21}, [U]! - vst1.8 {d22}, [V]! - .elseif \size == 4 - vst1.8 {d20[0]}, [Y]! - vst1.8 {d20[1]}, [Y]! - vst1.8 {d20[2]}, [Y]! - vst1.8 {d20[3]}, [Y]! - vst1.8 {d21[0]}, [U]! - vst1.8 {d21[1]}, [U]! - vst1.8 {d21[2]}, [U]! - vst1.8 {d21[3]}, [U]! - vst1.8 {d22[0]}, [V]! - vst1.8 {d22[1]}, [V]! - vst1.8 {d22[2]}, [V]! - vst1.8 {d22[3]}, [V]! - .elseif \size == 2 - vst1.8 {d20[4]}, [Y]! - vst1.8 {d20[5]}, [Y]! - vst1.8 {d21[4]}, [U]! - vst1.8 {d21[5]}, [U]! - vst1.8 {d22[4]}, [V]! - vst1.8 {d22[5]}, [V]! - .elseif \size == 1 - vst1.8 {d20[6]}, [Y]! - vst1.8 {d21[6]}, [U]! - vst1.8 {d22[6]}, [V]! - .else - .error unsupported macroblock size - .endif + .if \size == 8 + vst1.8 {d20}, [Y]! + vst1.8 {d21}, [U]! + vst1.8 {d22}, [V]! + .elseif \size == 4 + vst1.8 {d20[0]}, [Y]! + vst1.8 {d20[1]}, [Y]! + vst1.8 {d20[2]}, [Y]! + vst1.8 {d20[3]}, [Y]! + vst1.8 {d21[0]}, [U]! + vst1.8 {d21[1]}, [U]! + vst1.8 {d21[2]}, [U]! + vst1.8 {d21[3]}, [U]! + vst1.8 {d22[0]}, [V]! + vst1.8 {d22[1]}, [V]! + vst1.8 {d22[2]}, [V]! + vst1.8 {d22[3]}, [V]! + .elseif \size == 2 + vst1.8 {d20[4]}, [Y]! + vst1.8 {d20[5]}, [Y]! + vst1.8 {d21[4]}, [U]! + vst1.8 {d21[5]}, [U]! + vst1.8 {d22[4]}, [V]! + vst1.8 {d22[5]}, [V]! + .elseif \size == 1 + vst1.8 {d20[6]}, [Y]! + vst1.8 {d21[6]}, [U]! + vst1.8 {d22[6]}, [V]! + .else + .error unsupported macroblock size + .endif .endm .macro do_load bpp, size - .if \bpp == 24 - .if \size == 8 - vld3.8 {d10, d11, d12}, [RGB]! - pld [RGB, #128] - .elseif \size == 4 - vld3.8 {d10[0], d11[0], d12[0]}, [RGB]! - vld3.8 {d10[1], d11[1], d12[1]}, [RGB]! - vld3.8 {d10[2], d11[2], d12[2]}, [RGB]! - vld3.8 {d10[3], d11[3], d12[3]}, [RGB]! - .elseif \size == 2 - vld3.8 {d10[4], d11[4], d12[4]}, [RGB]! - vld3.8 {d10[5], d11[5], d12[5]}, [RGB]! - .elseif \size == 1 - vld3.8 {d10[6], d11[6], d12[6]}, [RGB]! - .else - .error unsupported macroblock size - .endif - .elseif \bpp == 32 - .if \size == 8 - vld4.8 {d10, d11, d12, d13}, [RGB]! - pld [RGB, #128] - .elseif \size == 4 - vld4.8 {d10[0], d11[0], d12[0], d13[0]}, [RGB]! - vld4.8 {d10[1], d11[1], d12[1], d13[1]}, [RGB]! - vld4.8 {d10[2], d11[2], d12[2], d13[2]}, [RGB]! - vld4.8 {d10[3], d11[3], d12[3], d13[3]}, [RGB]! - .elseif \size == 2 - vld4.8 {d10[4], d11[4], d12[4], d13[4]}, [RGB]! - vld4.8 {d10[5], d11[5], d12[5], d13[5]}, [RGB]! - .elseif \size == 1 - vld4.8 {d10[6], d11[6], d12[6], d13[6]}, [RGB]! - .else - .error unsupported macroblock size - .endif + .if \bpp == 24 + .if \size == 8 + vld3.8 {d10, d11, d12}, [RGB]! + pld [RGB, #128] + .elseif \size == 4 + vld3.8 {d10[0], d11[0], d12[0]}, [RGB]! + vld3.8 {d10[1], d11[1], d12[1]}, [RGB]! + vld3.8 {d10[2], d11[2], d12[2]}, [RGB]! + vld3.8 {d10[3], d11[3], d12[3]}, [RGB]! + .elseif \size == 2 + vld3.8 {d10[4], d11[4], d12[4]}, [RGB]! + vld3.8 {d10[5], d11[5], d12[5]}, [RGB]! + .elseif \size == 1 + vld3.8 {d10[6], d11[6], d12[6]}, [RGB]! .else - .error unsupported bpp + .error unsupported macroblock size .endif + .elseif \bpp == 32 + .if \size == 8 + vld4.8 {d10, d11, d12, d13}, [RGB]! + pld [RGB, #128] + .elseif \size == 4 + vld4.8 {d10[0], d11[0], d12[0], d13[0]}, [RGB]! + vld4.8 {d10[1], d11[1], d12[1], d13[1]}, [RGB]! + vld4.8 {d10[2], d11[2], d12[2], d13[2]}, [RGB]! + vld4.8 {d10[3], d11[3], d12[3], d13[3]}, [RGB]! + .elseif \size == 2 + vld4.8 {d10[4], d11[4], d12[4], d13[4]}, [RGB]! + vld4.8 {d10[5], d11[5], d12[5], d13[5]}, [RGB]! + .elseif \size == 1 + vld4.8 {d10[6], d11[6], d12[6], d13[6]}, [RGB]! + .else + .error unsupported macroblock size + .endif + .else + .error unsupported bpp + .endif .endm .macro generate_jsimd_rgb_ycc_convert_neon colorid, bpp, r_offs, g_offs, b_offs /* - * 2 stage pipelined RGB->YCbCr conversion + * 2-stage pipelined RGB->YCbCr conversion */ .macro do_rgb_to_yuv_stage1 - vmovl.u8 q2, d1\r_offs /* r = { d4, d5 } */ - vmovl.u8 q3, d1\g_offs /* g = { d6, d7 } */ - vmovl.u8 q4, d1\b_offs /* b = { d8, d9 } */ - vmull.u16 q7, d4, d0[0] - vmlal.u16 q7, d6, d0[1] - vmlal.u16 q7, d8, d0[2] - vmull.u16 q8, d5, d0[0] - vmlal.u16 q8, d7, d0[1] - vmlal.u16 q8, d9, d0[2] - vrev64.32 q9, q1 - vrev64.32 q13, q1 - vmlsl.u16 q9, d4, d0[3] - vmlsl.u16 q9, d6, d1[0] - vmlal.u16 q9, d8, d1[1] - vmlsl.u16 q13, d5, d0[3] - vmlsl.u16 q13, d7, d1[0] - vmlal.u16 q13, d9, d1[1] - vrev64.32 q14, q1 - vrev64.32 q15, q1 - vmlal.u16 q14, d4, d1[1] - vmlsl.u16 q14, d6, d1[2] - vmlsl.u16 q14, d8, d1[3] - vmlal.u16 q15, d5, d1[1] - vmlsl.u16 q15, d7, d1[2] - vmlsl.u16 q15, d9, d1[3] + vmovl.u8 q2, d1\r_offs /* r = { d4, d5 } */ + vmovl.u8 q3, d1\g_offs /* g = { d6, d7 } */ + vmovl.u8 q4, d1\b_offs /* b = { d8, d9 } */ + vmull.u16 q7, d4, d0[0] + vmlal.u16 q7, d6, d0[1] + vmlal.u16 q7, d8, d0[2] + vmull.u16 q8, d5, d0[0] + vmlal.u16 q8, d7, d0[1] + vmlal.u16 q8, d9, d0[2] + vrev64.32 q9, q1 + vrev64.32 q13, q1 + vmlsl.u16 q9, d4, d0[3] + vmlsl.u16 q9, d6, d1[0] + vmlal.u16 q9, d8, d1[1] + vmlsl.u16 q13, d5, d0[3] + vmlsl.u16 q13, d7, d1[0] + vmlal.u16 q13, d9, d1[1] + vrev64.32 q14, q1 + vrev64.32 q15, q1 + vmlal.u16 q14, d4, d1[1] + vmlsl.u16 q14, d6, d1[2] + vmlsl.u16 q14, d8, d1[3] + vmlal.u16 q15, d5, d1[1] + vmlsl.u16 q15, d7, d1[2] + vmlsl.u16 q15, d9, d1[3] .endm .macro do_rgb_to_yuv_stage2 - vrshrn.u32 d20, q7, #16 - vrshrn.u32 d21, q8, #16 - vshrn.u32 d22, q9, #16 - vshrn.u32 d23, q13, #16 - vshrn.u32 d24, q14, #16 - vshrn.u32 d25, q15, #16 - vmovn.u16 d20, q10 /* d20 = y */ - vmovn.u16 d21, q11 /* d21 = u */ - vmovn.u16 d22, q12 /* d22 = v */ + vrshrn.u32 d20, q7, #16 + vrshrn.u32 d21, q8, #16 + vshrn.u32 d22, q9, #16 + vshrn.u32 d23, q13, #16 + vshrn.u32 d24, q14, #16 + vshrn.u32 d25, q15, #16 + vmovn.u16 d20, q10 /* d20 = y */ + vmovn.u16 d21, q11 /* d21 = u */ + vmovn.u16 d22, q12 /* d22 = v */ .endm .macro do_rgb_to_yuv @@ -1745,52 +1745,52 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, 0, 0 .endm .macro do_rgb_to_yuv_stage2_store_load_stage1 - vrshrn.u32 d20, q7, #16 - vrshrn.u32 d21, q8, #16 - vshrn.u32 d22, q9, #16 - vrev64.32 q9, q1 - vshrn.u32 d23, q13, #16 - vrev64.32 q13, q1 - vshrn.u32 d24, q14, #16 - vshrn.u32 d25, q15, #16 - do_load \bpp, 8 - vmovn.u16 d20, q10 /* d20 = y */ - vmovl.u8 q2, d1\r_offs /* r = { d4, d5 } */ - vmovn.u16 d21, q11 /* d21 = u */ - vmovl.u8 q3, d1\g_offs /* g = { d6, d7 } */ - vmovn.u16 d22, q12 /* d22 = v */ - vmovl.u8 q4, d1\b_offs /* b = { d8, d9 } */ - vmull.u16 q7, d4, d0[0] - vmlal.u16 q7, d6, d0[1] - vmlal.u16 q7, d8, d0[2] - vst1.8 {d20}, [Y]! - vmull.u16 q8, d5, d0[0] - vmlal.u16 q8, d7, d0[1] - vmlal.u16 q8, d9, d0[2] - vmlsl.u16 q9, d4, d0[3] - vmlsl.u16 q9, d6, d1[0] - vmlal.u16 q9, d8, d1[1] - vst1.8 {d21}, [U]! - vmlsl.u16 q13, d5, d0[3] - vmlsl.u16 q13, d7, d1[0] - vmlal.u16 q13, d9, d1[1] - vrev64.32 q14, q1 - vrev64.32 q15, q1 - vmlal.u16 q14, d4, d1[1] - vmlsl.u16 q14, d6, d1[2] - vmlsl.u16 q14, d8, d1[3] - vst1.8 {d22}, [V]! - vmlal.u16 q15, d5, d1[1] - vmlsl.u16 q15, d7, d1[2] - vmlsl.u16 q15, d9, d1[3] + vrshrn.u32 d20, q7, #16 + vrshrn.u32 d21, q8, #16 + vshrn.u32 d22, q9, #16 + vrev64.32 q9, q1 + vshrn.u32 d23, q13, #16 + vrev64.32 q13, q1 + vshrn.u32 d24, q14, #16 + vshrn.u32 d25, q15, #16 + do_load \bpp, 8 + vmovn.u16 d20, q10 /* d20 = y */ + vmovl.u8 q2, d1\r_offs /* r = { d4, d5 } */ + vmovn.u16 d21, q11 /* d21 = u */ + vmovl.u8 q3, d1\g_offs /* g = { d6, d7 } */ + vmovn.u16 d22, q12 /* d22 = v */ + vmovl.u8 q4, d1\b_offs /* b = { d8, d9 } */ + vmull.u16 q7, d4, d0[0] + vmlal.u16 q7, d6, d0[1] + vmlal.u16 q7, d8, d0[2] + vst1.8 {d20}, [Y]! + vmull.u16 q8, d5, d0[0] + vmlal.u16 q8, d7, d0[1] + vmlal.u16 q8, d9, d0[2] + vmlsl.u16 q9, d4, d0[3] + vmlsl.u16 q9, d6, d1[0] + vmlal.u16 q9, d8, d1[1] + vst1.8 {d21}, [U]! + vmlsl.u16 q13, d5, d0[3] + vmlsl.u16 q13, d7, d1[0] + vmlal.u16 q13, d9, d1[1] + vrev64.32 q14, q1 + vrev64.32 q15, q1 + vmlal.u16 q14, d4, d1[1] + vmlsl.u16 q14, d6, d1[2] + vmlsl.u16 q14, d8, d1[3] + vst1.8 {d22}, [V]! + vmlal.u16 q15, d5, d1[1] + vmlsl.u16 q15, d7, d1[2] + vmlsl.u16 q15, d9, d1[3] .endm .balign 16 jsimd_\colorid\()_ycc_neon_consts: - .short 19595, 38470, 7471, 11059 - .short 21709, 32768, 27439, 5329 - .short 32767, 128, 32767, 128 - .short 32767, 128, 32767, 128 + .short 19595, 38470, 7471, 11059 + .short 21709, 32768, 27439, 5329 + .short 32767, 128, 32767, 128 + .short 32767, 128, 32767, 128 asm_function jsimd_\colorid\()_ycc_convert_neon OUTPUT_WIDTH .req r0 @@ -2000,10 +2000,10 @@ asm_function jsimd_convsamp_neon .balign 16 jsimd_fdct_ifast_neon_consts: - .short (98 * 128) /* XFIX_0_382683433 */ - .short (139 * 128) /* XFIX_0_541196100 */ - .short (181 * 128) /* XFIX_0_707106781 */ - .short (334 * 128 - 256 * 128) /* XFIX_1_306562965 */ + .short (98 * 128) /* XFIX_0_382683433 */ + .short (139 * 128) /* XFIX_0_541196100 */ + .short (181 * 128) /* XFIX_0_707106781 */ + .short (334 * 128 - 256 * 128) /* XFIX_1_306562965 */ asm_function jsimd_fdct_ifast_neon @@ -2040,52 +2040,52 @@ asm_function jsimd_fdct_ifast_neon /* Transpose */ vtrn.16 q12, q13 vtrn.16 q10, q11 - vtrn.16 q8, q9 + vtrn.16 q8, q9 vtrn.16 q14, q15 - vtrn.32 q9, q11 + vtrn.32 q9, q11 vtrn.32 q13, q15 - vtrn.32 q8, q10 + vtrn.32 q8, q10 vtrn.32 q12, q14 vswp d30, d23 vswp d24, d17 vswp d26, d19 /* 1-D FDCT */ - vadd.s16 q2, q11, q12 + vadd.s16 q2, q11, q12 vswp d28, d21 vsub.s16 q12, q11, q12 - vsub.s16 q6, q10, q13 + vsub.s16 q6, q10, q13 vadd.s16 q10, q10, q13 - vsub.s16 q7, q9, q14 - vadd.s16 q9, q9, q14 - vsub.s16 q1, q8, q15 - vadd.s16 q8, q8, q15 - vsub.s16 q4, q9, q10 - vsub.s16 q5, q8, q2 - vadd.s16 q3, q9, q10 - vadd.s16 q4, q4, q5 - vadd.s16 q2, q8, q2 - vqdmulh.s16 q4, q4, XFIX_0_707106781 + vsub.s16 q7, q9, q14 + vadd.s16 q9, q9, q14 + vsub.s16 q1, q8, q15 + vadd.s16 q8, q8, q15 + vsub.s16 q4, q9, q10 + vsub.s16 q5, q8, q2 + vadd.s16 q3, q9, q10 + vadd.s16 q4, q4, q5 + vadd.s16 q2, q8, q2 + vqdmulh.s16 q4, q4, XFIX_0_707106781 vadd.s16 q11, q12, q6 - vadd.s16 q8, q2, q3 - vsub.s16 q12, q2, q3 - vadd.s16 q3, q6, q7 - vadd.s16 q7, q7, q1 - vqdmulh.s16 q3, q3, XFIX_0_707106781 - vsub.s16 q6, q11, q7 - vadd.s16 q10, q5, q4 - vqdmulh.s16 q6, q6, XFIX_0_382683433 - vsub.s16 q14, q5, q4 + vadd.s16 q8, q2, q3 + vsub.s16 q12, q2, q3 + vadd.s16 q3, q6, q7 + vadd.s16 q7, q7, q1 + vqdmulh.s16 q3, q3, XFIX_0_707106781 + vsub.s16 q6, q11, q7 + vadd.s16 q10, q5, q4 + vqdmulh.s16 q6, q6, XFIX_0_382683433 + vsub.s16 q14, q5, q4 vqdmulh.s16 q11, q11, XFIX_0_541196100 - vqdmulh.s16 q5, q7, XFIX_1_306562965 - vadd.s16 q4, q1, q3 - vsub.s16 q3, q1, q3 - vadd.s16 q7, q7, q6 + vqdmulh.s16 q5, q7, XFIX_1_306562965 + vadd.s16 q4, q1, q3 + vsub.s16 q3, q1, q3 + vadd.s16 q7, q7, q6 vadd.s16 q11, q11, q6 - vadd.s16 q7, q7, q5 - vadd.s16 q13, q3, q11 - vsub.s16 q11, q3, q11 - vadd.s16 q9, q4, q7 - vsub.s16 q15, q4, q7 + vadd.s16 q7, q7, q5 + vadd.s16 q13, q3, q11 + vsub.s16 q11, q3, q11 + vadd.s16 q9, q4, q7 + vsub.s16 q15, q4, q7 subs TMP, TMP, #1 bne 1b @@ -2134,22 +2134,22 @@ asm_function jsimd_quantize_neon vld1.16 {d20, d21, d22, d23}, [CORRECTION, :128]! vabs.s16 q13, q1 vld1.16 {d16, d17, d18, d19}, [RECIPROCAL, :128]! - vadd.u16 q12, q12, q10 /* add correction */ + vadd.u16 q12, q12, q10 /* add correction */ vadd.u16 q13, q13, q11 - vmull.u16 q10, d24, d16 /* multiply by reciprocal */ + vmull.u16 q10, d24, d16 /* multiply by reciprocal */ vmull.u16 q11, d25, d17 - vmull.u16 q8, d26, d18 - vmull.u16 q9, d27, d19 + vmull.u16 q8, d26, d18 + vmull.u16 q9, d27, d19 vld1.16 {d24, d25, d26, d27}, [SHIFT, :128]! vshrn.u32 d20, q10, #16 vshrn.u32 d21, q11, #16 - vshrn.u32 d22, q8, #16 - vshrn.u32 d23, q9, #16 + vshrn.u32 d22, q8, #16 + vshrn.u32 d23, q9, #16 vneg.s16 q12, q12 vneg.s16 q13, q13 - vshr.s16 q2, q0, #15 /* extract sign */ - vshr.s16 q3, q1, #15 - vshl.u16 q14, q10, q12 /* shift */ + vshr.s16 q2, q0, #15 /* extract sign */ + vshr.s16 q3, q1, #15 + vshl.u16 q14, q10, q12 /* shift */ vshl.u16 q15, q11, q13 push {r4, r5} @@ -2162,25 +2162,25 @@ asm_function jsimd_quantize_neon vabs.s16 q13, q1 veor.u16 q15, q15, q3 vld1.16 {d16, d17, d18, d19}, [RECIPROCAL, :128]! - vadd.u16 q12, q12, q10 /* add correction */ + vadd.u16 q12, q12, q10 /* add correction */ vadd.u16 q13, q13, q11 - vmull.u16 q10, d24, d16 /* multiply by reciprocal */ + vmull.u16 q10, d24, d16 /* multiply by reciprocal */ vmull.u16 q11, d25, d17 - vmull.u16 q8, d26, d18 - vmull.u16 q9, d27, d19 + vmull.u16 q8, d26, d18 + vmull.u16 q9, d27, d19 vsub.u16 q14, q14, q2 vld1.16 {d24, d25, d26, d27}, [SHIFT, :128]! vsub.u16 q15, q15, q3 vshrn.u32 d20, q10, #16 vshrn.u32 d21, q11, #16 vst1.16 {d28, d29, d30, d31}, [COEF_BLOCK, :128]! - vshrn.u32 d22, q8, #16 - vshrn.u32 d23, q9, #16 + vshrn.u32 d22, q8, #16 + vshrn.u32 d23, q9, #16 vneg.s16 q12, q12 vneg.s16 q13, q13 - vshr.s16 q2, q0, #15 /* extract sign */ - vshr.s16 q3, q1, #15 - vshl.u16 q14, q10, q12 /* shift */ + vshr.s16 q2, q0, #15 /* extract sign */ + vshr.s16 q3, q1, #15 + vshl.u16 q14, q10, q12 /* shift */ vshl.u16 q15, q11, q13 subs LOOP_COUNT, LOOP_COUNT, #1 bne 1b @@ -2192,7 +2192,7 @@ asm_function jsimd_quantize_neon vsub.u16 q15, q15, q3 vst1.16 {d28, d29, d30, d31}, [COEF_BLOCK, :128]! - bx lr /* return */ + bx lr /* return */ .unreq COEF_BLOCK .unreq DIVISORS @@ -2207,9 +2207,9 @@ asm_function jsimd_quantize_neon /* * GLOBAL(void) - * jsimd_h2v1_fancy_upsample_neon (int max_v_samp_factor, - * JDIMENSION downsampled_width, - * JSAMPARRAY input_data, + * jsimd_h2v1_fancy_upsample_neon (int max_v_samp_factor, + * JDIMENSION downsampled_width, + * JSAMPARRAY input_data, * JSAMPARRAY * output_data_ptr); * * Note: the use of unaligned writes is the main remaining bottleneck in @@ -2224,22 +2224,22 @@ asm_function jsimd_quantize_neon * Register d28 is used for multiplication by 3. Register q15 is used * for adding +1 bias. */ -.macro upsample16 OUTPTR, INPTR +.macro upsample16 OUTPTR, INPTR vld1.8 {q0}, [\INPTR]! - vmovl.u8 q8, d0 - vext.8 q2, q1, q0, #15 - vmovl.u8 q9, d1 + vmovl.u8 q8, d0 + vext.8 q2, q1, q0, #15 + vmovl.u8 q9, d1 vaddw.u8 q10, q15, d4 vaddw.u8 q11, q15, d5 - vmlal.u8 q8, d4, d28 - vmlal.u8 q9, d5, d28 - vmlal.u8 q10, d0, d28 - vmlal.u8 q11, d1, d28 - vmov q1, q0 /* backup source pixels to q1 */ - vrshrn.u16 d6, q8, #2 - vrshrn.u16 d7, q9, #2 - vshrn.u16 d8, q10, #2 - vshrn.u16 d9, q11, #2 + vmlal.u8 q8, d4, d28 + vmlal.u8 q9, d5, d28 + vmlal.u8 q10, d0, d28 + vmlal.u8 q11, d1, d28 + vmov q1, q0 /* backup source pixels to q1 */ + vrshrn.u16 d6, q8, #2 + vrshrn.u16 d7, q9, #2 + vshrn.u16 d8, q10, #2 + vshrn.u16 d9, q11, #2 vst2.8 {d6, d7, d8, d9}, [\OUTPTR]! .endm @@ -2250,39 +2250,39 @@ asm_function jsimd_quantize_neon * Also this unrolling allows to reorder loads and stores to compensate * multiplication latency and reduce stalls. */ -.macro upsample32 OUTPTR, INPTR +.macro upsample32 OUTPTR, INPTR /* even 16 pixels group */ vld1.8 {q0}, [\INPTR]! - vmovl.u8 q8, d0 - vext.8 q2, q1, q0, #15 - vmovl.u8 q9, d1 + vmovl.u8 q8, d0 + vext.8 q2, q1, q0, #15 + vmovl.u8 q9, d1 vaddw.u8 q10, q15, d4 vaddw.u8 q11, q15, d5 - vmlal.u8 q8, d4, d28 - vmlal.u8 q9, d5, d28 - vmlal.u8 q10, d0, d28 - vmlal.u8 q11, d1, d28 - /* odd 16 pixels group */ - vld1.8 {q1}, [\INPTR]! - vrshrn.u16 d6, q8, #2 - vrshrn.u16 d7, q9, #2 - vshrn.u16 d8, q10, #2 - vshrn.u16 d9, q11, #2 - vmovl.u8 q8, d2 - vext.8 q2, q0, q1, #15 - vmovl.u8 q9, d3 - vaddw.u8 q10, q15, d4 - vaddw.u8 q11, q15, d5 - vmlal.u8 q8, d4, d28 - vmlal.u8 q9, d5, d28 - vmlal.u8 q10, d2, d28 - vmlal.u8 q11, d3, d28 + vmlal.u8 q8, d4, d28 + vmlal.u8 q9, d5, d28 + vmlal.u8 q10, d0, d28 + vmlal.u8 q11, d1, d28 + /* odd 16 pixels group */ + vld1.8 {q1}, [\INPTR]! + vrshrn.u16 d6, q8, #2 + vrshrn.u16 d7, q9, #2 + vshrn.u16 d8, q10, #2 + vshrn.u16 d9, q11, #2 + vmovl.u8 q8, d2 + vext.8 q2, q0, q1, #15 + vmovl.u8 q9, d3 + vaddw.u8 q10, q15, d4 + vaddw.u8 q11, q15, d5 + vmlal.u8 q8, d4, d28 + vmlal.u8 q9, d5, d28 + vmlal.u8 q10, d2, d28 + vmlal.u8 q11, d3, d28 vst2.8 {d6, d7, d8, d9}, [\OUTPTR]! - vrshrn.u16 d6, q8, #2 - vrshrn.u16 d7, q9, #2 - vshrn.u16 d8, q10, #2 - vshrn.u16 d9, q11, #2 - vst2.8 {d6, d7, d8, d9}, [\OUTPTR]! + vrshrn.u16 d6, q8, #2 + vrshrn.u16 d7, q9, #2 + vshrn.u16 d8, q10, #2 + vshrn.u16 d9, q11, #2 + vst2.8 {d6, d7, d8, d9}, [\OUTPTR]! .endm /* @@ -2343,21 +2343,21 @@ asm_function jsimd_quantize_neon 2: tst \WIDTH, #8 beq 2f - vmov d1, d0 + vmov d1, d0 sub \INPTR, \INPTR, #8 vld1.8 {d0}, [\INPTR] 2: /* upsample the remaining pixels */ - vmovl.u8 q8, d0 - vext.8 q2, q1, q0, #15 - vmovl.u8 q9, d1 + vmovl.u8 q8, d0 + vext.8 q2, q1, q0, #15 + vmovl.u8 q9, d1 vaddw.u8 q10, q15, d4 vaddw.u8 q11, q15, d5 - vmlal.u8 q8, d4, d28 - vmlal.u8 q9, d5, d28 - vmlal.u8 q10, d0, d28 - vmlal.u8 q11, d1, d28 - vrshrn.u16 d10, q8, #2 - vrshrn.u16 d12, q9, #2 + vmlal.u8 q8, d4, d28 + vmlal.u8 q9, d5, d28 + vmlal.u8 q10, d0, d28 + vmlal.u8 q11, d1, d28 + vrshrn.u16 d10, q8, #2 + vrshrn.u16 d12, q9, #2 vshrn.u16 d11, q10, #2 vshrn.u16 d13, q11, #2 vzip.8 d10, d11 @@ -2366,12 +2366,12 @@ asm_function jsimd_quantize_neon tst \WIDTH, #8 beq 2f vst1.8 {d10, d11}, [\OUTPTR]! - vmov q5, q6 + vmov q5, q6 2: tst \WIDTH, #4 beq 2f vst1.8 {d10}, [\OUTPTR]! - vmov d10, d11 + vmov d10, d11 2: tst \WIDTH, #2 beq 2f @@ -2435,11 +2435,11 @@ asm_function jsimd_h2v1_fancy_upsample_neon .unreq WIDTH .unreq TMP - .purgem upsample16 .purgem upsample32 .purgem upsample_row + /*****************************************************************************/ /* @@ -2451,424 +2451,426 @@ asm_function jsimd_h2v1_fancy_upsample_neon */ .macro emit_byte BUFFER, PUT_BUFFER, PUT_BITS, ZERO, TMP - sub \PUT_BITS, \PUT_BITS, #0x8 - lsr \TMP, \PUT_BUFFER, \PUT_BITS - uxtb \TMP, \TMP - strb \TMP, [\BUFFER, #1]! - cmp \TMP, #0xff + sub \PUT_BITS, \PUT_BITS, #0x8 + lsr \TMP, \PUT_BUFFER, \PUT_BITS + uxtb \TMP, \TMP + strb \TMP, [\BUFFER, #1]! + cmp \TMP, #0xff /*it eq*/ - streqb \ZERO, [\BUFFER, #1]! + streqb \ZERO, [\BUFFER, #1]! .endm + .macro put_bits PUT_BUFFER, PUT_BITS, CODE, SIZE - /*lsl \PUT_BUFFER, \PUT_BUFFER, \SIZE*/ - add \PUT_BITS, \SIZE - /*orr \PUT_BUFFER, \PUT_BUFFER, \CODE*/ - orr \PUT_BUFFER, \CODE, \PUT_BUFFER, lsl \SIZE + /*lsl \PUT_BUFFER, \PUT_BUFFER, \SIZE*/ + add \PUT_BITS, \SIZE + /*orr \PUT_BUFFER, \PUT_BUFFER, \CODE*/ + orr \PUT_BUFFER, \CODE, \PUT_BUFFER, lsl \SIZE .endm + .macro checkbuf15 BUFFER, PUT_BUFFER, PUT_BITS, ZERO, TMP - cmp \PUT_BITS, #0x10 - blt 15f - eor \ZERO, \ZERO, \ZERO - emit_byte \BUFFER, \PUT_BUFFER, \PUT_BITS, \ZERO, \TMP - emit_byte \BUFFER, \PUT_BUFFER, \PUT_BITS, \ZERO, \TMP + cmp \PUT_BITS, #0x10 + blt 15f + eor \ZERO, \ZERO, \ZERO + emit_byte \BUFFER, \PUT_BUFFER, \PUT_BITS, \ZERO, \TMP + emit_byte \BUFFER, \PUT_BUFFER, \PUT_BITS, \ZERO, \TMP 15: .endm .balign 16 jsimd_huff_encode_one_block_neon_consts: - .byte 0x01 - .byte 0x02 - .byte 0x04 - .byte 0x08 - .byte 0x10 - .byte 0x20 - .byte 0x40 - .byte 0x80 + .byte 0x01 + .byte 0x02 + .byte 0x04 + .byte 0x08 + .byte 0x10 + .byte 0x20 + .byte 0x40 + .byte 0x80 asm_function jsimd_huff_encode_one_block_neon - push {r4, r5, r6, r7, r8, r9, r10, r11, lr} - add r7, sp, #0x1c - sub r4, sp, #0x40 - bfc r4, #0, #5 - mov sp, r4 /* align sp on 32 bytes */ - vst1.64 {d8, d9, d10, d11}, [r4, :128]! - vst1.64 {d12, d13, d14, d15}, [r4, :128] - sub sp, #0x140 /* reserve 320 bytes */ - str r0, [sp, #0x18] /* working state > sp + Ox18 */ - add r4, sp, #0x20 /* r4 = t1 */ - ldr lr, [r7, #0x8] /* lr = dctbl */ - sub r10, r1, #0x1 /* r10=buffer-- */ - ldrsh r1, [r2] - mov r9, #0x10 - mov r8, #0x1 - adr r5, jsimd_huff_encode_one_block_neon_consts + push {r4, r5, r6, r7, r8, r9, r10, r11, lr} + add r7, sp, #0x1c + sub r4, sp, #0x40 + bfc r4, #0, #5 + mov sp, r4 /* align sp on 32 bytes */ + vst1.64 {d8, d9, d10, d11}, [r4, :128]! + vst1.64 {d12, d13, d14, d15}, [r4, :128] + sub sp, #0x140 /* reserve 320 bytes */ + str r0, [sp, #0x18] /* working state > sp + Ox18 */ + add r4, sp, #0x20 /* r4 = t1 */ + ldr lr, [r7, #0x8] /* lr = dctbl */ + sub r10, r1, #0x1 /* r10=buffer-- */ + ldrsh r1, [r2] + mov r9, #0x10 + mov r8, #0x1 + adr r5, jsimd_huff_encode_one_block_neon_consts /* prepare data */ - vld1.8 {d26}, [r5, :64] - veor q8, q8, q8 - veor q9, q9, q9 - vdup.16 q14, r9 - vdup.16 q15, r8 - veor q10, q10, q10 - veor q11, q11, q11 - sub r1, r1, r3 - add r9, r2, #0x22 - add r8, r2, #0x18 - add r3, r2, #0x36 - vmov.16 d0[0], r1 - vld1.16 {d2[0]}, [r9, :16] - vld1.16 {d4[0]}, [r8, :16] - vld1.16 {d6[0]}, [r3, :16] - add r1, r2, #0x2 - add r9, r2, #0x30 - add r8, r2, #0x26 - add r3, r2, #0x28 - vld1.16 {d0[1]}, [r1, :16] - vld1.16 {d2[1]}, [r9, :16] - vld1.16 {d4[1]}, [r8, :16] - vld1.16 {d6[1]}, [r3, :16] - add r1, r2, #0x10 - add r9, r2, #0x40 - add r8, r2, #0x34 - add r3, r2, #0x1a - vld1.16 {d0[2]}, [r1, :16] - vld1.16 {d2[2]}, [r9, :16] - vld1.16 {d4[2]}, [r8, :16] - vld1.16 {d6[2]}, [r3, :16] - add r1, r2, #0x20 - add r9, r2, #0x32 - add r8, r2, #0x42 - add r3, r2, #0xc - vld1.16 {d0[3]}, [r1, :16] - vld1.16 {d2[3]}, [r9, :16] - vld1.16 {d4[3]}, [r8, :16] - vld1.16 {d6[3]}, [r3, :16] - add r1, r2, #0x12 - add r9, r2, #0x24 - add r8, r2, #0x50 - add r3, r2, #0xe - vld1.16 {d1[0]}, [r1, :16] - vld1.16 {d3[0]}, [r9, :16] - vld1.16 {d5[0]}, [r8, :16] - vld1.16 {d7[0]}, [r3, :16] - add r1, r2, #0x4 - add r9, r2, #0x16 - add r8, r2, #0x60 - add r3, r2, #0x1c - vld1.16 {d1[1]}, [r1, :16] - vld1.16 {d3[1]}, [r9, :16] - vld1.16 {d5[1]}, [r8, :16] - vld1.16 {d7[1]}, [r3, :16] - add r1, r2, #0x6 - add r9, r2, #0x8 - add r8, r2, #0x52 - add r3, r2, #0x2a - vld1.16 {d1[2]}, [r1, :16] - vld1.16 {d3[2]}, [r9, :16] - vld1.16 {d5[2]}, [r8, :16] - vld1.16 {d7[2]}, [r3, :16] - add r1, r2, #0x14 - add r9, r2, #0xa - add r8, r2, #0x44 - add r3, r2, #0x38 - vld1.16 {d1[3]}, [r1, :16] - vld1.16 {d3[3]}, [r9, :16] - vld1.16 {d5[3]}, [r8, :16] - vld1.16 {d7[3]}, [r3, :16] - vcgt.s16 q8, q8, q0 - vcgt.s16 q9, q9, q1 - vcgt.s16 q10, q10, q2 - vcgt.s16 q11, q11, q3 - vabs.s16 q0, q0 - vabs.s16 q1, q1 - vabs.s16 q2, q2 - vabs.s16 q3, q3 - veor q8, q8, q0 - veor q9, q9, q1 - veor q10, q10, q2 - veor q11, q11, q3 - add r9, r4, #0x20 - add r8, r4, #0x80 - add r3, r4, #0xa0 - vclz.i16 q0, q0 - vclz.i16 q1, q1 - vclz.i16 q2, q2 - vclz.i16 q3, q3 - vsub.i16 q0, q14, q0 - vsub.i16 q1, q14, q1 - vsub.i16 q2, q14, q2 - vsub.i16 q3, q14, q3 - vst1.16 {d0, d1, d2, d3}, [r4, :256] - vst1.16 {d4, d5, d6, d7}, [r9, :256] - vshl.s16 q0, q15, q0 - vshl.s16 q1, q15, q1 - vshl.s16 q2, q15, q2 - vshl.s16 q3, q15, q3 - vsub.i16 q0, q0, q15 - vsub.i16 q1, q1, q15 - vsub.i16 q2, q2, q15 - vsub.i16 q3, q3, q15 - vand q8, q8, q0 - vand q9, q9, q1 - vand q10, q10, q2 - vand q11, q11, q3 - vst1.16 {d16, d17, d18, d19}, [r8, :256] - vst1.16 {d20, d21, d22, d23}, [r3, :256] - add r1, r2, #0x46 - add r9, r2, #0x3a - add r8, r2, #0x74 - add r3, r2, #0x6a - vld1.16 {d8[0]}, [r1, :16] - vld1.16 {d10[0]}, [r9, :16] - vld1.16 {d12[0]}, [r8, :16] - vld1.16 {d14[0]}, [r3, :16] - veor q8, q8, q8 - veor q9, q9, q9 - veor q10, q10, q10 - veor q11, q11, q11 - add r1, r2, #0x54 - add r9, r2, #0x2c - add r8, r2, #0x76 - add r3, r2, #0x78 - vld1.16 {d8[1]}, [r1, :16] - vld1.16 {d10[1]}, [r9, :16] - vld1.16 {d12[1]}, [r8, :16] - vld1.16 {d14[1]}, [r3, :16] - add r1, r2, #0x62 - add r9, r2, #0x1e - add r8, r2, #0x68 - add r3, r2, #0x7a - vld1.16 {d8[2]}, [r1, :16] - vld1.16 {d10[2]}, [r9, :16] - vld1.16 {d12[2]}, [r8, :16] - vld1.16 {d14[2]}, [r3, :16] - add r1, r2, #0x70 - add r9, r2, #0x2e - add r8, r2, #0x5a - add r3, r2, #0x6c - vld1.16 {d8[3]}, [r1, :16] - vld1.16 {d10[3]}, [r9, :16] - vld1.16 {d12[3]}, [r8, :16] - vld1.16 {d14[3]}, [r3, :16] - add r1, r2, #0x72 - add r9, r2, #0x3c - add r8, r2, #0x4c - add r3, r2, #0x5e - vld1.16 {d9[0]}, [r1, :16] - vld1.16 {d11[0]}, [r9, :16] - vld1.16 {d13[0]}, [r8, :16] - vld1.16 {d15[0]}, [r3, :16] - add r1, r2, #0x64 - add r9, r2, #0x4a - add r8, r2, #0x3e - add r3, r2, #0x6e - vld1.16 {d9[1]}, [r1, :16] - vld1.16 {d11[1]}, [r9, :16] - vld1.16 {d13[1]}, [r8, :16] - vld1.16 {d15[1]}, [r3, :16] - add r1, r2, #0x56 - add r9, r2, #0x58 - add r8, r2, #0x4e - add r3, r2, #0x7c - vld1.16 {d9[2]}, [r1, :16] - vld1.16 {d11[2]}, [r9, :16] - vld1.16 {d13[2]}, [r8, :16] - vld1.16 {d15[2]}, [r3, :16] - add r1, r2, #0x48 - add r9, r2, #0x66 - add r8, r2, #0x5c - add r3, r2, #0x7e - vld1.16 {d9[3]}, [r1, :16] - vld1.16 {d11[3]}, [r9, :16] - vld1.16 {d13[3]}, [r8, :16] - vld1.16 {d15[3]}, [r3, :16] - vcgt.s16 q8, q8, q4 - vcgt.s16 q9, q9, q5 - vcgt.s16 q10, q10, q6 - vcgt.s16 q11, q11, q7 - vabs.s16 q4, q4 - vabs.s16 q5, q5 - vabs.s16 q6, q6 - vabs.s16 q7, q7 - veor q8, q8, q4 - veor q9, q9, q5 - veor q10, q10, q6 - veor q11, q11, q7 - add r1, r4, #0x40 - add r9, r4, #0x60 - add r8, r4, #0xc0 - add r3, r4, #0xe0 - vclz.i16 q4, q4 - vclz.i16 q5, q5 - vclz.i16 q6, q6 - vclz.i16 q7, q7 - vsub.i16 q4, q14, q4 - vsub.i16 q5, q14, q5 - vsub.i16 q6, q14, q6 - vsub.i16 q7, q14, q7 - vst1.16 {d8, d9, d10, d11}, [r1, :256] - vst1.16 {d12, d13, d14, d15}, [r9, :256] - vshl.s16 q4, q15, q4 - vshl.s16 q5, q15, q5 - vshl.s16 q6, q15, q6 - vshl.s16 q7, q15, q7 - vsub.i16 q4, q4, q15 - vsub.i16 q5, q5, q15 - vsub.i16 q6, q6, q15 - vsub.i16 q7, q7, q15 - vand q8, q8, q4 - vand q9, q9, q5 - vand q10, q10, q6 - vand q11, q11, q7 - vst1.16 {d16, d17, d18, d19}, [r8, :256] - vst1.16 {d20, d21, d22, d23}, [r3, :256] - ldr r12, [r7, #0xc] /* r12 = actbl */ - add r1, lr, #0x400 /* r1 = dctbl->ehufsi */ - mov r9, r12 /* r9 = actbl */ - add r6, r4, #0x80 /* r6 = t2 */ - ldr r11, [r0, #0x8] /* r11 = put_buffer */ - ldr r4, [r0, #0xc] /* r4 = put_bits */ - ldrh r2, [r6, #-128] /* r2 = nbits */ - ldrh r3, [r6] /* r3 = temp2 & (((JLONG) 1)<ehufsi */ - ldrsb r6, [r5, #0xf0] /* r6 = actbl->ehufsi[0xf0] */ - veor q8, q8, q8 - vceq.i16 q0, q0, q8 - vceq.i16 q1, q1, q8 - vceq.i16 q2, q2, q8 - vceq.i16 q3, q3, q8 - vceq.i16 q4, q4, q8 - vceq.i16 q5, q5, q8 - vceq.i16 q6, q6, q8 - vceq.i16 q7, q7, q8 - vmovn.i16 d0, q0 - vmovn.i16 d2, q1 - vmovn.i16 d4, q2 - vmovn.i16 d6, q3 - vmovn.i16 d8, q4 - vmovn.i16 d10, q5 - vmovn.i16 d12, q6 - vmovn.i16 d14, q7 - vand d0, d0, d26 - vand d2, d2, d26 - vand d4, d4, d26 - vand d6, d6, d26 - vand d8, d8, d26 - vand d10, d10, d26 - vand d12, d12, d26 - vand d14, d14, d26 - vpadd.i8 d0, d0, d2 - vpadd.i8 d4, d4, d6 - vpadd.i8 d8, d8, d10 - vpadd.i8 d12, d12, d14 - vpadd.i8 d0, d0, d4 - vpadd.i8 d8, d8, d12 - vpadd.i8 d0, d0, d8 - vmov.32 r1, d0[1] - vmov.32 r8, d0[0] - mvn r1, r1 - mvn r8, r8 - lsrs r1, r1, #0x1 - rrx r8, r8 /* shift in last r1 bit while shifting out DC bit */ - rbit r1, r1 /* r1 = index1 */ - rbit r8, r8 /* r8 = index0 */ - ldr r0, [r9, #0x3c0] /* r0 = actbl->ehufco[0xf0] */ - str r1, [sp, #0x14] /* index1 > sp + 0x14 */ - cmp r8, #0x0 - beq 6f + vld1.8 {d26}, [r5, :64] + veor q8, q8, q8 + veor q9, q9, q9 + vdup.16 q14, r9 + vdup.16 q15, r8 + veor q10, q10, q10 + veor q11, q11, q11 + sub r1, r1, r3 + add r9, r2, #0x22 + add r8, r2, #0x18 + add r3, r2, #0x36 + vmov.16 d0[0], r1 + vld1.16 {d2[0]}, [r9, :16] + vld1.16 {d4[0]}, [r8, :16] + vld1.16 {d6[0]}, [r3, :16] + add r1, r2, #0x2 + add r9, r2, #0x30 + add r8, r2, #0x26 + add r3, r2, #0x28 + vld1.16 {d0[1]}, [r1, :16] + vld1.16 {d2[1]}, [r9, :16] + vld1.16 {d4[1]}, [r8, :16] + vld1.16 {d6[1]}, [r3, :16] + add r1, r2, #0x10 + add r9, r2, #0x40 + add r8, r2, #0x34 + add r3, r2, #0x1a + vld1.16 {d0[2]}, [r1, :16] + vld1.16 {d2[2]}, [r9, :16] + vld1.16 {d4[2]}, [r8, :16] + vld1.16 {d6[2]}, [r3, :16] + add r1, r2, #0x20 + add r9, r2, #0x32 + add r8, r2, #0x42 + add r3, r2, #0xc + vld1.16 {d0[3]}, [r1, :16] + vld1.16 {d2[3]}, [r9, :16] + vld1.16 {d4[3]}, [r8, :16] + vld1.16 {d6[3]}, [r3, :16] + add r1, r2, #0x12 + add r9, r2, #0x24 + add r8, r2, #0x50 + add r3, r2, #0xe + vld1.16 {d1[0]}, [r1, :16] + vld1.16 {d3[0]}, [r9, :16] + vld1.16 {d5[0]}, [r8, :16] + vld1.16 {d7[0]}, [r3, :16] + add r1, r2, #0x4 + add r9, r2, #0x16 + add r8, r2, #0x60 + add r3, r2, #0x1c + vld1.16 {d1[1]}, [r1, :16] + vld1.16 {d3[1]}, [r9, :16] + vld1.16 {d5[1]}, [r8, :16] + vld1.16 {d7[1]}, [r3, :16] + add r1, r2, #0x6 + add r9, r2, #0x8 + add r8, r2, #0x52 + add r3, r2, #0x2a + vld1.16 {d1[2]}, [r1, :16] + vld1.16 {d3[2]}, [r9, :16] + vld1.16 {d5[2]}, [r8, :16] + vld1.16 {d7[2]}, [r3, :16] + add r1, r2, #0x14 + add r9, r2, #0xa + add r8, r2, #0x44 + add r3, r2, #0x38 + vld1.16 {d1[3]}, [r1, :16] + vld1.16 {d3[3]}, [r9, :16] + vld1.16 {d5[3]}, [r8, :16] + vld1.16 {d7[3]}, [r3, :16] + vcgt.s16 q8, q8, q0 + vcgt.s16 q9, q9, q1 + vcgt.s16 q10, q10, q2 + vcgt.s16 q11, q11, q3 + vabs.s16 q0, q0 + vabs.s16 q1, q1 + vabs.s16 q2, q2 + vabs.s16 q3, q3 + veor q8, q8, q0 + veor q9, q9, q1 + veor q10, q10, q2 + veor q11, q11, q3 + add r9, r4, #0x20 + add r8, r4, #0x80 + add r3, r4, #0xa0 + vclz.i16 q0, q0 + vclz.i16 q1, q1 + vclz.i16 q2, q2 + vclz.i16 q3, q3 + vsub.i16 q0, q14, q0 + vsub.i16 q1, q14, q1 + vsub.i16 q2, q14, q2 + vsub.i16 q3, q14, q3 + vst1.16 {d0, d1, d2, d3}, [r4, :256] + vst1.16 {d4, d5, d6, d7}, [r9, :256] + vshl.s16 q0, q15, q0 + vshl.s16 q1, q15, q1 + vshl.s16 q2, q15, q2 + vshl.s16 q3, q15, q3 + vsub.i16 q0, q0, q15 + vsub.i16 q1, q1, q15 + vsub.i16 q2, q2, q15 + vsub.i16 q3, q3, q15 + vand q8, q8, q0 + vand q9, q9, q1 + vand q10, q10, q2 + vand q11, q11, q3 + vst1.16 {d16, d17, d18, d19}, [r8, :256] + vst1.16 {d20, d21, d22, d23}, [r3, :256] + add r1, r2, #0x46 + add r9, r2, #0x3a + add r8, r2, #0x74 + add r3, r2, #0x6a + vld1.16 {d8[0]}, [r1, :16] + vld1.16 {d10[0]}, [r9, :16] + vld1.16 {d12[0]}, [r8, :16] + vld1.16 {d14[0]}, [r3, :16] + veor q8, q8, q8 + veor q9, q9, q9 + veor q10, q10, q10 + veor q11, q11, q11 + add r1, r2, #0x54 + add r9, r2, #0x2c + add r8, r2, #0x76 + add r3, r2, #0x78 + vld1.16 {d8[1]}, [r1, :16] + vld1.16 {d10[1]}, [r9, :16] + vld1.16 {d12[1]}, [r8, :16] + vld1.16 {d14[1]}, [r3, :16] + add r1, r2, #0x62 + add r9, r2, #0x1e + add r8, r2, #0x68 + add r3, r2, #0x7a + vld1.16 {d8[2]}, [r1, :16] + vld1.16 {d10[2]}, [r9, :16] + vld1.16 {d12[2]}, [r8, :16] + vld1.16 {d14[2]}, [r3, :16] + add r1, r2, #0x70 + add r9, r2, #0x2e + add r8, r2, #0x5a + add r3, r2, #0x6c + vld1.16 {d8[3]}, [r1, :16] + vld1.16 {d10[3]}, [r9, :16] + vld1.16 {d12[3]}, [r8, :16] + vld1.16 {d14[3]}, [r3, :16] + add r1, r2, #0x72 + add r9, r2, #0x3c + add r8, r2, #0x4c + add r3, r2, #0x5e + vld1.16 {d9[0]}, [r1, :16] + vld1.16 {d11[0]}, [r9, :16] + vld1.16 {d13[0]}, [r8, :16] + vld1.16 {d15[0]}, [r3, :16] + add r1, r2, #0x64 + add r9, r2, #0x4a + add r8, r2, #0x3e + add r3, r2, #0x6e + vld1.16 {d9[1]}, [r1, :16] + vld1.16 {d11[1]}, [r9, :16] + vld1.16 {d13[1]}, [r8, :16] + vld1.16 {d15[1]}, [r3, :16] + add r1, r2, #0x56 + add r9, r2, #0x58 + add r8, r2, #0x4e + add r3, r2, #0x7c + vld1.16 {d9[2]}, [r1, :16] + vld1.16 {d11[2]}, [r9, :16] + vld1.16 {d13[2]}, [r8, :16] + vld1.16 {d15[2]}, [r3, :16] + add r1, r2, #0x48 + add r9, r2, #0x66 + add r8, r2, #0x5c + add r3, r2, #0x7e + vld1.16 {d9[3]}, [r1, :16] + vld1.16 {d11[3]}, [r9, :16] + vld1.16 {d13[3]}, [r8, :16] + vld1.16 {d15[3]}, [r3, :16] + vcgt.s16 q8, q8, q4 + vcgt.s16 q9, q9, q5 + vcgt.s16 q10, q10, q6 + vcgt.s16 q11, q11, q7 + vabs.s16 q4, q4 + vabs.s16 q5, q5 + vabs.s16 q6, q6 + vabs.s16 q7, q7 + veor q8, q8, q4 + veor q9, q9, q5 + veor q10, q10, q6 + veor q11, q11, q7 + add r1, r4, #0x40 + add r9, r4, #0x60 + add r8, r4, #0xc0 + add r3, r4, #0xe0 + vclz.i16 q4, q4 + vclz.i16 q5, q5 + vclz.i16 q6, q6 + vclz.i16 q7, q7 + vsub.i16 q4, q14, q4 + vsub.i16 q5, q14, q5 + vsub.i16 q6, q14, q6 + vsub.i16 q7, q14, q7 + vst1.16 {d8, d9, d10, d11}, [r1, :256] + vst1.16 {d12, d13, d14, d15}, [r9, :256] + vshl.s16 q4, q15, q4 + vshl.s16 q5, q15, q5 + vshl.s16 q6, q15, q6 + vshl.s16 q7, q15, q7 + vsub.i16 q4, q4, q15 + vsub.i16 q5, q5, q15 + vsub.i16 q6, q6, q15 + vsub.i16 q7, q7, q15 + vand q8, q8, q4 + vand q9, q9, q5 + vand q10, q10, q6 + vand q11, q11, q7 + vst1.16 {d16, d17, d18, d19}, [r8, :256] + vst1.16 {d20, d21, d22, d23}, [r3, :256] + ldr r12, [r7, #0xc] /* r12 = actbl */ + add r1, lr, #0x400 /* r1 = dctbl->ehufsi */ + mov r9, r12 /* r9 = actbl */ + add r6, r4, #0x80 /* r6 = t2 */ + ldr r11, [r0, #0x8] /* r11 = put_buffer */ + ldr r4, [r0, #0xc] /* r4 = put_bits */ + ldrh r2, [r6, #-128] /* r2 = nbits */ + ldrh r3, [r6] /* r3 = temp2 & (((JLONG) 1)<ehufsi */ + ldrsb r6, [r5, #0xf0] /* r6 = actbl->ehufsi[0xf0] */ + veor q8, q8, q8 + vceq.i16 q0, q0, q8 + vceq.i16 q1, q1, q8 + vceq.i16 q2, q2, q8 + vceq.i16 q3, q3, q8 + vceq.i16 q4, q4, q8 + vceq.i16 q5, q5, q8 + vceq.i16 q6, q6, q8 + vceq.i16 q7, q7, q8 + vmovn.i16 d0, q0 + vmovn.i16 d2, q1 + vmovn.i16 d4, q2 + vmovn.i16 d6, q3 + vmovn.i16 d8, q4 + vmovn.i16 d10, q5 + vmovn.i16 d12, q6 + vmovn.i16 d14, q7 + vand d0, d0, d26 + vand d2, d2, d26 + vand d4, d4, d26 + vand d6, d6, d26 + vand d8, d8, d26 + vand d10, d10, d26 + vand d12, d12, d26 + vand d14, d14, d26 + vpadd.i8 d0, d0, d2 + vpadd.i8 d4, d4, d6 + vpadd.i8 d8, d8, d10 + vpadd.i8 d12, d12, d14 + vpadd.i8 d0, d0, d4 + vpadd.i8 d8, d8, d12 + vpadd.i8 d0, d0, d8 + vmov.32 r1, d0[1] + vmov.32 r8, d0[0] + mvn r1, r1 + mvn r8, r8 + lsrs r1, r1, #0x1 + rrx r8, r8 /* shift in last r1 bit while shifting out DC bit */ + rbit r1, r1 /* r1 = index1 */ + rbit r8, r8 /* r8 = index0 */ + ldr r0, [r9, #0x3c0] /* r0 = actbl->ehufco[0xf0] */ + str r1, [sp, #0x14] /* index1 > sp + 0x14 */ + cmp r8, #0x0 + beq 6f 1: - clz r2, r8 - add lr, lr, r2, lsl #1 - lsl r8, r8, r2 - ldrh r1, [lr, #-126] + clz r2, r8 + add lr, lr, r2, lsl #1 + lsl r8, r8, r2 + ldrh r1, [lr, #-126] 2: - cmp r2, #0x10 - blt 3f - sub r2, r2, #0x10 - put_bits r11, r4, r0, r6 - cmp r4, #0x10 - blt 2b - eor r3, r3, r3 - emit_byte r10, r11, r4, r3, r12 - emit_byte r10, r11, r4, r3, r12 - b 2b + cmp r2, #0x10 + blt 3f + sub r2, r2, #0x10 + put_bits r11, r4, r0, r6 + cmp r4, #0x10 + blt 2b + eor r3, r3, r3 + emit_byte r10, r11, r4, r3, r12 + emit_byte r10, r11, r4, r3, r12 + b 2b 3: - add r2, r1, r2, lsl #4 - ldrh r3, [lr, #2]! - ldr r12, [r9, r2, lsl #2] - ldrb r2, [r5, r2] - put_bits r11, r4, r12, r2 - checkbuf15 r10, r11, r4, r2, r12 - put_bits r11, r4, r3, r1 - checkbuf15 r10, r11, r4, r2, r12 - lsls r8, r8, #0x1 - bne 1b + add r2, r1, r2, lsl #4 + ldrh r3, [lr, #2]! + ldr r12, [r9, r2, lsl #2] + ldrb r2, [r5, r2] + put_bits r11, r4, r12, r2 + checkbuf15 r10, r11, r4, r2, r12 + put_bits r11, r4, r3, r1 + checkbuf15 r10, r11, r4, r2, r12 + lsls r8, r8, #0x1 + bne 1b 6: - add r12, sp, #0x20 /* r12 = t1 */ - ldr r8,[sp, #0x14] /* r8 = index1 */ - adds r12, #0xc0 /* r12 = t2 + (DCTSIZE2/2) */ - cmp r8, #0x0 - beq 6f - clz r2, r8 - sub r12, r12, lr - lsl r8, r8, r2 - add r2, r2, r12, lsr #1 - add lr, lr, r2, lsl #1 - b 7f + add r12, sp, #0x20 /* r12 = t1 */ + ldr r8, [sp, #0x14] /* r8 = index1 */ + adds r12, #0xc0 /* r12 = t2 + (DCTSIZE2/2) */ + cmp r8, #0x0 + beq 6f + clz r2, r8 + sub r12, r12, lr + lsl r8, r8, r2 + add r2, r2, r12, lsr #1 + add lr, lr, r2, lsl #1 + b 7f 1: - clz r2, r8 - add lr, lr, r2, lsl #1 - lsl r8, r8, r2 + clz r2, r8 + add lr, lr, r2, lsl #1 + lsl r8, r8, r2 7: - ldrh r1, [lr, #-126] + ldrh r1, [lr, #-126] 2: - cmp r2, #0x10 - blt 3f - sub r2, r2, #0x10 - put_bits r11, r4, r0, r6 - cmp r4, #0x10 - blt 2b - eor r3, r3, r3 - emit_byte r10, r11, r4, r3, r12 - emit_byte r10, r11, r4, r3, r12 - b 2b + cmp r2, #0x10 + blt 3f + sub r2, r2, #0x10 + put_bits r11, r4, r0, r6 + cmp r4, #0x10 + blt 2b + eor r3, r3, r3 + emit_byte r10, r11, r4, r3, r12 + emit_byte r10, r11, r4, r3, r12 + b 2b 3: - add r2, r1, r2, lsl #4 - ldrh r3, [lr, #2]! - ldr r12, [r9, r2, lsl #2] - ldrb r2, [r5, r2] - put_bits r11, r4, r12, r2 - checkbuf15 r10, r11, r4, r2, r12 - put_bits r11, r4, r3, r1 - checkbuf15 r10, r11, r4, r2, r12 - lsls r8, r8, #0x1 - bne 1b + add r2, r1, r2, lsl #4 + ldrh r3, [lr, #2]! + ldr r12, [r9, r2, lsl #2] + ldrb r2, [r5, r2] + put_bits r11, r4, r12, r2 + checkbuf15 r10, r11, r4, r2, r12 + put_bits r11, r4, r3, r1 + checkbuf15 r10, r11, r4, r2, r12 + lsls r8, r8, #0x1 + bne 1b 6: - add r0, sp, #0x20 - add r0, #0xfe - cmp lr, r0 - bhs 1f - ldr r1, [r9] - ldrb r0, [r5] - put_bits r11, r4, r1, r0 - checkbuf15 r10, r11, r4, r0, r1 + add r0, sp, #0x20 + add r0, #0xfe + cmp lr, r0 + bhs 1f + ldr r1, [r9] + ldrb r0, [r5] + put_bits r11, r4, r1, r0 + checkbuf15 r10, r11, r4, r0, r1 1: - ldr r12, [sp, #0x18] - str r11, [r12, #0x8] - str r4, [r12, #0xc] - add r0, r10, #0x1 - add r4, sp, #0x140 - vld1.64 {d8, d9, d10, d11}, [r4, :128]! - vld1.64 {d12, d13, d14, d15}, [r4, :128] - sub r4, r7, #0x1c - mov sp, r4 - pop {r4, r5, r6, r7, r8, r9, r10, r11, pc} + ldr r12, [sp, #0x18] + str r11, [r12, #0x8] + str r4, [r12, #0xc] + add r0, r10, #0x1 + add r4, sp, #0x140 + vld1.64 {d8, d9, d10, d11}, [r4, :128]! + vld1.64 {d12, d13, d14, d15}, [r4, :128] + sub r4, r7, #0x1c + mov sp, r4 + pop {r4, r5, r6, r7, r8, r9, r10, r11, pc} .purgem emit_byte .purgem put_bits From fe11699d90c8dd4feac5bb3e1d87cc310b22712a Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 3 Feb 2016 14:02:13 -0600 Subject: [PATCH 094/140] Adjust performance claims Document the latest benchmarks on the Nexus 5X and change the "2-4x" overall claim to "2-6x". The peak performance on x86 platforms was already closer to 5x, and the addition of SIMD-accelerated Huffman encoding gave it that extra push over the cliff. --- ChangeLog.txt | 17 ++++++++++++----- README.md | 28 ++++++++++++++-------------- release/ReadMe.txt | 2 +- release/deb-control.tmpl | 2 +- release/libjpeg-turbo.spec.in | 2 +- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index a0e39d10..16b264d4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -69,21 +69,28 @@ setting the JSIMD_NOHUFFENC environment variable to 1. [13] Added SIMD acceleration for Huffman encoding on NEON-capable ARM 32-bit platforms. This speeds up the compression of full-color JPEGs by about 30% on -average. For the purposes of benchmarking or regression testing, -SIMD-accelerated Huffman encoding can be disabled by setting the -JSIMD_NOHUFFENC environment variable to 1. +average on a Cortex-A9 core (iPhone 4S) and by about 6-7% on average on +Cortex-A53 and Cortex-A57 cores. For the purposes of benchmarking or +regression testing, SIMD-accelerated Huffman encoding can be disabled by +setting the JSIMD_NOHUFFENC environment variable to 1. [14] Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used compression algorithms (including the slow integer forward DCT and h2v2 & h2v1 downsampling algorithms, which are not accelerated in the 32-bit NEON -implementation.) This speeds up the overall 64-bit compression performance by -about 2x on ARMv8 processors. +implementation.) This speeds up the compression of full-color JPEGs by about +75% on average on a Cavium ThunderX processor and by about 2-2.5x on average on +Cortex-A53 and Cortex-A57 cores. [15] pkg-config (.pc) scripts are now included for both the libjpeg and TurboJPEG API libraries on Un*x systems. Note that if a project's build system relies on these scripts, then it will not be possible to build that project with libjpeg or with a prior version of libjpeg-turbo. +[16] Optimized the ARM 64-bit (ARMv8) NEON SIMD decompression routines to +improve performance on CPUs with in-order pipelines. This speeds up the +decompression of full-color JPEGs by nearly 2x on average on a Cavium ThunderX +processor and by about 15% on average on a Cortex-A53 core. + 1.4.2 ===== diff --git a/README.md b/README.md index 1d3c3da5..ad614ca6 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Background libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is -generally 2-4x as fast as libjpeg, all else being equal. On other types of +generally 2-6x as fast as libjpeg, all else being equal. On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. @@ -36,7 +36,7 @@ Using libjpeg-turbo libjpeg-turbo includes two APIs that can be used to compress and decompress JPEG images: -- **TurboJPEG API** +- **TurboJPEG API** This API provides an easy-to-use interface for compressing and decompressing JPEG images in memory. It also provides some functionality that would not be straightforward to achieve using the underlying libjpeg API, such as @@ -44,7 +44,7 @@ JPEG images: transforms on an image. The Java interface for libjpeg-turbo is written on top of the TurboJPEG API. -- **libjpeg API** +- **libjpeg API** This is the de facto industry-standard API for compressing and decompressing JPEG images. It is more difficult to use than the TurboJPEG API but also more powerful. The libjpeg API implementation in libjpeg-turbo is both @@ -135,17 +135,17 @@ which aren't. #### Fully supported -- **libjpeg: IDCT scaling extensions in decompressor** +- **libjpeg: IDCT scaling extensions in decompressor** libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8, 1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4 and 1/2 are SIMD-accelerated.) - **libjpeg: Arithmetic coding** -- **libjpeg: In-memory source and destination managers** +- **libjpeg: In-memory source and destination managers** See notes below. -- **cjpeg: Separate quality settings for luminance and chrominance** +- **cjpeg: Separate quality settings for luminance and chrominance** Note that the libpjeg v7+ API was extended to accommodate this feature only for convenience purposes. It has always been possible to implement this feature with libjpeg v6b (see rdswitch.c for an example.) @@ -174,15 +174,15 @@ http://www.libjpeg-turbo.org/About/SmartScale and draw his/her own conclusions, but it is the general belief of our project that these features have not demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo. -- **libjpeg: DCT scaling in compressor** - `cinfo.scale_num` and `cinfo.scale_denom` are silently ignored. +- **libjpeg: DCT scaling in compressor** + `cinfo.scale_num` and `cinfo.scale_denom` are silently ignored. There is no technical reason why DCT scaling could not be supported when emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and 8/9 would be available, which is of limited usefulness. -- **libjpeg: SmartScale** - `cinfo.block_size` is silently ignored. +- **libjpeg: SmartScale** + `cinfo.block_size` is silently ignored. SmartScale is an extension to the JPEG format that allows for DCT block sizes other than 8x8. Providing support for this new format would be feasible (particularly without full acceleration.) However, until/unless @@ -194,15 +194,15 @@ demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo. interest in providing this feature would be as a means of supporting additional DCT scaling factors. -- **libjpeg: Fancy downsampling in compressor** - `cinfo.do_fancy_downsampling` is silently ignored. +- **libjpeg: Fancy downsampling in compressor** + `cinfo.do_fancy_downsampling` is silently ignored. This requires the DCT scaling feature, which is not supported. -- **jpegtran: Scaling** +- **jpegtran: Scaling** This requires both the DCT scaling and SmartScale features, which are not supported. -- **Lossless RGB JPEG files** +- **Lossless RGB JPEG files** This requires the SmartScale feature, which is not supported. ### What About libjpeg v9? diff --git a/release/ReadMe.txt b/release/ReadMe.txt index 2f00e8ae..7fb8d0f6 100644 --- a/release/ReadMe.txt +++ b/release/ReadMe.txt @@ -1,4 +1,4 @@ -libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is generally 2-4x as fast as libjpeg, all else being equal. On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. +libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg, all else being equal. On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. libjpeg-turbo implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API. libjpeg-turbo also features colorspace extensions that allow it to compress from/decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java interface. diff --git a/release/deb-control.tmpl b/release/deb-control.tmpl index 1a6242b2..681721d3 100644 --- a/release/deb-control.tmpl +++ b/release/deb-control.tmpl @@ -11,7 +11,7 @@ Description: A SIMD-accelerated JPEG codec that provides both the libjpeg and Tu libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is - generally 2-4x as fast as libjpeg, all else being equal. On other types of + generally 2-6x as fast as libjpeg, all else being equal. On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG diff --git a/release/libjpeg-turbo.spec.in b/release/libjpeg-turbo.spec.in index 3e0dfa2e..74ee3004 100644 --- a/release/libjpeg-turbo.spec.in +++ b/release/libjpeg-turbo.spec.in @@ -46,7 +46,7 @@ Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is -generally 2-4x as fast as libjpeg, all else being equal. On other types of +generally 2-6x as fast as libjpeg, all else being equal. On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. From 8ff67fdb24f5f101a1a72e6614dcc1688653542c Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 6 Feb 2016 12:17:40 -0600 Subject: [PATCH 095/140] Update MinGW Linux build recipe --- BUILDING.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 9075c183..e27bff22 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -734,11 +734,12 @@ mingw64-i686-gcc-g++ packages (and their dependencies) must be installed. ### MinGW Build on Linux cd {build_directory} - CC={mingw_binary_path}/i386-mingw32-gcc \ + CC={mingw_binary_path}/i686-pc-mingw32-gcc \ cmake -G "Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows \ - -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \ - -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \ - {source_directory} + -DCMAKE_RC_COMPILER={mingw_binary_path}/i686-pc-mingw32-windres \ + -DCMAKE_AR={mingw_binary_path}/i686-pc-mingw32-ar \ + -DCMAKE_RANLIB={mingw_binary_path}/i686-pc-mingw32-ranlib \ + {source_directory} make From ce0dd949b20b5b6f850bdff7216a8f3ac20840b4 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 6 Feb 2016 12:18:44 -0600 Subject: [PATCH 096/140] Fix MinGW build jinclude.h can't be safely included multiple times, so instead of including it in the shared (broken-out) headers, it should instead be included by the source files that include one or more of those headers. --- jdapistd.c | 3 ++- jdcoefct.c | 3 ++- jdcoefct.h | 1 - jdmainct.c | 3 ++- jdmainct.h | 1 - jdsample.c | 3 ++- jdsample.h | 1 - 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/jdapistd.c b/jdapistd.c index d134242b..2d00b199 100644 --- a/jdapistd.c +++ b/jdapistd.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2010, 2015, D. R. Commander. + * Copyright (C) 2010, 2015-2016, D. R. Commander. * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. @@ -18,6 +18,7 @@ * whole decompression library into a transcoder. */ +#include "jinclude.h" #include "jdmainct.h" #include "jdcoefct.h" #include "jdsample.h" diff --git a/jdcoefct.c b/jdcoefct.c index baf6bc8c..c51e3ffa 100644 --- a/jdcoefct.c +++ b/jdcoefct.c @@ -5,7 +5,7 @@ * Copyright (C) 1994-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright (C) 2010, 2015, D. R. Commander. + * Copyright (C) 2010, 2015-2016, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -18,6 +18,7 @@ * Also, the input side (only) is used when reading a file for transcoding. */ +#include "jinclude.h" #include "jdcoefct.h" #include "jpegcomp.h" diff --git a/jdcoefct.h b/jdcoefct.h index 55b877a0..28e7a2d9 100644 --- a/jdcoefct.h +++ b/jdcoefct.h @@ -10,7 +10,6 @@ */ #define JPEG_INTERNALS -#include "jinclude.h" #include "jpeglib.h" diff --git a/jdmainct.c b/jdmainct.c index d656b683..ebb069b0 100644 --- a/jdmainct.c +++ b/jdmainct.c @@ -4,7 +4,7 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2010, D. R. Commander. + * Copyright (C) 2010, 2016, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -16,6 +16,7 @@ * supplies the equivalent of the main buffer in that case. */ +#include "jinclude.h" #include "jdmainct.h" diff --git a/jdmainct.h b/jdmainct.h index 3e23aa83..c7de6195 100644 --- a/jdmainct.h +++ b/jdmainct.h @@ -8,7 +8,6 @@ */ #define JPEG_INTERNALS -#include "jinclude.h" #include "jpeglib.h" #include "jpegcomp.h" diff --git a/jdsample.c b/jdsample.c index 276feae2..c9c815a5 100644 --- a/jdsample.c +++ b/jdsample.c @@ -5,7 +5,7 @@ * Copyright (C) 1991-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman for Cendio AB - * Copyright (C) 2010, 2015, D. R. Commander. + * Copyright (C) 2010, 2015-2016, D. R. Commander. * Copyright (C) 2014, MIPS Technologies, Inc., California * For conditions of distribution and use, see the accompanying README.ijg * file. @@ -23,6 +23,7 @@ * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. */ +#include "jinclude.h" #include "jdsample.h" #include "jsimd.h" #include "jpegcomp.h" diff --git a/jdsample.h b/jdsample.h index da905a62..630d07e4 100644 --- a/jdsample.h +++ b/jdsample.h @@ -8,7 +8,6 @@ */ #define JPEG_INTERNALS -#include "jinclude.h" #include "jpeglib.h" From f9134384b728d8943f252b27464d83c4b7b2d159 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 6 Feb 2016 14:09:20 -0600 Subject: [PATCH 097/140] Win: Enable testing cross-compiled builds When cross-compiling, CMakeLists.txt now generates the CTest script using relative paths, so that CTest can more easily be executed on a different machine from the build machine. Furthermore, Windows builds are now tested using md5cmp, just like on Linux, rather than a CMake script. This prevents issues with differing CMake locations between the build and test machines. This also removes some trailing spaces from the md5cmp code and improves the readability of the test code in CMakeLists.txt. --- CMakeLists.txt | 304 ++++++++++++++++---------------------- cmakescripts/md5cmp.cmake | 15 -- md5/CMakeLists.txt | 1 + md5/md5.c | 4 +- md5/md5cmp.c | 3 +- md5/md5hl.c | 21 ++- 6 files changed, 154 insertions(+), 194 deletions(-) delete mode 100644 cmakescripts/md5cmp.cmake create mode 100644 md5/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 308754da..84f0a2df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -320,6 +320,8 @@ add_executable(wrjpgcom wrjpgcom.c) # Tests # +add_subdirectory(md5) + if(MSVC_IDE) set(OBJDIR "\${CTEST_CONFIGURATION_TYPE}/") else() @@ -454,6 +456,13 @@ if(ENABLE_STATIC) set(TEST_LIBTYPES ${TEST_LIBTYPES} static) endif() +set(TESTIMAGES ${CMAKE_SOURCE_DIR}/testimages) +set(MD5CMP ${CMAKE_CURRENT_BINARY_DIR}/md5/md5cmp) +if(CMAKE_CROSSCOMPILING) + file(RELATIVE_PATH TESTIMAGES ${CMAKE_CURRENT_BINARY_DIR} ${TESTIMAGES}) + file(RELATIVE_PATH MD5CMP ${CMAKE_CURRENT_BINARY_DIR} ${MD5CMP}) +endif() + foreach(libtype ${TEST_LIBTYPES}) if(libtype STREQUAL "shared") set(dir sharedlib/) @@ -475,219 +484,186 @@ foreach(libtype ${TEST_LIBTYPES}) # CC: null SAMP: fullsize FDCT: islow ENT: huff add_test(cjpeg${suffix}-rgb-islow - ${dir}cjpeg${suffix} -rgb -dct int -outfile testout_rgb_islow.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + ${dir}cjpeg${suffix} -rgb -dct int + -outfile testout_rgb_islow.jpg ${TESTIMAGES}/testorig.ppm) add_test(cjpeg${suffix}-rgb-islow-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_RGB_ISLOW} -DFILE=testout_rgb_islow.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_RGB_ISLOW} testout_rgb_islow.jpg) + # CC: null SAMP: fullsize IDCT: islow ENT: huff add_test(djpeg${suffix}-rgb-islow - ${dir}djpeg${suffix} -dct int -ppm -outfile testout_rgb_islow.ppm - testout_rgb_islow.jpg) + ${dir}djpeg${suffix} -dct int -ppm + -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg) add_test(djpeg${suffix}-rgb-islow-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_RGB_ISLOW} -DFILE=testout_rgb_islow.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_RGB_ISLOW} testout_rgb_islow.ppm) + if(NOT WITH_12BIT) # CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff add_test(djpeg${suffix}-rgb-islow-565 ${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp -outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg) add_test(djpeg${suffix}-rgb-islow-565-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_RGB_ISLOW_565} - -DFILE=testout_rgb_islow_565.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_RGB_ISLOW_565} testout_rgb_islow_565.bmp) + # CC: RGB->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff add_test(djpeg${suffix}-rgb-islow-565D ${dir}djpeg${suffix} -dct int -rgb565 -bmp -outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg) add_test(djpeg${suffix}-rgb-islow-565D-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_RGB_ISLOW_565D} - -DFILE=testout_rgb_islow_565D.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_RGB_ISLOW_565D} testout_rgb_islow_565D.bmp) endif() # CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff add_test(cjpeg${suffix}-422-ifast-opt ${dir}cjpeg${suffix} -sample 2x1 -dct fast -opt - -outfile testout_422_ifast_opt.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + -outfile testout_422_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm) add_test(cjpeg${suffix}-422-ifast-opt-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_422_IFAST_OPT} - -DFILE=testout_422_ifast_opt.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_422_IFAST_OPT} testout_422_ifast_opt.jpg) + # CC: YCC->RGB SAMP: fullsize/h2v1 fancy IDCT: ifast ENT: huff add_test(djpeg${suffix}-422-ifast - ${dir}djpeg${suffix} -dct fast -outfile testout_422_ifast.ppm - testout_422_ifast_opt.jpg) + ${dir}djpeg${suffix} -dct fast + -outfile testout_422_ifast.ppm testout_422_ifast_opt.jpg) add_test(djpeg${suffix}-422-ifast-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_422_IFAST} -DFILE=testout_422_ifast.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_422_IFAST} testout_422_ifast.ppm) + # CC: YCC->RGB SAMP: h2v1 merged IDCT: ifast ENT: huff add_test(djpeg${suffix}-422m-ifast - ${dir}djpeg${suffix} -dct fast -nosmooth -outfile testout_422m_ifast.ppm - testout_422_ifast_opt.jpg) + ${dir}djpeg${suffix} -dct fast -nosmooth + -outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg) add_test(djpeg${suffix}-422m-ifast-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_422M_IFAST} -DFILE=testout_422m_ifast.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_422M_IFAST} testout_422m_ifast.ppm) + if(NOT WITH_12BIT) # CC: YCC->RGB565 SAMP: h2v1 merged IDCT: ifast ENT: huff add_test(djpeg${suffix}-422m-ifast-565 ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg) add_test(djpeg${suffix}-422m-ifast-565-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_422M_IFAST_565} - -DFILE=testout_422m_ifast_565.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_422M_IFAST_565} testout_422m_ifast_565.bmp) + # CC: YCC->RGB565 (dithered) SAMP: h2v1 merged IDCT: ifast ENT: huff add_test(djpeg${suffix}-422m-ifast-565D ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -bmp -outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg) add_test(djpeg${suffix}-422m-ifast-565D-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_422M_IFAST_565D} - -DFILE=testout_422m_ifast_565D.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_422M_IFAST_565D} testout_422m_ifast_565D.bmp) endif() # CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff add_test(cjpeg${suffix}-420-q100-ifast-prog ${dir}cjpeg${suffix} -sample 2x2 -quality 100 -dct fast -prog - -outfile testout_420_q100_ifast_prog.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + -outfile testout_420_q100_ifast_prog.jpg ${TESTIMAGES}/testorig.ppm) add_test(cjpeg${suffix}-420-q100-ifast-prog-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420_IFAST_Q100_PROG} - -DFILE=testout_420_q100_ifast_prog.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_420_IFAST_Q100_PROG} testout_420_q100_ifast_prog.jpg) + # CC: YCC->RGB SAMP: fullsize/h2v2 fancy IDCT: ifast ENT: prog huff add_test(djpeg${suffix}-420-q100-ifast-prog - ${dir}djpeg${suffix} -dct fast -outfile testout_420_q100_ifast.ppm - testout_420_q100_ifast_prog.jpg) + ${dir}djpeg${suffix} -dct fast + -outfile testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg) add_test(djpeg${suffix}-420-q100-ifast-prog-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_Q100_IFAST} - -DFILE=testout_420_q100_ifast.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_420_Q100_IFAST} testout_420_q100_ifast.ppm) + # CC: YCC->RGB SAMP: h2v2 merged IDCT: ifast ENT: prog huff add_test(djpeg${suffix}-420m-q100-ifast-prog ${dir}djpeg${suffix} -dct fast -nosmooth -outfile testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg) add_test(djpeg${suffix}-420m-q100-ifast-prog-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420M_Q100_IFAST} - -DFILE=testout_420m_q100_ifast.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_420M_Q100_IFAST} testout_420m_q100_ifast.ppm) # CC: RGB->Gray SAMP: fullsize FDCT: islow ENT: huff add_test(cjpeg${suffix}-gray-islow - ${dir}cjpeg${suffix} -gray -dct int -outfile testout_gray_islow.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + ${dir}cjpeg${suffix} -gray -dct int + -outfile testout_gray_islow.jpg ${TESTIMAGES}/testorig.ppm) add_test(cjpeg${suffix}-gray-islow-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_GRAY_ISLOW} - -DFILE=testout_gray_islow.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_GRAY_ISLOW} testout_gray_islow.jpg) + # CC: Gray->Gray SAMP: fullsize IDCT: islow ENT: huff add_test(djpeg${suffix}-gray-islow - ${dir}djpeg${suffix} -dct int -outfile testout_gray_islow.ppm - testout_gray_islow.jpg) + ${dir}djpeg${suffix} -dct int + -outfile testout_gray_islow.ppm testout_gray_islow.jpg) add_test(djpeg${suffix}-gray-islow-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_GRAY_ISLOW} - -DFILE=testout_gray_islow.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_GRAY_ISLOW} testout_gray_islow.ppm) + # CC: Gray->RGB SAMP: fullsize IDCT: islow ENT: huff add_test(djpeg${suffix}-gray-islow-rgb - ${dir}djpeg${suffix} -dct int -rgb -outfile testout_gray_islow_rgb.ppm - testout_gray_islow.jpg) + ${dir}djpeg${suffix} -dct int -rgb + -outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg) add_test(djpeg${suffix}-gray-islow-rgb-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_GRAY_ISLOW_RGB} - -DFILE=testout_gray_islow_rgb.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_GRAY_ISLOW_RGB} testout_gray_islow_rgb.ppm) + if(NOT WITH_12BIT) # CC: Gray->RGB565 SAMP: fullsize IDCT: islow ENT: huff add_test(djpeg${suffix}-gray-islow-565 ${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp -outfile testout_gray_islow_565.bmp testout_gray_islow.jpg) add_test(djpeg${suffix}-gray-islow-565-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_GRAY_ISLOW_565} - -DFILE=testout_gray_islow_565.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_GRAY_ISLOW_565} testout_gray_islow_565.bmp) + # CC: Gray->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff add_test(djpeg${suffix}-gray-islow-565D ${dir}djpeg${suffix} -dct int -rgb565 -bmp -outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg) add_test(djpeg${suffix}-gray-islow-565D-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_GRAY_ISLOW_565D} - -DFILE=testout_gray_islow_565D.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_GRAY_ISLOW_565D} testout_gray_islow_565D.bmp) endif() # CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow # ENT: 2-pass huff add_test(cjpeg${suffix}-420s-ifast-opt - ${dir}cjpeg${suffix} -sample 2x2 -smooth 1 -dct int -opt -outfile - testout_420s_ifast_opt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + ${dir}cjpeg${suffix} -sample 2x2 -smooth 1 -dct int -opt + -outfile testout_420s_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm) add_test(cjpeg${suffix}-420s-ifast-opt-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420S_IFAST_OPT} - -DFILE=testout_420s_ifast_opt.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_420S_IFAST_OPT} testout_420s_ifast_opt.jpg) # CC: RGB->YCC SAMP: fullsize/int FDCT: float ENT: prog huff add_test(cjpeg${suffix}-3x2-float-prog ${dir}cjpeg${suffix} -sample 3x2 -dct float -prog - -outfile testout_3x2_float_prog.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + -outfile testout_3x2_float_prog.jpg ${TESTIMAGES}/testorig.ppm) add_test(cjpeg${suffix}-3x2-float-prog-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_3x2_FLOAT_PROG} - -DFILE=testout_3x2_float_prog.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_3x2_FLOAT_PROG} testout_3x2_float_prog.jpg) + # CC: YCC->RGB SAMP: fullsize/int IDCT: float ENT: prog huff add_test(djpeg${suffix}-3x2-float-prog - ${dir}djpeg${suffix} -dct float -outfile testout_3x2_float.ppm - testout_3x2_float_prog.jpg) + ${dir}djpeg${suffix} -dct float + -outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg) add_test(djpeg${suffix}-3x2-float-prog-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_3x2_FLOAT} -DFILE=testout_3x2_float.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_3x2_FLOAT} testout_3x2_float.ppm) if(WITH_ARITH_ENC) # CC: YCC->RGB SAMP: fullsize/h2v2 FDCT: islow ENT: arith add_test(cjpeg${suffix}-420-islow-ari ${dir}cjpeg${suffix} -dct int -arithmetic - -outfile testout_420_islow_ari.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + -outfile testout_420_islow_ari.jpg ${TESTIMAGES}/testorig.ppm) add_test(cjpeg${suffix}-420-islow-ari-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420_ISLOW_ARI} - -DFILE=testout_420_islow_ari.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_420_ISLOW_ARI} testout_420_islow_ari.jpg) + add_test(jpegtran${suffix}-420-islow-ari ${dir}jpegtran${suffix} -arithmetic - -outfile testout_420_islow_ari.jpg - ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg) + -outfile testout_420_islow_ari.jpg ${TESTIMAGES}/testimgint.jpg) add_test(jpegtran${suffix}-420-islow-ari-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420_ISLOW_ARI} - -DFILE=testout_420_islow_ari.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_420_ISLOW_ARI} testout_420_islow_ari.jpg) + # CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith add_test(cjpeg${suffix}-444-islow-progari ${dir}cjpeg${suffix} -sample 1x1 -dct int -prog -arithmetic - -outfile testout_444_islow_progari.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + -outfile testout_444_islow_progari.jpg ${TESTIMAGES}/testorig.ppm) add_test(cjpeg${suffix}-444-islow-progari-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_444_ISLOW_PROGARI} - -DFILE=testout_444_islow_progari.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_444_ISLOW_PROGARI} testout_444_islow_progari.jpg) endif() + if(WITH_ARITH_DEC) # CC: RGB->YCC SAMP: h2v2 merged IDCT: ifast ENT: arith add_test(djpeg${suffix}-420m-ifast-ari - ${dir}djpeg${suffix} -fast -ppm -outfile testout_420m_ifast_ari.ppm - ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) + ${dir}djpeg${suffix} -fast -ppm + -outfile testout_420m_ifast_ari.ppm ${TESTIMAGES}/testimgari.jpg) add_test(djpeg${suffix}-420m-ifast-ari-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420M_IFAST_ARI} - -DFILE=testout_420m_ifast_ari.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_420M_IFAST_ARI} testout_420m_ifast_ari.ppm) + add_test(jpegtran${suffix}-420-islow - ${dir}jpegtran${suffix} -outfile testout_420_islow.jpg - ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) + ${dir}jpegtran${suffix} + -outfile testout_420_islow.jpg ${TESTIMAGES}/testimgari.jpg) add_test(jpegtran${suffix}-420-islow-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_420_ISLOW} - -DFILE=testout_420_islow.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_420_ISLOW} testout_420_islow.jpg) endif() # 2/1-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 16x16 islow ENT: huff @@ -713,60 +689,46 @@ foreach(libtype ${TEST_LIBTYPES}) string(REGEX REPLACE "_" "/" scalearg ${scale}) add_test(djpeg${suffix}-420m-islow-${scale} ${dir}djpeg${suffix} -dct int -scale ${scalearg} -nosmooth -ppm - -outfile testout_420m_islow_${scale}.ppm - ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) + -outfile testout_420m_islow_${scale}.ppm ${TESTIMAGES}/${TESTORIG}) add_test(djpeg${suffix}-420m-islow-${scale}-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420M_ISLOW_${scale}} - -DFILE=testout_420m_islow_${scale}.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_420M_ISLOW_${scale}} testout_420m_islow_${scale}.ppm) endforeach() if(NOT WITH_12BIT) # CC: YCC->RGB (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff add_test(djpeg${suffix}-420-islow-256 ${dir}djpeg${suffix} -dct int -colors 256 -bmp - -outfile testout_420_islow_256.bmp - ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) + -outfile testout_420_islow_256.bmp ${TESTIMAGES}/${TESTORIG}) add_test(djpeg${suffix}-420-islow-256-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_420_ISLOW_256} - -DFILE=testout_420_islow_256.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_420_ISLOW_256} testout_420_islow_256.bmp) + # CC: YCC->RGB565 SAMP: h2v2 fancy IDCT: islow ENT: huff add_test(djpeg${suffix}-420-islow-565 ${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp - -outfile testout_420_islow_565.bmp - ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) + -outfile testout_420_islow_565.bmp ${TESTIMAGES}/${TESTORIG}) add_test(djpeg${suffix}-420-islow-565-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_420_ISLOW_565} - -DFILE=testout_420_islow_565.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_420_ISLOW_565} testout_420_islow_565.bmp) + # CC: YCC->RGB565 (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff add_test(djpeg${suffix}-420-islow-565D ${dir}djpeg${suffix} -dct int -rgb565 -bmp - -outfile testout_420_islow_565D.bmp - ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) + -outfile testout_420_islow_565D.bmp ${TESTIMAGES}/${TESTORIG}) add_test(djpeg${suffix}-420-islow-565D-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_420_ISLOW_565D} - -DFILE=testout_420_islow_565D.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_420_ISLOW_565D} testout_420_islow_565D.bmp) + # CC: YCC->RGB565 SAMP: h2v2 merged IDCT: islow ENT: huff add_test(djpeg${suffix}-420m-islow-565 ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp - -outfile testout_420m_islow_565.bmp - ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) + -outfile testout_420m_islow_565.bmp ${TESTIMAGES}/${TESTORIG}) add_test(djpeg${suffix}-420m-islow-565-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_420M_ISLOW_565} - -DFILE=testout_420m_islow_565.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_420M_ISLOW_565} testout_420m_islow_565.bmp) + # CC: YCC->RGB565 (dithered) SAMP: h2v2 merged IDCT: islow ENT: huff add_test(djpeg${suffix}-420m-islow-565D ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -bmp - -outfile testout_420m_islow_565D.bmp - ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) + -outfile testout_420m_islow_565D.bmp ${TESTIMAGES}/${TESTORIG}) add_test(djpeg${suffix}-420m-islow-565D-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_BMP_420M_ISLOW_565D} - -DFILE=testout_420m_islow_565D.bmp - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_BMP_420M_ISLOW_565D} testout_420m_islow_565D.bmp) endif() # Partial decode tests. These tests are designed to cover all of the @@ -775,96 +737,90 @@ foreach(libtype ${TEST_LIBTYPES}) # Context rows: Yes Intra-iMCU row: Yes iMCU row prefetch: No ENT: huff add_test(djpeg${suffix}-420-islow-skip15_31 ${dir}djpeg${suffix} -dct int -skip 15,31 -ppm - -outfile testout_420_islow_skip15,31.ppm - ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) + -outfile testout_420_islow_skip15,31.ppm ${TESTIMAGES}/${TESTORIG}) add_test(djpeg${suffix}-420-islow-skip15_31-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_ISLOW_SKIP15_31} - -DFILE=testout_420_islow_skip15,31.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_420_ISLOW_SKIP15_31} testout_420_islow_skip15,31.ppm) + # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: Yes ENT: arith if(WITH_ARITH_DEC) add_test(djpeg${suffix}-420-islow-ari-skip16_139 ${dir}djpeg${suffix} -dct int -skip 16,139 -ppm -outfile testout_420_islow_ari_skip16,139.ppm - ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) + ${TESTIMAGES}/testimgari.jpg) add_test(djpeg${suffix}-420-islow-ari_skip16_139-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_ISLOW_ARI_SKIP16_139} - -DFILE=testout_420_islow_ari_skip16,139.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_SKIP16_139} + testout_420_islow_ari_skip16,139.ppm) endif() + # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff add_test(cjpeg${suffix}-420-islow-prog - ${dir}cjpeg${suffix} -dct int -prog -outfile testout_420_islow_prog.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + ${dir}cjpeg${suffix} -dct int -prog + -outfile testout_420_islow_prog.jpg ${TESTIMAGES}/testorig.ppm) add_test(djpeg${suffix}-420-islow-prog-strip71_132 ${dir}djpeg${suffix} -dct int -strip 71,132 -ppm -outfile testout_420_islow_strip71,132.ppm testout_420_islow_prog.jpg) add_test(djpeg${suffix}-420-islow-prog-strip71_132-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_ISLOW_PROG_STRIP71_132} - -DFILE=testout_420_islow_strip71,132.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_420_ISLOW_PROG_STRIP71_132} + testout_420_islow_strip71,132.ppm) + # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith if(WITH_ARITH_DEC) add_test(djpeg${suffix}-420-islow-ari-strip4_56 ${dir}djpeg${suffix} -dct int -strip 4,56 -ppm -outfile testout_420_islow_ari_strip4,56.ppm - ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) + ${TESTIMAGES}/testimgari.jpg) add_test(djpeg${suffix}-420-islow-ari-strip4_56-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_420_ISLOW_ARI_STRIP4_56} - -DFILE=testout_420_islow_ari_strip4,56.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_STRIP4_56} + testout_420_islow_ari_strip4,56.ppm) endif() + # Context rows: No Intra-iMCU row: Yes ENT: huff add_test(cjpeg${suffix}-444-islow - ${dir}cjpeg${suffix} -dct int -sample 1x1 -outfile testout_444_islow.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + ${dir}cjpeg${suffix} -dct int -sample 1x1 + -outfile testout_444_islow.jpg ${TESTIMAGES}/testorig.ppm) add_test(djpeg${suffix}-444-islow-skip1_6 ${dir}djpeg${suffix} -dct int -skip 1,6 -ppm -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg) add_test(djpeg${suffix}-444-islow-skip1_6-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_444_ISLOW_SKIP1_6} - -DFILE=testout_444_islow_skip1,6.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_444_ISLOW_SKIP1_6} testout_444_islow_skip1,6.ppm) + # Context rows: No Intra-iMCU row: No ENT: prog huff add_test(cjpeg${suffix}-444-islow-prog ${dir}cjpeg${suffix} -dct int -prog -sample 1x1 - -outfile testout_444_islow_prog.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + -outfile testout_444_islow_prog.jpg ${TESTIMAGES}/testorig.ppm) add_test(djpeg${suffix}-444-islow-prog-strip13_110 ${dir}djpeg${suffix} -dct int -strip 13,110 -ppm - -outfile testout_444_islow_prog_strip13,110.ppm testout_444_islow_prog.jpg) + -outfile testout_444_islow_prog_strip13,110.ppm + testout_444_islow_prog.jpg) add_test(djpeg${suffix}-444-islow-prog_strip13_110-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_444_ISLOW_PROG_STRIP13_110} - -DFILE=testout_444_islow_prog_strip13,110.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_444_ISLOW_PROG_STRIP13_110} + testout_444_islow_prog_strip13,110.ppm) + # Context rows: No Intra-iMCU row: No ENT: arith if(WITH_ARITH_ENC) add_test(cjpeg${suffix}-444-islow-ari ${dir}cjpeg${suffix} -dct int -arithmetic -sample 1x1 - -outfile testout_444_islow_ari.jpg - ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) + -outfile testout_444_islow_ari.jpg ${TESTIMAGES}/testorig.ppm) if(WITH_ARITH_DEC) add_test(djpeg${suffix}-444-islow-ari-strip0_36 ${dir}djpeg${suffix} -dct int -strip 0,36 -ppm -outfile testout_444_islow_ari_strip0,36.ppm testout_444_islow_ari.jpg) add_test(djpeg${suffix}-444-islow-ari-strip0_36-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_PPM_444_ISLOW_ARI_STRIP0_36} - -DFILE=testout_444_islow_ari_strip0,36.ppm - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_PPM_444_ISLOW_ARI_STRIP0_36} + testout_444_islow_ari_strip0,36.ppm) endif() endif() add_test(jpegtran${suffix}-crop ${dir}jpegtran${suffix} -crop 120x90+20+50 -transpose -perfect - -outfile testout_crop.jpg ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG}) + -outfile testout_crop.jpg ${TESTIMAGES}/${TESTORIG}) add_test(jpegtran${suffix}-crop-cmp - ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_CROP} -DFILE=testout_crop.jpg - -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake) + ${MD5CMP} ${MD5_JPEG_CROP} testout_crop.jpg) endforeach() -add_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P +add_custom_target(testclean COMMAND ${MD5CMP} -P ${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake) diff --git a/cmakescripts/md5cmp.cmake b/cmakescripts/md5cmp.cmake deleted file mode 100644 index c315aa8a..00000000 --- a/cmakescripts/md5cmp.cmake +++ /dev/null @@ -1,15 +0,0 @@ -if(NOT MD5) - message(FATAL_ERROR "MD5 not specified") -endif() - -if(NOT FILE) - message(FATAL_ERROR "FILE not specified") -endif() - -file(MD5 ${FILE} MD5FILE) - -if(NOT MD5 STREQUAL MD5FILE) - message(FATAL_ERROR "MD5 of ${FILE} should be ${MD5}, not ${MD5FILE}.") -else() - message(STATUS "${MD5}: OK") -endif() diff --git a/md5/CMakeLists.txt b/md5/CMakeLists.txt new file mode 100644 index 00000000..526ef08b --- /dev/null +++ b/md5/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(md5cmp md5cmp.c md5.c md5hl.c) diff --git a/md5/md5.c b/md5/md5.c index b30df974..087f4b02 100644 --- a/md5/md5.c +++ b/md5/md5.c @@ -36,7 +36,7 @@ static void MD5Transform(unsigned int [4], const unsigned char [64]); #if (BYTE_ORDER == LITTLE_ENDIAN) #define Encode memcpy #define Decode memcpy -#else +#else /* * OS X doesn't have le32toh() or htole32() @@ -134,7 +134,7 @@ MD5Init (context) context->state[3] = 0x10325476; } -/* +/* * MD5 block update operation. Continues an MD5 message-digest * operation, processing another message block, and updating the * context. diff --git a/md5/md5cmp.c b/md5/md5cmp.c index 07acda45..dfd60bd3 100644 --- a/md5/md5cmp.c +++ b/md5/md5cmp.c @@ -1,5 +1,5 @@ /* - * Copyright (C)2013 D. R. Commander. All Rights Reserved. + * Copyright (C)2013, 2016 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,6 +30,7 @@ #include #include #include "./md5.h" +#include "../tjutil.h" int main(int argc, char *argv[]) { diff --git a/md5/md5hl.c b/md5/md5hl.c index eaa41e27..d2b7ca45 100644 --- a/md5/md5hl.c +++ b/md5/md5hl.c @@ -4,12 +4,25 @@ * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- + * libjpeg-turbo Modifications: + * Copyright (C) 2016, D. R. Commander + * Modifications are under the same license as the original code (see above) + * ---------------------------------------------------------------------------- */ #include #include #include +#ifdef _WIN32 +#include +#define close _close +#define fstat _fstat +#define lseek _lseek +#define read _read +#define stat _stat +#else #include +#endif #include #include @@ -55,7 +68,11 @@ MD5FileChunk(const char *filename, char *buf, off_t ofs, off_t len) off_t n; MD5Init(&ctx); +#if _WIN32 + f = _open(filename, O_RDONLY|O_BINARY); +#else f = open(filename, O_RDONLY); +#endif if (f < 0) return 0; if (fstat(f, &stbuf) < 0) @@ -73,11 +90,11 @@ MD5FileChunk(const char *filename, char *buf, off_t ofs, off_t len) i = read(f, buffer, sizeof(buffer)); else i = read(f, buffer, n); - if (i < 0) + if (i < 0) break; MD5Update(&ctx, buffer, i); n -= i; - } + } e = errno; close(f); errno = e; From 2d623257545f8e24f837ee53502a9ebddd786fc4 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 6 Feb 2016 16:03:57 -0600 Subject: [PATCH 098/140] Fix Visual C++ compiler warnings Somehow this got reverted with aa769febf25c64f115c2a237516b0c7d65f651cd. Oops. --- rdppm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rdppm.c b/rdppm.c index f496ab36..a2491422 100644 --- a/rdppm.c +++ b/rdppm.c @@ -99,7 +99,8 @@ read_pbm_integer (j_compress_ptr cinfo, FILE * infile, unsigned int maxval) /* Note that on a 16-bit-int machine, only values up to 64k can be read. */ /* This should not be a problem in practice. */ { - register int ch, val; + register int ch; + register unsigned int val; /* Skip any leading whitespace */ do { From 45bbe06ec5a3a88c9e348ddbd5a41bcd6952e6df Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 6 Feb 2016 16:04:29 -0600 Subject: [PATCH 099/140] Un*x: Enable testing cross-compiled builds Don't include the all: target as a dependency of the tests when cross-compiling, and ensure that the files generated by the tests are removed, even if they were created read-only (or if the tests are being run on a different type of system that doesn't correctly interpret the file permissions.) This allows one to easily build the code on one machine and run 'make test' on another. --- Makefile.am | 116 ++++++++++++++++++++++++++++----------------------- configure.ac | 1 + 2 files changed, 65 insertions(+), 52 deletions(-) diff --git a/Makefile.am b/Makefile.am index 2928a7a1..21f61e40 100644 --- a/Makefile.am +++ b/Makefile.am @@ -282,7 +282,11 @@ endif .PHONY: test test: tjquicktest tjbittest bittest +if CROSS_COMPILING +tjquicktest: testclean +else tjquicktest: testclean all +endif if WITH_TURBOJPEG if WITH_JAVA @@ -301,7 +305,11 @@ endif endif echo GREAT SUCCESS! +if CROSS_COMPILING +tjbittest: testclean +else tjbittest: testclean all +endif if WITH_TURBOJPEG @@ -342,7 +350,7 @@ MD5_PPM_444_TILE = 7964e41e67cfb8d0a587c0aa4798f9c3 for i in 8 16 32 64 128; do \ md5/md5cmp $(MD5_PPM_444_TILE) testout_tile_444_Q95_$$i\x$$i.ppm; \ done - rm testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* + rm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* ./tjbench testout_tile.ppm 95 -rgb -fastupsample -quiet -tile -benchtime 0.01 >/dev/null 2>&1 md5/md5cmp $(MD5_PPM_420M_8x8_TILE) testout_tile_420_Q95_8x8.ppm @@ -353,12 +361,16 @@ MD5_PPM_444_TILE = 7964e41e67cfb8d0a587c0aa4798f9c3 for i in 16 32 64 128; do \ md5/md5cmp $(MD5_PPM_422M_TILE) testout_tile_422_Q95_$$i\x$$i.ppm; \ done - rm testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* testout_tile.ppm + rm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* testout_tile.ppm echo GREAT SUCCESS! endif +if CROSS_COMPILING +bittest: testclean +else bittest: testclean all +endif # These tests are carefully crafted to provide full coverage of as many of the # underlying algorithms as possible (including all of the SIMD-accelerated @@ -370,18 +382,18 @@ bittest: testclean all # CC: null SAMP: fullsize IDCT: islow ENT: huff ./djpeg -dct int -ppm -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg md5/md5cmp $(MD5_PPM_RGB_ISLOW) testout_rgb_islow.ppm - rm testout_rgb_islow.ppm + rm -f testout_rgb_islow.ppm if WITH_12BIT - rm testout_rgb_islow.jpg + rm -f testout_rgb_islow.jpg else # CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff ./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg md5/md5cmp $(MD5_BMP_RGB_ISLOW_565) testout_rgb_islow_565.bmp - rm testout_rgb_islow_565.bmp + rm -f testout_rgb_islow_565.bmp # CC: RGB->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff ./djpeg -dct int -rgb565 -bmp -outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg md5/md5cmp $(MD5_BMP_RGB_ISLOW_565D) testout_rgb_islow_565D.bmp - rm testout_rgb_islow_565D.bmp testout_rgb_islow.jpg + rm -f testout_rgb_islow_565D.bmp testout_rgb_islow.jpg endif # CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff @@ -390,22 +402,22 @@ endif # CC: YCC->RGB SAMP: fullsize/h2v1 fancy IDCT: ifast ENT: huff ./djpeg -dct fast -outfile testout_422_ifast.ppm testout_422_ifast_opt.jpg md5/md5cmp $(MD5_PPM_422_IFAST) testout_422_ifast.ppm - rm testout_422_ifast.ppm + rm -f testout_422_ifast.ppm # CC: YCC->RGB SAMP: h2v1 merged IDCT: ifast ENT: huff ./djpeg -dct fast -nosmooth -outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg md5/md5cmp $(MD5_PPM_422M_IFAST) testout_422m_ifast.ppm - rm testout_422m_ifast.ppm + rm -f testout_422m_ifast.ppm if WITH_12BIT - rm testout_422_ifast_opt.jpg + rm -f testout_422_ifast_opt.jpg else # CC: YCC->RGB565 SAMP: h2v1 merged IDCT: ifast ENT: huff ./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg md5/md5cmp $(MD5_BMP_422M_IFAST_565) testout_422m_ifast_565.bmp - rm testout_422m_ifast_565.bmp + rm -f testout_422m_ifast_565.bmp # CC: YCC->RGB565 (dithered) SAMP: h2v1 merged IDCT: ifast ENT: huff ./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg md5/md5cmp $(MD5_BMP_422M_IFAST_565D) testout_422m_ifast_565D.bmp - rm testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg + rm -f testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg endif # CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff @@ -414,11 +426,11 @@ endif # CC: YCC->RGB SAMP: fullsize/h2v2 fancy IDCT: ifast ENT: prog huff ./djpeg -dct fast -outfile testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg md5/md5cmp $(MD5_PPM_420_Q100_IFAST) testout_420_q100_ifast.ppm - rm testout_420_q100_ifast.ppm + rm -f testout_420_q100_ifast.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: ifast ENT: prog huff ./djpeg -dct fast -nosmooth -outfile testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg md5/md5cmp $(MD5_PPM_420M_Q100_IFAST) testout_420m_q100_ifast.ppm - rm testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg + rm -f testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg # CC: RGB->Gray SAMP: fullsize FDCT: islow ENT: huff ./cjpeg -gray -dct int -outfile testout_gray_islow.jpg $(srcdir)/testimages/testorig.ppm @@ -426,29 +438,29 @@ endif # CC: Gray->Gray SAMP: fullsize IDCT: islow ENT: huff ./djpeg -dct int -outfile testout_gray_islow.ppm testout_gray_islow.jpg md5/md5cmp $(MD5_PPM_GRAY_ISLOW) testout_gray_islow.ppm - rm testout_gray_islow.ppm + rm -f testout_gray_islow.ppm # CC: Gray->RGB SAMP: fullsize IDCT: islow ENT: huff ./djpeg -dct int -rgb -outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg md5/md5cmp $(MD5_PPM_GRAY_ISLOW_RGB) testout_gray_islow_rgb.ppm - rm testout_gray_islow_rgb.ppm + rm -f testout_gray_islow_rgb.ppm if WITH_12BIT - rm testout_gray_islow.jpg + rm -f testout_gray_islow.jpg else # CC: Gray->RGB565 SAMP: fullsize IDCT: islow ENT: huff ./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_gray_islow_565.bmp testout_gray_islow.jpg md5/md5cmp $(MD5_BMP_GRAY_ISLOW_565) testout_gray_islow_565.bmp - rm testout_gray_islow_565.bmp + rm -f testout_gray_islow_565.bmp # CC: Gray->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff ./djpeg -dct int -rgb565 -bmp -outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg md5/md5cmp $(MD5_BMP_GRAY_ISLOW_565D) testout_gray_islow_565D.bmp - rm testout_gray_islow_565D.bmp testout_gray_islow.jpg + rm -f testout_gray_islow_565D.bmp testout_gray_islow.jpg endif # CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow # ENT: 2-pass huff ./cjpeg -sample 2x2 -smooth 1 -dct int -opt -outfile testout_420s_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm md5/md5cmp $(MD5_JPEG_420S_IFAST_OPT) testout_420s_ifast_opt.jpg - rm testout_420s_ifast_opt.jpg + rm -f testout_420s_ifast_opt.jpg # The output of the floating point tests is not validated by default, because # the output differs depending on the type of floating point math used, and @@ -482,7 +494,7 @@ endif elif [ "${FLOATTEST}" = "64bit" ]; then \ md5/md5cmp $(MD5_PPM_3x2_FLOAT_64BIT) testout_3x2_float.ppm; \ fi - rm testout_3x2_float.ppm testout_3x2_float_prog.jpg + rm -f testout_3x2_float.ppm testout_3x2_float_prog.jpg # CC: RGB->YCC SAMP: fullsize/int FDCT: ifast ENT: prog huff ./cjpeg -sample 3x2 -dct fast -prog -outfile testout_3x2_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm @@ -490,101 +502,101 @@ endif # CC: YCC->RGB SAMP: fullsize/int IDCT: ifast ENT: prog huff ./djpeg -dct fast -outfile testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg md5/md5cmp $(MD5_PPM_3x2_IFAST) testout_3x2_ifast.ppm - rm testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg + rm -f testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg if WITH_ARITH_ENC # CC: YCC->RGB SAMP: fullsize/h2v2 FDCT: islow ENT: arith ./cjpeg -dct int -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testorig.ppm md5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg - rm testout_420_islow_ari.jpg + rm -f testout_420_islow_ari.jpg ./jpegtran -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testimgint.jpg md5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg - rm testout_420_islow_ari.jpg + rm -f testout_420_islow_ari.jpg # CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith ./cjpeg -sample 1x1 -dct int -prog -arithmetic -outfile testout_444_islow_progari.jpg $(srcdir)/testimages/testorig.ppm md5/md5cmp $(MD5_JPEG_444_ISLOW_PROGARI) testout_444_islow_progari.jpg - rm testout_444_islow_progari.jpg + rm -f testout_444_islow_progari.jpg endif if WITH_ARITH_DEC # CC: RGB->YCC SAMP: h2v2 merged IDCT: ifast ENT: arith ./djpeg -fast -ppm -outfile testout_420m_ifast_ari.ppm $(srcdir)/testimages/testimgari.jpg md5/md5cmp $(MD5_PPM_420M_IFAST_ARI) testout_420m_ifast_ari.ppm - rm testout_420m_ifast_ari.ppm + rm -f testout_420m_ifast_ari.ppm ./jpegtran -outfile testout_420_islow.jpg $(srcdir)/testimages/testimgari.jpg md5/md5cmp $(MD5_JPEG_420_ISLOW) testout_420_islow.jpg - rm testout_420_islow.jpg + rm -f testout_420_islow.jpg endif # CC: YCC->RGB SAMP: h2v2 merged IDCT: 16x16 islow ENT: huff ./djpeg -dct int -scale 2/1 -nosmooth -ppm -outfile testout_420m_islow_2_1.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_2_1) testout_420m_islow_2_1.ppm - rm testout_420m_islow_2_1.ppm + rm -f testout_420m_islow_2_1.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 15x15 islow ENT: huff ./djpeg -dct int -scale 15/8 -nosmooth -ppm -outfile testout_420m_islow_15_8.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_15_8) testout_420m_islow_15_8.ppm - rm testout_420m_islow_15_8.ppm + rm -f testout_420m_islow_15_8.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 13x13 islow ENT: huff ./djpeg -dct int -scale 13/8 -nosmooth -ppm -outfile testout_420m_islow_13_8.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_13_8) testout_420m_islow_13_8.ppm - rm testout_420m_islow_13_8.ppm + rm -f testout_420m_islow_13_8.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 11x11 islow ENT: huff ./djpeg -dct int -scale 11/8 -nosmooth -ppm -outfile testout_420m_islow_11_8.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_11_8) testout_420m_islow_11_8.ppm - rm testout_420m_islow_11_8.ppm + rm -f testout_420m_islow_11_8.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 9x9 islow ENT: huff ./djpeg -dct int -scale 9/8 -nosmooth -ppm -outfile testout_420m_islow_9_8.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_9_8) testout_420m_islow_9_8.ppm - rm testout_420m_islow_9_8.ppm + rm -f testout_420m_islow_9_8.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 7x7 islow/14x14 islow ENT: huff ./djpeg -dct int -scale 7/8 -nosmooth -ppm -outfile testout_420m_islow_7_8.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_7_8) testout_420m_islow_7_8.ppm - rm testout_420m_islow_7_8.ppm + rm -f testout_420m_islow_7_8.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 6x6 islow/12x12 islow ENT: huff ./djpeg -dct int -scale 3/4 -nosmooth -ppm -outfile testout_420m_islow_3_4.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_3_4) testout_420m_islow_3_4.ppm - rm testout_420m_islow_3_4.ppm + rm -f testout_420m_islow_3_4.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 5x5 islow/10x10 islow ENT: huff ./djpeg -dct int -scale 5/8 -nosmooth -ppm -outfile testout_420m_islow_5_8.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_5_8) testout_420m_islow_5_8.ppm - rm testout_420m_islow_5_8.ppm + rm -f testout_420m_islow_5_8.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 4x4 islow/8x8 islow ENT: huff ./djpeg -dct int -scale 1/2 -nosmooth -ppm -outfile testout_420m_islow_1_2.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_1_2) testout_420m_islow_1_2.ppm - rm testout_420m_islow_1_2.ppm + rm -f testout_420m_islow_1_2.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 3x3 islow/6x6 islow ENT: huff ./djpeg -dct int -scale 3/8 -nosmooth -ppm -outfile testout_420m_islow_3_8.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_3_8) testout_420m_islow_3_8.ppm - rm testout_420m_islow_3_8.ppm + rm -f testout_420m_islow_3_8.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 2x2 islow/4x4 islow ENT: huff ./djpeg -dct int -scale 1/4 -nosmooth -ppm -outfile testout_420m_islow_1_4.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_1_4) testout_420m_islow_1_4.ppm - rm testout_420m_islow_1_4.ppm + rm -f testout_420m_islow_1_4.ppm # CC: YCC->RGB SAMP: h2v2 merged IDCT: 1x1 islow/2x2 islow ENT: huff ./djpeg -dct int -scale 1/8 -nosmooth -ppm -outfile testout_420m_islow_1_8.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420M_ISLOW_1_8) testout_420m_islow_1_8.ppm - rm testout_420m_islow_1_8.ppm + rm -f testout_420m_islow_1_8.ppm if WITH_12BIT else # CC: YCC->RGB (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff ./djpeg -dct int -colors 256 -bmp -outfile testout_420_islow_256.bmp $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_BMP_420_ISLOW_256) testout_420_islow_256.bmp - rm testout_420_islow_256.bmp + rm -f testout_420_islow_256.bmp # CC: YCC->RGB565 SAMP: h2v2 fancy IDCT: islow ENT: huff ./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_420_islow_565.bmp $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_BMP_420_ISLOW_565) testout_420_islow_565.bmp - rm testout_420_islow_565.bmp + rm -f testout_420_islow_565.bmp # CC: YCC->RGB565 (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff ./djpeg -dct int -rgb565 -bmp -outfile testout_420_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_BMP_420_ISLOW_565D) testout_420_islow_565D.bmp - rm testout_420_islow_565D.bmp + rm -f testout_420_islow_565D.bmp # CC: YCC->RGB565 SAMP: h2v2 merged IDCT: islow ENT: huff ./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_420m_islow_565.bmp $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_BMP_420M_ISLOW_565) testout_420m_islow_565.bmp - rm testout_420m_islow_565.bmp + rm -f testout_420m_islow_565.bmp # CC: YCC->RGB565 (dithered) SAMP: h2v2 merged IDCT: islow ENT: huff ./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_420m_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_BMP_420M_ISLOW_565D) testout_420m_islow_565D.bmp - rm testout_420m_islow_565D.bmp + rm -f testout_420m_islow_565D.bmp endif # Partial decode tests. These tests are designed to cover all of the possible @@ -593,48 +605,48 @@ endif # Context rows: Yes Intra-iMCU row: Yes iMCU row prefetch: No ENT: huff ./djpeg -dct int -skip 15,31 -ppm -outfile testout_420_islow_skip15,31.ppm $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_PPM_420_ISLOW_SKIP15_31) testout_420_islow_skip15,31.ppm - rm testout_420_islow_skip15,31.ppm + rm -f testout_420_islow_skip15,31.ppm # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: Yes ENT: arith if WITH_ARITH_DEC ./djpeg -dct int -skip 16,139 -ppm -outfile testout_420_islow_ari_skip16,139.ppm $(srcdir)/testimages/testimgari.jpg md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_SKIP16_139) testout_420_islow_ari_skip16,139.ppm - rm testout_420_islow_ari_skip16,139.ppm + rm -f testout_420_islow_ari_skip16,139.ppm endif # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff ./cjpeg -dct int -prog -outfile testout_420_islow_prog.jpg $(srcdir)/testimages/testorig.ppm ./djpeg -dct int -strip 71,132 -ppm -outfile testout_420_islow_prog_strip71,132.ppm testout_420_islow_prog.jpg md5/md5cmp $(MD5_PPM_420_ISLOW_PROG_STRIP71_132) testout_420_islow_prog_strip71,132.ppm - rm testout_420_islow_prog_strip71,132.ppm testout_420_islow_prog.jpg + rm -f testout_420_islow_prog_strip71,132.ppm testout_420_islow_prog.jpg # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith if WITH_ARITH_DEC ./djpeg -dct int -strip 4,56 -ppm -outfile testout_420_islow_ari_strip4,56.ppm $(srcdir)/testimages/testimgari.jpg md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_STRIP4_56) testout_420_islow_ari_strip4,56.ppm - rm testout_420_islow_ari_strip4,56.ppm + rm -f testout_420_islow_ari_strip4,56.ppm endif # Context rows: No Intra-iMCU row: Yes ENT: huff ./cjpeg -dct int -sample 1x1 -outfile testout_444_islow.jpg $(srcdir)/testimages/testorig.ppm ./djpeg -dct int -skip 1,6 -ppm -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg md5/md5cmp $(MD5_PPM_444_ISLOW_SKIP1_6) testout_444_islow_skip1,6.ppm - rm testout_444_islow_skip1,6.ppm testout_444_islow.jpg + rm -f testout_444_islow_skip1,6.ppm testout_444_islow.jpg # Context rows: No Intra-iMCU row: No ENT: prog huff ./cjpeg -dct int -prog -sample 1x1 -outfile testout_444_islow_prog.jpg $(srcdir)/testimages/testorig.ppm ./djpeg -dct int -strip 13,110 -ppm -outfile testout_444_islow_prog_strip13,110.ppm testout_444_islow_prog.jpg md5/md5cmp $(MD5_PPM_444_ISLOW_PROG_STRIP13_110) testout_444_islow_prog_strip13,110.ppm - rm testout_444_islow_prog_strip13,110.ppm testout_444_islow_prog.jpg + rm -f testout_444_islow_prog_strip13,110.ppm testout_444_islow_prog.jpg # Context rows: No Intra-iMCU row: No ENT: arith if WITH_ARITH_ENC ./cjpeg -dct int -arithmetic -sample 1x1 -outfile testout_444_islow_ari.jpg $(srcdir)/testimages/testorig.ppm if WITH_ARITH_DEC ./djpeg -dct int -strip 0,36 -ppm -outfile testout_444_islow_ari_strip0,36.ppm testout_444_islow_ari.jpg md5/md5cmp $(MD5_PPM_444_ISLOW_ARI_STRIP0_36) testout_444_islow_ari_strip0,36.ppm - rm testout_444_islow_ari_strip0,36.ppm + rm -f testout_444_islow_ari_strip0,36.ppm endif - rm testout_444_islow_ari.jpg + rm -f testout_444_islow_ari.jpg endif ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg $(srcdir)/testimages/$(TESTORIG) md5/md5cmp $(MD5_JPEG_CROP) testout_crop.jpg - rm testout_crop.jpg + rm -f testout_crop.jpg echo GREAT SUCCESS! diff --git a/configure.ac b/configure.ac index 6be99fed..9dd4f970 100644 --- a/configure.ac +++ b/configure.ac @@ -532,6 +532,7 @@ AM_CONDITIONAL([SIMD_MIPS], [test "x$simd_arch" = "xmips"]) AM_CONDITIONAL([SIMD_POWERPC], [test "x$simd_arch" = "xpowerpc"]) AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"]) AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"]) +AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"]) AC_ARG_VAR(PKGNAME, [distribution package name (default: libjpeg-turbo)]) if test "x$PKGNAME" = "x"; then From 15aaa7f7e21af6066e22ab18fbd02576078351ff Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 7 Feb 2016 17:39:33 -0600 Subject: [PATCH 100/140] ARM SIMD: Comment tweaks --- simd/jsimd_arm64_neon.S | 2 +- simd/jsimd_arm_neon.S | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index c13a8593..51b07a63 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -1447,7 +1447,7 @@ asm_function jsimd_idct_2x2_neon #if defined(__APPLE__) || defined(__ANDROID__) /* TODO: expand this to include other devices that are known not to have a slow - * ld3 implementation. */ + * st3 implementation. */ #define ST3_IS_FAST #endif diff --git a/simd/jsimd_arm_neon.S b/simd/jsimd_arm_neon.S index c63e5136..aa6d37ae 100644 --- a/simd/jsimd_arm_neon.S +++ b/simd/jsimd_arm_neon.S @@ -2444,9 +2444,9 @@ asm_function jsimd_h2v1_fancy_upsample_neon /* * GLOBAL(JOCTET*) - * jsimd_chuff_encode_one_block (working_state * state, JOCTET *buffer, - * JCOEFPTR block, int last_dc_val, - * c_derived_tbl *dctbl, c_derived_tbl *actbl) + * jsimd_huff_encode_one_block (working_state * state, JOCTET *buffer, + * JCOEFPTR block, int last_dc_val, + * c_derived_tbl *dctbl, c_derived_tbl *actbl) * */ From 219470d6acffbad6fc121adb5486d1c43d25defb Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 7 Feb 2016 20:36:02 -0600 Subject: [PATCH 101/140] ARM64 NEON SIMD implementation of Huffman encoding Full-color compression speedups relative to previous commits: Cortex-A53 (Nexus 5X), Android, 64-bit: 1.1-13% (avg. 6.0%) Cortex-A57 (Nexus 5X), Android, 64-bit: 0.0-22% (avg. 6.3%) Refer to #47 and #50 for discussion Closes #50 Note that this commit introduces a similar /proc/cpuinfo parser to that of the ARM32 implementation. It is used to specifically check whether the code is running on Cavium ThunderX and, if so, disable the ARM64 SIMD Huffman routines (which slow performance by an average of 8% on that CPU.) Based on: https://github.com/mayeut/libjpeg-turbo/commit/a8c282e5e5ac10a715d6d6a9ab22121982b485f6 --- simd/jsimd_arm64.c | 90 +++++++- simd/jsimd_arm64_neon.S | 452 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 541 insertions(+), 1 deletion(-) diff --git a/simd/jsimd_arm64.c b/simd/jsimd_arm64.c index 2b0e6f77..583a62b3 100644 --- a/simd/jsimd_arm64.c +++ b/simd/jsimd_arm64.c @@ -27,6 +27,70 @@ #include static unsigned int simd_support = ~0; +static unsigned int simd_huffman = 1; + +#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) + +#define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024) + +LOCAL(int) +check_cpuinfo (char *buffer, const char *field, char *value) +{ + char *p; + if (*value == 0) + return 0; + if (strncmp(buffer, field, strlen(field)) != 0) + return 0; + buffer += strlen(field); + while (isspace(*buffer)) + buffer++; + + /* Check if 'value' is present in the buffer as a separate word */ + while ((p = strstr(buffer, value))) { + if (p > buffer && !isspace(*(p - 1))) { + buffer++; + continue; + } + p += strlen(value); + if (*p != 0 && !isspace(*p)) { + buffer++; + continue; + } + return 1; + } + return 0; +} + +LOCAL(int) +parse_proc_cpuinfo (int bufsize) +{ + char *buffer = (char *)malloc(bufsize); + FILE *fd; + + if (!buffer) + return 0; + + fd = fopen("/proc/cpuinfo", "r"); + if (fd) { + while (fgets(buffer, bufsize, fd)) { + if (!strchr(buffer, '\n') && !feof(fd)) { + /* "impossible" happened - insufficient size of the buffer! */ + fclose(fd); + free(buffer); + return 0; + } + if (check_cpuinfo(buffer, "CPU part", "0x0a1")) + /* The SIMD version of Huffman encoding is slower than the C version on + Cavium ThunderX. */ + simd_huffman = 0; + } + fclose(fd); + } + free(buffer); + return 1; +} + +#endif /* * Check what SIMD accelerations are supported. @@ -44,6 +108,9 @@ LOCAL(void) init_simd (void) { char *env = NULL; +#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) + int bufsize = 1024; /* an initial guess for the line buffer size limit */ +#endif if (simd_support != ~0U) return; @@ -51,6 +118,13 @@ init_simd (void) simd_support = 0; simd_support |= JSIMD_ARM_NEON; +#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) + while (!parse_proc_cpuinfo(bufsize)) { + bufsize *= 2; + if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT) + break; + } +#endif /* Force different settings through environment variables */ env = getenv("JSIMD_FORCENEON"); @@ -59,6 +133,9 @@ init_simd (void) env = getenv("JSIMD_FORCENONE"); if ((env != NULL) && (strcmp(env, "1") == 0)) simd_support = 0; + env = getenv("JSIMD_NOHUFFENC"); + if ((env != NULL) && (strcmp(env, "1") == 0)) + simd_huffman = 0; } GLOBAL(int) @@ -657,6 +734,16 @@ jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, GLOBAL(int) jsimd_can_huff_encode_one_block (void) { + init_simd(); + + if (DCTSIZE != 8) + return 0; + if (sizeof(JCOEF) != 2) + return 0; + + if (simd_support & JSIMD_ARM_NEON && simd_huffman) + return 1; + return 0; } @@ -665,5 +752,6 @@ jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { - return NULL; + return jsimd_huff_encode_one_block_neon(state, buffer, block, last_dc_val, + dctbl, actbl); } diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index 51b07a63..c1998ba7 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -2961,3 +2961,455 @@ asm_function jsimd_h2v2_downsample_neon .unreq TMP2 .unreq TMP3 .unreq TMPDUP + + +/*****************************************************************************/ + +#define TBL_IS_FAST + +/* + * GLOBAL(JOCTET*) + * jsimd_huff_encode_one_block (working_state * state, JOCTET *buffer, + * JCOEFPTR block, int last_dc_val, + * c_derived_tbl *dctbl, c_derived_tbl *actbl) + * + */ + + BUFFER .req x1 + PUT_BUFFER .req x6 + PUT_BITS .req x7 + PUT_BITSw .req w7 + +.macro emit_byte + sub PUT_BITS, PUT_BITS, #0x8 + lsr x19, PUT_BUFFER, PUT_BITS + uxtb w19, w19 + strb w19, [BUFFER, #1]! + cmp w19, #0xff + b.ne 14f + strb wzr, [BUFFER, #1]! +14: +.endm +.macro put_bits CODE, SIZE + lsl PUT_BUFFER, PUT_BUFFER, \SIZE + add PUT_BITS, PUT_BITS, \SIZE + orr PUT_BUFFER, PUT_BUFFER, \CODE +.endm +.macro checkbuf31 + cmp PUT_BITS, #0x20 + b.lt 31f + emit_byte + emit_byte + emit_byte + emit_byte +31: +.endm +.macro checkbuf47 + cmp PUT_BITS, #0x30 + b.lt 47f + emit_byte + emit_byte + emit_byte + emit_byte + emit_byte + emit_byte +47: +.endm + +.balign 16 +Ljsimd_huff_encode_one_block_neon_consts: + .byte 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, \ + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 +#if defined(TBL_IS_FAST) + .byte 0, 1, 2, 3, 16, 17, 32, 33, \ + 18, 19, 4, 5, 6, 7, 20, 21 /* L0 => L3 : 4 lines OK */ + .byte 34, 35, 48, 49, 255, 255, 50, 51, \ + 36, 37, 22, 23, 8, 9, 10, 11 /* L0 => L3 : 4 lines OK */ + .byte 8, 9, 22, 23, 36, 37, 50, 51, \ + 255, 255, 255, 255, 255, 255, 52, 53 /* L1 => L4 : 4 lines OK */ + .byte 54, 55, 40, 41, 26, 27, 12, 13, \ + 14, 15, 28, 29, 42, 43, 56, 57 /* L0 => L3 : 4 lines OK */ + .byte 6, 7, 20, 21, 34, 35, 48, 49, \ + 50, 51, 36, 37, 22, 23, 8, 9 /* L4 => L7 : 4 lines OK */ + .byte 42, 43, 28, 29, 14, 15, 30, 31, \ + 44, 45, 58, 59, 255, 255, 255, 255 /* L1 => L4 : 4 lines OK */ + .byte 255, 255, 255, 255, 56, 57, 42, 43, \ + 28, 29, 14, 15, 30, 31, 44, 45 /* L3 => L6 : 4 lines OK */ + .byte 26, 27, 40, 41, 42, 43, 28, 29, \ + 14, 15, 30, 31, 44, 45, 46, 47 /* L5 => L7 : 3 lines OK */ + .byte 255, 255, 255, 255, 0, 1, 255, 255, \ + 255, 255, 255, 255, 255, 255, 255, 255 /* L4 : 1 lines OK */ + .byte 255, 255, 255, 255, 255, 255, 255, 255, \ + 0, 1, 16, 17, 2, 3, 255, 255 /* L5 => L6 : 2 lines OK */ + .byte 255, 255, 255, 255, 255, 255, 255, 255, \ + 255, 255, 255, 255, 8, 9, 22, 23 /* L5 => L6 : 2 lines OK */ + .byte 4, 5, 6, 7, 255, 255, 255, 255, \ + 255, 255, 255, 255, 255, 255, 255, 255 /* L7 : 1 line OK */ +#endif + +asm_function jsimd_huff_encode_one_block_neon + sub sp, sp, 272 + sub BUFFER, BUFFER, #0x1 /* BUFFER=buffer-- */ + /* Save ARM registers */ + stp x19, x20, [sp], 16 + adr x15, Ljsimd_huff_encode_one_block_neon_consts + ldr PUT_BUFFER, [x0, #0x10] + ldr PUT_BITSw, [x0, #0x18] + ldrsh w12, [x2] /* load DC coeff in w12 */ + /* prepare data */ +#if defined(TBL_IS_FAST) + ld1 {v23.16b}, [x15], #16 + ld1 {v0.16b, v1.16b, v2.16b, v3.16b}, [x15], #64 + ld1 {v4.16b, v5.16b, v6.16b, v7.16b}, [x15], #64 + ld1 {v16.16b, v17.16b, v18.16b, v19.16b}, [x15], #64 + ld1 {v24.16b, v25.16b, v26.16b, v27.16b}, [x2], #64 + ld1 {v28.16b, v29.16b, v30.16b, v31.16b}, [x2], #64 + sub w12, w12, w3 /* last_dc_val, not used afterwards */ + /* ZigZag 8x8 */ + tbl v0.16b, {v24.16b, v25.16b, v26.16b, v27.16b}, v0.16b + tbl v1.16b, {v24.16b, v25.16b, v26.16b, v27.16b}, v1.16b + tbl v2.16b, {v25.16b, v26.16b, v27.16b, v28.16b}, v2.16b + tbl v3.16b, {v24.16b, v25.16b, v26.16b, v27.16b}, v3.16b + tbl v4.16b, {v28.16b, v29.16b, v30.16b, v31.16b}, v4.16b + tbl v5.16b, {v25.16b, v26.16b, v27.16b, v28.16b}, v5.16b + tbl v6.16b, {v27.16b, v28.16b, v29.16b, v30.16b}, v6.16b + tbl v7.16b, {v29.16b, v30.16b, v31.16b}, v7.16b + ins v0.h[0], w12 + tbx v1.16b, {v28.16b}, v16.16b + tbx v2.16b, {v29.16b, v30.16b}, v17.16b + tbx v5.16b, {v29.16b, v30.16b}, v18.16b + tbx v6.16b, {v31.16b}, v19.16b +#else + add x13, x2, #0x22 + sub w12, w12, w3 /* last_dc_val, not used afterwards */ + ld1 {v23.16b}, [x15] + add x14, x2, #0x18 + add x3, x2, #0x36 + ins v0.h[0], w12 + add x9, x2, #0x2 + ld1 {v1.h}[0], [x13] + add x15, x2, #0x30 + ld1 {v2.h}[0], [x14] + add x19, x2, #0x26 + ld1 {v3.h}[0], [x3] + add x20, x2, #0x28 + ld1 {v0.h}[1], [x9] + add x12, x2, #0x10 + ld1 {v1.h}[1], [x15] + add x13, x2, #0x40 + ld1 {v2.h}[1], [x19] + add x14, x2, #0x34 + ld1 {v3.h}[1], [x20] + add x3, x2, #0x1a + ld1 {v0.h}[2], [x12] + add x9, x2, #0x20 + ld1 {v1.h}[2], [x13] + add x15, x2, #0x32 + ld1 {v2.h}[2], [x14] + add x19, x2, #0x42 + ld1 {v3.h}[2], [x3] + add x20, x2, #0xc + ld1 {v0.h}[3], [x9] + add x12, x2, #0x12 + ld1 {v1.h}[3], [x15] + add x13, x2, #0x24 + ld1 {v2.h}[3], [x19] + add x14, x2, #0x50 + ld1 {v3.h}[3], [x20] + add x3, x2, #0xe + ld1 {v0.h}[4], [x12] + add x9, x2, #0x4 + ld1 {v1.h}[4], [x13] + add x15, x2, #0x16 + ld1 {v2.h}[4], [x14] + add x19, x2, #0x60 + ld1 {v3.h}[4], [x3] + add x20, x2, #0x1c + ld1 {v0.h}[5], [x9] + add x12, x2, #0x6 + ld1 {v1.h}[5], [x15] + add x13, x2, #0x8 + ld1 {v2.h}[5], [x19] + add x14, x2, #0x52 + ld1 {v3.h}[5], [x20] + add x3, x2, #0x2a + ld1 {v0.h}[6], [x12] + add x9, x2, #0x14 + ld1 {v1.h}[6], [x13] + add x15, x2, #0xa + ld1 {v2.h}[6], [x14] + add x19, x2, #0x44 + ld1 {v3.h}[6], [x3] + add x20, x2, #0x38 + ld1 {v0.h}[7], [x9] + add x12, x2, #0x46 + ld1 {v1.h}[7], [x15] + add x13, x2, #0x3a + ld1 {v2.h}[7], [x19] + add x14, x2, #0x74 + ld1 {v3.h}[7], [x20] + add x3, x2, #0x6a + ld1 {v4.h}[0], [x12] + add x9, x2, #0x54 + ld1 {v5.h}[0], [x13] + add x15, x2, #0x2c + ld1 {v6.h}[0], [x14] + add x19, x2, #0x76 + ld1 {v7.h}[0], [x3] + add x20, x2, #0x78 + ld1 {v4.h}[1], [x9] + add x12, x2, #0x62 + ld1 {v5.h}[1], [x15] + add x13, x2, #0x1e + ld1 {v6.h}[1], [x19] + add x14, x2, #0x68 + ld1 {v7.h}[1], [x20] + add x3, x2, #0x7a + ld1 {v4.h}[2], [x12] + add x9, x2, #0x70 + ld1 {v5.h}[2], [x13] + add x15, x2, #0x2e + ld1 {v6.h}[2], [x14] + add x19, x2, #0x5a + ld1 {v7.h}[2], [x3] + add x20, x2, #0x6c + ld1 {v4.h}[3], [x9] + add x12, x2, #0x72 + ld1 {v5.h}[3], [x15] + add x13, x2, #0x3c + ld1 {v6.h}[3], [x19] + add x14, x2, #0x4c + ld1 {v7.h}[3], [x20] + add x3, x2, #0x5e + ld1 {v4.h}[4], [x12] + add x9, x2, #0x64 + ld1 {v5.h}[4], [x13] + add x15, x2, #0x4a + ld1 {v6.h}[4], [x14] + add x19, x2, #0x3e + ld1 {v7.h}[4], [x3] + add x20, x2, #0x6e + ld1 {v4.h}[5], [x9] + add x12, x2, #0x56 + ld1 {v5.h}[5], [x15] + add x13, x2, #0x58 + ld1 {v6.h}[5], [x19] + add x14, x2, #0x4e + ld1 {v7.h}[5], [x20] + add x3, x2, #0x7c + ld1 {v4.h}[6], [x12] + add x9, x2, #0x48 + ld1 {v5.h}[6], [x13] + add x15, x2, #0x66 + ld1 {v6.h}[6], [x14] + add x19, x2, #0x5c + ld1 {v7.h}[6], [x3] + add x20, x2, #0x7e + ld1 {v4.h}[7], [x9] + ld1 {v5.h}[7], [x15] + ld1 {v6.h}[7], [x19] + ld1 {v7.h}[7], [x20] +#endif + cmlt v24.8h, v0.8h, #0 + cmlt v25.8h, v1.8h, #0 + cmlt v26.8h, v2.8h, #0 + cmlt v27.8h, v3.8h, #0 + cmlt v28.8h, v4.8h, #0 + cmlt v29.8h, v5.8h, #0 + cmlt v30.8h, v6.8h, #0 + cmlt v31.8h, v7.8h, #0 + abs v0.8h, v0.8h + abs v1.8h, v1.8h + abs v2.8h, v2.8h + abs v3.8h, v3.8h + abs v4.8h, v4.8h + abs v5.8h, v5.8h + abs v6.8h, v6.8h + abs v7.8h, v7.8h + eor v24.16b, v24.16b, v0.16b + eor v25.16b, v25.16b, v1.16b + eor v26.16b, v26.16b, v2.16b + eor v27.16b, v27.16b, v3.16b + eor v28.16b, v28.16b, v4.16b + eor v29.16b, v29.16b, v5.16b + eor v30.16b, v30.16b, v6.16b + eor v31.16b, v31.16b, v7.16b + cmeq v16.8h, v0.8h, #0 + cmeq v17.8h, v1.8h, #0 + cmeq v18.8h, v2.8h, #0 + cmeq v19.8h, v3.8h, #0 + cmeq v20.8h, v4.8h, #0 + cmeq v21.8h, v5.8h, #0 + cmeq v22.8h, v6.8h, #0 + xtn v16.8b, v16.8h + xtn v18.8b, v18.8h + xtn v20.8b, v20.8h + xtn v22.8b, v22.8h + umov w14, v0.h[0] + xtn2 v16.16b, v17.8h + umov w13, v24.h[0] + xtn2 v18.16b, v19.8h + clz w14, w14 + xtn2 v20.16b, v21.8h + lsl w13, w13, w14 + cmeq v17.8h, v7.8h, #0 + sub w12, w14, #32 + xtn2 v22.16b, v17.8h + lsr w13, w13, w14 + and v16.16b, v16.16b, v23.16b + neg w12, w12 + and v18.16b, v18.16b, v23.16b + add x3, x4, #0x400 /* r1 = dctbl->ehufsi */ + and v20.16b, v20.16b, v23.16b + add x15, sp, #0x80 /* x15 = t2 */ + and v22.16b, v22.16b, v23.16b + ldr w10, [x4, x12, lsl #2] + addp v16.16b, v16.16b, v18.16b + ldrb w11, [x3, x12] + addp v20.16b, v20.16b, v22.16b + checkbuf47 + addp v16.16b, v16.16b, v20.16b + put_bits x10, x11 + addp v16.16b, v16.16b, v18.16b + checkbuf47 + umov x9,v16.D[0] + put_bits x13, x12 + cnt v17.8b, v16.8b + mvn x9, x9 + addv B18, v17.8b + add x4, x5, #0x400 /* x4 = actbl->ehufsi */ + umov w12, v18.b[0] + lsr x9, x9, #0x1 /* clear AC coeff */ + ldr w13, [x5, #0x3c0] /* x13 = actbl->ehufco[0xf0] */ + rbit x9, x9 /* x9 = index0 */ + ldrb w14, [x4, #0xf0] /* x14 = actbl->ehufsi[0xf0] */ + cmp w12, #(64-8) + mov x11, sp + b.lt 4f + cbz x9, 6f + st1 {v0.8h, v1.8h, v2.8h, v3.8h}, [x11], #64 + st1 {v4.8h, v5.8h, v6.8h, v7.8h}, [x11], #64 + st1 {v24.8h, v25.8h, v26.8h, v27.8h}, [x11], #64 + st1 {v28.8h, v29.8h, v30.8h, v31.8h}, [x11], #64 +1: + clz x2, x9 + add x15, x15, x2, lsl #1 + lsl x9, x9, x2 + ldrh w20, [x15, #-126] +2: + cmp x2, #0x10 + b.lt 3f + sub x2, x2, #0x10 + checkbuf47 + put_bits x13, x14 + b 2b +3: + clz w20, w20 + ldrh w3, [x15, #2]! + sub w11, w20, #32 + lsl w3, w3, w20 + neg w11, w11 + lsr w3, w3, w20 + add x2, x11, x2, lsl #4 + lsl x9, x9, #0x1 + ldr w12, [x5, x2, lsl #2] + ldrb w10, [x4, x2] + checkbuf31 + put_bits x12, x10 + put_bits x3, x11 + cbnz x9, 1b + b 6f +4: + movi v21.8h, #0x0010 + clz v0.8h, v0.8h + clz v1.8h, v1.8h + clz v2.8h, v2.8h + clz v3.8h, v3.8h + clz v4.8h, v4.8h + clz v5.8h, v5.8h + clz v6.8h, v6.8h + clz v7.8h, v7.8h + ushl v24.8h, v24.8h, v0.8h + ushl v25.8h, v25.8h, v1.8h + ushl v26.8h, v26.8h, v2.8h + ushl v27.8h, v27.8h, v3.8h + ushl v28.8h, v28.8h, v4.8h + ushl v29.8h, v29.8h, v5.8h + ushl v30.8h, v30.8h, v6.8h + ushl v31.8h, v31.8h, v7.8h + neg v0.8h, v0.8h + neg v1.8h, v1.8h + neg v2.8h, v2.8h + neg v3.8h, v3.8h + neg v4.8h, v4.8h + neg v5.8h, v5.8h + neg v6.8h, v6.8h + neg v7.8h, v7.8h + ushl v24.8h, v24.8h, v0.8h + ushl v25.8h, v25.8h, v1.8h + ushl v26.8h, v26.8h, v2.8h + ushl v27.8h, v27.8h, v3.8h + ushl v28.8h, v28.8h, v4.8h + ushl v29.8h, v29.8h, v5.8h + ushl v30.8h, v30.8h, v6.8h + ushl v31.8h, v31.8h, v7.8h + add v0.8h, v21.8h, v0.8h + add v1.8h, v21.8h, v1.8h + add v2.8h, v21.8h, v2.8h + add v3.8h, v21.8h, v3.8h + add v4.8h, v21.8h, v4.8h + add v5.8h, v21.8h, v5.8h + add v6.8h, v21.8h, v6.8h + add v7.8h, v21.8h, v7.8h + st1 {v0.8h, v1.8h, v2.8h, v3.8h}, [x11], #64 + st1 {v4.8h, v5.8h, v6.8h, v7.8h}, [x11], #64 + st1 {v24.8h, v25.8h, v26.8h, v27.8h}, [x11], #64 + st1 {v28.8h, v29.8h, v30.8h, v31.8h}, [x11], #64 +1: + clz x2, x9 + add x15, x15, x2, lsl #1 + lsl x9, x9, x2 + ldrh w11, [x15, #-126] +2: + cmp x2, #0x10 + b.lt 3f + sub x2, x2, #0x10 + checkbuf47 + put_bits x13, x14 + b 2b +3: + ldrh w3, [x15, #2]! + add x2, x11, x2, lsl #4 + lsl x9, x9, #0x1 + ldr w12, [x5, x2, lsl #2] + ldrb w10, [x4, x2] + checkbuf31 + put_bits x12, x10 + put_bits x3, x11 + cbnz x9, 1b +6: + add x13, sp, #0xfe + cmp x15, x13 + b.hs 1f + ldr w12, [x5] + ldrb w14, [x4] + checkbuf47 + put_bits x12, x14 +1: + sub sp, sp, 16 + str PUT_BUFFER, [x0, #0x10] + str PUT_BITSw, [x0, #0x18] + ldp x19, x20, [sp], 16 + add x0, BUFFER, #0x1 + add sp, sp, 256 + br x30 + + .unreq BUFFER + .unreq PUT_BUFFER + .unreq PUT_BITS + .unreq PUT_BITSw + +.purgem emit_byte +.purgem put_bits +.purgem checkbuf31 +.purgem checkbuf47 From 46ecffa324be43aab80f6160dc57d98b0a54a704 Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 7 Feb 2016 22:05:56 -0600 Subject: [PATCH 102/140] ARM64: Avoid LD3/ST3 at run time, not compile time ... and only if ThunderX is detected. This can be easily expanded later on to include other CPUs that are known to suffer from slow LD3/ST3, but it doesn't make sense to disable LD3/ST3 for all non-Android Linux platforms just because ThunderX is slow. --- simd/jsimd.h | 14 +++ simd/jsimd_arm64.c | 49 +++++++++-- simd/jsimd_arm64_neon.S | 189 +++++++++++++++++++++------------------- 3 files changed, 156 insertions(+), 96 deletions(-) diff --git a/simd/jsimd.h b/simd/jsimd.h index 1c598f05..a312930f 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -95,6 +95,13 @@ EXTERN(void) jsimd_extxrgb_ycc_convert_neon (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extrgb_ycc_convert_neon_slowld3 + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); +EXTERN(void) jsimd_extbgr_ycc_convert_neon_slowld3 + (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows); + EXTERN(void) jsimd_rgb_ycc_convert_mips_dspr2 (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows); @@ -300,6 +307,13 @@ EXTERN(void) jsimd_ycc_rgb565_convert_neon (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); +EXTERN(void) jsimd_ycc_extrgb_convert_neon_slowst3 + (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); +EXTERN(void) jsimd_ycc_extbgr_convert_neon_slowst3 + (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); + EXTERN(void) jsimd_ycc_rgb_convert_mips_dspr2 (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows); diff --git a/simd/jsimd_arm64.c b/simd/jsimd_arm64.c index 583a62b3..86331622 100644 --- a/simd/jsimd_arm64.c +++ b/simd/jsimd_arm64.c @@ -26,8 +26,12 @@ #include #include +#define JSIMD_FASTLD3 1 +#define JSIMD_FASTST3 2 + static unsigned int simd_support = ~0; static unsigned int simd_huffman = 1; +static unsigned int simd_features = JSIMD_FASTLD3 | JSIMD_FASTST3; #if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) @@ -81,8 +85,9 @@ parse_proc_cpuinfo (int bufsize) } if (check_cpuinfo(buffer, "CPU part", "0x0a1")) /* The SIMD version of Huffman encoding is slower than the C version on - Cavium ThunderX. */ - simd_huffman = 0; + Cavium ThunderX. Also, ld3 and st3 are abyssmally slow on that + CPU. */ + simd_huffman = simd_features = 0; } fclose(fd); } @@ -136,6 +141,16 @@ init_simd (void) env = getenv("JSIMD_NOHUFFENC"); if ((env != NULL) && (strcmp(env, "1") == 0)) simd_huffman = 0; + env = getenv("JSIMD_FASTLD3"); + if ((env != NULL) && (strcmp(env, "1") == 0)) + simd_features |= JSIMD_FASTLD3; + if ((env != NULL) && (strcmp(env, "0") == 0)) + simd_features &= ~JSIMD_FASTLD3; + env = getenv("JSIMD_FASTST3"); + if ((env != NULL) && (strcmp(env, "1") == 0)) + simd_features |= JSIMD_FASTST3; + if ((env != NULL) && (strcmp(env, "0") == 0)) + simd_features &= ~JSIMD_FASTST3; } GLOBAL(int) @@ -210,14 +225,20 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo, switch(cinfo->in_color_space) { case JCS_EXT_RGB: - neonfct=jsimd_extrgb_ycc_convert_neon; + if (simd_features & JSIMD_FASTLD3) + neonfct=jsimd_extrgb_ycc_convert_neon; + else + neonfct=jsimd_extrgb_ycc_convert_neon_slowld3; break; case JCS_EXT_RGBX: case JCS_EXT_RGBA: neonfct=jsimd_extrgbx_ycc_convert_neon; break; case JCS_EXT_BGR: - neonfct=jsimd_extbgr_ycc_convert_neon; + if (simd_features & JSIMD_FASTLD3) + neonfct=jsimd_extbgr_ycc_convert_neon; + else + neonfct=jsimd_extbgr_ycc_convert_neon_slowld3; break; case JCS_EXT_BGRX: case JCS_EXT_BGRA: @@ -232,7 +253,10 @@ jsimd_rgb_ycc_convert (j_compress_ptr cinfo, neonfct=jsimd_extxrgb_ycc_convert_neon; break; default: - neonfct=jsimd_extrgb_ycc_convert_neon; + if (simd_features & JSIMD_FASTLD3) + neonfct=jsimd_extrgb_ycc_convert_neon; + else + neonfct=jsimd_extrgb_ycc_convert_neon_slowld3; break; } @@ -255,14 +279,20 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo, switch(cinfo->out_color_space) { case JCS_EXT_RGB: - neonfct=jsimd_ycc_extrgb_convert_neon; + if (simd_features & JSIMD_FASTST3) + neonfct=jsimd_ycc_extrgb_convert_neon; + else + neonfct=jsimd_ycc_extrgb_convert_neon_slowst3; break; case JCS_EXT_RGBX: case JCS_EXT_RGBA: neonfct=jsimd_ycc_extrgbx_convert_neon; break; case JCS_EXT_BGR: - neonfct=jsimd_ycc_extbgr_convert_neon; + if (simd_features & JSIMD_FASTST3) + neonfct=jsimd_ycc_extbgr_convert_neon; + else + neonfct=jsimd_ycc_extbgr_convert_neon_slowst3; break; case JCS_EXT_BGRX: case JCS_EXT_BGRA: @@ -277,7 +307,10 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo, neonfct=jsimd_ycc_extxrgb_convert_neon; break; default: - neonfct=jsimd_ycc_extrgb_convert_neon; + if (simd_features & JSIMD_FASTST3) + neonfct=jsimd_ycc_extrgb_convert_neon; + else + neonfct=jsimd_ycc_extrgb_convert_neon_slowst3; break; } diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index c1998ba7..3f003ce4 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -1445,12 +1445,6 @@ asm_function jsimd_idct_2x2_neon * Colorspace conversion YCbCr -> RGB */ -#if defined(__APPLE__) || defined(__ANDROID__) -/* TODO: expand this to include other devices that are known not to have a slow - * st3 implementation. */ -#define ST3_IS_FAST -#endif - .macro do_load size .if \size == 8 ld1 {v4.8b}, [U], 8 @@ -1488,44 +1482,44 @@ asm_function jsimd_idct_2x2_neon .endif .endm -.macro do_store bpp, size +.macro do_store bpp, size, fast_st3 .if \bpp == 24 .if \size == 8 -#ifdef ST3_IS_FAST - st3 {v10.8b, v11.8b, v12.8b}, [RGB], 24 -#else - st1 {v10.b}[0], [RGB], #1 - st1 {v11.b}[0], [RGB], #1 - st1 {v12.b}[0], [RGB], #1 + .if \fast_st3 == 1 + st3 {v10.8b, v11.8b, v12.8b}, [RGB], 24 + .else + st1 {v10.b}[0], [RGB], #1 + st1 {v11.b}[0], [RGB], #1 + st1 {v12.b}[0], [RGB], #1 - st1 {v10.b}[1], [RGB], #1 - st1 {v11.b}[1], [RGB], #1 - st1 {v12.b}[1], [RGB], #1 + st1 {v10.b}[1], [RGB], #1 + st1 {v11.b}[1], [RGB], #1 + st1 {v12.b}[1], [RGB], #1 - st1 {v10.b}[2], [RGB], #1 - st1 {v11.b}[2], [RGB], #1 - st1 {v12.b}[2], [RGB], #1 + st1 {v10.b}[2], [RGB], #1 + st1 {v11.b}[2], [RGB], #1 + st1 {v12.b}[2], [RGB], #1 - st1 {v10.b}[3], [RGB], #1 - st1 {v11.b}[3], [RGB], #1 - st1 {v12.b}[3], [RGB], #1 + st1 {v10.b}[3], [RGB], #1 + st1 {v11.b}[3], [RGB], #1 + st1 {v12.b}[3], [RGB], #1 - st1 {v10.b}[4], [RGB], #1 - st1 {v11.b}[4], [RGB], #1 - st1 {v12.b}[4], [RGB], #1 + st1 {v10.b}[4], [RGB], #1 + st1 {v11.b}[4], [RGB], #1 + st1 {v12.b}[4], [RGB], #1 - st1 {v10.b}[5], [RGB], #1 - st1 {v11.b}[5], [RGB], #1 - st1 {v12.b}[5], [RGB], #1 + st1 {v10.b}[5], [RGB], #1 + st1 {v11.b}[5], [RGB], #1 + st1 {v12.b}[5], [RGB], #1 - st1 {v10.b}[6], [RGB], #1 - st1 {v11.b}[6], [RGB], #1 - st1 {v12.b}[6], [RGB], #1 + st1 {v10.b}[6], [RGB], #1 + st1 {v11.b}[6], [RGB], #1 + st1 {v12.b}[6], [RGB], #1 - st1 {v10.b}[7], [RGB], #1 - st1 {v11.b}[7], [RGB], #1 - st1 {v12.b}[7], [RGB], #1 -#endif + st1 {v10.b}[7], [RGB], #1 + st1 {v11.b}[7], [RGB], #1 + st1 {v12.b}[7], [RGB], #1 + .endif .elseif \size == 4 st3 {v10.b, v11.b, v12.b}[0], [RGB], 3 st3 {v10.b, v11.b, v12.b}[1], [RGB], 3 @@ -1573,7 +1567,9 @@ asm_function jsimd_idct_2x2_neon .endif .endm -.macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, rsize, g_offs, gsize, b_offs, bsize, defsize +.macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, rsize, \ + g_offs, gsize, b_offs, bsize, \ + defsize, fast_st3 = 1 /* * 2-stage pipelined YCbCr->RGB conversion @@ -1615,7 +1611,7 @@ asm_function jsimd_idct_2x2_neon .endif .endm -.macro do_yuv_to_rgb_stage2_store_load_stage1 +.macro do_yuv_to_rgb_stage2_store_load_stage1 fast_st3 rshrn v20.4h, v20.4s, #15 rshrn v24.4h, v24.4s, #14 rshrn v28.4h, v28.4s, #14 @@ -1662,7 +1658,7 @@ asm_function jsimd_idct_2x2_neon prfm pldl1keep, [Y, #64] sri v25.8h, v29.8h, #11 .endif - do_store \bpp, 8 + do_store \bpp, 8, \fast_st3 smull v28.4s, v6.4h, v1.h[3] /* multiply by 29033 */ smull2 v30.4s, v6.8h, v1.h[3] /* multiply by 29033 */ .endm @@ -1677,13 +1673,21 @@ asm_function jsimd_idct_2x2_neon */ .balign 16 +.if \fast_st3 == 1 Ljsimd_ycc_\colorid\()_neon_consts: +.else +Ljsimd_ycc_\colorid\()_neon_slowst3_consts: +.endif .short 0, 0, 0, 0 .short 22971, -11277, -23401, 29033 .short -128, -128, -128, -128 .short -128, -128, -128, -128 +.if \fast_st3 == 1 asm_function jsimd_ycc_\colorid\()_convert_neon +.else +asm_function jsimd_ycc_\colorid\()_convert_neon_slowst3 +.endif OUTPUT_WIDTH .req x0 INPUT_BUF .req x1 INPUT_ROW .req x2 @@ -1753,12 +1757,12 @@ asm_function jsimd_ycc_\colorid\()_convert_neon subs N, N, #8 b.lt 2f 1: - do_yuv_to_rgb_stage2_store_load_stage1 + do_yuv_to_rgb_stage2_store_load_stage1 \fast_st3 subs N, N, #8 b.ge 1b 2: do_yuv_to_rgb_stage2 - do_store \bpp, 8 + do_store \bpp, 8, \fast_st3 tst N, #7 b.eq 8f 3: @@ -1777,15 +1781,15 @@ asm_function jsimd_ycc_\colorid\()_convert_neon do_yuv_to_rgb tst N, #4 b.eq 6f - do_store \bpp, 4 + do_store \bpp, 4, \fast_st3 6: tst N, #2 b.eq 7f - do_store \bpp, 2 + do_store \bpp, 2, \fast_st3 7: tst N, #1 b.eq 8f - do_store \bpp, 1 + do_store \bpp, 1, \fast_st3 8: subs NUM_ROWS, NUM_ROWS, #1 b.gt 0b @@ -1827,7 +1831,7 @@ asm_function jsimd_ycc_\colorid\()_convert_neon .endm -/*--------------------------------- id ----- bpp R rsize G gsize B bsize defsize */ +/*--------------------------------- id ----- bpp R rsize G gsize B bsize defsize fast_st3*/ generate_jsimd_ycc_rgb_convert_neon extrgb, 24, 0, .4h, 1, .4h, 2, .4h, .8b generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h, .8b generate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, .4h, 1, .4h, 2, .4h, .8b @@ -1836,6 +1840,9 @@ generate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, .4h, 2, .4h, 1, .4h, .8b generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, .4h, 2, .4h, 3, .4h, .8b generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b +generate_jsimd_ycc_rgb_convert_neon extrgb, 24, 0, .4h, 1, .4h, 2, .4h, .8b, 0 +generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h, .8b, 0 + .purgem do_load .purgem do_store @@ -1887,50 +1894,44 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b .endif .endm -#if defined(__APPLE__) || defined(__ANDROID__) -/* TODO: expand this to include other devices that are known not to have a slow - * ld3 implementation. */ -#define LD3_IS_FAST -#endif - -.macro do_load bpp, size +.macro do_load bpp, size, fast_ld3 .if \bpp == 24 .if \size == 8 -#ifdef LD3_IS_FAST - ld3 {v10.8b, v11.8b, v12.8b}, [RGB], #24 -#else - ld1 {v10.b}[0], [RGB], #1 - ld1 {v11.b}[0], [RGB], #1 - ld1 {v12.b}[0], [RGB], #1 + .if \fast_ld3 == 1 + ld3 {v10.8b, v11.8b, v12.8b}, [RGB], #24 + .else + ld1 {v10.b}[0], [RGB], #1 + ld1 {v11.b}[0], [RGB], #1 + ld1 {v12.b}[0], [RGB], #1 - ld1 {v10.b}[1], [RGB], #1 - ld1 {v11.b}[1], [RGB], #1 - ld1 {v12.b}[1], [RGB], #1 + ld1 {v10.b}[1], [RGB], #1 + ld1 {v11.b}[1], [RGB], #1 + ld1 {v12.b}[1], [RGB], #1 - ld1 {v10.b}[2], [RGB], #1 - ld1 {v11.b}[2], [RGB], #1 - ld1 {v12.b}[2], [RGB], #1 + ld1 {v10.b}[2], [RGB], #1 + ld1 {v11.b}[2], [RGB], #1 + ld1 {v12.b}[2], [RGB], #1 - ld1 {v10.b}[3], [RGB], #1 - ld1 {v11.b}[3], [RGB], #1 - ld1 {v12.b}[3], [RGB], #1 + ld1 {v10.b}[3], [RGB], #1 + ld1 {v11.b}[3], [RGB], #1 + ld1 {v12.b}[3], [RGB], #1 - ld1 {v10.b}[4], [RGB], #1 - ld1 {v11.b}[4], [RGB], #1 - ld1 {v12.b}[4], [RGB], #1 + ld1 {v10.b}[4], [RGB], #1 + ld1 {v11.b}[4], [RGB], #1 + ld1 {v12.b}[4], [RGB], #1 - ld1 {v10.b}[5], [RGB], #1 - ld1 {v11.b}[5], [RGB], #1 - ld1 {v12.b}[5], [RGB], #1 + ld1 {v10.b}[5], [RGB], #1 + ld1 {v11.b}[5], [RGB], #1 + ld1 {v12.b}[5], [RGB], #1 - ld1 {v10.b}[6], [RGB], #1 - ld1 {v11.b}[6], [RGB], #1 - ld1 {v12.b}[6], [RGB], #1 + ld1 {v10.b}[6], [RGB], #1 + ld1 {v11.b}[6], [RGB], #1 + ld1 {v12.b}[6], [RGB], #1 - ld1 {v10.b}[7], [RGB], #1 - ld1 {v11.b}[7], [RGB], #1 - ld1 {v12.b}[7], [RGB], #1 -#endif + ld1 {v10.b}[7], [RGB], #1 + ld1 {v11.b}[7], [RGB], #1 + ld1 {v12.b}[7], [RGB], #1 + .endif prfm pldl1keep, [RGB, #128] .elseif \size == 4 ld3 {v10.b, v11.b, v12.b}[0], [RGB], #3 @@ -1967,7 +1968,8 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b .endif .endm -.macro generate_jsimd_rgb_ycc_convert_neon colorid, bpp, r_offs, g_offs, b_offs +.macro generate_jsimd_rgb_ycc_convert_neon colorid, bpp, r_offs, g_offs, \ + b_offs, fast_ld3 = 1 /* * 2-stage pipelined RGB->YCbCr conversion @@ -2020,9 +2022,9 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b /* TODO: expand macros and interleave instructions if some in-order * ARM64 processor actually can dual-issue LOAD/STORE with ALU */ -.macro do_rgb_to_yuv_stage2_store_load_stage1 +.macro do_rgb_to_yuv_stage2_store_load_stage1 fast_ld3 do_rgb_to_yuv_stage2 - do_load \bpp, 8 + do_load \bpp, 8, \fast_ld3 st1 {v20.8b}, [Y], #8 st1 {v21.8b}, [U], #8 st1 {v22.8b}, [V], #8 @@ -2030,13 +2032,21 @@ generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b .endm .balign 16 +.if \fast_ld3 == 1 Ljsimd_\colorid\()_ycc_neon_consts: +.else +Ljsimd_\colorid\()_ycc_neon_slowld3_consts: +.endif .short 19595, 38470, 7471, 11059 .short 21709, 32768, 27439, 5329 .short 32767, 128, 32767, 128 .short 32767, 128, 32767, 128 +.if \fast_ld3 == 1 asm_function jsimd_\colorid\()_ycc_convert_neon +.else +asm_function jsimd_\colorid\()_ycc_convert_neon_slowld3 +.endif OUTPUT_WIDTH .req w0 INPUT_BUF .req x1 OUTPUT_BUF .req x2 @@ -2081,12 +2091,12 @@ asm_function jsimd_\colorid\()_ycc_convert_neon /* Inner loop over pixels */ subs N, N, #8 b.lt 3f - do_load \bpp, 8 + do_load \bpp, 8, \fast_ld3 do_rgb_to_yuv_stage1 subs N, N, #8 b.lt 2f 1: - do_rgb_to_yuv_stage2_store_load_stage1 + do_rgb_to_yuv_stage2_store_load_stage1 \fast_ld3 subs N, N, #8 b.ge 1b 2: @@ -2096,13 +2106,13 @@ asm_function jsimd_\colorid\()_ycc_convert_neon b.eq 8f 3: tbz N, #2, 3f - do_load \bpp, 4 + do_load \bpp, 4, \fast_ld3 3: tbz N, #1, 4f - do_load \bpp, 2 + do_load \bpp, 2, \fast_ld3 4: tbz N, #0, 5f - do_load \bpp, 1 + do_load \bpp, 1, \fast_ld3 5: do_rgb_to_yuv tbz N, #2, 6f @@ -2143,7 +2153,7 @@ asm_function jsimd_\colorid\()_ycc_convert_neon .endm -/*--------------------------------- id ----- bpp R G B */ +/*--------------------------------- id ----- bpp R G B Fast LD3 */ generate_jsimd_rgb_ycc_convert_neon extrgb, 24, 0, 1, 2 generate_jsimd_rgb_ycc_convert_neon extbgr, 24, 2, 1, 0 generate_jsimd_rgb_ycc_convert_neon extrgbx, 32, 0, 1, 2 @@ -2151,6 +2161,9 @@ generate_jsimd_rgb_ycc_convert_neon extbgrx, 32, 2, 1, 0 generate_jsimd_rgb_ycc_convert_neon extxbgr, 32, 3, 2, 1 generate_jsimd_rgb_ycc_convert_neon extxrgb, 32, 1, 2, 3 +generate_jsimd_rgb_ycc_convert_neon extrgb, 24, 0, 1, 2, 0 +generate_jsimd_rgb_ycc_convert_neon extbgr, 24, 2, 1, 0, 0 + .purgem do_load .purgem do_store From 53c635b8e8d6d9681fb5347701bb48f1e172a83f Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 8 Feb 2016 14:03:13 -0600 Subject: [PATCH 103/140] Fix 'make dist'; Include LICENSE.md in packages --- Makefile.am | 6 +++--- release/libjpeg-turbo.nsi.in | 2 ++ simd/Makefile.am | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 21f61e40..68cf8d82 100644 --- a/Makefile.am +++ b/Makefile.am @@ -157,11 +157,11 @@ jcstest_LDADD = libjpeg.la dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 -DOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.txt \ +DOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.md \ ChangeLog.txt dist_doc_DATA = README.ijg README.md libjpeg.txt structure.txt usage.txt \ - wizard.txt + wizard.txt LICENSE.md exampledir = $(docdir) dist_example_DATA = example.c @@ -170,7 +170,7 @@ dist_example_DATA = example.c EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \ sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \ doxygen-extra.css jccolext.c jdcolext.c jdcol565.c jdmrgext.c jdmrg565.c \ - jstdhuff.c jdcoefct.h jdmainct.h jdsample.h + jstdhuff.c jdcoefct.h jdmainct.h jdsample.h md5/CMakeLists.txt dist-hook: rm -rf `find $(distdir) -name .svn` diff --git a/release/libjpeg-turbo.nsi.in b/release/libjpeg-turbo.nsi.in index 4c9d453e..f458b81e 100755 --- a/release/libjpeg-turbo.nsi.in +++ b/release/libjpeg-turbo.nsi.in @@ -81,6 +81,7 @@ Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)" SetOutPath $INSTDIR\doc File "@CMAKE_SOURCE_DIR@\README.ijg" File "@CMAKE_SOURCE_DIR@\README.md" + File "@CMAKE_SOURCE_DIR@\LICENSE.md" File "@CMAKE_SOURCE_DIR@\example.c" File "@CMAKE_SOURCE_DIR@\libjpeg.txt" File "@CMAKE_SOURCE_DIR@\structure.txt" @@ -142,6 +143,7 @@ Section "Uninstall" Delete $INSTDIR\uninstall_@VERSION@.exe Delete $INSTDIR\doc\README.ijg Delete $INSTDIR\doc\README.md + Delete $INSTDIR\doc\LICENSE.md Delete $INSTDIR\doc\example.c Delete $INSTDIR\doc\libjpeg.txt Delete $INSTDIR\doc\structure.txt diff --git a/simd/Makefile.am b/simd/Makefile.am index f78d51c2..fad6c8c8 100644 --- a/simd/Makefile.am +++ b/simd/Makefile.am @@ -12,7 +12,7 @@ EXTRA_DIST = nasm_lt.sh CMakeLists.txt \ if SIMD_X86_64 libsimd_la_SOURCES = jsimd_x86_64.c jsimd.h jsimdcfg.inc.h jsimdext.inc \ - jcolsamp.inc jdct.inc jfdctflt-sse-64.asm \ + jcolsamp.inc jdct.inc jpeg_nbits_table.inc jfdctflt-sse-64.asm \ jccolor-sse2-64.asm jcgray-sse2-64.asm jchuff-sse2-64.asm \ jcsample-sse2-64.asm jdcolor-sse2-64.asm jdmerge-sse2-64.asm \ jdsample-sse2-64.asm jfdctfst-sse2-64.asm jfdctint-sse2-64.asm \ @@ -29,7 +29,7 @@ endif if SIMD_I386 libsimd_la_SOURCES = jsimd_i386.c jsimd.h jsimdcfg.inc.h jsimdext.inc \ - jcolsamp.inc jdct.inc jsimdcpu.asm \ + jcolsamp.inc jdct.inc jpeg_nbits_table.inc jsimdcpu.asm \ jfdctflt-3dn.asm jidctflt-3dn.asm jquant-3dn.asm \ jccolor-mmx.asm jcgray-mmx.asm jcsample-mmx.asm \ jdcolor-mmx.asm jdmerge-mmx.asm jdsample-mmx.asm \ From ab80273b611271d89e9c3a796ae5c8db3d730442 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 8 Feb 2016 14:41:07 -0600 Subject: [PATCH 104/140] BUILDING.md: Update OS X Java information The Apple Java Developer Package is only necessary on OS X < 10.7. When building on Lion and later, the Oracle JDK is preferred. --- BUILDING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index e27bff22..727d728f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -42,11 +42,11 @@ Build Requirements - If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is required. Some systems, such as Solaris 10 and later and Red Hat Enterprise - Linux 5 and later, have this pre-installed. On OS X 10.5 and later, it will + Linux 5 and later, have this pre-installed. On OS X 10.5 and 10.6, it will be necessary to install the Java Developer Package, which can be downloaded - from http://developer.apple.com/downloads (Apple ID required.) For systems - that do not have a JDK installed, you can obtain the Oracle Java Development - Kit from http://www.java.com. + from http://developer.apple.com/downloads (Apple ID required.) For other + systems, you can obtain the Oracle Java Development Kit from + http://www.java.com. Out-of-Tree Builds From 28f00bf23593076cd27ff19aedd8ee7a02a40983 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 8 Feb 2016 15:15:11 -0600 Subject: [PATCH 105/140] Fix iOS/ARMv8 build Broken by 46ecffa324be43aab80f6160dc57d98b0a54a704. gas-preprocessor.pl and/or the clang assembler apparently don't like default values in macro arguments, and we need to use a separate const section for each function (because of our use of adr, also necessitated by the broken clang assembler.) --- simd/jsimd_arm64_neon.S | 42 ++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index 3f003ce4..0df1c4a8 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -1569,7 +1569,7 @@ asm_function jsimd_idct_2x2_neon .macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, rsize, \ g_offs, gsize, b_offs, bsize, \ - defsize, fast_st3 = 1 + defsize, fast_st3 /* * 2-stage pipelined YCbCr->RGB conversion @@ -1708,7 +1708,11 @@ asm_function jsimd_ycc_\colorid\()_convert_neon_slowst3 str x15, [sp], 16 /* Load constants to d1, d2, d3 (v0.4h is just used for padding) */ - adr x15, Ljsimd_ycc_\colorid\()_neon_consts + .if \fast_st3 == 1 + adr x15, Ljsimd_ycc_\colorid\()_neon_consts + .else + adr x15, Ljsimd_ycc_\colorid\()_neon_slowst3_consts + .endif /* Save NEON registers */ st1 {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32 @@ -1832,13 +1836,13 @@ asm_function jsimd_ycc_\colorid\()_convert_neon_slowst3 .endm /*--------------------------------- id ----- bpp R rsize G gsize B bsize defsize fast_st3*/ -generate_jsimd_ycc_rgb_convert_neon extrgb, 24, 0, .4h, 1, .4h, 2, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, .4h, 1, .4h, 2, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, .4h, 1, .4h, 0, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, .4h, 2, .4h, 1, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, .4h, 2, .4h, 3, .4h, .8b -generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b +generate_jsimd_ycc_rgb_convert_neon extrgb, 24, 0, .4h, 1, .4h, 2, .4h, .8b, 1 +generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h, .8b, 1 +generate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, .4h, 1, .4h, 2, .4h, .8b, 1 +generate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, .4h, 1, .4h, 0, .4h, .8b, 1 +generate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, .4h, 2, .4h, 1, .4h, .8b, 1 +generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, .4h, 2, .4h, 3, .4h, .8b, 1 +generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b, 1 generate_jsimd_ycc_rgb_convert_neon extrgb, 24, 0, .4h, 1, .4h, 2, .4h, .8b, 0 generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h, .8b, 0 @@ -1969,7 +1973,7 @@ generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h, .8b, .endm .macro generate_jsimd_rgb_ycc_convert_neon colorid, bpp, r_offs, g_offs, \ - b_offs, fast_ld3 = 1 + b_offs, fast_ld3 /* * 2-stage pipelined RGB->YCbCr conversion @@ -2064,7 +2068,11 @@ asm_function jsimd_\colorid\()_ycc_convert_neon_slowld3 N .req w12 /* Load constants to d0, d1, d2, d3 */ - adr x13, Ljsimd_\colorid\()_ycc_neon_consts + .if \fast_ld3 == 1 + adr x13, Ljsimd_\colorid\()_ycc_neon_consts + .else + adr x13, Ljsimd_\colorid\()_ycc_neon_slowld3_consts + .endif ld1 {v0.8h, v1.8h}, [x13] ldr OUTPUT_BUF0, [OUTPUT_BUF] @@ -2154,12 +2162,12 @@ asm_function jsimd_\colorid\()_ycc_convert_neon_slowld3 .endm /*--------------------------------- id ----- bpp R G B Fast LD3 */ -generate_jsimd_rgb_ycc_convert_neon extrgb, 24, 0, 1, 2 -generate_jsimd_rgb_ycc_convert_neon extbgr, 24, 2, 1, 0 -generate_jsimd_rgb_ycc_convert_neon extrgbx, 32, 0, 1, 2 -generate_jsimd_rgb_ycc_convert_neon extbgrx, 32, 2, 1, 0 -generate_jsimd_rgb_ycc_convert_neon extxbgr, 32, 3, 2, 1 -generate_jsimd_rgb_ycc_convert_neon extxrgb, 32, 1, 2, 3 +generate_jsimd_rgb_ycc_convert_neon extrgb, 24, 0, 1, 2, 1 +generate_jsimd_rgb_ycc_convert_neon extbgr, 24, 2, 1, 0, 1 +generate_jsimd_rgb_ycc_convert_neon extrgbx, 32, 0, 1, 2, 1 +generate_jsimd_rgb_ycc_convert_neon extbgrx, 32, 2, 1, 0, 1 +generate_jsimd_rgb_ycc_convert_neon extxbgr, 32, 3, 2, 1, 1 +generate_jsimd_rgb_ycc_convert_neon extxrgb, 32, 1, 2, 3, 1 generate_jsimd_rgb_ycc_convert_neon extrgb, 24, 0, 1, 2, 0 generate_jsimd_rgb_ycc_convert_neon extbgr, 24, 2, 1, 0, 0 From bba7978981e4fc6d0e10f72e95e5e249479ce0e9 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 8 Feb 2016 16:10:28 -0600 Subject: [PATCH 106/140] ChangeLog: Mention ARM64 Huffman & adj perf claims --- ChangeLog.txt | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 505f7664..ccff54fb 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -67,20 +67,32 @@ when compiling the C version of the Huffman encoder or regression testing, SIMD-accelerated Huffman encoding can be disabled by setting the JSIMD_NOHUFFENC environment variable to 1. -[13] Added SIMD acceleration for Huffman encoding on NEON-capable ARM 32-bit -platforms. This speeds up the compression of full-color JPEGs by about 30% on -average on a Cortex-A9 core (iPhone 4S) and by about 6-7% on average on -Cortex-A53 and Cortex-A57 cores. For the purposes of benchmarking or -regression testing, SIMD-accelerated Huffman encoding can be disabled by -setting the JSIMD_NOHUFFENC environment variable to 1. - -[14] Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used +[13] Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used compression algorithms (including the slow integer forward DCT and h2v2 & h2v1 downsampling algorithms, which are not accelerated in the 32-bit NEON implementation.) This speeds up the compression of full-color JPEGs by about 75% on average on a Cavium ThunderX processor and by about 2-2.5x on average on Cortex-A53 and Cortex-A57 cores. +[14] Added SIMD acceleration for Huffman encoding on NEON-capable ARM 32-bit +and 64-bit platforms. + +For 32-bit code, this speeds up the compression of full-color JPEGs by about +30% on average on a typical iOS device (iPhone 4S, Cortex-A9) and by about 6-7% +on average on a typical Android device (Nexus 5X, Cortex-A53 and Cortex-A57), +relative to libjpeg-turbo 1.4.x. Note that the larger speedup under iOS is due +to the fact that iOS builds use LLVM, which does not optimize the C Huffman +encoder as well as GCC does. + +For 64-bit code, NEON-accelerated Huffman encoding speeds up the compression of +full-color JPEGs by about 40% on average on a typical iOS device (iPhone 5S, +Apple A7) and by about 7-8% on average on a typical Android device (Nexus 5X, +Cortex-A53 and Cortex-A57), in addition to the speedup described in [13] above. + +For the purposes of benchmarking or regression testing, SIMD-accelerated +Huffman encoding can be disabled by setting the JSIMD_NOHUFFENC environment +variable to 1. + [15] pkg-config (.pc) scripts are now included for both the libjpeg and TurboJPEG API libraries on Un*x systems. Note that if a project's build system relies on these scripts, then it will not be possible to build that project From 8632f1b2626ccef099f58382d880e9c7325a2d28 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 9 Feb 2016 00:38:58 -0600 Subject: [PATCH 107/140] ARM64: Avoid tbl instruction on Cortex-A53/A57 Full-color compression speedups relative to previous commits: Cortex-A53 (Nexus 5X), Android, 64-bit: 0.91-3.0% (avg. 1.8%) Cortex-A57 (Nexus 5X), Android, 64-bit: -0.35-1.5% (avg. 0.65%) --- simd/jsimd.h | 4 ++++ simd/jsimd_arm64.c | 20 ++++++++++++++++---- simd/jsimd_arm64_neon.S | 31 ++++++++++++++++++++++++------- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/simd/jsimd.h b/simd/jsimd.h index a312930f..d05a2ec0 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -865,3 +865,7 @@ EXTERN(JOCTET*) jsimd_huff_encode_one_block_sse2 EXTERN(JOCTET*) jsimd_huff_encode_one_block_neon (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl); + +EXTERN(JOCTET*) jsimd_huff_encode_one_block_neon_slowtbl + (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, + c_derived_tbl *dctbl, c_derived_tbl *actbl); diff --git a/simd/jsimd_arm64.c b/simd/jsimd_arm64.c index 86331622..cb482584 100644 --- a/simd/jsimd_arm64.c +++ b/simd/jsimd_arm64.c @@ -28,10 +28,12 @@ #define JSIMD_FASTLD3 1 #define JSIMD_FASTST3 2 +#define JSIMD_FASTTBL 4 static unsigned int simd_support = ~0; static unsigned int simd_huffman = 1; -static unsigned int simd_features = JSIMD_FASTLD3 | JSIMD_FASTST3; +static unsigned int simd_features = JSIMD_FASTLD3 | JSIMD_FASTST3 | + JSIMD_FASTTBL; #if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) @@ -83,7 +85,13 @@ parse_proc_cpuinfo (int bufsize) free(buffer); return 0; } - if (check_cpuinfo(buffer, "CPU part", "0x0a1")) + if (check_cpuinfo(buffer, "CPU part", "0xd03") || + check_cpuinfo(buffer, "CPU part", "0xd07")) + /* The Cortex-A53 has a slow tbl implementation. We can gain a few + percent speedup by disabling the use of that instruction. The + speedup on Cortex-A57 is more subtle but still measurable. */ + simd_features &= ~JSIMD_FASTTBL; + else if (check_cpuinfo(buffer, "CPU part", "0x0a1")) /* The SIMD version of Huffman encoding is slower than the C version on Cavium ThunderX. Also, ld3 and st3 are abyssmally slow on that CPU. */ @@ -785,6 +793,10 @@ jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { - return jsimd_huff_encode_one_block_neon(state, buffer, block, last_dc_val, - dctbl, actbl); + if (simd_features & JSIMD_FASTTBL) + return jsimd_huff_encode_one_block_neon(state, buffer, block, last_dc_val, + dctbl, actbl); + else + return jsimd_huff_encode_one_block_neon_slowtbl(state, buffer, block, + last_dc_val, dctbl, actbl); } diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index 0df1c4a8..b9bb5de4 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -2986,8 +2986,6 @@ asm_function jsimd_h2v2_downsample_neon /*****************************************************************************/ -#define TBL_IS_FAST - /* * GLOBAL(JOCTET*) * jsimd_huff_encode_one_block (working_state * state, JOCTET *buffer, @@ -3037,11 +3035,17 @@ asm_function jsimd_h2v2_downsample_neon 47: .endm +.macro generate_jsimd_huff_encode_one_block fast_tbl + .balign 16 +.if \fast_tbl == 1 Ljsimd_huff_encode_one_block_neon_consts: +.else +Ljsimd_huff_encode_one_block_neon_slowtbl_consts: +.endif .byte 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, \ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 -#if defined(TBL_IS_FAST) +.if \fast_tbl == 1 .byte 0, 1, 2, 3, 16, 17, 32, 33, \ 18, 19, 4, 5, 6, 7, 20, 21 /* L0 => L3 : 4 lines OK */ .byte 34, 35, 48, 49, 255, 255, 50, 51, \ @@ -3066,19 +3070,27 @@ Ljsimd_huff_encode_one_block_neon_consts: 255, 255, 255, 255, 8, 9, 22, 23 /* L5 => L6 : 2 lines OK */ .byte 4, 5, 6, 7, 255, 255, 255, 255, \ 255, 255, 255, 255, 255, 255, 255, 255 /* L7 : 1 line OK */ -#endif +.endif +.if \fast_tbl == 1 asm_function jsimd_huff_encode_one_block_neon +.else +asm_function jsimd_huff_encode_one_block_neon_slowtbl +.endif sub sp, sp, 272 sub BUFFER, BUFFER, #0x1 /* BUFFER=buffer-- */ /* Save ARM registers */ stp x19, x20, [sp], 16 +.if \fast_tbl == 1 adr x15, Ljsimd_huff_encode_one_block_neon_consts +.else + adr x15, Ljsimd_huff_encode_one_block_neon_slowtbl_consts +.endif ldr PUT_BUFFER, [x0, #0x10] ldr PUT_BITSw, [x0, #0x18] ldrsh w12, [x2] /* load DC coeff in w12 */ /* prepare data */ -#if defined(TBL_IS_FAST) +.if \fast_tbl == 1 ld1 {v23.16b}, [x15], #16 ld1 {v0.16b, v1.16b, v2.16b, v3.16b}, [x15], #64 ld1 {v4.16b, v5.16b, v6.16b, v7.16b}, [x15], #64 @@ -3100,7 +3112,7 @@ asm_function jsimd_huff_encode_one_block_neon tbx v2.16b, {v29.16b, v30.16b}, v17.16b tbx v5.16b, {v29.16b, v30.16b}, v18.16b tbx v6.16b, {v31.16b}, v19.16b -#else +.else add x13, x2, #0x22 sub w12, w12, w3 /* last_dc_val, not used afterwards */ ld1 {v23.16b}, [x15] @@ -3230,7 +3242,7 @@ asm_function jsimd_huff_encode_one_block_neon ld1 {v5.h}[7], [x15] ld1 {v6.h}[7], [x19] ld1 {v7.h}[7], [x20] -#endif +.endif cmlt v24.8h, v0.8h, #0 cmlt v25.8h, v1.8h, #0 cmlt v26.8h, v2.8h, #0 @@ -3425,6 +3437,11 @@ asm_function jsimd_huff_encode_one_block_neon add sp, sp, 256 br x30 +.endm + +generate_jsimd_huff_encode_one_block 1 +generate_jsimd_huff_encode_one_block 0 + .unreq BUFFER .unreq PUT_BUFFER .unreq PUT_BITS From d123c125c50993986537a2c1a49b8b52313c2af9 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 9 Feb 2016 01:35:39 -0600 Subject: [PATCH 108/140] Java: Avoid OOM error when running 'make test' We need to garbage collect between iterations of the outside loop in bufSizeTest() in order to avoid exhausting the heap when running with Java 6 (which is still used on Linux to test the 32-bit version of libjpeg-turbo in automated builds.) --- java/TJUnitTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/TJUnitTest.java b/java/TJUnitTest.java index d4726b39..444e7985 100644 --- a/java/TJUnitTest.java +++ b/java/TJUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C)2011-2015 D. R. Commander. All Rights Reserved. + * Copyright (C)2011-2016 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -892,6 +892,9 @@ public class TJUnitTest { else tjc.compress(dstBuf, 0); } + dstImage = null; + dstBuf = null; + System.gc(); } } System.out.println("Done. "); From 03841e6e8905e971b0d9ded0c448e6134d8dbdc5 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 9 Feb 2016 18:27:27 -0600 Subject: [PATCH 109/140] Win: Display effective C/LD flags in CMake output --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84f0a2df..91c8ac66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,6 +173,14 @@ configure_file(win/jconfigint.h.in jconfigint.h) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) +string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC) + +set(EFFECTIVE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}") +message(STATUS "Compiler flags = ${EFFECTIVE_C_FLAGS}") + +set(EFFECTIVE_LD_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UC}}") +message(STATUS "Linker flags = ${EFFECTIVE_LD_FLAGS}") + if(WITH_JAVA) find_package(Java) find_package(JNI) From 18dcac46320694303b6e92bdca86a2b74efd8bbe Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 14 Feb 2016 09:01:07 -0600 Subject: [PATCH 110/140] Fix compiler warning --- turbojpeg-jni.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/turbojpeg-jni.c b/turbojpeg-jni.c index 4d9900c9..eaba670c 100644 --- a/turbojpeg-jni.c +++ b/turbojpeg-jni.c @@ -1,5 +1,5 @@ /* - * Copyright (C)2011-2015 D. R. Commander. All Rights Reserved. + * Copyright (C)2011-2016 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -758,6 +758,8 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress if(scaledWidth<=width && scaledHeight<=height) break; } + if(i>=nsf) + _throwarg("Could not scale down to desired image dimensions"); bailif0(dstOffsets=(*env)->GetPrimitiveArrayCritical(env, jDstOffsets, 0)); bailif0(dstStrides=(*env)->GetPrimitiveArrayCritical(env, jDstStrides, 0)); From aefd8b79421db753160d47462e81b6ff8748f8f0 Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 14 Feb 2016 17:20:30 -0600 Subject: [PATCH 111/140] Clean up pkgconfig dir when removing RPM & Mac pkg --- release/libjpeg-turbo.spec.in | 1 + release/uninstall.in | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/release/libjpeg-turbo.spec.in b/release/libjpeg-turbo.spec.in index 74ee3004..4b792d7a 100644 --- a/release/libjpeg-turbo.spec.in +++ b/release/libjpeg-turbo.spec.in @@ -124,6 +124,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@ %{_libdir}/libjpeg.so %{_libdir}/libjpeg.a +%{_libdir}/pkgconfig %{_libdir}/pkgconfig/libjpeg.pc %{_libdir}/libturbojpeg.so.0.1.0 %{_libdir}/libturbojpeg.so.0 diff --git a/release/uninstall.in b/release/uninstall.in index f167bbdf..6cd1f869 100644 --- a/release/uninstall.in +++ b/release/uninstall.in @@ -1,4 +1,4 @@ -# Copyright (C)2009-2011, 2013 D. R. Commander. All Rights Reserved. +# Copyright (C)2009-2011, 2013, 2016 D. R. Commander. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -66,6 +66,9 @@ MANDIR=%{__mandir} if [ -d $BINDIR ]; then rmdir $BINDIR 2>&1 || EXITSTATUS=-1 fi +if [ -d $LIBDIR/pkgconfig ]; then + rmdir $LIBDIR/pkgconfig 2>&1 || EXITSTATUS=-1 +fi if [ -d $LIBDIR ]; then rmdir $LIBDIR 2>&1 || EXITSTATUS=-1 fi From e7f88aec23279d58bf5f37524c1958ba366f346d Mon Sep 17 00:00:00 2001 From: Guido Vollbeding Date: Sun, 13 Jan 2013 00:00:00 +0000 Subject: [PATCH 112/140] The Independent JPEG Group's JPEG software v9 --- Makefile.am | 6 +- Makefile.in | 615 ++++++------- README | 47 +- aclocal.m4 | 523 ++++++----- ansi2knr.1 | 36 - ansi2knr.c | 739 --------------- ar-lib | 270 ++++++ change.log | 36 + cjpeg.1 | 26 +- cjpeg.c | 17 +- config.guess | 71 +- config.sub | 97 +- configure | 2398 +++++++++++++++++++------------------------------ configure.ac | 19 +- depcomp | 480 ++++++---- djpeg.c | 6 +- filelist.txt | 5 +- install-sh | 14 +- install.txt | 6 +- jcarith.c | 44 +- jccolor.c | 91 +- jcmainct.c | 110 +-- jcmarker.c | 65 +- jconfig.vc | 2 +- jcparam.c | 11 +- jctrans.c | 9 +- jdarith.c | 38 +- jdatadst.c | 3 + jdcolor.c | 132 ++- jdhuff.c | 33 +- jdmainct.c | 129 +-- jdmarker.c | 165 +++- jerror.c | 3 +- jerror.h | 4 +- jmemmgr.c | 4 +- jmorecfg.h | 29 +- jpeglib.h | 27 +- jpegtran.c | 4 +- jversion.h | 6 +- libjpeg.map | 2 +- libjpeg.txt | 17 +- makefile.ansi | 6 +- makefile.bcc | 6 +- makefile.dj | 6 +- makefile.manx | 6 +- makefile.mc6 | 6 +- makefile.mms | 6 +- makefile.sas | 6 +- makefile.unix | 6 +- makefile.vc | 6 +- makefile.wat | 6 +- missing | 457 +++------- transupp.c | 4 +- usage.txt | 17 +- 54 files changed, 3074 insertions(+), 3803 deletions(-) delete mode 100644 ansi2knr.1 delete mode 100644 ansi2knr.c create mode 100755 ar-lib diff --git a/Makefile.am b/Makefile.am index 42cff57f..86895a1e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,11 +51,11 @@ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vms # Support scripts for configure -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib # Miscellaneous support files -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map # Test support files TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ diff --git a/Makefile.in b/Makefile.in index 5bda1fb6..d9a3664d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.2 from Makefile.am. +# Makefile.in generated by automake 1.13.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -24,6 +23,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -43,15 +59,14 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -ANSI2KNR = @ANSI2KNR@ @HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,--version-script=$(srcdir)/libjpeg.map bin_PROGRAMS = cjpeg$(EXEEXT) djpeg$(EXEEXT) jpegtran$(EXEEXT) \ rdjpgcom$(EXEEXT) wrjpgcom$(EXEEXT) subdir = . -DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/jconfig.cfg ansi2knr.c ansi2knr.1 depcomp \ - $(include_HEADERS) $(noinst_HEADERS) + $(srcdir)/jconfig.cfg depcomp $(include_HEADERS) \ + $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -93,47 +108,58 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libjpeg_la_LIBADD = -am__objects_1 = jaricom$U.lo jcapimin$U.lo jcapistd$U.lo jcarith$U.lo \ - jccoefct$U.lo jccolor$U.lo jcdctmgr$U.lo jchuff$U.lo \ - jcinit$U.lo jcmainct$U.lo jcmarker$U.lo jcmaster$U.lo \ - jcomapi$U.lo jcparam$U.lo jcprepct$U.lo jcsample$U.lo \ - jctrans$U.lo jdapimin$U.lo jdapistd$U.lo jdarith$U.lo \ - jdatadst$U.lo jdatasrc$U.lo jdcoefct$U.lo jdcolor$U.lo \ - jddctmgr$U.lo jdhuff$U.lo jdinput$U.lo jdmainct$U.lo \ - jdmarker$U.lo jdmaster$U.lo jdmerge$U.lo jdpostct$U.lo \ - jdsample$U.lo jdtrans$U.lo jerror$U.lo jfdctflt$U.lo \ - jfdctfst$U.lo jfdctint$U.lo jidctflt$U.lo jidctfst$U.lo \ - jidctint$U.lo jquant1$U.lo jquant2$U.lo jutils$U.lo \ - jmemmgr$U.lo @MEMORYMGR@$U.lo +am__objects_1 = jaricom.lo jcapimin.lo jcapistd.lo jcarith.lo \ + jccoefct.lo jccolor.lo jcdctmgr.lo jchuff.lo jcinit.lo \ + jcmainct.lo jcmarker.lo jcmaster.lo jcomapi.lo jcparam.lo \ + jcprepct.lo jcsample.lo jctrans.lo jdapimin.lo jdapistd.lo \ + jdarith.lo jdatadst.lo jdatasrc.lo jdcoefct.lo jdcolor.lo \ + jddctmgr.lo jdhuff.lo jdinput.lo jdmainct.lo jdmarker.lo \ + jdmaster.lo jdmerge.lo jdpostct.lo jdsample.lo jdtrans.lo \ + jerror.lo jfdctflt.lo jfdctfst.lo jfdctint.lo jidctflt.lo \ + jidctfst.lo jidctint.lo jquant1.lo jquant2.lo jutils.lo \ + jmemmgr.lo @MEMORYMGR@.lo am_libjpeg_la_OBJECTS = $(am__objects_1) libjpeg_la_OBJECTS = $(am_libjpeg_la_OBJECTS) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = libjpeg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libjpeg_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) -am_cjpeg_OBJECTS = cjpeg$U.$(OBJEXT) rdppm$U.$(OBJEXT) \ - rdgif$U.$(OBJEXT) rdtarga$U.$(OBJEXT) rdrle$U.$(OBJEXT) \ - rdbmp$U.$(OBJEXT) rdswitch$U.$(OBJEXT) cdjpeg$U.$(OBJEXT) +am_cjpeg_OBJECTS = cjpeg.$(OBJEXT) rdppm.$(OBJEXT) rdgif.$(OBJEXT) \ + rdtarga.$(OBJEXT) rdrle.$(OBJEXT) rdbmp.$(OBJEXT) \ + rdswitch.$(OBJEXT) cdjpeg.$(OBJEXT) cjpeg_OBJECTS = $(am_cjpeg_OBJECTS) cjpeg_DEPENDENCIES = libjpeg.la -am_djpeg_OBJECTS = djpeg$U.$(OBJEXT) wrppm$U.$(OBJEXT) \ - wrgif$U.$(OBJEXT) wrtarga$U.$(OBJEXT) wrrle$U.$(OBJEXT) \ - wrbmp$U.$(OBJEXT) rdcolmap$U.$(OBJEXT) cdjpeg$U.$(OBJEXT) +am_djpeg_OBJECTS = djpeg.$(OBJEXT) wrppm.$(OBJEXT) wrgif.$(OBJEXT) \ + wrtarga.$(OBJEXT) wrrle.$(OBJEXT) wrbmp.$(OBJEXT) \ + rdcolmap.$(OBJEXT) cdjpeg.$(OBJEXT) djpeg_OBJECTS = $(am_djpeg_OBJECTS) djpeg_DEPENDENCIES = libjpeg.la -am_jpegtran_OBJECTS = jpegtran$U.$(OBJEXT) rdswitch$U.$(OBJEXT) \ - cdjpeg$U.$(OBJEXT) transupp$U.$(OBJEXT) +am_jpegtran_OBJECTS = jpegtran.$(OBJEXT) rdswitch.$(OBJEXT) \ + cdjpeg.$(OBJEXT) transupp.$(OBJEXT) jpegtran_OBJECTS = $(am_jpegtran_OBJECTS) jpegtran_DEPENDENCIES = libjpeg.la -am_rdjpgcom_OBJECTS = rdjpgcom$U.$(OBJEXT) +am_rdjpgcom_OBJECTS = rdjpgcom.$(OBJEXT) rdjpgcom_OBJECTS = $(am_rdjpgcom_OBJECTS) rdjpgcom_LDADD = $(LDADD) -am_wrjpgcom_OBJECTS = wrjpgcom$U.$(OBJEXT) +am_wrjpgcom_OBJECTS = wrjpgcom.$(OBJEXT) wrjpgcom_OBJECTS = $(am_wrjpgcom_OBJECTS) wrjpgcom_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -144,30 +170,51 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libjpeg_la_SOURCES) $(cjpeg_SOURCES) $(djpeg_SOURCES) \ $(jpegtran_SOURCES) $(rdjpgcom_SOURCES) $(wrjpgcom_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) HEADERS = $(include_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)jconfig.cfg +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -233,7 +280,6 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -U = @U@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ @@ -343,12 +389,12 @@ CONFIGFILES = jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ # Support scripts for configure -CONFIGUREFILES = config.guess config.sub install-sh ltmain.sh depcomp missing +CONFIGUREFILES = config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib + # Miscellaneous support files -OTHERFILES = jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map - +OTHERFILES = jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map # Test support files TESTFILES = testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ @@ -451,9 +497,9 @@ $(srcdir)/jconfig.cfg: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) distclean-hdr: -rm -f jconfig.h stamp-h1 + install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -461,6 +507,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -476,24 +524,31 @@ uninstall-libLTLIBRARIES: clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES) $(AM_V_CCLD)$(libjpeg_la_LINK) -rpath $(libdir) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ @@ -514,7 +569,8 @@ uninstall-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files @@ -527,19 +583,19 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -cjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) +cjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) $(EXTRA_cjpeg_DEPENDENCIES) @rm -f cjpeg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cjpeg_OBJECTS) $(cjpeg_LDADD) $(LIBS) -djpeg$(EXEEXT): $(djpeg_OBJECTS) $(djpeg_DEPENDENCIES) +djpeg$(EXEEXT): $(djpeg_OBJECTS) $(djpeg_DEPENDENCIES) $(EXTRA_djpeg_DEPENDENCIES) @rm -f djpeg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(djpeg_OBJECTS) $(djpeg_LDADD) $(LIBS) -jpegtran$(EXEEXT): $(jpegtran_OBJECTS) $(jpegtran_DEPENDENCIES) +jpegtran$(EXEEXT): $(jpegtran_OBJECTS) $(jpegtran_DEPENDENCIES) $(EXTRA_jpegtran_DEPENDENCIES) @rm -f jpegtran$(EXEEXT) $(AM_V_CCLD)$(LINK) $(jpegtran_OBJECTS) $(jpegtran_LDADD) $(LIBS) -rdjpgcom$(EXEEXT): $(rdjpgcom_OBJECTS) $(rdjpgcom_DEPENDENCIES) +rdjpgcom$(EXEEXT): $(rdjpgcom_OBJECTS) $(rdjpgcom_DEPENDENCIES) $(EXTRA_rdjpgcom_DEPENDENCIES) @rm -f rdjpgcom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rdjpgcom_OBJECTS) $(rdjpgcom_LDADD) $(LIBS) -wrjpgcom$(EXEEXT): $(wrjpgcom_OBJECTS) $(wrjpgcom_DEPENDENCIES) +wrjpgcom$(EXEEXT): $(wrjpgcom_OBJECTS) $(wrjpgcom_DEPENDENCIES) $(EXTRA_wrjpgcom_DEPENDENCIES) @rm -f wrjpgcom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wrjpgcom_OBJECTS) $(wrjpgcom_LDADD) $(LIBS) @@ -548,81 +604,72 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -./ansi2knr: ansi2knr.$(OBJEXT) - $(LINK) ansi2knr.$(OBJEXT) $(LIBS) -ansi2knr.$(OBJEXT): $(CONFIG_HEADER) -clean-krextra: - -rm -f ansi2knr - -mostlyclean-kr: - -test "$U" = "" || rm -f *_.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@MEMORYMGR@$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdjpeg$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jaricom$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapimin$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapistd$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcarith$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccoefct$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccolor$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcdctmgr$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcinit$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmainct$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmarker$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmaster$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcomapi$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcparam$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcprepct$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcsample$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jctrans$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapimin$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapistd$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdarith$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatadst$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatasrc$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcoefct$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcolor$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jddctmgr$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdhuff$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdinput$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmainct$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmarker$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmaster$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmerge$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdpostct$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdsample$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdtrans$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jerror$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctflt$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctfst$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctint$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctflt$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctfst$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctint$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemmgr$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegtran$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant1$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant2$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jutils$U.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdbmp$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdcolmap$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdgif$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdjpgcom$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdppm$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdrle$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdswitch$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdtarga$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transupp$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrbmp$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrgif$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrjpgcom$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrppm$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrrle$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrtarga$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@MEMORYMGR@.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdjpeg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jaricom.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapimin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapistd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcarith.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccoefct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccolor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcdctmgr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcinit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmainct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmarker.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmaster.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcomapi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcparam.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcprepct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcsample.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jctrans.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapimin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapistd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdarith.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatadst.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatasrc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcoefct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcolor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jddctmgr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdhuff.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdinput.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmainct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmarker.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmaster.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmerge.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdpostct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdsample.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdtrans.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jerror.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctflt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctfst.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctflt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctfst.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemmgr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegtran.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jutils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdbmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdcolmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdgif.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdjpgcom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdppm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdrle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdswitch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdtarga.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transupp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrbmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrgif.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrjpgcom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrppm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrrle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrtarga.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -644,169 +691,6 @@ mostlyclean-kr: @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -@MEMORYMGR@_.c: @MEMORYMGR@.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/@MEMORYMGR@.c; then echo $(srcdir)/@MEMORYMGR@.c; else echo @MEMORYMGR@.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -cdjpeg_.c: cdjpeg.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/cdjpeg.c; then echo $(srcdir)/cdjpeg.c; else echo cdjpeg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -cjpeg_.c: cjpeg.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/cjpeg.c; then echo $(srcdir)/cjpeg.c; else echo cjpeg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -djpeg_.c: djpeg.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/djpeg.c; then echo $(srcdir)/djpeg.c; else echo djpeg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jaricom_.c: jaricom.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jaricom.c; then echo $(srcdir)/jaricom.c; else echo jaricom.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcapimin_.c: jcapimin.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcapimin.c; then echo $(srcdir)/jcapimin.c; else echo jcapimin.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcapistd_.c: jcapistd.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcapistd.c; then echo $(srcdir)/jcapistd.c; else echo jcapistd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcarith_.c: jcarith.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcarith.c; then echo $(srcdir)/jcarith.c; else echo jcarith.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jccoefct_.c: jccoefct.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jccoefct.c; then echo $(srcdir)/jccoefct.c; else echo jccoefct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jccolor_.c: jccolor.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jccolor.c; then echo $(srcdir)/jccolor.c; else echo jccolor.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcdctmgr_.c: jcdctmgr.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcdctmgr.c; then echo $(srcdir)/jcdctmgr.c; else echo jcdctmgr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jchuff_.c: jchuff.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jchuff.c; then echo $(srcdir)/jchuff.c; else echo jchuff.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcinit_.c: jcinit.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcinit.c; then echo $(srcdir)/jcinit.c; else echo jcinit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcmainct_.c: jcmainct.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcmainct.c; then echo $(srcdir)/jcmainct.c; else echo jcmainct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcmarker_.c: jcmarker.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcmarker.c; then echo $(srcdir)/jcmarker.c; else echo jcmarker.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcmaster_.c: jcmaster.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcmaster.c; then echo $(srcdir)/jcmaster.c; else echo jcmaster.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcomapi_.c: jcomapi.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcomapi.c; then echo $(srcdir)/jcomapi.c; else echo jcomapi.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcparam_.c: jcparam.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcparam.c; then echo $(srcdir)/jcparam.c; else echo jcparam.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcprepct_.c: jcprepct.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcprepct.c; then echo $(srcdir)/jcprepct.c; else echo jcprepct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jcsample_.c: jcsample.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jcsample.c; then echo $(srcdir)/jcsample.c; else echo jcsample.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jctrans_.c: jctrans.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jctrans.c; then echo $(srcdir)/jctrans.c; else echo jctrans.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdapimin_.c: jdapimin.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdapimin.c; then echo $(srcdir)/jdapimin.c; else echo jdapimin.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdapistd_.c: jdapistd.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdapistd.c; then echo $(srcdir)/jdapistd.c; else echo jdapistd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdarith_.c: jdarith.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdarith.c; then echo $(srcdir)/jdarith.c; else echo jdarith.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdatadst_.c: jdatadst.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdatadst.c; then echo $(srcdir)/jdatadst.c; else echo jdatadst.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdatasrc_.c: jdatasrc.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdatasrc.c; then echo $(srcdir)/jdatasrc.c; else echo jdatasrc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdcoefct_.c: jdcoefct.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdcoefct.c; then echo $(srcdir)/jdcoefct.c; else echo jdcoefct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdcolor_.c: jdcolor.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdcolor.c; then echo $(srcdir)/jdcolor.c; else echo jdcolor.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jddctmgr_.c: jddctmgr.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jddctmgr.c; then echo $(srcdir)/jddctmgr.c; else echo jddctmgr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdhuff_.c: jdhuff.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdhuff.c; then echo $(srcdir)/jdhuff.c; else echo jdhuff.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdinput_.c: jdinput.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdinput.c; then echo $(srcdir)/jdinput.c; else echo jdinput.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdmainct_.c: jdmainct.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdmainct.c; then echo $(srcdir)/jdmainct.c; else echo jdmainct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdmarker_.c: jdmarker.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdmarker.c; then echo $(srcdir)/jdmarker.c; else echo jdmarker.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdmaster_.c: jdmaster.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdmaster.c; then echo $(srcdir)/jdmaster.c; else echo jdmaster.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdmerge_.c: jdmerge.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdmerge.c; then echo $(srcdir)/jdmerge.c; else echo jdmerge.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdpostct_.c: jdpostct.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdpostct.c; then echo $(srcdir)/jdpostct.c; else echo jdpostct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdsample_.c: jdsample.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdsample.c; then echo $(srcdir)/jdsample.c; else echo jdsample.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jdtrans_.c: jdtrans.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jdtrans.c; then echo $(srcdir)/jdtrans.c; else echo jdtrans.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jerror_.c: jerror.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jerror.c; then echo $(srcdir)/jerror.c; else echo jerror.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jfdctflt_.c: jfdctflt.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jfdctflt.c; then echo $(srcdir)/jfdctflt.c; else echo jfdctflt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jfdctfst_.c: jfdctfst.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jfdctfst.c; then echo $(srcdir)/jfdctfst.c; else echo jfdctfst.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jfdctint_.c: jfdctint.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jfdctint.c; then echo $(srcdir)/jfdctint.c; else echo jfdctint.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jidctflt_.c: jidctflt.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jidctflt.c; then echo $(srcdir)/jidctflt.c; else echo jidctflt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jidctfst_.c: jidctfst.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jidctfst.c; then echo $(srcdir)/jidctfst.c; else echo jidctfst.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jidctint_.c: jidctint.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jidctint.c; then echo $(srcdir)/jidctint.c; else echo jidctint.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jmemmgr_.c: jmemmgr.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jmemmgr.c; then echo $(srcdir)/jmemmgr.c; else echo jmemmgr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jpegtran_.c: jpegtran.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jpegtran.c; then echo $(srcdir)/jpegtran.c; else echo jpegtran.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jquant1_.c: jquant1.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jquant1.c; then echo $(srcdir)/jquant1.c; else echo jquant1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jquant2_.c: jquant2.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jquant2.c; then echo $(srcdir)/jquant2.c; else echo jquant2.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -jutils_.c: jutils.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/jutils.c; then echo $(srcdir)/jutils.c; else echo jutils.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -rdbmp_.c: rdbmp.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdbmp.c; then echo $(srcdir)/rdbmp.c; else echo rdbmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -rdcolmap_.c: rdcolmap.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdcolmap.c; then echo $(srcdir)/rdcolmap.c; else echo rdcolmap.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -rdgif_.c: rdgif.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdgif.c; then echo $(srcdir)/rdgif.c; else echo rdgif.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -rdjpgcom_.c: rdjpgcom.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdjpgcom.c; then echo $(srcdir)/rdjpgcom.c; else echo rdjpgcom.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -rdppm_.c: rdppm.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdppm.c; then echo $(srcdir)/rdppm.c; else echo rdppm.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -rdrle_.c: rdrle.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdrle.c; then echo $(srcdir)/rdrle.c; else echo rdrle.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -rdswitch_.c: rdswitch.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdswitch.c; then echo $(srcdir)/rdswitch.c; else echo rdswitch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -rdtarga_.c: rdtarga.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rdtarga.c; then echo $(srcdir)/rdtarga.c; else echo rdtarga.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -transupp_.c: transupp.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/transupp.c; then echo $(srcdir)/transupp.c; else echo transupp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -wrbmp_.c: wrbmp.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrbmp.c; then echo $(srcdir)/wrbmp.c; else echo wrbmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -wrgif_.c: wrgif.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrgif.c; then echo $(srcdir)/wrgif.c; else echo wrgif.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -wrjpgcom_.c: wrjpgcom.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrjpgcom.c; then echo $(srcdir)/wrjpgcom.c; else echo wrjpgcom.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -wrppm_.c: wrppm.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrppm.c; then echo $(srcdir)/wrppm.c; else echo wrppm.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -wrrle_.c: wrrle.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrrle.c; then echo $(srcdir)/wrrle.c; else echo wrrle.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -wrtarga_.c: wrtarga.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/wrtarga.c; then echo $(srcdir)/wrtarga.c; else echo wrtarga.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -@MEMORYMGR@_.$(OBJEXT) @MEMORYMGR@_.lo cdjpeg_.$(OBJEXT) cdjpeg_.lo \ -cjpeg_.$(OBJEXT) cjpeg_.lo djpeg_.$(OBJEXT) djpeg_.lo \ -jaricom_.$(OBJEXT) jaricom_.lo jcapimin_.$(OBJEXT) jcapimin_.lo \ -jcapistd_.$(OBJEXT) jcapistd_.lo jcarith_.$(OBJEXT) jcarith_.lo \ -jccoefct_.$(OBJEXT) jccoefct_.lo jccolor_.$(OBJEXT) jccolor_.lo \ -jcdctmgr_.$(OBJEXT) jcdctmgr_.lo jchuff_.$(OBJEXT) jchuff_.lo \ -jcinit_.$(OBJEXT) jcinit_.lo jcmainct_.$(OBJEXT) jcmainct_.lo \ -jcmarker_.$(OBJEXT) jcmarker_.lo jcmaster_.$(OBJEXT) jcmaster_.lo \ -jcomapi_.$(OBJEXT) jcomapi_.lo jcparam_.$(OBJEXT) jcparam_.lo \ -jcprepct_.$(OBJEXT) jcprepct_.lo jcsample_.$(OBJEXT) jcsample_.lo \ -jctrans_.$(OBJEXT) jctrans_.lo jdapimin_.$(OBJEXT) jdapimin_.lo \ -jdapistd_.$(OBJEXT) jdapistd_.lo jdarith_.$(OBJEXT) jdarith_.lo \ -jdatadst_.$(OBJEXT) jdatadst_.lo jdatasrc_.$(OBJEXT) jdatasrc_.lo \ -jdcoefct_.$(OBJEXT) jdcoefct_.lo jdcolor_.$(OBJEXT) jdcolor_.lo \ -jddctmgr_.$(OBJEXT) jddctmgr_.lo jdhuff_.$(OBJEXT) jdhuff_.lo \ -jdinput_.$(OBJEXT) jdinput_.lo jdmainct_.$(OBJEXT) jdmainct_.lo \ -jdmarker_.$(OBJEXT) jdmarker_.lo jdmaster_.$(OBJEXT) jdmaster_.lo \ -jdmerge_.$(OBJEXT) jdmerge_.lo jdpostct_.$(OBJEXT) jdpostct_.lo \ -jdsample_.$(OBJEXT) jdsample_.lo jdtrans_.$(OBJEXT) jdtrans_.lo \ -jerror_.$(OBJEXT) jerror_.lo jfdctflt_.$(OBJEXT) jfdctflt_.lo \ -jfdctfst_.$(OBJEXT) jfdctfst_.lo jfdctint_.$(OBJEXT) jfdctint_.lo \ -jidctflt_.$(OBJEXT) jidctflt_.lo jidctfst_.$(OBJEXT) jidctfst_.lo \ -jidctint_.$(OBJEXT) jidctint_.lo jmemmgr_.$(OBJEXT) jmemmgr_.lo \ -jpegtran_.$(OBJEXT) jpegtran_.lo jquant1_.$(OBJEXT) jquant1_.lo \ -jquant2_.$(OBJEXT) jquant2_.lo jutils_.$(OBJEXT) jutils_.lo \ -rdbmp_.$(OBJEXT) rdbmp_.lo rdcolmap_.$(OBJEXT) rdcolmap_.lo \ -rdgif_.$(OBJEXT) rdgif_.lo rdjpgcom_.$(OBJEXT) rdjpgcom_.lo \ -rdppm_.$(OBJEXT) rdppm_.lo rdrle_.$(OBJEXT) rdrle_.lo \ -rdswitch_.$(OBJEXT) rdswitch_.lo rdtarga_.$(OBJEXT) rdtarga_.lo \ -transupp_.$(OBJEXT) transupp_.lo wrbmp_.$(OBJEXT) wrbmp_.lo \ -wrgif_.$(OBJEXT) wrgif_.lo wrjpgcom_.$(OBJEXT) wrjpgcom_.lo \ -wrppm_.$(OBJEXT) wrppm_.lo wrrle_.$(OBJEXT) wrrle_.lo \ -wrtarga_.$(OBJEXT) wrtarga_.lo : $(ANSI2KNR) mostlyclean-libtool: -rm -f *.lo @@ -818,11 +702,18 @@ distclean-libtool: -rm -f libtool config.lt install-man1: $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list=''; test -n "$(man1dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ @@ -854,8 +745,11 @@ uninstall-man1: dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -871,26 +765,15 @@ uninstall-includeHEADERS: files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) jconfig.cfg $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) jconfig.cfg $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -902,15 +785,11 @@ TAGS: $(HEADERS) $(SOURCES) jconfig.cfg $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) jconfig.cfg $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) jconfig.cfg $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -919,14 +798,36 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am -all-am: Makefile $(ANSI2KNR) $(LTLIBRARIES) $(PROGRAMS) $(MANS) \ - $(HEADERS) jconfig.h +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS) \ + jconfig.h install-binPROGRAMS: install-libLTLIBRARIES installdirs: @@ -966,8 +867,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-krextra \ - clean-libLTLIBRARIES clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) @@ -1025,7 +926,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am @@ -1043,22 +944,22 @@ uninstall-man: uninstall-man1 .MAKE: all check-am install-am install-strip -.PHONY: CTAGS GTAGS all all-am am--refresh check check-am check-local \ - clean clean-binPROGRAMS clean-generic clean-krextra \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-hdr \ - distclean-libtool distclean-tags dvi dvi-am html html-am info \ - info-am install install-am install-binPROGRAMS install-data \ - install-data-am install-data-local install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-includeHEADERS install-info install-info-am \ - install-libLTLIBRARIES install-man install-man1 install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-kr mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-includeHEADERS \ +.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am \ + check-local clean clean-binPROGRAMS clean-cscope clean-generic \ + clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-local uninstall-man \ uninstall-man1 diff --git a/README b/README index 0a23c195..fc5ca5d4 100644 --- a/README +++ b/README @@ -1,10 +1,10 @@ The Independent JPEG Group's JPEG software ========================================== -README for release 8d of 15-Jan-2012 -==================================== +README for release 9 of 13-Jan-2013 +=================================== -This distribution contains the eighth public release of the Independent JPEG +This distribution contains the ninth public release of the Independent JPEG Group's free JPEG software. You are welcome to redistribute this software and to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. @@ -115,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or fitness for a particular purpose. This software is provided "AS IS", and you, its user, assume the entire risk as to its quality and accuracy. -This software is copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. +This software is copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. All Rights Reserved except as specified below. Permission is hereby granted to use, copy, modify, and distribute this @@ -146,15 +146,6 @@ commercial products, provided that all warranty or liability claims are assumed by the product vendor. -ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, -sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. -ansi2knr.c is NOT covered by the above copyright and conditions, but instead -by the usual distribution terms of the Free Software Foundation; principally, -that you must include source code if you redistribute it. (See the file -ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part -of any program generated from the IJG code, this does not limit you more than -the foregoing paragraphs do. - The Unix configuration script "configure" was produced with GNU Autoconf. It is copyright by the Free Software Foundation but is freely distributable. The same holds for its supporting scripts (config.guess, config.sub, @@ -222,12 +213,16 @@ Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS 10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of Continuous-tone Still Images, Part 2: Compliance testing" and has document numbers ISO/IEC IS 10918-2, ITU-T T.83. -IJG JPEG 8 introduces an implementation of the JPEG SmartScale extension +IJG JPEG 8 introduced an implementation of the JPEG SmartScale extension which is specified in two documents: A contributed document at ITU and ISO with title "ITU-T JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced Image Coding", April 2006, Geneva, Switzerland. The latest version of this document is Revision 3. And a contributed document ISO/IEC JTC1/SC29/WG1 N 5799 with title "Evolution of JPEG", June/July 2011, Berlin, Germany. +IJG JPEG 9 introduces a reversible color transform for improved lossless +compression which is described in a contributed document ISO/IEC JTC1/SC29/ +WG1 N 6080 with title "JPEG 9 Lossless Coding", June/July 2012, Paris, +France. The JPEG standard does not specify all details of an interchangeable file format. For the omitted details we follow the "JFIF" conventions, revision @@ -257,8 +252,8 @@ ARCHIVE LOCATIONS The "official" archive site for this software is www.ijg.org. The most recent released version can always be found there in directory "files". This particular version will be archived as -http://www.ijg.org/files/jpegsrc.v8d.tar.gz, and in Windows-compatible -"zip" archive format as http://www.ijg.org/files/jpegsr8d.zip. +http://www.ijg.org/files/jpegsrc.v9.tar.gz, and in Windows-compatible +"zip" archive format as http://www.ijg.org/files/jpegsr9.zip. The JPEG FAQ (Frequently Asked Questions) article is a source of some general information about JPEG. @@ -331,20 +326,24 @@ Furthermore, the ISO committee pretends to be "responsible for the popular JPEG" in their public reports which is not true because they don't respond to actual requirements for the maintenance of the original JPEG specification. -There are currently distributions in circulation containing the name -"libjpeg" which claim to be a "derivative" or "fork" of the original -libjpeg, but don't have the features and are incompatible with formats -supported by actual IJG libjpeg distributions. Furthermore, they -violate the license conditions as described under LEGAL ISSUES above. -We have no sympathy for the release of misleading and illegal -distributions derived from obsolete code bases. +There are currently different distributions in circulation containing the +name "libjpeg" which is misleading because they don't have the features and +are incompatible with formats supported by actual IJG libjpeg distributions. +One of those fakes is released by members of the ISO committee and just uses +the name of libjpeg for misdirection of people, similar to the abuse of the +name JPEG as described above, while having nothing in common with actual IJG +libjpeg distributions. +The other one claims to be a "derivative" or "fork" of the original libjpeg +and violates the license conditions as described under LEGAL ISSUES above. +We have no sympathy for the release of misleading and illegal distributions +derived from obsolete code bases. Don't use an obsolete code base! TO DO ===== -Version 8 is the first release of a new generation JPEG standard +Version 9 is the second release of a new generation JPEG standard to overcome the limitations of the original JPEG specification. More features are being prepared for coming releases... diff --git a/aclocal.m4 b/aclocal.m4 index 9b38b974..9f63e17a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.2 -*- Autoconf -*- +# generated automatically by aclocal 1.13.1 -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,13 +11,14 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # @@ -8607,25 +8607,22 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.13' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.2], [], +m4_if([$1], [1.13.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -8641,24 +8638,81 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.2])dnl +[AM_AUTOMAKE_VERSION([1.13.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=ar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [am_cv_ar_interface=ar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], + [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + ]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -8677,7 +8731,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -8703,22 +8757,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -8737,16 +8788,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -8756,7 +8805,7 @@ fi])]) # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -8769,12 +8818,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -8782,8 +8832,8 @@ AC_CACHE_CHECK([dependency style of $depcc], # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -8823,16 +8873,16 @@ AC_CACHE_CHECK([dependency style of $depcc], : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -8841,8 +8891,8 @@ AC_CACHE_CHECK([dependency style of $depcc], test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -8850,7 +8900,7 @@ AC_CACHE_CHECK([dependency style of $depcc], fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -8898,7 +8948,7 @@ AM_CONDITIONAL([am__fastdep$1], [ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -8908,9 +8958,13 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -8925,20 +8979,18 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -8951,7 +9003,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -8963,21 +9015,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -8995,7 +9045,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will +# is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -9005,15 +9055,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -9029,7 +9076,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl +[AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -9058,31 +9105,40 @@ AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -9093,28 +9149,32 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], @@ -9142,15 +9202,12 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -9164,16 +9221,14 @@ if test x"${install_sh}" != xset; then install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -9190,20 +9245,17 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, -# 2011 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless `enable' is passed literally. -# For symmetry, `disable' may be passed as well. Anyway, the user +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), @@ -9214,10 +9266,11 @@ AC_DEFUN([AM_MAINTAINER_MODE], AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], -[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - [USE_MAINTAINER_MODE=$enableval], - [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE @@ -9225,18 +9278,14 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) ] ) -AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) - # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -9254,7 +9303,7 @@ am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -9281,15 +9330,12 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -9297,11 +9343,10 @@ AC_DEFUN([AM_MISSING_PROG], $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl @@ -9314,54 +9359,22 @@ if test x"${MISSING+set}" != xset; then esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], @@ -9371,7 +9384,7 @@ AC_DEFUN([_AM_MANGLE_OPTION], # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ @@ -9385,52 +9398,18 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -AC_DEFUN([AM_C_PROTOTYPES], -[AC_REQUIRE([AC_C_PROTOTYPES]) -AC_DIAGNOSE([obsolete], - [$0: automatic de-ANSI-fication support is deprecated]) -if test "$ac_cv_prog_cc_stdc" != no; then - U= ANSI2KNR= -else - U=_ ANSI2KNR=./ansi2knr -fi -# Ensure some checks needed by ansi2knr itself. -AC_REQUIRE([AC_HEADER_STDC]) -AC_CHECK_HEADERS([string.h]) -AC_SUBST([U])dnl -AC_SUBST([ANSI2KNR])dnl -_AM_SUBST_NOTMAKE([ANSI2KNR])dnl -]) - -AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) - # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -9441,32 +9420,40 @@ case `pwd` in esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -9476,73 +9463,118 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT -# (`yes' being less verbose, `no' or empty being verbose). +# ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], -[ --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0')]) -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor `install' (even GNU) is that you can't +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -9556,18 +9588,16 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -9578,10 +9608,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) @@ -9589,7 +9620,7 @@ AC_MSG_CHECKING([how to create a $1 tar archive]) _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. +# Solaris sh will not grok spaces in the rhs of '-'. for _am_tool in $_am_tools do case $_am_tool in diff --git a/ansi2knr.1 b/ansi2knr.1 deleted file mode 100644 index f9ee5a63..00000000 --- a/ansi2knr.1 +++ /dev/null @@ -1,36 +0,0 @@ -.TH ANSI2KNR 1 "19 Jan 1996" -.SH NAME -ansi2knr \- convert ANSI C to Kernighan & Ritchie C -.SH SYNOPSIS -.I ansi2knr -[--varargs] input_file [output_file] -.SH DESCRIPTION -If no output_file is supplied, output goes to stdout. -.br -There are no error messages. -.sp -.I ansi2knr -recognizes function definitions by seeing a non-keyword identifier at the left -margin, followed by a left parenthesis, with a right parenthesis as the last -character on the line, and with a left brace as the first token on the -following line (ignoring possible intervening comments). It will recognize a -multi-line header provided that no intervening line ends with a left or right -brace or a semicolon. These algorithms ignore whitespace and comments, except -that the function name must be the first thing on the line. -.sp -The following constructs will confuse it: -.br - - Any other construct that starts at the left margin and follows the -above syntax (such as a macro or function call). -.br - - Some macros that tinker with the syntax of the function header. -.sp -The --varargs switch is obsolete, and is recognized only for -backwards compatibility. The present version of -.I ansi2knr -will always attempt to convert a ... argument to va_alist and va_dcl. -.SH AUTHOR -L. Peter Deutsch wrote the original ansi2knr and -continues to maintain the current version; most of the code in the current -version is his work. ansi2knr also includes contributions by Francois -Pinard and Jim Avera . diff --git a/ansi2knr.c b/ansi2knr.c deleted file mode 100644 index e84c210b..00000000 --- a/ansi2knr.c +++ /dev/null @@ -1,739 +0,0 @@ -/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */ - -/*$Id: ansi2knr.c,v 1.14 2003/09/06 05:36:56 eggert Exp $*/ -/* Convert ANSI C function definitions to K&R ("traditional C") syntax */ - -/* -ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY. No author or distributor accepts responsibility to anyone for the -consequences of using it or for whether it serves any particular purpose or -works at all, unless he says so in writing. Refer to the GNU General Public -License (the "GPL") for full details. - -Everyone is granted permission to copy, modify and redistribute ansi2knr, -but only under the conditions described in the GPL. A copy of this license -is supposed to have been given to you along with ansi2knr so you can know -your rights and responsibilities. It should be in a file named COPYLEFT, -or, if there is no file named COPYLEFT, a file named COPYING. Among other -things, the copyright notice and this notice must be preserved on all -copies. - -We explicitly state here what we believe is already implied by the GPL: if -the ansi2knr program is distributed as a separate set of sources and a -separate executable file which are aggregated on a storage medium together -with another program, this in itself does not bring the other program under -the GPL, nor does the mere fact that such a program or the procedures for -constructing it invoke the ansi2knr executable bring any other part of the -program under the GPL. -*/ - -/* - * Usage: - ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]] - * --filename provides the file name for the #line directive in the output, - * overriding input_file (if present). - * If no input_file is supplied, input is read from stdin. - * If no output_file is supplied, output goes to stdout. - * There are no error messages. - * - * ansi2knr recognizes function definitions by seeing a non-keyword - * identifier at the left margin, followed by a left parenthesis, with a - * right parenthesis as the last character on the line, and with a left - * brace as the first token on the following line (ignoring possible - * intervening comments and/or preprocessor directives), except that a line - * consisting of only - * identifier1(identifier2) - * will not be considered a function definition unless identifier2 is - * the word "void", and a line consisting of - * identifier1(identifier2, <>) - * will not be considered a function definition. - * ansi2knr will recognize a multi-line header provided that no intervening - * line ends with a left or right brace or a semicolon. These algorithms - * ignore whitespace, comments, and preprocessor directives, except that - * the function name must be the first thing on the line. The following - * constructs will confuse it: - * - Any other construct that starts at the left margin and - * follows the above syntax (such as a macro or function call). - * - Some macros that tinker with the syntax of function headers. - */ - -/* - * The original and principal author of ansi2knr is L. Peter Deutsch - * . Other authors are noted in the change history - * that follows (in reverse chronological order): - - lpd 2000-04-12 backs out Eggert's changes because of bugs: - - concatlits didn't declare the type of its bufend argument; - - concatlits didn't recognize when it was inside a comment; - - scanstring could scan backward past the beginning of the string; when - - the check for \ + newline in scanstring was unnecessary. - - 2000-03-05 Paul Eggert - - Add support for concatenated string literals. - * ansi2knr.c (concatlits): New decl. - (main): Invoke concatlits to concatenate string literals. - (scanstring): Handle backslash-newline correctly. Work with - character constants. Fix bug when scanning backwards through - backslash-quote. Check for unterminated strings. - (convert1): Parse character constants, too. - (appendline, concatlits): New functions. - * ansi2knr.1: Document this. - - lpd 1999-08-17 added code to allow preprocessor directives - wherever comments are allowed - lpd 1999-04-12 added minor fixes from Pavel Roskin - for clean compilation with - gcc -W -Wall - lpd 1999-03-22 added hack to recognize lines consisting of - identifier1(identifier2, xxx) as *not* being procedures - lpd 1999-02-03 made indentation of preprocessor commands consistent - lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an - endless loop; quoted strings within an argument list - confused the parser - lpd 1999-01-24 added a check for write errors on the output, - suggested by Jim Meyering - lpd 1998-11-09 added further hack to recognize identifier(void) - as being a procedure - lpd 1998-10-23 added hack to recognize lines consisting of - identifier1(identifier2) as *not* being procedures - lpd 1997-12-08 made input_file optional; only closes input and/or - output file if not stdin or stdout respectively; prints - usage message on stderr rather than stdout; adds - --filename switch (changes suggested by - ) - lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with - compilers that don't understand void, as suggested by - Tom Lane - lpd 1996-01-15 changed to require that the first non-comment token - on the line following a function header be a left brace, - to reduce sensitivity to macros, as suggested by Tom Lane - - lpd 1995-06-22 removed #ifndefs whose sole purpose was to define - undefined preprocessor symbols as 0; changed all #ifdefs - for configuration symbols to #ifs - lpd 1995-04-05 changed copyright notice to make it clear that - including ansi2knr in a program does not bring the entire - program under the GPL - lpd 1994-12-18 added conditionals for systems where ctype macros - don't handle 8-bit characters properly, suggested by - Francois Pinard ; - removed --varargs switch (this is now the default) - lpd 1994-10-10 removed CONFIG_BROKETS conditional - lpd 1994-07-16 added some conditionals to help GNU `configure', - suggested by Francois Pinard ; - properly erase prototype args in function parameters, - contributed by Jim Avera ; - correct error in writeblanks (it shouldn't erase EOLs) - lpd 1989-xx-xx original version - */ - -/* Most of the conditionals here are to make ansi2knr work with */ -/* or without the GNU configure machinery. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -#if HAVE_CONFIG_H - -/* - For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). - This will define HAVE_CONFIG_H and so, activate the following lines. - */ - -# if STDC_HEADERS || HAVE_STRING_H -# include -# else -# include -# endif - -#else /* not HAVE_CONFIG_H */ - -/* Otherwise do it the hard way */ - -# ifdef BSD -# include -# else -# ifdef VMS - extern int strlen(), strncmp(); -# else -# include -# endif -# endif - -#endif /* not HAVE_CONFIG_H */ - -#if STDC_HEADERS -# include -#else -/* - malloc and free should be declared in stdlib.h, - but if you've got a K&R compiler, they probably aren't. - */ -# ifdef MSDOS -# include -# else -# ifdef VMS - extern char *malloc(); - extern void free(); -# else - extern char *malloc(); - extern int free(); -# endif -# endif - -#endif - -/* Define NULL (for *very* old compilers). */ -#ifndef NULL -# define NULL (0) -#endif - -/* - * The ctype macros don't always handle 8-bit characters correctly. - * Compensate for this here. - */ -#ifdef isascii -# undef HAVE_ISASCII /* just in case */ -# define HAVE_ISASCII 1 -#else -#endif -#if STDC_HEADERS || !HAVE_ISASCII -# define is_ascii(c) 1 -#else -# define is_ascii(c) isascii(c) -#endif - -#define is_space(c) (is_ascii(c) && isspace(c)) -#define is_alpha(c) (is_ascii(c) && isalpha(c)) -#define is_alnum(c) (is_ascii(c) && isalnum(c)) - -/* Scanning macros */ -#define isidchar(ch) (is_alnum(ch) || (ch) == '_') -#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') - -/* Forward references */ -char *ppdirforward(); -char *ppdirbackward(); -char *skipspace(); -char *scanstring(); -int writeblanks(); -int test1(); -int convert1(); - -/* The main program */ -int -main(argc, argv) - int argc; - char *argv[]; -{ FILE *in = stdin; - FILE *out = stdout; - char *filename = 0; - char *program_name = argv[0]; - char *output_name = 0; -#define bufsize 5000 /* arbitrary size */ - char *buf; - char *line; - char *more; - char *usage = - "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n"; - /* - * In previous versions, ansi2knr recognized a --varargs switch. - * If this switch was supplied, ansi2knr would attempt to convert - * a ... argument to va_alist and va_dcl; if this switch was not - * supplied, ansi2knr would simply drop any such arguments. - * Now, ansi2knr always does this conversion, and we only - * check for this switch for backward compatibility. - */ - int convert_varargs = 1; - int output_error; - - while ( argc > 1 && argv[1][0] == '-' ) { - if ( !strcmp(argv[1], "--varargs") ) { - convert_varargs = 1; - argc--; - argv++; - continue; - } - if ( !strcmp(argv[1], "--filename") && argc > 2 ) { - filename = argv[2]; - argc -= 2; - argv += 2; - continue; - } - fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name, - argv[1]); - fprintf(stderr, usage); - exit(1); - } - switch ( argc ) - { - default: - fprintf(stderr, usage); - exit(0); - case 3: - output_name = argv[2]; - out = fopen(output_name, "w"); - if ( out == NULL ) { - fprintf(stderr, "%s: Cannot open output file %s\n", - program_name, output_name); - exit(1); - } - /* falls through */ - case 2: - in = fopen(argv[1], "r"); - if ( in == NULL ) { - fprintf(stderr, "%s: Cannot open input file %s\n", - program_name, argv[1]); - exit(1); - } - if ( filename == 0 ) - filename = argv[1]; - /* falls through */ - case 1: - break; - } - if ( filename ) - fprintf(out, "#line 1 \"%s\"\n", filename); - buf = malloc(bufsize); - if ( buf == NULL ) - { - fprintf(stderr, "Unable to allocate read buffer!\n"); - exit(1); - } - line = buf; - while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) - { -test: line += strlen(line); - switch ( test1(buf) ) - { - case 2: /* a function header */ - convert1(buf, out, 1, convert_varargs); - break; - case 1: /* a function */ - /* Check for a { at the start of the next line. */ - more = ++line; -f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ - goto wl; - if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) - goto wl; - switch ( *skipspace(ppdirforward(more), 1) ) - { - case '{': - /* Definitely a function header. */ - convert1(buf, out, 0, convert_varargs); - fputs(more, out); - break; - case 0: - /* The next line was blank or a comment: */ - /* keep scanning for a non-comment. */ - line += strlen(line); - goto f; - default: - /* buf isn't a function header, but */ - /* more might be. */ - fputs(buf, out); - strcpy(buf, more); - line = buf; - goto test; - } - break; - case -1: /* maybe the start of a function */ - if ( line != buf + (bufsize - 1) ) /* overflow check */ - continue; - /* falls through */ - default: /* not a function */ -wl: fputs(buf, out); - break; - } - line = buf; - } - if ( line != buf ) - fputs(buf, out); - free(buf); - if ( output_name ) { - output_error = ferror(out); - output_error |= fclose(out); - } else { /* out == stdout */ - fflush(out); - output_error = ferror(out); - } - if ( output_error ) { - fprintf(stderr, "%s: error writing to %s\n", program_name, - (output_name ? output_name : "stdout")); - exit(1); - } - if ( in != stdin ) - fclose(in); - return 0; -} - -/* - * Skip forward or backward over one or more preprocessor directives. - */ -char * -ppdirforward(p) - char *p; -{ - for (; *p == '#'; ++p) { - for (; *p != '\r' && *p != '\n'; ++p) - if (*p == 0) - return p; - if (*p == '\r' && p[1] == '\n') - ++p; - } - return p; -} -char * -ppdirbackward(p, limit) - char *p; - char *limit; -{ - char *np = p; - - for (;; p = --np) { - if (*np == '\n' && np[-1] == '\r') - --np; - for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np) - if (np[-1] == 0) - return np; - if (*np != '#') - return p; - } -} - -/* - * Skip over whitespace, comments, and preprocessor directives, - * in either direction. - */ -char * -skipspace(p, dir) - char *p; - int dir; /* 1 for forward, -1 for backward */ -{ - for ( ; ; ) { - while ( is_space(*p) ) - p += dir; - if ( !(*p == '/' && p[dir] == '*') ) - break; - p += dir; p += dir; - while ( !(*p == '*' && p[dir] == '/') ) { - if ( *p == 0 ) - return p; /* multi-line comment?? */ - p += dir; - } - p += dir; p += dir; - } - return p; -} - -/* Scan over a quoted string, in either direction. */ -char * -scanstring(p, dir) - char *p; - int dir; -{ - for (p += dir; ; p += dir) - if (*p == '"' && p[-dir] != '\\') - return p + dir; -} - -/* - * Write blanks over part of a string. - * Don't overwrite end-of-line characters. - */ -int -writeblanks(start, end) - char *start; - char *end; -{ char *p; - for ( p = start; p < end; p++ ) - if ( *p != '\r' && *p != '\n' ) - *p = ' '; - return 0; -} - -/* - * Test whether the string in buf is a function definition. - * The string may contain and/or end with a newline. - * Return as follows: - * 0 - definitely not a function definition; - * 1 - definitely a function definition; - * 2 - definitely a function prototype (NOT USED); - * -1 - may be the beginning of a function definition, - * append another line and look again. - * The reason we don't attempt to convert function prototypes is that - * Ghostscript's declaration-generating macros look too much like - * prototypes, and confuse the algorithms. - */ -int -test1(buf) - char *buf; -{ char *p = buf; - char *bend; - char *endfn; - int contin; - - if ( !isidfirstchar(*p) ) - return 0; /* no name at left margin */ - bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1); - switch ( *bend ) - { - case ';': contin = 0 /*2*/; break; - case ')': contin = 1; break; - case '{': return 0; /* not a function */ - case '}': return 0; /* not a function */ - default: contin = -1; - } - while ( isidchar(*p) ) - p++; - endfn = p; - p = skipspace(p, 1); - if ( *p++ != '(' ) - return 0; /* not a function */ - p = skipspace(p, 1); - if ( *p == ')' ) - return 0; /* no parameters */ - /* Check that the apparent function name isn't a keyword. */ - /* We only need to check for keywords that could be followed */ - /* by a left parenthesis (which, unfortunately, is most of them). */ - { static char *words[] = - { "asm", "auto", "case", "char", "const", "double", - "extern", "float", "for", "if", "int", "long", - "register", "return", "short", "signed", "sizeof", - "static", "switch", "typedef", "unsigned", - "void", "volatile", "while", 0 - }; - char **key = words; - char *kp; - unsigned len = endfn - buf; - - while ( (kp = *key) != 0 ) - { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) - return 0; /* name is a keyword */ - key++; - } - } - { - char *id = p; - int len; - /* - * Check for identifier1(identifier2) and not - * identifier1(void), or identifier1(identifier2, xxxx). - */ - - while ( isidchar(*p) ) - p++; - len = p - id; - p = skipspace(p, 1); - if (*p == ',' || - (*p == ')' && (len != 4 || strncmp(id, "void", 4))) - ) - return 0; /* not a function */ - } - /* - * If the last significant character was a ), we need to count - * parentheses, because it might be part of a formal parameter - * that is a procedure. - */ - if (contin > 0) { - int level = 0; - - for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1)) - level += (*p == '(' ? 1 : *p == ')' ? -1 : 0); - if (level > 0) - contin = -1; - } - return contin; -} - -/* Convert a recognized function definition or header to K&R syntax. */ -int -convert1(buf, out, header, convert_varargs) - char *buf; - FILE *out; - int header; /* Boolean */ - int convert_varargs; /* Boolean */ -{ char *endfn; - char *p; - /* - * The breaks table contains pointers to the beginning and end - * of each argument. - */ - char **breaks; - unsigned num_breaks = 2; /* for testing */ - char **btop; - char **bp; - char **ap; - char *vararg = 0; - - /* Pre-ANSI implementations don't agree on whether strchr */ - /* is called strchr or index, so we open-code it here. */ - for ( endfn = buf; *(endfn++) != '('; ) - ; -top: p = endfn; - breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); - if ( breaks == NULL ) - { /* Couldn't allocate break table, give up */ - fprintf(stderr, "Unable to allocate break table!\n"); - fputs(buf, out); - return -1; - } - btop = breaks + num_breaks * 2 - 2; - bp = breaks; - /* Parse the argument list */ - do - { int level = 0; - char *lp = NULL; - char *rp = NULL; - char *end = NULL; - - if ( bp >= btop ) - { /* Filled up break table. */ - /* Allocate a bigger one and start over. */ - free((char *)breaks); - num_breaks <<= 1; - goto top; - } - *bp++ = p; - /* Find the end of the argument */ - for ( ; end == NULL; p++ ) - { switch(*p) - { - case ',': - if ( !level ) end = p; - break; - case '(': - if ( !level ) lp = p; - level++; - break; - case ')': - if ( --level < 0 ) end = p; - else rp = p; - break; - case '/': - if (p[1] == '*') - p = skipspace(p, 1) - 1; - break; - case '"': - p = scanstring(p, 1) - 1; - break; - default: - ; - } - } - /* Erase any embedded prototype parameters. */ - if ( lp && rp ) - writeblanks(lp + 1, rp); - p--; /* back up over terminator */ - /* Find the name being declared. */ - /* This is complicated because of procedure and */ - /* array modifiers. */ - for ( ; ; ) - { p = skipspace(p - 1, -1); - switch ( *p ) - { - case ']': /* skip array dimension(s) */ - case ')': /* skip procedure args OR name */ - { int level = 1; - while ( level ) - switch ( *--p ) - { - case ']': case ')': - level++; - break; - case '[': case '(': - level--; - break; - case '/': - if (p > buf && p[-1] == '*') - p = skipspace(p, -1) + 1; - break; - case '"': - p = scanstring(p, -1) + 1; - break; - default: ; - } - } - if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) - { /* We found the name being declared */ - while ( !isidfirstchar(*p) ) - p = skipspace(p, 1) + 1; - goto found; - } - break; - default: - goto found; - } - } -found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) - { if ( convert_varargs ) - { *bp++ = "va_alist"; - vararg = p-2; - } - else - { p++; - if ( bp == breaks + 1 ) /* sole argument */ - writeblanks(breaks[0], p); - else - writeblanks(bp[-1] - 1, p); - bp--; - } - } - else - { while ( isidchar(*p) ) p--; - *bp++ = p+1; - } - p = end; - } - while ( *p++ == ',' ); - *bp = p; - /* Make a special check for 'void' arglist */ - if ( bp == breaks+2 ) - { p = skipspace(breaks[0], 1); - if ( !strncmp(p, "void", 4) ) - { p = skipspace(p+4, 1); - if ( p == breaks[2] - 1 ) - { bp = breaks; /* yup, pretend arglist is empty */ - writeblanks(breaks[0], p + 1); - } - } - } - /* Put out the function name and left parenthesis. */ - p = buf; - while ( p != endfn ) putc(*p, out), p++; - /* Put out the declaration. */ - if ( header ) - { fputs(");", out); - for ( p = breaks[0]; *p; p++ ) - if ( *p == '\r' || *p == '\n' ) - putc(*p, out); - } - else - { for ( ap = breaks+1; ap < bp; ap += 2 ) - { p = *ap; - while ( isidchar(*p) ) - putc(*p, out), p++; - if ( ap < bp - 1 ) - fputs(", ", out); - } - fputs(") ", out); - /* Put out the argument declarations */ - for ( ap = breaks+2; ap <= bp; ap += 2 ) - (*ap)[-1] = ';'; - if ( vararg != 0 ) - { *vararg = 0; - fputs(breaks[0], out); /* any prior args */ - fputs("va_dcl", out); /* the final arg */ - fputs(bp[0], out); - } - else - fputs(breaks[0], out); - } - free((char *)breaks); - return 0; -} diff --git a/ar-lib b/ar-lib new file mode 100755 index 00000000..fe2301e7 --- /dev/null +++ b/ar-lib @@ -0,0 +1,270 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2012-03-01.08; # UTC + +# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <= 9 + fprintf(stderr, " -rgb1 Create RGB JPEG file with reversible color transform\n"); +#endif #ifdef DCT_ISLOW_SUPPORTED fprintf(stderr, " -dct int Use integer DCT method%s\n", (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : "")); @@ -310,8 +313,14 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, /* Force a monochrome JPEG file to be generated. */ jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); - } else if (keymatch(arg, "rgb", 3)) { + } else if (keymatch(arg, "rgb", 3) || keymatch(arg, "rgb1", 4)) { /* Force an RGB JPEG file to be generated. */ +#if JPEG_LIB_VERSION_MAJOR >= 9 + /* Note: Entropy table assignment in jpeg_set_colorspace depends + * on color_transform. + */ + cinfo->color_transform = arg[3] ? JCT_SUBTRACT_GREEN : JCT_NONE; +#endif jpeg_set_colorspace(cinfo, JCS_RGB); } else if (keymatch(arg, "maxmemory", 3)) { @@ -328,7 +337,7 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, cinfo->mem->max_memory_to_use = lval * 1000L; } else if (keymatch(arg, "nosmooth", 3)) { - /* Suppress fancy downsampling */ + /* Suppress fancy downsampling. */ cinfo->do_fancy_downsampling = FALSE; } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) { @@ -414,7 +423,7 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, /* Scale the image by a fraction M/N. */ if (++argn >= argc) /* advance to next argument */ usage(); - if (sscanf(argv[argn], "%d/%d", + if (sscanf(argv[argn], "%u/%u", &cinfo->scale_num, &cinfo->scale_denom) != 2) usage(); diff --git a/config.guess b/config.guess index 8152efd6..1804e9fc 100755 --- a/config.guess +++ b/config.guess @@ -2,13 +2,13 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012, 2013 Free Software Foundation, Inc. -timestamp='2011-11-11' +timestamp='2012-12-29' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -17,26 +17,22 @@ timestamp='2011-11-11' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -57,8 +53,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, +2012, 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +141,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -202,6 +198,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -304,7 +304,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -803,6 +803,9 @@ EOF i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; @@ -863,6 +866,13 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -897,16 +907,16 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) - echo hexagon-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -948,7 +958,7 @@ EOF test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -989,7 +999,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1196,6 +1206,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1251,7 +1264,7 @@ EOF NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1320,11 +1333,11 @@ EOF i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - eval $set_cc_for_build cat >$dummy.c <. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -76,8 +71,8 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, +2012, 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -125,13 +120,17 @@ esac maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -154,7 +153,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -223,6 +222,12 @@ case $os in -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; -lynx*) os=-lynxos ;; @@ -247,11 +252,14 @@ case $basic_machine in # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ @@ -264,7 +272,7 @@ case $basic_machine in | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -319,8 +327,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -333,7 +340,10 @@ case $basic_machine in strongarm | thumb | xscale) basic_machine=arm-unknown ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; xscaleeb) basic_machine=armeb-unknown ;; @@ -356,6 +366,7 @@ case $basic_machine in # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ @@ -377,7 +388,8 @@ case $basic_machine in | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -719,7 +731,6 @@ case $basic_machine in i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -777,9 +788,13 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -1008,7 +1023,11 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1341,15 +1360,15 @@ case $os in | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1532,6 +1551,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + hexagon-*) + os=-elf + ;; tic54x-*) os=-coff ;; @@ -1559,9 +1581,6 @@ case $basic_machine in ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout diff --git a/configure b/configure index 9ba1383c..c7b13875 100755 --- a/configure +++ b/configure @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libjpeg 8.4.0. +# Generated by GNU Autoconf 2.69 for libjpeg 9.0.0. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -220,21 +244,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -336,6 +364,14 @@ $as_echo X"$as_dir" | } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -457,6 +493,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -491,16 +531,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -512,28 +552,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -567,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libjpeg' PACKAGE_TARNAME='libjpeg' -PACKAGE_VERSION='8.4.0' -PACKAGE_STRING='libjpeg 8.4.0' +PACKAGE_VERSION='9.0.0' +PACKAGE_STRING='libjpeg 9.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -621,8 +641,6 @@ NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB -ac_ct_AR -AR NM ac_ct_DUMPBIN DUMPBIN @@ -633,16 +651,13 @@ LIBTOOL OBJDUMP DLLTOOL AS -HAVE_LD_VERSION_SCRIPT_FALSE -HAVE_LD_VERSION_SCRIPT_TRUE -LN_S -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE -ANSI2KNR -U EGREP GREP +HAVE_LD_VERSION_SCRIPT_FALSE +HAVE_LD_VERSION_SCRIPT_TRUE +ac_ct_AR +AR +LN_S CPP am__fastdepCC_FALSE am__fastdepCC_TRUE @@ -661,8 +676,13 @@ CPPFLAGS LDFLAGS CFLAGS CC +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -740,8 +760,8 @@ ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules -enable_dependency_tracking enable_maintainer_mode +enable_dependency_tracking enable_ld_version_script enable_shared enable_static @@ -1216,8 +1236,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1303,7 +1321,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libjpeg 8.4.0 to adapt to many kinds of systems. +\`configure' configures libjpeg 9.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1374,7 +1392,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libjpeg 8.4.0:";; + short | recursive ) echo "Configuration of libjpeg 9.0.0:";; esac cat <<\_ACEOF @@ -1382,12 +1400,15 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0') - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-ld-version-script enable linker version script (default is enabled when possible) @@ -1483,10 +1504,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libjpeg configure 8.4.0 -generated by GNU Autoconf 2.68 +libjpeg configure 9.0.0 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1572,13 +1593,13 @@ fi } # ac_fn_c_try_cpp -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -1586,33 +1607,37 @@ case "(($ac_try" in esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 + (eval "$ac_link") 2>conftest.err ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : ac_retval=0 else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=1 fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_try_run +} # ac_fn_c_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- @@ -1701,6 +1726,48 @@ fi } # ac_fn_c_check_header_mongrel +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -1732,52 +1799,6 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_header_compile -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -1848,8 +1869,8 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libjpeg $as_me 8.4.0, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by libjpeg $as_me 9.0.0, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2349,7 +2370,7 @@ test -n "$target_alias" && # Initialize Automake # Don't require all the GNU mandated files -am__api_version='1.11' +am__api_version='1.13' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2388,7 +2409,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2446,9 +2467,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2459,32 +2477,40 @@ case `pwd` in esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then @@ -2496,6 +2522,16 @@ Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -2518,12 +2554,12 @@ if test x"${MISSING+set}" != xset; then esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -2535,10 +2571,10 @@ if test x"${install_sh}" != xset; then esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. +# will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. @@ -2557,7 +2593,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2597,7 +2633,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2648,7 +2684,7 @@ do test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2677,12 +2713,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2701,7 +2731,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2765,6 +2795,45 @@ else fi rmdir .tst 2>/dev/null +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -2787,7 +2856,7 @@ fi # Define the identity of the package. PACKAGE='libjpeg' - VERSION='8.4.0' + VERSION='9.0.0' cat >>confdefs.h <<_ACEOF @@ -2815,13 +2884,19 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -2836,78 +2911,69 @@ if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=0;; +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi AM_BACKSLASH='\' -# This is required when using the de-ANSI-fication feature. -DEPDIR="${am__leading_dot}deps" +# Add configure option --enable-maintainer-mode which enables +# dependency checking and generation useful to package maintainers. +# This is made an option to avoid confusing end users. -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else - AMDEP_TRUE='#' - AMDEP_FALSE= + USE_MAINTAINER_MODE=no fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# Check for programs ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2930,7 +2996,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2970,7 +3036,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3023,7 +3089,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3064,7 +3130,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3122,7 +3188,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3166,7 +3232,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3612,8 +3678,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3697,6 +3762,69 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + depcc="$CC" am_compiler_list= @@ -3709,8 +3837,8 @@ else # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -3745,16 +3873,16 @@ else : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -3763,8 +3891,8 @@ else test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -3772,1140 +3900,7 @@ else fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5 -$as_echo_n "checking for function prototypes... " >&6; } -if test "$ac_cv_prog_cc_c89" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define PROTOTYPES 1" >>confdefs.h - - -$as_echo "#define __PROTOTYPES 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - -if test "$ac_cv_prog_cc_stdc" != no; then - U= ANSI2KNR= -else - U=_ ANSI2KNR=./ansi2knr -fi -# Ensure some checks needed by ansi2knr itself. - -for ac_header in string.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" -if test "x$ac_cv_header_string_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRING_H 1 -_ACEOF - -fi - -done - - - -# Add configure option --enable-maintainer-mode which enables -# dependency checking and generation useful to package maintainers. -# This is made an option to avoid confusing end users. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - -# Check for programs -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -5109,7 +4104,7 @@ main () return 0; } _ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : @@ -5149,8 +4144,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -5433,6 +4427,167 @@ $as_echo "no, using $LN_S" >&6; } fi +if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_ar_interface=ar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable = 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac + + # Check if LD supports linker scripts, # and define automake conditional HAVE_LD_VERSION_SCRIPT if so. # Check whether --enable-ld-version-script was given. @@ -5535,6 +4690,266 @@ $as_echo "$as_me: WARNING: Your compiler does not seem to know about function pr fi # Check header files + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + for ac_header in stddef.h stdlib.h locale.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -5736,11 +5151,11 @@ else int main () { -/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus - /* Ultrix mips cc rejects this. */ + /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; - const charset cs; + const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; @@ -5757,8 +5172,9 @@ main () ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; @@ -5774,10 +5190,10 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this saying + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; @@ -5937,6 +5353,10 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifdef HAVE_STDLIB_H +#include +#endif +#include #ifdef HAVE_PROTOTYPES int is_char_signed (int arg) #else @@ -5982,6 +5402,10 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifdef HAVE_STDLIB_H +#include +#endif +#include #ifdef HAVE_PROTOTYPES int is_shifting_signed (long arg) #else @@ -6033,6 +5457,9 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifdef HAVE_STDLIB_H +#include +#endif #include int main() { if (fopen("conftestdata", "wb") != NULL) @@ -6077,7 +5504,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6117,7 +5544,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6169,7 +5596,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6209,7 +5636,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6261,7 +5688,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6301,7 +5728,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6475,7 +5902,7 @@ do for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -6554,7 +5981,7 @@ do for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -6810,7 +6237,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6854,7 +6281,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7267,7 +6694,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7307,7 +6734,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7610,7 +7037,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7650,7 +7077,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7750,7 +7177,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7794,7 +7221,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7919,7 +7346,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7959,7 +7386,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8018,7 +7445,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8058,7 +7485,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8707,7 +8134,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8747,7 +8174,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8827,7 +8254,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8867,7 +8294,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8919,7 +8346,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8959,7 +8386,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9011,7 +8438,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9051,7 +8478,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9103,7 +8530,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9143,7 +8570,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9195,7 +8622,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9235,7 +8662,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13636,6 +13063,7 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -13650,6 +13078,14 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -13658,18 +13094,14 @@ else am__EXEEXT_FALSE= fi -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -13976,16 +13408,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -14045,28 +13477,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -14087,8 +13507,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libjpeg $as_me 8.4.0, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by libjpeg $as_me 9.0.0, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -14153,11 +13573,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libjpeg config.status 8.4.0 -configured by $0, generated by GNU Autoconf 2.68, +libjpeg config.status 9.0.0 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -14248,7 +13668,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -15161,7 +14581,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -15174,7 +14594,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -15208,21 +14628,19 @@ $as_echo X"$mf" | continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || diff --git a/configure.ac b/configure.ac index 12293b01..e0cc36b7 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ # Configure script for IJG libjpeg # -AC_INIT([libjpeg], [8.4.0]) +AC_INIT([libjpeg], [9.0.0]) # Directory where autotools helper scripts lives. AC_CONFIG_AUX_DIR([.]) @@ -21,16 +21,13 @@ AC_CANONICAL_TARGET # Initialize Automake # Don't require all the GNU mandated files -AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obsolete ansi2knr no-dist foreign]) +AM_INIT_AUTOMAKE([-Wall -Werror no-dist foreign]) # Make --enable-silent-rules the default. # To get verbose build output you may configure # with --disable-silent-rules or use "make V=1". AM_SILENT_RULES([yes]) -# This is required when using the de-ANSI-fication feature. -AM_C_PROTOTYPES - # Add configure option --enable-maintainer-mode which enables # dependency checking and generation useful to package maintainers. # This is made an option to avoid confusing end users. @@ -43,6 +40,7 @@ AC_PROG_CPP AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LN_S +AM_PROG_AR # Check if LD supports linker scripts, # and define automake conditional HAVE_LD_VERSION_SCRIPT if so. @@ -225,6 +223,10 @@ int possibly_dupli_function () { return 1; } # Run-time checks AC_MSG_CHECKING([to see if char is signed]) AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include +#endif +#include #ifdef HAVE_PROTOTYPES int is_char_signed (int arg) #else @@ -254,6 +256,10 @@ int main() { AC_MSG_CHECKING([to see if right shift is signed]) AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include +#endif +#include #ifdef HAVE_PROTOTYPES int is_shifting_signed (long arg) #else @@ -288,6 +294,9 @@ int main() { AC_MSG_CHECKING([to see if fopen accepts b spec]) AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include +#endif #include int main() { if (fopen("conftestdata", "wb") != NULL) diff --git a/depcomp b/depcomp index bd0ac089..06b0882d 100755 --- a/depcomp +++ b/depcomp @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2012-10-18.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,9 +27,9 @@ scriptversion=2011-12-04.11; # UTC case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -40,8 +39,8 @@ as side-effects. Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. @@ -57,6 +56,66 @@ EOF ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -69,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -80,26 +142,32 @@ if test "$depmode" = hp; then fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -122,8 +190,7 @@ gcc3) done "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -131,13 +198,17 @@ gcc3) ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -145,33 +216,31 @@ gcc) fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -189,8 +258,7 @@ sgi) "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -198,43 +266,41 @@ sgi) if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u @@ -247,9 +313,7 @@ aix) "$@" -M fi stat=$? - - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi @@ -258,44 +322,100 @@ aix) do test -f "$tmpdepfile" && break done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -307,8 +427,8 @@ icc) sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -319,9 +439,8 @@ hp2) # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d @@ -332,8 +451,7 @@ hp2) "$@" +Maked fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi @@ -343,77 +461,61 @@ hp2) test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; msvc7) if test "$libtool" = yes; then @@ -424,8 +526,7 @@ msvc7) "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" - if test "$stat" = 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -443,11 +544,11 @@ msvc7) p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g -s/\(.*\)/ \1 \\/p +s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { - s/.*/ / + s/.*/'"$tab"'/ G p }' >> "$depfile" @@ -478,7 +579,7 @@ dashmstdout) shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -498,18 +599,18 @@ dashmstdout) done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -562,11 +663,12 @@ makedepend) # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -583,7 +685,7 @@ cpp) shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -602,10 +704,10 @@ cpp) esac done - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -637,23 +739,23 @@ msvisualcpp) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff --git a/djpeg.c b/djpeg.c index bc544dc1..be7f2690 100644 --- a/djpeg.c +++ b/djpeg.c @@ -2,7 +2,7 @@ * djpeg.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2009 by Guido Vollbeding. + * Modified 2009-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -298,7 +298,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, cinfo->mem->max_memory_to_use = lval * 1000L; } else if (keymatch(arg, "nosmooth", 3)) { - /* Suppress fancy upsampling */ + /* Suppress fancy upsampling. */ cinfo->do_fancy_upsampling = FALSE; } else if (keymatch(arg, "onepass", 3)) { @@ -327,7 +327,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, /* Scale the output image by a fraction M/N. */ if (++argn >= argc) /* advance to next argument */ usage(); - if (sscanf(argv[argn], "%d/%d", + if (sscanf(argv[argn], "%u/%u", &cinfo->scale_num, &cinfo->scale_denom) < 1) usage(); diff --git a/filelist.txt b/filelist.txt index 7e053869..86633bc6 100644 --- a/filelist.txt +++ b/filelist.txt @@ -1,6 +1,6 @@ IJG JPEG LIBRARY: FILE LIST -Copyright (C) 1994-2009, Thomas G. Lane, Guido Vollbeding. +Copyright (C) 1994-2012, Thomas G. Lane, Guido Vollbeding. This file is part of the Independent JPEG Group's software. For conditions of distribution and use, see the accompanying README file. @@ -197,6 +197,7 @@ config.guess config.sub depcomp missing +ar-lib install-sh Install shell script for those Unix systems lacking one. Makefile.in Makefile input for configure. Makefile.am Source file for use with Automake to generate Makefile.in. @@ -206,8 +207,6 @@ mak*.* Sample makefiles for particular systems. jconfig.* Sample jconfig.h for particular systems. libjpeg.map Script to generate shared library with versioned symbols. aclocal.m4 M4 macro definitions for use with Autoconf. -ansi2knr.c De-ANSIfier for pre-ANSI C compilers (courtesy of - L. Peter Deutsch and Aladdin Enterprises). Test files (see install.txt for test procedure): diff --git a/install-sh b/install-sh index a9244eb0..377bb868 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-01-19.21; # UTC +scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ scriptversion=2011-01-19.21; # UTC # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,7 +156,7 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -190,7 +190,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -202,7 +202,7 @@ if test $# -eq 0; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi @@ -240,7 +240,7 @@ fi for src do - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac @@ -354,7 +354,7 @@ do if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. + # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in diff --git a/install.txt b/install.txt index 04bed914..7ca92cbc 100644 --- a/install.txt +++ b/install.txt @@ -1,6 +1,6 @@ INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software -Copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding. +Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. This file is part of the Independent JPEG Group's software. For conditions of distribution and use, see the accompanying README file. @@ -848,14 +848,14 @@ with /Oo-. Microsoft Windows (all versions), generic comments: Some Windows system include files define typedef boolean as "unsigned char". -The IJG code also defines typedef boolean, but we make it "int" by default. +The IJG code also defines typedef boolean, but we make it an "enum" by default. This doesn't affect the IJG programs because we don't import those Windows include files. But if you use the JPEG library in your own program, and some of your program's files import one definition of boolean while some import the other, you can get all sorts of mysterious problems. A good preventive step is to make the IJG library use "unsigned char" for boolean. To do that, add something like this to your jconfig.h file: - /* Define "boolean" as unsigned char, not int, per Windows custom */ + /* Define "boolean" as unsigned char, not enum, per Windows custom */ #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; #endif diff --git a/jcarith.c b/jcarith.c index 033f6706..a7f9ff7a 100644 --- a/jcarith.c +++ b/jcarith.c @@ -1,7 +1,7 @@ /* * jcarith.c * - * Developed 1997-2011 by Guido Vollbeding. + * Developed 1997-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -479,7 +479,8 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */ /* Establish EOB (end-of-block) index */ - for (ke = cinfo->Se; ke > 0; ke--) + ke = cinfo->Se; + do { /* We must apply the point transform by Al. For AC coefficients this * is an integer division with rounding towards 0. To do this portably * in C, we shift after obtaining the absolute value. @@ -490,13 +491,14 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) v = -v; if (v >>= cinfo->Al) break; } + } while (--ke); /* Figure F.5: Encode_AC_Coefficients */ - for (k = cinfo->Ss; k <= ke; k++) { - st = entropy->ac_stats[tbl] + 3 * (k - 1); + for (k = cinfo->Ss - 1; k < ke;) { + st = entropy->ac_stats[tbl] + 3 * k; arith_encode(cinfo, st, 0); /* EOB decision */ for (;;) { - if ((v = (*block)[natural_order[k]]) >= 0) { + if ((v = (*block)[natural_order[++k]]) >= 0) { if (v >>= cinfo->Al) { arith_encode(cinfo, st + 1, 1); arith_encode(cinfo, entropy->fixed_bin, 0); @@ -510,7 +512,8 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) break; } } - arith_encode(cinfo, st + 1, 0); st += 3; k++; + arith_encode(cinfo, st + 1, 0); + st += 3; } st += 2; /* Figure F.8: Encoding the magnitude category of v */ @@ -537,9 +540,9 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) while (m >>= 1) arith_encode(cinfo, st, (m & v) ? 1 : 0); } - /* Encode EOB decision only if k <= cinfo->Se */ - if (k <= cinfo->Se) { - st = entropy->ac_stats[tbl] + 3 * (k - 1); + /* Encode EOB decision only if k < cinfo->Se */ + if (k < cinfo->Se) { + st = entropy->ac_stats[tbl] + 3 * k; arith_encode(cinfo, st, 1); } @@ -616,7 +619,8 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) /* Section G.1.3.3: Encoding of AC coefficients */ /* Establish EOB (end-of-block) index */ - for (ke = cinfo->Se; ke > 0; ke--) + ke = cinfo->Se; + do { /* We must apply the point transform by Al. For AC coefficients this * is an integer division with rounding towards 0. To do this portably * in C, we shift after obtaining the absolute value. @@ -627,6 +631,7 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) v = -v; if (v >>= cinfo->Al) break; } + } while (--ke); /* Establish EOBx (previous stage end-of-block) index */ for (kex = ke; kex > 0; kex--) @@ -638,12 +643,12 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) } /* Figure G.10: Encode_AC_Coefficients_SA */ - for (k = cinfo->Ss; k <= ke; k++) { - st = entropy->ac_stats[tbl] + 3 * (k - 1); - if (k > kex) + for (k = cinfo->Ss - 1; k < ke;) { + st = entropy->ac_stats[tbl] + 3 * k; + if (k >= kex) arith_encode(cinfo, st, 0); /* EOB decision */ for (;;) { - if ((v = (*block)[natural_order[k]]) >= 0) { + if ((v = (*block)[natural_order[++k]]) >= 0) { if (v >>= cinfo->Al) { if (v >> 1) /* previously nonzero coef */ arith_encode(cinfo, st + 2, (v & 1)); @@ -665,12 +670,13 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) break; } } - arith_encode(cinfo, st + 1, 0); st += 3; k++; + arith_encode(cinfo, st + 1, 0); + st += 3; } } - /* Encode EOB decision only if k <= cinfo->Se */ - if (k <= cinfo->Se) { - st = entropy->ac_stats[tbl] + 3 * (k - 1); + /* Encode EOB decision only if k < cinfo->Se */ + if (k < cinfo->Se) { + st = entropy->ac_stats[tbl] + 3 * k; arith_encode(cinfo, st, 1); } @@ -922,7 +928,7 @@ jinit_arith_encoder (j_compress_ptr cinfo) entropy = (arith_entropy_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(arith_entropy_encoder)); - cinfo->entropy = (struct jpeg_entropy_encoder *) entropy; + cinfo->entropy = &entropy->pub; entropy->pub.start_pass = start_pass; entropy->pub.finish_pass = finish_pass; diff --git a/jccolor.c b/jccolor.c index 3e2d0e92..81d74efb 100644 --- a/jccolor.c +++ b/jccolor.c @@ -2,7 +2,7 @@ * jccolor.c * * Copyright (C) 1991-1996, Thomas G. Lane. - * Modified 2011 by Guido Vollbeding. + * Modified 2011-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -133,8 +133,8 @@ rgb_ycc_convert (j_compress_ptr cinfo, JDIMENSION output_row, int num_rows) { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int r, g, b; register INT32 * ctab = cconvert->rgb_ycc_tab; + register int r, g, b; register JSAMPROW inptr; register JSAMPROW outptr0, outptr1, outptr2; register JDIMENSION col; @@ -150,7 +150,6 @@ rgb_ycc_convert (j_compress_ptr cinfo, r = GETJSAMPLE(inptr[RGB_RED]); g = GETJSAMPLE(inptr[RGB_GREEN]); b = GETJSAMPLE(inptr[RGB_BLUE]); - inptr += RGB_PIXELSIZE; /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations * must be too; we do not need an explicit range-limiting operation. * Hence the value being shifted is never negative, and we don't @@ -168,6 +167,7 @@ rgb_ycc_convert (j_compress_ptr cinfo, outptr2[col] = (JSAMPLE) ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) >> SCALEBITS); + inptr += RGB_PIXELSIZE; } } } @@ -189,8 +189,8 @@ rgb_gray_convert (j_compress_ptr cinfo, JDIMENSION output_row, int num_rows) { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int r, g, b; register INT32 * ctab = cconvert->rgb_ycc_tab; + register int r, g, b; register JSAMPROW inptr; register JSAMPROW outptr; register JDIMENSION col; @@ -198,17 +198,16 @@ rgb_gray_convert (j_compress_ptr cinfo, while (--num_rows >= 0) { inptr = *input_buf++; - outptr = output_buf[0][output_row]; - output_row++; + outptr = output_buf[0][output_row++]; for (col = 0; col < num_cols; col++) { r = GETJSAMPLE(inptr[RGB_RED]); g = GETJSAMPLE(inptr[RGB_GREEN]); b = GETJSAMPLE(inptr[RGB_BLUE]); - inptr += RGB_PIXELSIZE; /* Y */ outptr[col] = (JSAMPLE) ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) >> SCALEBITS); + inptr += RGB_PIXELSIZE; } } } @@ -228,8 +227,8 @@ cmyk_ycck_convert (j_compress_ptr cinfo, JDIMENSION output_row, int num_rows) { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int r, g, b; register INT32 * ctab = cconvert->rgb_ycc_tab; + register int r, g, b; register JSAMPROW inptr; register JSAMPROW outptr0, outptr1, outptr2, outptr3; register JDIMENSION col; @@ -248,7 +247,6 @@ cmyk_ycck_convert (j_compress_ptr cinfo, b = MAXJSAMPLE - GETJSAMPLE(inptr[2]); /* K passes through as-is */ outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */ - inptr += 4; /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations * must be too; we do not need an explicit range-limiting operation. * Hence the value being shifted is never negative, and we don't @@ -266,6 +264,46 @@ cmyk_ycck_convert (j_compress_ptr cinfo, outptr2[col] = (JSAMPLE) ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) >> SCALEBITS); + inptr += 4; + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * [R,G,B] to [R-G,G,B-G] conversion with modulo calculation + * (forward reversible color transform). + */ + +METHODDEF(void) +rgb_rgb1_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + register int r, g, b; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD + * (modulo) operator is equivalent to the bitmask operator AND. + */ + outptr0[col] = (JSAMPLE) ((r - g + CENTERJSAMPLE) & MAXJSAMPLE); + outptr1[col] = (JSAMPLE) g; + outptr2[col] = (JSAMPLE) ((b - g + CENTERJSAMPLE) & MAXJSAMPLE); + inptr += RGB_PIXELSIZE; } } } @@ -282,16 +320,15 @@ grayscale_convert (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { + int instride = cinfo->input_components; register JSAMPROW inptr; register JSAMPROW outptr; register JDIMENSION col; JDIMENSION num_cols = cinfo->image_width; - int instride = cinfo->input_components; while (--num_rows >= 0) { inptr = *input_buf++; - outptr = output_buf[0][output_row]; - output_row++; + outptr = output_buf[0][output_row++]; for (col = 0; col < num_cols; col++) { outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */ inptr += instride; @@ -344,20 +381,20 @@ null_convert (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { + int ci; + register int nc = cinfo->num_components; register JSAMPROW inptr; register JSAMPROW outptr; register JDIMENSION col; - register int ci; - int nc = cinfo->num_components; JDIMENSION num_cols = cinfo->image_width; while (--num_rows >= 0) { /* It seems fastest to make a separate pass for each component. */ for (ci = 0; ci < nc; ci++) { - inptr = *input_buf; + inptr = input_buf[0] + ci; outptr = output_buf[ci][output_row]; for (col = 0; col < num_cols; col++) { - outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */ + *outptr++ = *inptr; /* don't need GETJSAMPLE() here */ inptr += nc; } } @@ -390,7 +427,7 @@ jinit_color_converter (j_compress_ptr cinfo) cconvert = (my_cconvert_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_color_converter)); - cinfo->cconvert = (struct jpeg_color_converter *) cconvert; + cinfo->cconvert = &cconvert->pub; /* set start_pass to null method until we find out differently */ cconvert->pub.start_pass = null_method; @@ -423,6 +460,10 @@ jinit_color_converter (j_compress_ptr cinfo) break; } + /* Support color transform only for RGB colorspace */ + if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + /* Check num_components, set conversion method based on requested space */ switch (cinfo->jpeg_color_space) { case JCS_GRAYSCALE: @@ -441,9 +482,19 @@ jinit_color_converter (j_compress_ptr cinfo) case JCS_RGB: if (cinfo->num_components != 3) ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_RGB) - cconvert->pub.color_convert = rgb_convert; - else + if (cinfo->in_color_space == JCS_RGB) { + switch (cinfo->color_transform) { + case JCT_NONE: + cconvert->pub.color_convert = rgb_convert; + break; + case JCT_SUBTRACT_GREEN: + cconvert->pub.color_convert = rgb_rgb1_convert; + break; + default: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } + } else ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); break; diff --git a/jcmainct.c b/jcmainct.c index 7de75d16..39b97902 100644 --- a/jcmainct.c +++ b/jcmainct.c @@ -2,6 +2,7 @@ * jcmainct.c * * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2003-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -68,32 +69,32 @@ METHODDEF(void) process_data_buffer_main METHODDEF(void) start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode) { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; /* Do nothing in raw-data mode. */ if (cinfo->raw_data_in) return; - main->cur_iMCU_row = 0; /* initialize counters */ - main->rowgroup_ctr = 0; - main->suspended = FALSE; - main->pass_mode = pass_mode; /* save mode for use by process_data */ + mainp->cur_iMCU_row = 0; /* initialize counters */ + mainp->rowgroup_ctr = 0; + mainp->suspended = FALSE; + mainp->pass_mode = pass_mode; /* save mode for use by process_data */ switch (pass_mode) { case JBUF_PASS_THRU: #ifdef FULL_MAIN_BUFFER_SUPPORTED - if (main->whole_image[0] != NULL) + if (mainp->whole_image[0] != NULL) ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); #endif - main->pub.process_data = process_data_simple_main; + mainp->pub.process_data = process_data_simple_main; break; #ifdef FULL_MAIN_BUFFER_SUPPORTED case JBUF_SAVE_SOURCE: case JBUF_CRANK_DEST: case JBUF_SAVE_AND_PASS: - if (main->whole_image[0] == NULL) + if (mainp->whole_image[0] == NULL) ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - main->pub.process_data = process_data_buffer_main; + mainp->pub.process_data = process_data_buffer_main; break; #endif default: @@ -114,46 +115,46 @@ process_data_simple_main (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail) { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; - while (main->cur_iMCU_row < cinfo->total_iMCU_rows) { + while (mainp->cur_iMCU_row < cinfo->total_iMCU_rows) { /* Read input data if we haven't filled the main buffer yet */ - if (main->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size) + if (mainp->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size) (*cinfo->prep->pre_process_data) (cinfo, input_buf, in_row_ctr, in_rows_avail, - main->buffer, &main->rowgroup_ctr, + mainp->buffer, &mainp->rowgroup_ctr, (JDIMENSION) cinfo->min_DCT_v_scaled_size); /* If we don't have a full iMCU row buffered, return to application for * more data. Note that preprocessor will always pad to fill the iMCU row * at the bottom of the image. */ - if (main->rowgroup_ctr != (JDIMENSION) cinfo->min_DCT_v_scaled_size) + if (mainp->rowgroup_ctr != (JDIMENSION) cinfo->min_DCT_v_scaled_size) return; /* Send the completed row to the compressor */ - if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) { + if (! (*cinfo->coef->compress_data) (cinfo, mainp->buffer)) { /* If compressor did not consume the whole row, then we must need to * suspend processing and return to the application. In this situation * we pretend we didn't yet consume the last input row; otherwise, if * it happened to be the last row of the image, the application would * think we were done. */ - if (! main->suspended) { + if (! mainp->suspended) { (*in_row_ctr)--; - main->suspended = TRUE; + mainp->suspended = TRUE; } return; } /* We did finish the row. Undo our little suspension hack if a previous * call suspended; then mark the main buffer empty. */ - if (main->suspended) { + if (mainp->suspended) { (*in_row_ctr)++; - main->suspended = FALSE; + mainp->suspended = FALSE; } - main->rowgroup_ctr = 0; - main->cur_iMCU_row++; + mainp->rowgroup_ctr = 0; + mainp->cur_iMCU_row++; } } @@ -170,25 +171,27 @@ process_data_buffer_main (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail) { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; int ci; jpeg_component_info *compptr; - boolean writing = (main->pass_mode != JBUF_CRANK_DEST); + boolean writing = (mainp->pass_mode != JBUF_CRANK_DEST); - while (main->cur_iMCU_row < cinfo->total_iMCU_rows) { + while (mainp->cur_iMCU_row < cinfo->total_iMCU_rows) { /* Realign the virtual buffers if at the start of an iMCU row. */ - if (main->rowgroup_ctr == 0) { + if (mainp->rowgroup_ctr == 0) { for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { - main->buffer[ci] = (*cinfo->mem->access_virt_sarray) - ((j_common_ptr) cinfo, main->whole_image[ci], - main->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE), - (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing); + mainp->buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, mainp->whole_image[ci], mainp->cur_iMCU_row * + ((JDIMENSION) (compptr->v_samp_factor * cinfo->min_DCT_v_scaled_size)), + (JDIMENSION) (compptr->v_samp_factor * cinfo->min_DCT_v_scaled_size), + writing); } /* In a read pass, pretend we just read some source data. */ if (! writing) { - *in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE; - main->rowgroup_ctr = DCTSIZE; + *in_row_ctr += (JDIMENSION) + (cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size); + mainp->rowgroup_ctr = (JDIMENSION) cinfo->min_DCT_v_scaled_size; } } @@ -197,40 +200,40 @@ process_data_buffer_main (j_compress_ptr cinfo, if (writing) { (*cinfo->prep->pre_process_data) (cinfo, input_buf, in_row_ctr, in_rows_avail, - main->buffer, &main->rowgroup_ctr, - (JDIMENSION) DCTSIZE); + mainp->buffer, &mainp->rowgroup_ctr, + (JDIMENSION) cinfo->min_DCT_v_scaled_size); /* Return to application if we need more data to fill the iMCU row. */ - if (main->rowgroup_ctr < DCTSIZE) + if (mainp->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size) return; } /* Emit data, unless this is a sink-only pass. */ - if (main->pass_mode != JBUF_SAVE_SOURCE) { - if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) { + if (mainp->pass_mode != JBUF_SAVE_SOURCE) { + if (! (*cinfo->coef->compress_data) (cinfo, mainp->buffer)) { /* If compressor did not consume the whole row, then we must need to * suspend processing and return to the application. In this situation * we pretend we didn't yet consume the last input row; otherwise, if * it happened to be the last row of the image, the application would * think we were done. */ - if (! main->suspended) { + if (! mainp->suspended) { (*in_row_ctr)--; - main->suspended = TRUE; + mainp->suspended = TRUE; } return; } /* We did finish the row. Undo our little suspension hack if a previous * call suspended; then mark the main buffer empty. */ - if (main->suspended) { + if (mainp->suspended) { (*in_row_ctr)++; - main->suspended = FALSE; + mainp->suspended = FALSE; } } /* If get here, we are done with this iMCU row. Mark buffer empty. */ - main->rowgroup_ctr = 0; - main->cur_iMCU_row++; + mainp->rowgroup_ctr = 0; + mainp->cur_iMCU_row++; } } @@ -244,15 +247,15 @@ process_data_buffer_main (j_compress_ptr cinfo, GLOBAL(void) jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) { - my_main_ptr main; + my_main_ptr mainp; int ci; jpeg_component_info *compptr; - main = (my_main_ptr) + mainp = (my_main_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_main_controller)); - cinfo->main = (struct jpeg_c_main_controller *) main; - main->pub.start_pass = start_pass_main; + cinfo->main = &mainp->pub; + mainp->pub.start_pass = start_pass_main; /* We don't need to create a buffer in raw-data mode. */ if (cinfo->raw_data_in) @@ -267,11 +270,12 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) /* Note we pad the bottom to a multiple of the iMCU height */ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { - main->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + mainp->whole_image[ci] = (*cinfo->mem->request_virt_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, - compptr->width_in_blocks * compptr->DCT_h_scaled_size, - (JDIMENSION) jround_up((long) compptr->height_in_blocks, - (long) compptr->v_samp_factor) * DCTSIZE, + compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size), + ((JDIMENSION) jround_up((long) compptr->height_in_blocks, + (long) compptr->v_samp_factor)) * + ((JDIMENSION) cinfo->min_DCT_v_scaled_size), (JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size)); } #else @@ -279,14 +283,14 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) #endif } else { #ifdef FULL_MAIN_BUFFER_SUPPORTED - main->whole_image[0] = NULL; /* flag for no virtual arrays */ + mainp->whole_image[0] = NULL; /* flag for no virtual arrays */ #endif /* Allocate a strip buffer for each component */ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { - main->buffer[ci] = (*cinfo->mem->alloc_sarray) + mainp->buffer[ci] = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, - compptr->width_in_blocks * compptr->DCT_h_scaled_size, + compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size), (JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size)); } } diff --git a/jcmarker.c b/jcmarker.c index 606c19af..92aa65fe 100644 --- a/jcmarker.c +++ b/jcmarker.c @@ -2,7 +2,7 @@ * jcmarker.c * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2003-2010 by Guido Vollbeding. + * Modified 2003-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -19,24 +19,24 @@ typedef enum { /* JPEG marker codes */ M_SOF1 = 0xc1, M_SOF2 = 0xc2, M_SOF3 = 0xc3, - + M_SOF5 = 0xc5, M_SOF6 = 0xc6, M_SOF7 = 0xc7, - + M_JPG = 0xc8, M_SOF9 = 0xc9, M_SOF10 = 0xca, M_SOF11 = 0xcb, - + M_SOF13 = 0xcd, M_SOF14 = 0xce, M_SOF15 = 0xcf, - + M_DHT = 0xc4, - + M_DAC = 0xcc, - + M_RST0 = 0xd0, M_RST1 = 0xd1, M_RST2 = 0xd2, @@ -45,7 +45,7 @@ typedef enum { /* JPEG marker codes */ M_RST5 = 0xd5, M_RST6 = 0xd6, M_RST7 = 0xd7, - + M_SOI = 0xd8, M_EOI = 0xd9, M_SOS = 0xda, @@ -54,7 +54,7 @@ typedef enum { /* JPEG marker codes */ M_DRI = 0xdd, M_DHP = 0xde, M_EXP = 0xdf, - + M_APP0 = 0xe0, M_APP1 = 0xe1, M_APP2 = 0xe2, @@ -71,13 +71,14 @@ typedef enum { /* JPEG marker codes */ M_APP13 = 0xed, M_APP14 = 0xee, M_APP15 = 0xef, - + M_JPG0 = 0xf0, + M_JPG8 = 0xf8, M_JPG13 = 0xfd, M_COM = 0xfe, - + M_TEM = 0x01, - + M_ERROR = 0x100 } JPEG_MARKER; @@ -281,6 +282,37 @@ emit_dri (j_compress_ptr cinfo) } +LOCAL(void) +emit_lse_ict (j_compress_ptr cinfo) +/* Emit an LSE inverse color transform specification marker */ +{ + /* Support only 1 transform */ + if (cinfo->color_transform != JCT_SUBTRACT_GREEN || + cinfo->num_components < 3) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + + emit_marker(cinfo, M_JPG8); + + emit_2bytes(cinfo, 24); /* fixed length */ + + emit_byte(cinfo, 0x0D); /* ID inverse transform specification */ + emit_2bytes(cinfo, MAXJSAMPLE); /* MAXTRANS */ + emit_byte(cinfo, 3); /* Nt=3 */ + emit_byte(cinfo, cinfo->comp_info[1].component_id); + emit_byte(cinfo, cinfo->comp_info[0].component_id); + emit_byte(cinfo, cinfo->comp_info[2].component_id); + emit_byte(cinfo, 0x80); /* F1: CENTER1=1, NORM1=0 */ + emit_2bytes(cinfo, 0); /* A(1,1)=0 */ + emit_2bytes(cinfo, 0); /* A(1,2)=0 */ + emit_byte(cinfo, 0); /* F2: CENTER2=0, NORM2=0 */ + emit_2bytes(cinfo, 1); /* A(2,1)=1 */ + emit_2bytes(cinfo, 0); /* A(2,2)=0 */ + emit_byte(cinfo, 0); /* F3: CENTER3=0, NORM3=0 */ + emit_2bytes(cinfo, 1); /* A(3,1)=1 */ + emit_2bytes(cinfo, 0); /* A(3,2)=0 */ +} + + LOCAL(void) emit_sof (j_compress_ptr cinfo, JPEG_MARKER code) /* Emit a SOF marker */ @@ -502,7 +534,8 @@ write_file_header (j_compress_ptr cinfo) /* * Write frame header. - * This consists of DQT and SOFn markers, and a conditional pseudo SOS marker. + * This consists of DQT and SOFn markers, + * a conditional LSE marker and a conditional pseudo SOS marker. * Note that we do not emit the SOF until we have emitted the DQT(s). * This avoids compatibility problems with incorrect implementations that * try to error-check the quant table numbers as soon as they see the SOF. @@ -560,6 +593,10 @@ write_frame_header (j_compress_ptr cinfo) emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */ } + /* Check to emit LSE inverse color transform specification marker */ + if (cinfo->color_transform) + emit_lse_ict(cinfo); + /* Check to emit pseudo SOS marker */ if (cinfo->progressive_mode && cinfo->block_size != DCTSIZE) emit_pseudo_sos(cinfo); @@ -668,7 +705,7 @@ jinit_marker_writer (j_compress_ptr cinfo) marker = (my_marker_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_marker_writer)); - cinfo->marker = (struct jpeg_marker_writer *) marker; + cinfo->marker = &marker->pub; /* Initialize method pointers */ marker->pub.write_file_header = write_file_header; marker->pub.write_frame_header = write_frame_header; diff --git a/jconfig.vc b/jconfig.vc index 679404da..f15b418f 100644 --- a/jconfig.vc +++ b/jconfig.vc @@ -15,7 +15,7 @@ #undef NEED_SHORT_EXTERNAL_NAMES #undef INCOMPLETE_TYPES_BROKEN -/* Define "boolean" as unsigned char, not int, per Windows custom */ +/* Define "boolean" as unsigned char, not enum, per Windows custom */ #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; #endif diff --git a/jcparam.c b/jcparam.c index c5e85dda..e530c3c4 100644 --- a/jcparam.c +++ b/jcparam.c @@ -2,7 +2,7 @@ * jcparam.c * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2003-2008 by Guido Vollbeding. + * Modified 2003-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -150,7 +150,7 @@ jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline) /* Set or change the 'quality' (quantization) setting, using default tables. * This is the standard quality-adjusting entry point for typical user * interfaces; only those who want detailed control over quantization tables - * would use the preceding three routines directly. + * would use the preceding routines directly. */ { /* Convert user 0-100 rating to percentage scaling */ @@ -367,6 +367,9 @@ jpeg_set_defaults (j_compress_ptr cinfo) cinfo->X_density = 1; /* Pixel aspect ratio is square by default */ cinfo->Y_density = 1; + /* No color transform */ + cinfo->color_transform = JCT_NONE; + /* Choose JPEG colorspace based on input space, set defaults accordingly */ jpeg_default_colorspace(cinfo); @@ -448,7 +451,9 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */ cinfo->num_components = 3; SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0); - SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0); + SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0); SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0); break; case JCS_YCbCr: diff --git a/jctrans.c b/jctrans.c index f7d7b814..8813c3ea 100644 --- a/jctrans.c +++ b/jctrans.c @@ -2,7 +2,7 @@ * jctrans.c * * Copyright (C) 1995-1998, Thomas G. Lane. - * Modified 2000-2011 by Guido Vollbeding. + * Modified 2000-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -85,7 +85,10 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, jpeg_set_defaults(dstinfo); /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB. * Fix it to get the right header markers for the image colorspace. + * Note: Entropy table assignment in jpeg_set_colorspace depends + * on color_transform. */ + dstinfo->color_transform = srcinfo->color_transform; jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space); dstinfo->data_precision = srcinfo->data_precision; dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling; @@ -130,7 +133,7 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno); } } - /* Note: we do not copy the source's Huffman table assignments; + /* Note: we do not copy the source's entropy table assignments; * instead we rely on jpeg_set_colorspace to have made a suitable choice. */ } @@ -364,7 +367,7 @@ transencode_coef_controller (j_compress_ptr cinfo, coef = (my_coef_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_coef_controller)); - cinfo->coef = (struct jpeg_c_coef_controller *) coef; + cinfo->coef = &coef->pub; coef->pub.start_pass = start_pass_coef; coef->pub.compress_data = compress_output; diff --git a/jdarith.c b/jdarith.c index 092f8af5..6e32d230 100644 --- a/jdarith.c +++ b/jdarith.c @@ -1,7 +1,7 @@ /* * jdarith.c * - * Developed 1997-2011 by Guido Vollbeding. + * Developed 1997-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -345,12 +345,15 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */ /* Figure F.20: Decode_AC_coefficients */ - for (k = cinfo->Ss; k <= cinfo->Se; k++) { - st = entropy->ac_stats[tbl] + 3 * (k - 1); + k = cinfo->Ss - 1; + do { + st = entropy->ac_stats[tbl] + 3 * k; if (arith_decode(cinfo, st)) break; /* EOB flag */ - while (arith_decode(cinfo, st + 1) == 0) { - st += 3; k++; - if (k > cinfo->Se) { + for (;;) { + k++; + if (arith_decode(cinfo, st + 1)) break; + st += 3; + if (k >= cinfo->Se) { WARNMS(cinfo, JWRN_ARITH_BAD_CODE); entropy->ct = -1; /* spectral overflow */ return TRUE; @@ -384,7 +387,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) v += 1; if (sign) v = -v; /* Scale and output coefficient in natural (dezigzagged) order */ (*block)[natural_order[k]] = (JCOEF) (v << cinfo->Al); - } + } while (k < cinfo->Se); return TRUE; } @@ -457,15 +460,18 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */ /* Establish EOBx (previous stage end-of-block) index */ - for (kex = cinfo->Se; kex > 0; kex--) + kex = cinfo->Se; + do { if ((*block)[natural_order[kex]]) break; + } while (--kex); - for (k = cinfo->Ss; k <= cinfo->Se; k++) { - st = entropy->ac_stats[tbl] + 3 * (k - 1); - if (k > kex) + k = cinfo->Ss - 1; + do { + st = entropy->ac_stats[tbl] + 3 * k; + if (k >= kex) if (arith_decode(cinfo, st)) break; /* EOB flag */ for (;;) { - thiscoef = *block + natural_order[k]; + thiscoef = *block + natural_order[++k]; if (*thiscoef) { /* previously nonzero coef */ if (arith_decode(cinfo, st + 2)) { if (*thiscoef < 0) @@ -482,14 +488,14 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) *thiscoef = p1; break; } - st += 3; k++; - if (k > cinfo->Se) { + st += 3; + if (k >= cinfo->Se) { WARNMS(cinfo, JWRN_ARITH_BAD_CODE); entropy->ct = -1; /* spectral overflow */ return TRUE; } } - } + } while (k < cinfo->Se); return TRUE; } @@ -750,7 +756,7 @@ jinit_arith_decoder (j_decompress_ptr cinfo) entropy = (arith_entropy_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(arith_entropy_decoder)); - cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; + cinfo->entropy = &entropy->pub; entropy->pub.start_pass = start_pass; /* Mark tables unallocated */ diff --git a/jdatadst.c b/jdatadst.c index 6981fb73..5c8681c9 100644 --- a/jdatadst.c +++ b/jdatadst.c @@ -226,6 +226,9 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile) * larger memory, so the buffer is available to the application after * finishing compression, and then the application is responsible for * freeing the requested memory. + * Note: An initial buffer supplied by the caller is expected to be + * managed by the application. The library does not free such buffer + * when allocating a larger buffer. */ GLOBAL(void) diff --git a/jdcolor.c b/jdcolor.c index 83e4d069..939df757 100644 --- a/jdcolor.c +++ b/jdcolor.c @@ -2,7 +2,7 @@ * jdcolor.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2011 by Guido Vollbeding. + * Modified 2011-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -215,8 +215,8 @@ rgb_gray_convert (j_decompress_ptr cinfo, JSAMPARRAY output_buf, int num_rows) { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int r, g, b; register INT32 * ctab = cconvert->rgb_y_tab; + register int r, g, b; register JSAMPROW outptr; register JSAMPROW inptr0, inptr1, inptr2; register JDIMENSION col; @@ -241,6 +241,86 @@ rgb_gray_convert (j_decompress_ptr cinfo, } +/* + * [R-G,G,B-G] to [R,G,B] conversion with modulo calculation + * (inverse color transform). + */ + +METHODDEF(void) +rgb1_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register int r, g, b; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr0[col]); + g = GETJSAMPLE(inptr1[col]); + b = GETJSAMPLE(inptr2[col]); + /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD + * (modulo) operator is equivalent to the bitmask operator AND. + */ + outptr[RGB_RED] = (JSAMPLE) ((r + g - CENTERJSAMPLE) & MAXJSAMPLE); + outptr[RGB_GREEN] = (JSAMPLE) g; + outptr[RGB_BLUE] = (JSAMPLE) ((b + g - CENTERJSAMPLE) & MAXJSAMPLE); + outptr += RGB_PIXELSIZE; + } + } +} + + +/* + * [R-G,G,B-G] to grayscale conversion with modulo calculation + * (inverse color transform). + */ + +METHODDEF(void) +rgb1_gray_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register INT32 * ctab = cconvert->rgb_y_tab; + register int r, g, b; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr0[col]); + g = GETJSAMPLE(inptr1[col]); + b = GETJSAMPLE(inptr2[col]); + /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD + * (modulo) operator is equivalent to the bitmask operator AND. + */ + r = (r + g - CENTERJSAMPLE) & MAXJSAMPLE; + b = (b + g - CENTERJSAMPLE) & MAXJSAMPLE; + /* Y */ + outptr[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + } + } +} + + /* * No colorspace change, but conversion from separate-planes * to interleaved representation. @@ -283,19 +363,20 @@ null_convert (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows) { - register JSAMPROW inptr, outptr; - register JDIMENSION count; - register int num_components = cinfo->num_components; - JDIMENSION num_cols = cinfo->output_width; int ci; + register int nc = cinfo->num_components; + register JSAMPROW outptr; + register JSAMPROW inptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; while (--num_rows >= 0) { - for (ci = 0; ci < num_components; ci++) { + for (ci = 0; ci < nc; ci++) { inptr = input_buf[ci][input_row]; outptr = output_buf[0] + ci; - for (count = num_cols; count > 0; count--) { + for (col = 0; col < num_cols; col++) { *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */ - outptr += num_components; + outptr += nc; } } input_row++; @@ -331,7 +412,8 @@ gray_rgb_convert (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows) { - register JSAMPROW inptr, outptr; + register JSAMPROW outptr; + register JSAMPROW inptr; register JDIMENSION col; JDIMENSION num_cols = cinfo->output_width; @@ -422,7 +504,7 @@ jinit_color_deconverter (j_decompress_ptr cinfo) cconvert = (my_cconvert_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_color_deconverter)); - cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert; + cinfo->cconvert = &cconvert->pub; cconvert->pub.start_pass = start_pass_dcolor; /* Make sure num_components agrees with jpeg_color_space */ @@ -450,6 +532,10 @@ jinit_color_deconverter (j_decompress_ptr cinfo) break; } + /* Support color transform only for RGB colorspace */ + if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + /* Set out_color_components and conversion method based on requested space. * Also clear the component_needed flags for any unused components, * so that earlier pipeline stages can avoid useless computation. @@ -465,7 +551,17 @@ jinit_color_deconverter (j_decompress_ptr cinfo) for (ci = 1; ci < cinfo->num_components; ci++) cinfo->comp_info[ci].component_needed = FALSE; } else if (cinfo->jpeg_color_space == JCS_RGB) { - cconvert->pub.color_convert = rgb_gray_convert; + switch (cinfo->color_transform) { + case JCT_NONE: + cconvert->pub.color_convert = rgb_gray_convert; + break; + case JCT_SUBTRACT_GREEN: + cconvert->pub.color_convert = rgb1_gray_convert; + break; + default: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } build_rgb_y_table(cinfo); } else ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); @@ -479,7 +575,17 @@ jinit_color_deconverter (j_decompress_ptr cinfo) } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) { cconvert->pub.color_convert = gray_rgb_convert; } else if (cinfo->jpeg_color_space == JCS_RGB) { - cconvert->pub.color_convert = rgb_convert; + switch (cinfo->color_transform) { + case JCT_NONE: + cconvert->pub.color_convert = rgb_convert; + break; + case JCT_SUBTRACT_GREEN: + cconvert->pub.color_convert = rgb1_rgb_convert; + break; + default: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } } else ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); break; diff --git a/jdhuff.c b/jdhuff.c index 06f92fe4..e548e689 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -2,7 +2,7 @@ * jdhuff.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2006-2009 by Guido Vollbeding. + * Modified 2006-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -797,7 +797,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) /* There is always only one block per MCU */ - if (EOBRUN > 0) /* if it's a band of zeroes... */ + if (EOBRUN) /* if it's a band of zeroes... */ EOBRUN--; /* ...process it now (we do nothing) */ else { BITREAD_LOAD_STATE(cinfo,entropy->bitstate); @@ -816,18 +816,17 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) /* Scale and output coefficient in natural (dezigzagged) order */ (*block)[natural_order[k]] = (JCOEF) (s << Al); } else { - if (r == 15) { /* ZRL */ - k += 15; /* skip 15 zeroes in band */ - } else { /* EOBr, run length is 2^r + appended bits */ - EOBRUN = 1 << r; + if (r != 15) { /* EOBr, run length is 2^r + appended bits */ if (r) { /* EOBr, r > 0 */ + EOBRUN = 1 << r; CHECK_BIT_BUFFER(br_state, r, return FALSE); r = GET_BITS(r); EOBRUN += r; + EOBRUN--; /* this band is processed at this moment */ } - EOBRUN--; /* this band is processed at this moment */ break; /* force end-of-band */ } + k += 15; /* ZRL: skip 15 zeroes in band */ } } @@ -951,7 +950,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) k = cinfo->Ss; if (EOBRUN == 0) { - for (; k <= Se; k++) { + do { HUFF_DECODE(s, br_state, tbl, goto undoit, label3); r = s >> 4; s &= 15; @@ -981,7 +980,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) */ do { thiscoef = *block + natural_order[k]; - if (*thiscoef != 0) { + if (*thiscoef) { CHECK_BIT_BUFFER(br_state, 1, goto undoit); if (GET_BITS(1)) { if ((*thiscoef & p1) == 0) { /* do nothing if already set it */ @@ -1004,18 +1003,19 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) /* Remember its position in case we have to suspend */ newnz_pos[num_newnz++] = pos; } - } + k++; + } while (k <= Se); } - if (EOBRUN > 0) { + if (EOBRUN) { /* Scan any remaining coefficient positions after the end-of-band * (the last newly nonzero coefficient, if any). Append a correction * bit to each already-nonzero coefficient. A correction bit is 1 * if the absolute value of the coefficient must be increased. */ - for (; k <= Se; k++) { + do { thiscoef = *block + natural_order[k]; - if (*thiscoef != 0) { + if (*thiscoef) { CHECK_BIT_BUFFER(br_state, 1, goto undoit); if (GET_BITS(1)) { if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */ @@ -1026,7 +1026,8 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) } } } - } + k++; + } while (k <= Se); /* Count one block completed in EOB run */ EOBRUN--; } @@ -1043,7 +1044,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) undoit: /* Re-zero any output coefficients that we made newly nonzero */ - while (num_newnz > 0) + while (num_newnz) (*block)[newnz_pos[--num_newnz]] = 0; return FALSE; @@ -1514,7 +1515,7 @@ jinit_huff_decoder (j_decompress_ptr cinfo) entropy = (huff_entropy_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_decoder)); - cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; + cinfo->entropy = &entropy->pub; entropy->pub.start_pass = start_pass_huff_decoder; if (cinfo->progressive_mode) { diff --git a/jdmainct.c b/jdmainct.c index 02723ca7..52091fb2 100644 --- a/jdmainct.c +++ b/jdmainct.c @@ -2,6 +2,7 @@ * jdmainct.c * * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2002-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -159,7 +160,7 @@ alloc_funny_pointers (j_decompress_ptr cinfo) * This is done only once, not once per pass. */ { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; int ci, rgroup; int M = cinfo->min_DCT_v_scaled_size; jpeg_component_info *compptr; @@ -168,10 +169,10 @@ alloc_funny_pointers (j_decompress_ptr cinfo) /* Get top-level space for component array pointers. * We alloc both arrays with one call to save a few cycles. */ - main->xbuffer[0] = (JSAMPIMAGE) + mainp->xbuffer[0] = (JSAMPIMAGE) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->num_components * 2 * SIZEOF(JSAMPARRAY)); - main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components; + mainp->xbuffer[1] = mainp->xbuffer[0] + cinfo->num_components; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { @@ -184,9 +185,9 @@ alloc_funny_pointers (j_decompress_ptr cinfo) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW)); xbuf += rgroup; /* want one row group at negative offsets */ - main->xbuffer[0][ci] = xbuf; + mainp->xbuffer[0][ci] = xbuf; xbuf += rgroup * (M + 4); - main->xbuffer[1][ci] = xbuf; + mainp->xbuffer[1][ci] = xbuf; } } @@ -200,7 +201,7 @@ make_funny_pointers (j_decompress_ptr cinfo) * This will be repeated at the beginning of each pass. */ { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; int ci, i, rgroup; int M = cinfo->min_DCT_v_scaled_size; jpeg_component_info *compptr; @@ -210,10 +211,10 @@ make_funny_pointers (j_decompress_ptr cinfo) ci++, compptr++) { rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / cinfo->min_DCT_v_scaled_size; /* height of a row group of component */ - xbuf0 = main->xbuffer[0][ci]; - xbuf1 = main->xbuffer[1][ci]; + xbuf0 = mainp->xbuffer[0][ci]; + xbuf1 = mainp->xbuffer[1][ci]; /* First copy the workspace pointers as-is */ - buf = main->buffer[ci]; + buf = mainp->buffer[ci]; for (i = 0; i < rgroup * (M + 2); i++) { xbuf0[i] = xbuf1[i] = buf[i]; } @@ -240,7 +241,7 @@ set_wraparound_pointers (j_decompress_ptr cinfo) * This changes the pointer list state from top-of-image to the normal state. */ { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; int ci, i, rgroup; int M = cinfo->min_DCT_v_scaled_size; jpeg_component_info *compptr; @@ -250,8 +251,8 @@ set_wraparound_pointers (j_decompress_ptr cinfo) ci++, compptr++) { rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / cinfo->min_DCT_v_scaled_size; /* height of a row group of component */ - xbuf0 = main->xbuffer[0][ci]; - xbuf1 = main->xbuffer[1][ci]; + xbuf0 = mainp->xbuffer[0][ci]; + xbuf1 = mainp->xbuffer[1][ci]; for (i = 0; i < rgroup; i++) { xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i]; xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i]; @@ -269,7 +270,7 @@ set_bottom_pointers (j_decompress_ptr cinfo) * Also sets rowgroups_avail to indicate number of nondummy row groups in row. */ { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; int ci, i, rgroup, iMCUheight, rows_left; jpeg_component_info *compptr; JSAMPARRAY xbuf; @@ -286,12 +287,12 @@ set_bottom_pointers (j_decompress_ptr cinfo) * so we need only do it once. */ if (ci == 0) { - main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1); + mainp->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1); } /* Duplicate the last real sample row rgroup*2 times; this pads out the * last partial rowgroup and ensures at least one full rowgroup of context. */ - xbuf = main->xbuffer[main->whichptr][ci]; + xbuf = mainp->xbuffer[mainp->whichptr][ci]; for (i = 0; i < rgroup * 2; i++) { xbuf[rows_left + i] = xbuf[rows_left-1]; } @@ -306,27 +307,27 @@ set_bottom_pointers (j_decompress_ptr cinfo) METHODDEF(void) start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; switch (pass_mode) { case JBUF_PASS_THRU: if (cinfo->upsample->need_context_rows) { - main->pub.process_data = process_data_context_main; + mainp->pub.process_data = process_data_context_main; make_funny_pointers(cinfo); /* Create the xbuffer[] lists */ - main->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ - main->context_state = CTX_PREPARE_FOR_IMCU; - main->iMCU_row_ctr = 0; + mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ + mainp->context_state = CTX_PREPARE_FOR_IMCU; + mainp->iMCU_row_ctr = 0; } else { /* Simple case with no context needed */ - main->pub.process_data = process_data_simple_main; + mainp->pub.process_data = process_data_simple_main; } - main->buffer_full = FALSE; /* Mark buffer empty */ - main->rowgroup_ctr = 0; + mainp->buffer_full = FALSE; /* Mark buffer empty */ + mainp->rowgroup_ctr = 0; break; #ifdef QUANT_2PASS_SUPPORTED case JBUF_CRANK_DEST: /* For last pass of 2-pass quantization, just crank the postprocessor */ - main->pub.process_data = process_data_crank_post; + mainp->pub.process_data = process_data_crank_post; break; #endif default: @@ -346,14 +347,14 @@ process_data_simple_main (j_decompress_ptr cinfo, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; JDIMENSION rowgroups_avail; /* Read input data if we haven't filled the main buffer yet */ - if (! main->buffer_full) { - if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer)) + if (! mainp->buffer_full) { + if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer)) return; /* suspension forced, can do nothing more */ - main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ } /* There are always min_DCT_scaled_size row groups in an iMCU row. */ @@ -364,14 +365,14 @@ process_data_simple_main (j_decompress_ptr cinfo, */ /* Feed the postprocessor */ - (*cinfo->post->post_process_data) (cinfo, main->buffer, - &main->rowgroup_ctr, rowgroups_avail, + (*cinfo->post->post_process_data) (cinfo, mainp->buffer, + &mainp->rowgroup_ctr, rowgroups_avail, output_buf, out_row_ctr, out_rows_avail); /* Has postprocessor consumed all the data yet? If so, mark buffer empty */ - if (main->rowgroup_ctr >= rowgroups_avail) { - main->buffer_full = FALSE; - main->rowgroup_ctr = 0; + if (mainp->rowgroup_ctr >= rowgroups_avail) { + mainp->buffer_full = FALSE; + mainp->rowgroup_ctr = 0; } } @@ -386,15 +387,15 @@ process_data_context_main (j_decompress_ptr cinfo, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) { - my_main_ptr main = (my_main_ptr) cinfo->main; + my_main_ptr mainp = (my_main_ptr) cinfo->main; /* Read input data if we haven't filled the main buffer yet */ - if (! main->buffer_full) { + if (! mainp->buffer_full) { if (! (*cinfo->coef->decompress_data) (cinfo, - main->xbuffer[main->whichptr])) + mainp->xbuffer[mainp->whichptr])) return; /* suspension forced, can do nothing more */ - main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ - main->iMCU_row_ctr++; /* count rows received */ + mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + mainp->iMCU_row_ctr++; /* count rows received */ } /* Postprocessor typically will not swallow all the input data it is handed @@ -402,47 +403,47 @@ process_data_context_main (j_decompress_ptr cinfo, * to exit and restart. This switch lets us keep track of how far we got. * Note that each case falls through to the next on successful completion. */ - switch (main->context_state) { + switch (mainp->context_state) { case CTX_POSTPONED_ROW: /* Call postprocessor using previously set pointers for postponed row */ - (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr], - &main->rowgroup_ctr, main->rowgroups_avail, + (*cinfo->post->post_process_data) (cinfo, mainp->xbuffer[mainp->whichptr], + &mainp->rowgroup_ctr, mainp->rowgroups_avail, output_buf, out_row_ctr, out_rows_avail); - if (main->rowgroup_ctr < main->rowgroups_avail) + if (mainp->rowgroup_ctr < mainp->rowgroups_avail) return; /* Need to suspend */ - main->context_state = CTX_PREPARE_FOR_IMCU; + mainp->context_state = CTX_PREPARE_FOR_IMCU; if (*out_row_ctr >= out_rows_avail) return; /* Postprocessor exactly filled output buf */ /*FALLTHROUGH*/ case CTX_PREPARE_FOR_IMCU: /* Prepare to process first M-1 row groups of this iMCU row */ - main->rowgroup_ctr = 0; - main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size - 1); + mainp->rowgroup_ctr = 0; + mainp->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size - 1); /* Check for bottom of image: if so, tweak pointers to "duplicate" * the last sample row, and adjust rowgroups_avail to ignore padding rows. */ - if (main->iMCU_row_ctr == cinfo->total_iMCU_rows) + if (mainp->iMCU_row_ctr == cinfo->total_iMCU_rows) set_bottom_pointers(cinfo); - main->context_state = CTX_PROCESS_IMCU; + mainp->context_state = CTX_PROCESS_IMCU; /*FALLTHROUGH*/ case CTX_PROCESS_IMCU: /* Call postprocessor using previously set pointers */ - (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr], - &main->rowgroup_ctr, main->rowgroups_avail, + (*cinfo->post->post_process_data) (cinfo, mainp->xbuffer[mainp->whichptr], + &mainp->rowgroup_ctr, mainp->rowgroups_avail, output_buf, out_row_ctr, out_rows_avail); - if (main->rowgroup_ctr < main->rowgroups_avail) + if (mainp->rowgroup_ctr < mainp->rowgroups_avail) return; /* Need to suspend */ /* After the first iMCU, change wraparound pointers to normal state */ - if (main->iMCU_row_ctr == 1) + if (mainp->iMCU_row_ctr == 1) set_wraparound_pointers(cinfo); /* Prepare to load new iMCU row using other xbuffer list */ - main->whichptr ^= 1; /* 0=>1 or 1=>0 */ - main->buffer_full = FALSE; + mainp->whichptr ^= 1; /* 0=>1 or 1=>0 */ + mainp->buffer_full = FALSE; /* Still need to process last row group of this iMCU row, */ /* which is saved at index M+1 of the other xbuffer */ - main->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 1); - main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 2); - main->context_state = CTX_POSTPONED_ROW; + mainp->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 1); + mainp->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 2); + mainp->context_state = CTX_POSTPONED_ROW; } } @@ -475,15 +476,15 @@ process_data_crank_post (j_decompress_ptr cinfo, GLOBAL(void) jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer) { - my_main_ptr main; + my_main_ptr mainp; int ci, rgroup, ngroups; jpeg_component_info *compptr; - main = (my_main_ptr) + mainp = (my_main_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_main_controller)); - cinfo->main = (struct jpeg_d_main_controller *) main; - main->pub.start_pass = start_pass_main; + cinfo->main = &mainp->pub; + mainp->pub.start_pass = start_pass_main; if (need_full_buffer) /* shouldn't happen */ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); @@ -504,9 +505,9 @@ jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer) ci++, compptr++) { rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / cinfo->min_DCT_v_scaled_size; /* height of a row group of component */ - main->buffer[ci] = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - compptr->width_in_blocks * compptr->DCT_h_scaled_size, - (JDIMENSION) (rgroup * ngroups)); + mainp->buffer[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size), + (JDIMENSION) (rgroup * ngroups)); } } diff --git a/jdmarker.c b/jdmarker.c index f2a9cc42..ce8b713c 100644 --- a/jdmarker.c +++ b/jdmarker.c @@ -2,7 +2,7 @@ * jdmarker.c * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2009 by Guido Vollbeding. + * Modified 2009-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -23,24 +23,24 @@ typedef enum { /* JPEG marker codes */ M_SOF1 = 0xc1, M_SOF2 = 0xc2, M_SOF3 = 0xc3, - + M_SOF5 = 0xc5, M_SOF6 = 0xc6, M_SOF7 = 0xc7, - + M_JPG = 0xc8, M_SOF9 = 0xc9, M_SOF10 = 0xca, M_SOF11 = 0xcb, - + M_SOF13 = 0xcd, M_SOF14 = 0xce, M_SOF15 = 0xcf, - + M_DHT = 0xc4, - + M_DAC = 0xcc, - + M_RST0 = 0xd0, M_RST1 = 0xd1, M_RST2 = 0xd2, @@ -49,7 +49,7 @@ typedef enum { /* JPEG marker codes */ M_RST5 = 0xd5, M_RST6 = 0xd6, M_RST7 = 0xd7, - + M_SOI = 0xd8, M_EOI = 0xd9, M_SOS = 0xda, @@ -58,7 +58,7 @@ typedef enum { /* JPEG marker codes */ M_DRI = 0xdd, M_DHP = 0xde, M_EXP = 0xdf, - + M_APP0 = 0xe0, M_APP1 = 0xe1, M_APP2 = 0xe2, @@ -75,13 +75,14 @@ typedef enum { /* JPEG marker codes */ M_APP13 = 0xed, M_APP14 = 0xee, M_APP15 = 0xef, - + M_JPG0 = 0xf0, + M_JPG8 = 0xf8, M_JPG13 = 0xfd, M_COM = 0xfe, - + M_TEM = 0x01, - + M_ERROR = 0x100 } JPEG_MARKER; @@ -217,6 +218,7 @@ get_soi (j_decompress_ptr cinfo) /* Set initial assumptions for colorspace etc */ cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->color_transform = JCT_NONE; cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */ cinfo->saw_JFIF_marker = FALSE; @@ -240,7 +242,7 @@ get_sof (j_decompress_ptr cinfo, boolean is_baseline, boolean is_prog, /* Process a SOFn marker */ { INT32 length; - int c, ci; + int c, ci, i; jpeg_component_info * compptr; INPUT_VARS(cinfo); @@ -278,11 +280,27 @@ get_sof (j_decompress_ptr cinfo, boolean is_baseline, boolean is_prog, cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->num_components * SIZEOF(jpeg_component_info)); - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { + + for (ci = 0; ci < cinfo->num_components; ci++) { + INPUT_BYTE(cinfo, c, return FALSE); + /* Check to see whether component id has already been seen */ + /* (in violation of the spec, but unfortunately seen in some */ + /* files). If so, create "fake" component id equal to the */ + /* max id seen so far + 1. */ + for (i = 0, compptr = cinfo->comp_info; i < ci; i++, compptr++) { + if (c == compptr->component_id) { + compptr = cinfo->comp_info; + c = compptr->component_id; + compptr++; + for (i = 1; i < ci; i++, compptr++) { + if (compptr->component_id > c) c = compptr->component_id; + } + c++; + break; + } + } + compptr->component_id = c; compptr->component_index = ci; - INPUT_BYTE(cinfo, compptr->component_id, return FALSE); INPUT_BYTE(cinfo, c, return FALSE); compptr->h_samp_factor = (c >> 4) & 15; compptr->v_samp_factor = (c ) & 15; @@ -305,12 +323,12 @@ get_sos (j_decompress_ptr cinfo) /* Process a SOS marker */ { INT32 length; - int i, ci, n, c, cc; + int c, ci, i, n; jpeg_component_info * compptr; INPUT_VARS(cinfo); if (! cinfo->marker->saw_SOF) - ERREXIT(cinfo, JERR_SOS_NO_SOF); + ERREXITS(cinfo, JERR_SOF_BEFORE, "SOS"); INPUT_2BYTES(cinfo, length, return FALSE); @@ -328,24 +346,38 @@ get_sos (j_decompress_ptr cinfo) /* Collect the component-spec parameters */ for (i = 0; i < n; i++) { - INPUT_BYTE(cinfo, cc, return FALSE); INPUT_BYTE(cinfo, c, return FALSE); - + + /* Detect the case where component id's are not unique, and, if so, */ + /* create a fake component id using the same logic as in get_sof. */ + for (ci = 0; ci < i; ci++) { + if (c == cinfo->cur_comp_info[ci]->component_id) { + c = cinfo->cur_comp_info[0]->component_id; + for (ci = 1; ci < i; ci++) { + compptr = cinfo->cur_comp_info[ci]; + if (compptr->component_id > c) c = compptr->component_id; + } + c++; + break; + } + } + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { - if (cc == compptr->component_id) + if (c == compptr->component_id) goto id_found; } - ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); + ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, c); id_found: cinfo->cur_comp_info[i] = compptr; + INPUT_BYTE(cinfo, c, return FALSE); compptr->dc_tbl_no = (c >> 4) & 15; compptr->ac_tbl_no = (c ) & 15; - - TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, + + TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, compptr->component_id, compptr->dc_tbl_no, compptr->ac_tbl_no); } @@ -605,6 +637,68 @@ get_dri (j_decompress_ptr cinfo) } +LOCAL(boolean) +get_lse (j_decompress_ptr cinfo) +/* Process an LSE marker */ +{ + INT32 length; + unsigned int tmp; + int cid; + INPUT_VARS(cinfo); + + if (! cinfo->marker->saw_SOF) + ERREXITS(cinfo, JERR_SOF_BEFORE, "LSE"); + + if (cinfo->num_components < 3) goto bad; + + INPUT_2BYTES(cinfo, length, return FALSE); + + if (length != 24) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 0x0D) /* ID inverse transform specification */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != MAXJSAMPLE) goto bad; /* MAXTRANS */ + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 3) goto bad; /* Nt=3 */ + INPUT_BYTE(cinfo, cid, return FALSE); + if (cid != cinfo->comp_info[1].component_id) goto bad; + INPUT_BYTE(cinfo, cid, return FALSE); + if (cid != cinfo->comp_info[0].component_id) goto bad; + INPUT_BYTE(cinfo, cid, return FALSE); + if (cid != cinfo->comp_info[2].component_id) goto bad; + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 0x80) goto bad; /* F1: CENTER1=1, NORM1=0 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* A(1,1)=0 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* A(1,2)=0 */ + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* F2: CENTER2=0, NORM2=0 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 1) goto bad; /* A(2,1)=1 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* A(2,2)=0 */ + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* F3: CENTER3=0, NORM3=0 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 1) goto bad; /* A(3,1)=1 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 0) { /* A(3,2)=0 */ + bad: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } + + /* OK, valid transform that we can handle. */ + cinfo->color_transform = JCT_SUBTRACT_GREEN; + + INPUT_SYNC(cinfo); + return TRUE; +} + + /* * Routines for processing APPn and COM markers. * These are either saved in memory or discarded, per application request. @@ -1059,32 +1153,37 @@ read_markers (j_decompress_ptr cinfo) return JPEG_SUSPENDED; cinfo->unread_marker = 0; /* processed the marker */ return JPEG_REACHED_SOS; - + case M_EOI: TRACEMS(cinfo, 1, JTRC_EOI); cinfo->unread_marker = 0; /* processed the marker */ return JPEG_REACHED_EOI; - + case M_DAC: if (! get_dac(cinfo)) return JPEG_SUSPENDED; break; - + case M_DHT: if (! get_dht(cinfo)) return JPEG_SUSPENDED; break; - + case M_DQT: if (! get_dqt(cinfo)) return JPEG_SUSPENDED; break; - + case M_DRI: if (! get_dri(cinfo)) return JPEG_SUSPENDED; break; - + + case M_JPG8: + if (! get_lse(cinfo)) + return JPEG_SUSPENDED; + break; + case M_APP0: case M_APP1: case M_APP2: @@ -1105,7 +1204,7 @@ read_markers (j_decompress_ptr cinfo) cinfo->unread_marker - (int) M_APP0]) (cinfo)) return JPEG_SUSPENDED; break; - + case M_COM: if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo)) return JPEG_SUSPENDED; @@ -1314,7 +1413,7 @@ jinit_marker_reader (j_decompress_ptr cinfo) marker = (my_marker_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_marker_reader)); - cinfo->marker = (struct jpeg_marker_reader *) marker; + cinfo->marker = &marker->pub; /* Initialize public method pointers */ marker->pub.reset_marker_reader = reset_marker_reader; marker->pub.read_markers = read_markers; diff --git a/jerror.c b/jerror.c index 3da7be86..8c0b9e07 100644 --- a/jerror.c +++ b/jerror.c @@ -2,6 +2,7 @@ * jerror.c * * Copyright (C) 1991-1998, Thomas G. Lane. + * Modified 2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -66,7 +67,7 @@ const char * const jpeg_std_message_table[] = { * or jpeg_destroy) at some point. */ -METHODDEF(void) +METHODDEF(noreturn_t) error_exit (j_common_ptr cinfo) { /* Always display the message */ diff --git a/jerror.h b/jerror.h index 1cfb2b19..a4b661f7 100644 --- a/jerror.h +++ b/jerror.h @@ -2,7 +2,7 @@ * jerror.h * * Copyright (C) 1994-1997, Thomas G. Lane. - * Modified 1997-2009 by Guido Vollbeding. + * Modified 1997-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -106,11 +106,11 @@ JMESSAGE(JERR_QUANT_COMPONENTS, "Cannot quantize more than %d color components") JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") +JMESSAGE(JERR_SOF_BEFORE, "Invalid JPEG file structure: %s before SOF") JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") -JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") diff --git a/jmemmgr.c b/jmemmgr.c index f0e83fb9..0a137cdd 100644 --- a/jmemmgr.c +++ b/jmemmgr.c @@ -2,7 +2,7 @@ * jmemmgr.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2011 by Guido Vollbeding. + * Modified 2011-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -214,7 +214,7 @@ print_mem_stats (j_common_ptr cinfo, int pool_id) #endif /* MEM_STATS */ -LOCAL(void) +LOCAL(noreturn_t) out_of_memory (j_common_ptr cinfo, int which) /* Report an out-of-memory error and stop execution */ /* If we compiled MEM_STATS support, report alloc requests before dying */ diff --git a/jmorecfg.h b/jmorecfg.h index 6c085c36..2407edbe 100644 --- a/jmorecfg.h +++ b/jmorecfg.h @@ -2,7 +2,7 @@ * jmorecfg.h * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 1997-2011 by Guido Vollbeding. + * Modified 1997-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -210,6 +210,26 @@ typedef unsigned int JDIMENSION; #endif +/* The noreturn type identifier is used to declare functions + * which cannot return. + * Compilers can thus create more optimized code and perform + * better checks for warnings and errors. + * Static analyzer tools can make improved inferences about + * execution paths and are prevented from giving false alerts. + * + * Unfortunately, the proposed specifications of corresponding + * extensions in the Dec 2011 ISO C standard revision (C11), + * GCC, MSVC, etc. are not viable. + * Thus we introduce a user defined type to declare noreturn + * functions at least for clarity. A proper compiler would + * have a suitable noreturn type to match in place of void. + */ + +#ifndef HAVE_NORETURN_T +typedef void noreturn_t; +#endif + + /* Here is the pseudo-keyword for declaring pointers that must be "far" * on 80x86 machines. Most of the specialized coding for 80x86 is handled * by just saying "FAR *" where such a pointer is needed. In a few places @@ -232,15 +252,16 @@ typedef unsigned int JDIMENSION; * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. */ -#ifndef HAVE_BOOLEAN -typedef int boolean; -#endif +#ifdef HAVE_BOOLEAN #ifndef FALSE /* in case these macros already exist */ #define FALSE 0 /* values of boolean */ #endif #ifndef TRUE #define TRUE 1 #endif +#else +typedef enum { FALSE = 0, TRUE = 1 } boolean; +#endif /* diff --git a/jpeglib.h b/jpeglib.h index 1327cffa..0a6dac44 100644 --- a/jpeglib.h +++ b/jpeglib.h @@ -2,7 +2,7 @@ * jpeglib.h * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2002-2011 by Guido Vollbeding. + * Modified 2002-2012 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -34,12 +34,12 @@ extern "C" { #endif /* Version IDs for the JPEG library. - * Might be useful for tests like "#if JPEG_LIB_VERSION >= 80". + * Might be useful for tests like "#if JPEG_LIB_VERSION >= 90". */ -#define JPEG_LIB_VERSION 80 /* Compatibility version 8.0 */ -#define JPEG_LIB_VERSION_MAJOR 8 -#define JPEG_LIB_VERSION_MINOR 4 +#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */ +#define JPEG_LIB_VERSION_MAJOR 9 +#define JPEG_LIB_VERSION_MINOR 0 /* Various constants determining the sizes of things. @@ -221,6 +221,13 @@ typedef enum { JCS_YCCK /* Y/Cb/Cr/K */ } J_COLOR_SPACE; +/* Supported color transforms. */ + +typedef enum { + JCT_NONE = 0, + JCT_SUBTRACT_GREEN = 1 +} J_COLOR_TRANSFORM; + /* DCT/IDCT algorithm options. */ typedef enum { @@ -369,7 +376,10 @@ struct jpeg_compress_struct { UINT16 X_density; /* Horizontal pixel density */ UINT16 Y_density; /* Vertical pixel density */ boolean write_Adobe_marker; /* should an Adobe marker be written? */ - + + J_COLOR_TRANSFORM color_transform; + /* Color transform identifier, writes LSE marker if nonzero */ + /* State variable: index of next scanline to be written to * jpeg_write_scanlines(). Application may use this to control its * processing loop, e.g., "while (next_scanline < image_height)". @@ -589,6 +599,9 @@ struct jpeg_decompress_struct { boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ UINT8 Adobe_transform; /* Color transform code from Adobe marker */ + J_COLOR_TRANSFORM color_transform; + /* Color transform identifier derived from LSE marker, otherwise zero */ + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ /* Aside from the specific data retained from APPn markers known to the @@ -681,7 +694,7 @@ struct jpeg_decompress_struct { struct jpeg_error_mgr { /* Error exit handler: does not return to caller */ - JMETHOD(void, error_exit, (j_common_ptr cinfo)); + JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo)); /* Conditionally emit a trace or warning message */ JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); /* Routine that actually outputs a trace or error message */ diff --git a/jpegtran.c b/jpegtran.c index e539e91b..7e8ef0ce 100644 --- a/jpegtran.c +++ b/jpegtran.c @@ -1,7 +1,7 @@ /* * jpegtran.c * - * Copyright (C) 1995-2011, Thomas G. Lane, Guido Vollbeding. + * Copyright (C) 1995-2012, Thomas G. Lane, Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -467,7 +467,7 @@ main (int argc, char **argv) /* Adjust default decompression parameters */ if (scaleoption != NULL) - if (sscanf(scaleoption, "%d/%d", + if (sscanf(scaleoption, "%u/%u", &srcinfo.scale_num, &srcinfo.scale_denom) < 1) usage(); diff --git a/jversion.h b/jversion.h index 5d491510..232085f1 100644 --- a/jversion.h +++ b/jversion.h @@ -1,7 +1,7 @@ /* * jversion.h * - * Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. + * Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -9,6 +9,6 @@ */ -#define JVERSION "8d 15-Jan-2012" +#define JVERSION "9 13-Jan-2013" -#define JCOPYRIGHT "Copyright (C) 2012, Thomas G. Lane, Guido Vollbeding" +#define JCOPYRIGHT "Copyright (C) 2013, Thomas G. Lane, Guido Vollbeding" diff --git a/libjpeg.map b/libjpeg.map index ac77dca7..fa70b1f1 100644 --- a/libjpeg.map +++ b/libjpeg.map @@ -1,4 +1,4 @@ -LIBJPEG_8.0 { +LIBJPEG_9.0 { global: *; }; diff --git a/libjpeg.txt b/libjpeg.txt index 9702669e..292a1270 100644 --- a/libjpeg.txt +++ b/libjpeg.txt @@ -1,6 +1,6 @@ USING THE IJG JPEG LIBRARY -Copyright (C) 1994-2011, Thomas G. Lane, Guido Vollbeding. +Copyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding. This file is part of the Independent JPEG Group's software. For conditions of distribution and use, see the accompanying README file. @@ -876,6 +876,10 @@ jpeg_simple_progression (j_compress_ptr cinfo) Compression parameters (cinfo fields) include: +boolean arith_code + If TRUE, use arithmetic coding. + If FALSE, use Huffman coding. + int block_size Set DCT block size. All N from 1 to 16 are possible. Default is 8 (baseline format). @@ -916,7 +920,16 @@ J_COLOR_SPACE jpeg_color_space int num_components The JPEG color space and corresponding number of components; see "Special color spaces", below, for more info. We recommend using - jpeg_set_color_space() if you want to change these. + jpeg_set_colorspace() if you want to change these. + +J_COLOR_TRANSFORM color_transform + Internal color transform identifier, writes LSE marker if nonzero + (requires decoder with inverse color transform support, introduced + with IJG JPEG 9). + Two values are currently possible: JCT_NONE and JCT_SUBTRACT_GREEN. + Set this value for lossless RGB application *before* calling + jpeg_set_colorspace(), because entropy table assignment in + jpeg_set_colorspace() depends on color_transform. boolean optimize_coding TRUE causes the compressor to compute optimal Huffman coding tables diff --git a/makefile.ansi b/makefile.ansi index 7d0499f8..c0fe72b1 100644 --- a/makefile.ansi +++ b/makefile.ansi @@ -74,9 +74,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ diff --git a/makefile.bcc b/makefile.bcc index d89e09bd..68d68ef0 100644 --- a/makefile.bcc +++ b/makefile.bcc @@ -101,9 +101,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ diff --git a/makefile.dj b/makefile.dj index 37b6ee76..f37c1216 100644 --- a/makefile.dj +++ b/makefile.dj @@ -74,9 +74,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ diff --git a/makefile.manx b/makefile.manx index 471f4082..57a1bb93 100644 --- a/makefile.manx +++ b/makefile.manx @@ -75,9 +75,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ diff --git a/makefile.mc6 b/makefile.mc6 index 1ee83be0..7dd37f19 100644 --- a/makefile.mc6 +++ b/makefile.mc6 @@ -72,9 +72,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ diff --git a/makefile.mms b/makefile.mms index 6019dfa4..53493060 100644 --- a/makefile.mms +++ b/makefile.mms @@ -61,9 +61,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ diff --git a/makefile.sas b/makefile.sas index 252f8fba..ba0d63b9 100644 --- a/makefile.sas +++ b/makefile.sas @@ -83,9 +83,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ diff --git a/makefile.unix b/makefile.unix index eaadfc1d..7dfaf10b 100644 --- a/makefile.unix +++ b/makefile.unix @@ -78,9 +78,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ diff --git a/makefile.vc b/makefile.vc index d4df9d4c..ae461799 100644 --- a/makefile.vc +++ b/makefile.vc @@ -71,9 +71,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \ - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ diff --git a/makefile.wat b/makefile.wat index a3e652bc..9cb8d611 100644 --- a/makefile.wat +++ b/makefile.wat @@ -73,9 +73,9 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc & CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat & jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas & jconfig.vms -CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing -OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm & - libjpeg.map +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp & + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg & testimgp.jpg DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) & diff --git a/missing b/missing index 28055d2a..cdea5149 100755 --- a/missing +++ b/missing @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-06-26.16; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,69 +25,40 @@ scriptversion=2009-04-28.21; # UTC # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -100,272 +70,141 @@ Send bug reports to ." ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` +# Run the given program, remember its exit status. +"$@"; st=$? -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'automa4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/transupp.c b/transupp.c index 016f383d..d0013cce 100644 --- a/transupp.c +++ b/transupp.c @@ -1,7 +1,7 @@ /* * transupp.c * - * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding. + * Copyright (C) 1997-2012, Thomas G. Lane, Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -1076,7 +1076,7 @@ jtransform_request_workspace (j_decompress_ptr srcinfo, if (need_workspace) { coef_arrays = (jvirt_barray_ptr *) (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE, - SIZEOF(jvirt_barray_ptr) * info->num_components); + SIZEOF(jvirt_barray_ptr) * info->num_components); width_in_iMCUs = (JDIMENSION) jdiv_round_up((long) info->output_width, (long) info->iMCU_sample_width); diff --git a/usage.txt b/usage.txt index de9def71..88158d63 100644 --- a/usage.txt +++ b/usage.txt @@ -80,8 +80,9 @@ The basic command line switches for cjpeg are: -rgb Create RGB JPEG file. Using this switch suppresses the conversion from RGB colorspace input to the default YCbCr JPEG colorspace. - Use this switch in combination with the -block N - switch (see below) for lossless JPEG coding. + You can use this switch in combination with the + -block N switch (see below) for lossless JPEG coding. + See also the -rgb1 switch below. -optimize Perform optimization of entropy encoding parameters. Without this, default encoding parameters are used. @@ -175,6 +176,18 @@ Switches for advanced users: decoders will be unable to view a SmartScale extended JPEG file at all. + -rgb1 Create RGB JPEG file with reversible color transform. + Works like the -rgb switch (see above) and inserts a + simple reversible color transform into the processing + which significantly improves the compression. + Use this switch in combination with the -block N + switch (see above) for lossless JPEG coding. + CAUTION: A decoder with inverse color transform + support is required for this feature. Reversible + color transform support is not yet widely implemented, + so many decoders will be unable to view a reversible + color transformed JPEG file at all. + -dct int Use integer DCT method (default). -dct fast Use fast integer DCT (less accurate). -dct float Use floating-point DCT method. From fc11193e7a4548616a3803c66697a58d2a7304c5 Mon Sep 17 00:00:00 2001 From: Guido Vollbeding Date: Sun, 19 Jan 2014 00:00:00 +0000 Subject: [PATCH 113/140] The Independent JPEG Group's JPEG software v9a --- Makefile.in | 74 ++++-- README | 81 +++++-- aclocal.m4 | 291 +++++++++++++++++------ change.log | 27 +++ cjpeg.1 | 25 +- cjpeg.c | 12 + compile | 347 ++++++++++++++++++++++++++++ config.guess | 161 +++++++------ config.sub | 45 ++-- configure | 142 ++++++++++-- configure.ac | 2 +- depcomp | 3 +- djpeg.1 | 4 +- filelist.txt | 3 +- install.txt | 68 +++--- jcapistd.c | 3 +- jcarith.c | 19 +- jccolor.c | 133 ++++++++--- jcdctmgr.c | 79 +++---- jchuff.c | 119 +++++----- jcinit.c | 19 ++ jcmarker.c | 6 +- jcmaster.c | 36 ++- jconfig.cfg | 8 +- jconfig.txt | 9 +- jconfig.vc | 6 + jcparam.c | 110 ++++++--- jctrans.c | 6 +- jdapimin.c | 43 ++-- jdapistd.c | 1 + jdarith.c | 16 +- jdcolor.c | 226 ++++++++++++++---- jddctmgr.c | 4 +- jdhuff.c | 38 +-- jdinput.c | 11 +- jdmarker.c | 16 +- jdmaster.c | 18 +- jdmerge.c | 17 +- jfdctint.c | 622 +++++++++++++++++++++++++++----------------------- jidctint.c | 356 ++++++++++++++++------------- jmorecfg.h | 80 ++++++- jpegint.h | 6 +- jpeglib.h | 31 ++- jpegtran.1 | 16 +- jpegtran.c | 23 +- jversion.h | 6 +- libjpeg.txt | 125 +++++----- missing | 4 +- rdjpgcom.1 | 2 +- structure.txt | 33 +-- testimg.bmp | Bin 35050 -> 35050 bytes testimg.ppm | 2 +- transupp.c | 230 ++++++++++++++++--- transupp.h | 22 +- usage.txt | 47 +++- 55 files changed, 2665 insertions(+), 1168 deletions(-) create mode 100755 compile diff --git a/Makefile.in b/Makefile.in index d9a3664d..5654c785 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.1 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -23,23 +23,51 @@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -484,8 +512,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): jconfig.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/jconfig.cfg $(top_builddir)/config.status @rm -f stamp-h1 @@ -532,6 +560,7 @@ clean-libLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } + libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES) $(AM_V_CCLD)$(libjpeg_la_LINK) -rpath $(libdir) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @@ -583,18 +612,23 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + cjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) $(EXTRA_cjpeg_DEPENDENCIES) @rm -f cjpeg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cjpeg_OBJECTS) $(cjpeg_LDADD) $(LIBS) + djpeg$(EXEEXT): $(djpeg_OBJECTS) $(djpeg_DEPENDENCIES) $(EXTRA_djpeg_DEPENDENCIES) @rm -f djpeg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(djpeg_OBJECTS) $(djpeg_LDADD) $(LIBS) + jpegtran$(EXEEXT): $(jpegtran_OBJECTS) $(jpegtran_DEPENDENCIES) $(EXTRA_jpegtran_DEPENDENCIES) @rm -f jpegtran$(EXEEXT) $(AM_V_CCLD)$(LINK) $(jpegtran_OBJECTS) $(jpegtran_LDADD) $(LIBS) + rdjpgcom$(EXEEXT): $(rdjpgcom_OBJECTS) $(rdjpgcom_DEPENDENCIES) $(EXTRA_rdjpgcom_DEPENDENCIES) @rm -f rdjpgcom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rdjpgcom_OBJECTS) $(rdjpgcom_LDADD) $(LIBS) + wrjpgcom$(EXEEXT): $(wrjpgcom_OBJECTS) $(wrjpgcom_DEPENDENCIES) $(EXTRA_wrjpgcom_DEPENDENCIES) @rm -f wrjpgcom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wrjpgcom_OBJECTS) $(wrjpgcom_LDADD) $(LIBS) @@ -676,14 +710,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/README b/README index fc5ca5d4..014ad301 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ The Independent JPEG Group's JPEG software ========================================== -README for release 9 of 13-Jan-2013 -=================================== +README for release 9a of 19-Jan-2014 +==================================== This distribution contains the ninth public release of the Independent JPEG Group's free JPEG software. You are welcome to redistribute this software and @@ -14,7 +14,7 @@ Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, and other members of the Independent JPEG Group. IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee -(also known as JPEG, together with ITU-T SG16). +(previously known as JPEG, together with ITU-T SG16). DOCUMENTATION ROADMAP @@ -115,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or fitness for a particular purpose. This software is provided "AS IS", and you, its user, assume the entire risk as to its quality and accuracy. -This software is copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. +This software is copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding. All Rights Reserved except as specified below. Permission is hereby granted to use, copy, modify, and distribute this @@ -153,11 +153,11 @@ ltmain.sh). Another support script, install-sh, is copyright by X Consortium but is also freely distributable. The IJG distribution formerly included code to read and write GIF files. -To avoid entanglement with the Unisys LZW patent, GIF reading support has -been removed altogether, and the GIF writer has been simplified to produce -"uncompressed GIFs". This technique does not use the LZW algorithm; the -resulting GIF files are larger than usual, but are readable by all standard -GIF decoders. +To avoid entanglement with the Unisys LZW patent (now expired), GIF reading +support has been removed altogether, and the GIF writer has been simplified +to produce "uncompressed GIFs". This technique does not use the LZW +algorithm; the resulting GIF files are larger than usual, but are readable +by all standard GIF decoders. We are required to state that "The Graphics Interchange Format(c) is the Copyright property of @@ -252,8 +252,8 @@ ARCHIVE LOCATIONS The "official" archive site for this software is www.ijg.org. The most recent released version can always be found there in directory "files". This particular version will be archived as -http://www.ijg.org/files/jpegsrc.v9.tar.gz, and in Windows-compatible -"zip" archive format as http://www.ijg.org/files/jpegsr9.zip. +http://www.ijg.org/files/jpegsrc.v9a.tar.gz, and in Windows-compatible +"zip" archive format as http://www.ijg.org/files/jpegsr9a.zip. The JPEG FAQ (Frequently Asked Questions) article is a source of some general information about JPEG. @@ -280,7 +280,7 @@ Thank to Thomas Wiegand and Gary Sullivan for inviting me to the Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland. Thank to Thomas Richter and Daniel Lee for inviting me to the -ISO/IEC JTC1/SC29/WG1 (also known as JPEG, together with ITU-T SG16) +ISO/IEC JTC1/SC29/WG1 (previously known as JPEG, together with ITU-T SG16) meeting in Berlin, Germany. Thank to John Korejwa and Massimo Ballerini for inviting me to @@ -306,10 +306,10 @@ design and development of this singular software package. FILE FORMAT WARS ================ -The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together -with ITU-T SG16) currently promotes different formats containing the name -"JPEG" which is misleading because these formats are incompatible with -original DCT-based JPEG and are based on faulty technologies. +The ISO/IEC JTC1/SC29/WG1 standards committee (previously known as JPEG, +together with ITU-T SG16) currently promotes different formats containing +the name "JPEG" which is misleading because these formats are incompatible +with original DCT-based JPEG and are based on faulty technologies. IJG therefore does not and will not support such momentary mistakes (see REFERENCES). There exist also distributions under the name "OpenJPEG" promoting such @@ -322,9 +322,13 @@ Don't use an incompatible file format! (In any case, our decoder will remain capable of reading existing JPEG image files indefinitely.) -Furthermore, the ISO committee pretends to be "responsible for the popular -JPEG" in their public reports which is not true because they don't respond to -actual requirements for the maintenance of the original JPEG specification. +The ISO committee pretends to be "responsible for the popular JPEG" in their +public reports which is not true because they don't respond to actual +requirements for the maintenance of the original JPEG specification. +Furthermore, the ISO committee pretends to "ensure interoperability" with +their standards which is not true because their "standards" support only +application-specific and proprietary use cases and contain mathematically +incorrect code. There are currently different distributions in circulation containing the name "libjpeg" which is misleading because they don't have the features and @@ -332,19 +336,46 @@ are incompatible with formats supported by actual IJG libjpeg distributions. One of those fakes is released by members of the ISO committee and just uses the name of libjpeg for misdirection of people, similar to the abuse of the name JPEG as described above, while having nothing in common with actual IJG -libjpeg distributions. -The other one claims to be a "derivative" or "fork" of the original libjpeg -and violates the license conditions as described under LEGAL ISSUES above. -We have no sympathy for the release of misleading and illegal distributions -derived from obsolete code bases. +libjpeg distributions and containing mathematically incorrect code. +The other one claims to be a "derivative" or "fork" of the original libjpeg, +but violates the license conditions as described under LEGAL ISSUES above +and violates basic C programming properties. +We have no sympathy for the release of misleading, incorrect and illegal +distributions derived from obsolete code bases. Don't use an obsolete code base! +According to the UCC (Uniform Commercial Code) law, IJG has the lawful and +legal right to foreclose on certain standardization bodies and other +institutions or corporations that knowingly perform substantial and +systematic deceptive acts and practices, fraud, theft, and damaging of the +value of the people of this planet without their knowing, willing and +intentional consent. +The titles, ownership, and rights of these institutions and all their assets +are now duly secured and held in trust for the free people of this planet. +People of the planet, on every country, may have a financial interest in +the assets of these former principals, agents, and beneficiaries of the +foreclosed institutions and corporations. +IJG asserts what is: that each man, woman, and child has unalienable value +and rights granted and deposited in them by the Creator and not any one of +the people is subordinate to any artificial principality, corporate fiction +or the special interest of another without their appropriate knowing, +willing and intentional consent made by contract or accommodation agreement. +IJG expresses that which already was. +The people have already determined and demanded that public administration +entities, national governments, and their supporting judicial systems must +be fully transparent, accountable, and liable. +IJG has secured the value for all concerned free people of the planet. + +A partial list of foreclosed institutions and corporations ("Hall of Shame") +is currently prepared and will be published later. + TO DO ===== Version 9 is the second release of a new generation JPEG standard -to overcome the limitations of the original JPEG specification. +to overcome the limitations of the original JPEG specification, +and is the first true source reference JPEG codec. More features are being prepared for coming releases... Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. diff --git a/aclocal.m4 b/aclocal.m4 index 9f63e17a..9e947ab4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.13.1 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -8619,10 +8619,10 @@ m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.1], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -8638,7 +8638,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.1])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -8663,7 +8663,8 @@ AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], - [am_cv_ar_interface=ar + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) @@ -8680,7 +8681,7 @@ AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], fi rm -f conftest.lib libconftest.a ]) - ]) + AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) @@ -9019,7 +9020,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the @@ -9064,6 +9065,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -9172,7 +9179,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -9180,7 +9228,6 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -9398,6 +9445,70 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -9607,76 +9718,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of '-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - # tar/untar a dummy directory, and stop if the command works + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR diff --git a/change.log b/change.log index a1d94ff4..97cde1d4 100644 --- a/change.log +++ b/change.log @@ -1,6 +1,33 @@ CHANGE LOG for Independent JPEG Group's JPEG software +Version 9a 19-Jan-2014 +----------------------- + +Add support for wide gamut color spaces (JFIF version 2). +Improve clarity and accuracy in color conversion modules. +Note: Requires rebuild of test images. + +Extend the bit depth support to all values from 8 to 12 +(BITS_IN_JSAMPLE configuration option in jmorecfg.h). +jpegtran now supports N bits sample data precision with all N from 8 to 12 +in a single instance. Thank to Roland Fassauer for inspiration. + +Try to resolve issues with new boolean type definition. +Thank also to v4hn for suggestion. + +Enable option to use default Huffman tables for lossless compression +(for hardware solution), and in this case improve lossless RGB compression +with reversible color transform. Thank to Benny Alexandar for hint. + +Extend the entropy decoding structure, so that extraneous bytes between +compressed scan data and following marker can be reported correctly. +Thank to Nigel Tao for hint. + +Add jpegtran -wipe option and extension for -crop. +Thank to Andrew Senior, David Clunie, and Josef Schmid for suggestion. + + Version 9 13-Jan-2013 ---------------------- diff --git a/cjpeg.1 b/cjpeg.1 index e0b8d430..8684331e 100644 --- a/cjpeg.1 +++ b/cjpeg.1 @@ -1,4 +1,4 @@ -.TH CJPEG 1 "4 May 2012" +.TH CJPEG 1 "23 November 2013" .SH NAME cjpeg \- compress an image file to a JPEG file .SH SYNOPSIS @@ -199,6 +199,26 @@ this feature. Reversible color transform support is not yet widely implemented, so many decoders will be unable to view a reversible color transformed JPEG file at all. .TP +.B \-bgycc +Create big gamut YCC JPEG file. +In this type of encoding the color difference components are quantized +further by a factor of 2 compared to the normal Cb/Cr values, thus creating +space to allow larger color values with higher saturation than the normal +gamut limits to be encoded. In order to compensate for the loss of color +fidelity compared to a normal YCC encoded file, the color quantization +tables can be adjusted accordingly. For example, +.B cjpeg \-bgycc \-quality +80,90 will give similar results as +.B cjpeg \-quality +80. +.B Caution: +For correct decompression a decoder with big gamut YCC support (JFIF +version 2) is required. An old decoder may or may not display a big +gamut YCC encoded JPEG file, depending on JFIF version check and +corresponding warning/error configuration. In case of a granted +decompression the old decoder will display the image with half +saturated colors. +.TP .B \-dct int Use integer DCT method (default). .TP @@ -355,7 +375,8 @@ Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. .SH AUTHOR Independent JPEG Group .SH BUGS -GIF input files are no longer supported, to avoid the Unisys LZW patent. +GIF input files are no longer supported, to avoid the Unisys LZW patent +(now expired). (Conversion of GIF files to JPEG is usually a bad idea anyway.) .PP Not all variants of BMP and Targa file formats are supported. diff --git a/cjpeg.c b/cjpeg.c index d05cdd0a..3cb07fa4 100644 --- a/cjpeg.c +++ b/cjpeg.c @@ -174,6 +174,7 @@ usage (void) #endif #if JPEG_LIB_VERSION_MAJOR >= 9 fprintf(stderr, " -rgb1 Create RGB JPEG file with reversible color transform\n"); + fprintf(stderr, " -bgycc Create big gamut YCC JPEG file\n"); #endif #ifdef DCT_ISLOW_SUPPORTED fprintf(stderr, " -dct int Use integer DCT method%s\n", @@ -323,6 +324,17 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, #endif jpeg_set_colorspace(cinfo, JCS_RGB); + } else if (keymatch(arg, "bgycc", 5)) { + /* Force a big gamut YCC JPEG file to be generated. */ +#if JPEG_LIB_VERSION_MAJOR >= 9 && \ + (JPEG_LIB_VERSION_MAJOR > 9 || JPEG_LIB_VERSION_MINOR >= 1) + jpeg_set_colorspace(cinfo, JCS_BG_YCC); +#else + fprintf(stderr, "%s: sorry, BG_YCC colorspace not supported\n", + progname); + exit(EXIT_FAILURE); +#endif + } else if (keymatch(arg, "maxmemory", 3)) { /* Maximum memory in Kb (or Mb with 'm'). */ long lval; diff --git a/compile b/compile new file mode 100755 index 00000000..531136b0 --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.guess b/config.guess index 1804e9fc..9afd6762 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012, 2013 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-12-29' +timestamp='2013-11-29' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -26,7 +24,7 @@ timestamp='2012-12-29' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD @@ -52,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013 Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -136,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -857,21 +874,21 @@ EOF exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -884,59 +901,54 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -955,54 +967,63 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1235,19 +1256,31 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) diff --git a/config.sub b/config.sub index 802a224d..61cb4bc2 100755 --- a/config.sub +++ b/config.sub @@ -1,10 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012, 2013 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-12-29' +timestamp='2013-10-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -70,9 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013 Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -256,12 +252,12 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc \ + | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -269,6 +265,7 @@ case $basic_machine in | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -290,16 +287,17 @@ case $basic_machine in | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -327,7 +325,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -369,13 +367,13 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -384,6 +382,7 @@ case $basic_machine in | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -407,12 +406,13 @@ case $basic_machine in | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ @@ -796,7 +796,7 @@ case $basic_machine in os=-mingw64 ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -832,7 +832,7 @@ case $basic_machine in basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1354,7 +1354,7 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ @@ -1500,9 +1500,6 @@ case $os in -aros*) os=-aros ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; @@ -1551,6 +1548,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1594,6 +1594,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; diff --git a/configure b/configure index c7b13875..77a5df32 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libjpeg 9.0.0. +# Generated by GNU Autoconf 2.69 for libjpeg 9.1.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libjpeg' PACKAGE_TARNAME='libjpeg' -PACKAGE_VERSION='9.0.0' -PACKAGE_STRING='libjpeg 9.0.0' +PACKAGE_VERSION='9.1.0' +PACKAGE_STRING='libjpeg 9.1.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1321,7 +1321,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libjpeg 9.0.0 to adapt to many kinds of systems. +\`configure' configures libjpeg 9.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1392,7 +1392,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libjpeg 9.0.0:";; + short | recursive ) echo "Configuration of libjpeg 9.1.0:";; esac cat <<\_ACEOF @@ -1504,7 +1504,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libjpeg configure 9.0.0 +libjpeg configure 9.1.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1869,7 +1869,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libjpeg $as_me 9.0.0, which was +It was created by libjpeg $as_me 9.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2370,7 +2370,7 @@ test -n "$target_alias" && # Initialize Automake # Don't require all the GNU mandated files -am__api_version='1.13' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2856,7 +2856,7 @@ fi # Define the identity of the package. PACKAGE='libjpeg' - VERSION='9.0.0' + VERSION='9.1.0' cat >>confdefs.h <<_ACEOF @@ -2896,6 +2896,10 @@ mkdir_p='$(MKDIR_P)' # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -2903,6 +2907,48 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + # Make --enable-silent-rules the default. # To get verbose build output you may configure # with --disable-silent-rules or use "make V=1". @@ -3762,6 +3808,65 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -4534,7 +4639,13 @@ $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_ar_interface=ar + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; @@ -4565,6 +4676,11 @@ if ac_fn_c_try_compile "$LINENO"; then : fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 @@ -13507,7 +13623,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libjpeg $as_me 9.0.0, which was +This file was extended by libjpeg $as_me 9.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13573,7 +13689,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libjpeg config.status 9.0.0 +libjpeg config.status 9.1.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -14632,7 +14748,7 @@ $as_echo X"$mf" | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the diff --git a/configure.ac b/configure.ac index e0cc36b7..934d07e9 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ # Configure script for IJG libjpeg # -AC_INIT([libjpeg], [9.0.0]) +AC_INIT([libjpeg], [9.1.0]) # Directory where autotools helper scripts lives. AC_CONFIG_AUX_DIR([.]) diff --git a/depcomp b/depcomp index 06b0882d..4ebd5b3a 100755 --- a/depcomp +++ b/depcomp @@ -1,7 +1,7 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2012-10-18.11; # UTC +scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. @@ -552,6 +552,7 @@ $ { G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; diff --git a/djpeg.1 b/djpeg.1 index f3722d15..67ee5cba 100644 --- a/djpeg.1 +++ b/djpeg.1 @@ -1,4 +1,4 @@ -.TH DJPEG 1 "3 October 2009" +.TH DJPEG 1 "23 November 2013" .SH NAME djpeg \- decompress a JPEG file to an image file .SH SYNOPSIS @@ -246,7 +246,7 @@ Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. .SH AUTHOR Independent JPEG Group .SH BUGS -To avoid the Unisys LZW patent, +To avoid the Unisys LZW patent (now expired), .B djpeg produces uncompressed GIF files. These are larger than they should be, but are readable by standard GIF decoders. diff --git a/filelist.txt b/filelist.txt index 86633bc6..adfd14f3 100644 --- a/filelist.txt +++ b/filelist.txt @@ -1,6 +1,6 @@ IJG JPEG LIBRARY: FILE LIST -Copyright (C) 1994-2012, Thomas G. Lane, Guido Vollbeding. +Copyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding. This file is part of the Independent JPEG Group's software. For conditions of distribution and use, see the accompanying README file. @@ -198,6 +198,7 @@ config.sub depcomp missing ar-lib +compile install-sh Install shell script for those Unix systems lacking one. Makefile.in Makefile input for configure. Makefile.am Source file for use with Automake to generate Makefile.in. diff --git a/install.txt b/install.txt index 7ca92cbc..04053068 100644 --- a/install.txt +++ b/install.txt @@ -1,6 +1,6 @@ INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software -Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. +Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. This file is part of the Independent JPEG Group's software. For conditions of distribution and use, see the accompanying README file. @@ -418,54 +418,58 @@ support as follows: the directory containing the URT "librle.a" file (typically the "lib" subdirectory of the URT distribution). -Support for 12-bit-deep pixel data: +Support for 9-bit to 12-bit deep pixel data: -The JPEG standard allows either 8-bit or 12-bit data precision. (For color, -this means 8 or 12 bits per channel, of course.) If you need to work with -deeper than 8-bit data, you can compile the IJG code for 12-bit operation. +The IJG code currently allows 8, 9, 10, 11, or 12 bits sample data precision. +(For color, this means 8 to 12 bits per channel, of course.) If you need to +work with deeper than 8-bit data, you can compile the IJG code for 9-bit to +12-bit operation. To do so: - 1. In jmorecfg.h, define BITS_IN_JSAMPLE as 12 rather than 8. + 1. In jmorecfg.h, define BITS_IN_JSAMPLE as 9, 10, 11, or 12 rather than 8. 2. In jconfig.h, undefine BMP_SUPPORTED, RLE_SUPPORTED, and TARGA_SUPPORTED, - because the code for those formats doesn't handle 12-bit data and won't - even compile. (The PPM code does work, as explained below. The GIF - code works too; it scales 8-bit GIF data to and from 12-bit depth - automatically.) + because the code for those formats doesn't handle deeper than 8-bit data + and won't even compile. (The PPM code does work, as explained below. + The GIF code works too; it scales 8-bit GIF data to and from 12-bit + depth automatically.) 3. Compile. Don't expect "make test" to pass, since the supplied test files are for 8-bit data. -Currently, 12-bit support does not work on 16-bit-int machines. +Currently, 9-bit to 12-bit support does not work on 16-bit-int machines. -Note that a 12-bit version will not read 8-bit JPEG files, nor vice versa; -so you'll want to keep around a regular 8-bit compilation as well. -(Run-time selection of data depth, to allow a single copy that does both, -is possible but would probably slow things down considerably; it's very low -on our to-do list.) +Run-time selection and conversion of data precision are currently not +supported and may be added later. +Exception: The transcoding part (jpegtran) supports all settings in a +single instance, since it operates on the level of DCT coefficients and +not sample values. -The PPM reader (rdppm.c) can read 12-bit data from either text-format or -binary-format PPM and PGM files. Binary-format PPM/PGM files which have a -maxval greater than 255 are assumed to use 2 bytes per sample, MSB first -(big-endian order). As of early 1995, 2-byte binary format is not +The PPM reader (rdppm.c) can read deeper than 8-bit data from either +text-format or binary-format PPM and PGM files. Binary-format PPM/PGM files +which have a maxval greater than 255 are assumed to use 2 bytes per sample, +MSB first (big-endian order). As of early 1995, 2-byte binary format is not officially supported by the PBMPLUS library, but it is expected that a future release of PBMPLUS will support it. Note that the PPM reader will read files of any maxval regardless of the BITS_IN_JSAMPLE setting; incoming -data is automatically rescaled to either maxval=255 or maxval=4095 as -appropriate for the cjpeg bit depth. +data is automatically rescaled to maxval=MAXJSAMPLE as appropriate for the +cjpeg bit depth. The PPM writer (wrppm.c) will normally write 2-byte binary PPM or PGM -format, maxval 4095, when compiled with BITS_IN_JSAMPLE=12. Since this +format, maxval=MAXJSAMPLE, when compiled with BITS_IN_JSAMPLE>8. Since this format is not yet widely supported, you can disable it by compiling wrppm.c with PPM_NORAWWORD defined; then the data is scaled down to 8 bits to make a standard 1-byte/sample PPM or PGM file. (Yes, this means still another copy of djpeg to keep around. But hopefully you won't need it for very long. Poskanzer's supposed to get that new PBMPLUS release out Real Soon Now.) -Of course, if you are working with 12-bit data, you probably have it stored -in some other, nonstandard format. In that case you'll probably want to -write your own I/O modules to read and write your format. +Of course, if you are working with 9-bit to 12-bit data, you probably have +it stored in some other, nonstandard format. In that case you'll probably +want to write your own I/O modules to read and write your format. -Note that a 12-bit version of cjpeg always runs in "-optimize" mode, in -order to generate valid Huffman tables. This is necessary because our -default Huffman tables only cover 8-bit data. +Note: +The standard Huffman tables are only valid for 8-bit data precision. If +you selected more than 8-bit data precision, cjpeg uses arithmetic coding +by default. The Huffman encoder normally uses entropy optimization to +compute usable tables for higher precision. Otherwise, you'll have to +supply different default Huffman tables. Removing code: @@ -859,6 +863,12 @@ add something like this to your jconfig.h file: #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; #endif + #ifndef FALSE /* in case these macros already exist */ + #define FALSE 0 /* values of boolean */ + #endif + #ifndef TRUE + #define TRUE 1 + #endif #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ (This is already in jconfig.vc, by the way.) diff --git a/jcapistd.c b/jcapistd.c index c0320b1b..0917afa9 100644 --- a/jcapistd.c +++ b/jcapistd.c @@ -2,6 +2,7 @@ * jcapistd.c * * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -145,7 +146,7 @@ jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, (*cinfo->master->pass_startup) (cinfo); /* Verify that at least one iMCU row has been passed. */ - lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE; + lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size; if (num_lines < lines_per_iMCU_row) ERREXIT(cinfo, JERR_BUFFER_SIZE); diff --git a/jcarith.c b/jcarith.c index a7f9ff7a..a64190e7 100644 --- a/jcarith.c +++ b/jcarith.c @@ -1,7 +1,7 @@ /* * jcarith.c * - * Developed 1997-2012 by Guido Vollbeding. + * Developed 1997-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -362,7 +362,6 @@ METHODDEF(boolean) encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; - JBLOCKROW block; unsigned char *st; int blkn, ci, tbl; int v, v2, m; @@ -381,14 +380,13 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) /* Encode the MCU data blocks */ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; ci = cinfo->MCU_membership[blkn]; tbl = cinfo->cur_comp_info[ci]->dc_tbl_no; /* Compute the DC value after the required point transform by Al. * This is simply an arithmetic right shift. */ - m = IRIGHT_SHIFT((int) ((*block)[0]), cinfo->Al); + m = IRIGHT_SHIFT((int) (MCU_data[blkn][0][0]), cinfo->Al); /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */ @@ -453,11 +451,11 @@ METHODDEF(boolean) encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + const int * natural_order; JBLOCKROW block; unsigned char *st; int tbl, k, ke; int v, v2, m; - const int * natural_order; /* Emit restart marker if needed */ if (cinfo->restart_interval) { @@ -552,6 +550,8 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) /* * MCU encoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, + * although the spec is not very clear on the point. */ METHODDEF(boolean) @@ -593,11 +593,11 @@ METHODDEF(boolean) encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + const int * natural_order; JBLOCKROW block; unsigned char *st; int tbl, k, ke, kex; int v; - const int * natural_order; /* Emit restart marker if needed */ if (cinfo->restart_interval) { @@ -692,12 +692,13 @@ METHODDEF(boolean) encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; - jpeg_component_info * compptr; + const int * natural_order; JBLOCKROW block; unsigned char *st; - int blkn, ci, tbl, k, ke; + int tbl, k, ke; int v, v2, m; - const int * natural_order; + int blkn, ci; + jpeg_component_info * compptr; /* Emit restart marker if needed */ if (cinfo->restart_interval) { diff --git a/jccolor.c b/jccolor.c index 81d74efb..f6b4a493 100644 --- a/jccolor.c +++ b/jccolor.c @@ -2,7 +2,7 @@ * jccolor.c * * Copyright (C) 1991-1996, Thomas G. Lane. - * Modified 2011-2012 by Guido Vollbeding. + * Modified 2011-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -29,13 +29,25 @@ typedef my_color_converter * my_cconvert_ptr; /**************** RGB -> YCbCr conversion: most common case **************/ /* - * YCbCr is defined per CCIR 601-1, except that Cb and Cr are - * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. - * The conversion equations to be implemented are therefore - * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B - * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE - * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE - * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * YCbCr is defined per Recommendation ITU-R BT.601-7 (03/2011), + * previously known as Recommendation CCIR 601-1, except that Cb and Cr + * are normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * sRGB (standard RGB color space) is defined per IEC 61966-2-1:1999. + * sYCC (standard luma-chroma-chroma color space with extended gamut) + * is defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex F. + * bg-sRGB and bg-sYCC (big gamut standard color spaces) + * are defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex G. + * Note that the derived conversion coefficients given in some of these + * documents are imprecise. The general conversion equations are + * Y = Kr * R + (1 - Kr - Kb) * G + Kb * B + * Cb = 0.5 * (B - Y) / (1 - Kb) + * Cr = 0.5 * (R - Y) / (1 - Kr) + * With Kr = 0.299 and Kb = 0.114 (derived according to SMPTE RP 177-1993 + * from the 1953 FCC NTSC primaries and CIE Illuminant C), + * the conversion equations to be implemented are therefore + * Y = 0.299 * R + 0.587 * G + 0.114 * B + * Cb = -0.168735892 * R - 0.331264108 * G + 0.5 * B + CENTERJSAMPLE + * Cr = 0.5 * R - 0.418687589 * G - 0.081312411 * B + CENTERJSAMPLE * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2, * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0) @@ -49,9 +61,9 @@ typedef my_color_converter * my_cconvert_ptr; * For even more speed, we avoid doing any multiplications in the inner loop * by precalculating the constants times R,G,B for all possible values. * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); - * for 12-bit samples it is still acceptable. It's not very reasonable for - * 16-bit samples, but if you want lossless storage you shouldn't be changing - * colorspace anyway. + * for 9-bit to 12-bit samples it is still acceptable. It's not very + * reasonable for 16-bit samples, but if you want lossless storage you + * shouldn't be changing colorspace anyway. * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included * in the tables to save adding them separately in the inner loop. */ @@ -96,21 +108,21 @@ rgb_ycc_start (j_compress_ptr cinfo) (TABLE_SIZE * SIZEOF(INT32))); for (i = 0; i <= MAXJSAMPLE; i++) { - rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i; - rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; - rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; - rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i; - rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i; + rgb_ycc_tab[i+R_Y_OFF] = FIX(0.299) * i; + rgb_ycc_tab[i+G_Y_OFF] = FIX(0.587) * i; + rgb_ycc_tab[i+B_Y_OFF] = FIX(0.114) * i + ONE_HALF; + rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.168735892)) * i; + rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.331264108)) * i; /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr. * This ensures that the maximum output will round to MAXJSAMPLE * not MAXJSAMPLE+1, and thus that we don't have to range-limit. */ - rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; + rgb_ycc_tab[i+B_CB_OFF] = FIX(0.5) * i + CBCR_OFFSET + ONE_HALF-1; /* B=>Cb and R=>Cr tables are the same - rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; + rgb_ycc_tab[i+R_CR_OFF] = FIX(0.5) * i + CBCR_OFFSET + ONE_HALF-1; */ - rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i; - rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i; + rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.418687589)) * i; + rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.081312411)) * i; } } @@ -274,6 +286,9 @@ cmyk_ycck_convert (j_compress_ptr cinfo, * Convert some rows of samples to the JPEG colorspace. * [R,G,B] to [R-G,G,B-G] conversion with modulo calculation * (forward reversible color transform). + * This can be seen as an adaption of the general RGB->YCbCr + * conversion equation with Kr = Kb = 0, while replacing the + * normalization by modulo calculation. */ METHODDEF(void) @@ -312,7 +327,7 @@ rgb_rgb1_convert (j_compress_ptr cinfo, /* * Convert some rows of samples to the JPEG colorspace. * This version handles grayscale output with no conversion. - * The source can be either plain grayscale or YCbCr (since Y == gray). + * The source can be either plain grayscale or YCC (since Y == gray). */ METHODDEF(void) @@ -439,11 +454,13 @@ jinit_color_converter (j_compress_ptr cinfo) break; case JCS_RGB: + case JCS_BG_RGB: if (cinfo->input_components != RGB_PIXELSIZE) ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); break; case JCS_YCbCr: + case JCS_BG_YCC: if (cinfo->input_components != 3) ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); break; @@ -460,8 +477,10 @@ jinit_color_converter (j_compress_ptr cinfo) break; } - /* Support color transform only for RGB colorspace */ - if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB) + /* Support color transform only for RGB colorspaces */ + if (cinfo->color_transform && + cinfo->jpeg_color_space != JCS_RGB && + cinfo->jpeg_color_space != JCS_BG_RGB) ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); /* Check num_components, set conversion method based on requested space */ @@ -469,20 +488,26 @@ jinit_color_converter (j_compress_ptr cinfo) case JCS_GRAYSCALE: if (cinfo->num_components != 1) ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_GRAYSCALE || - cinfo->in_color_space == JCS_YCbCr) + switch (cinfo->in_color_space) { + case JCS_GRAYSCALE: + case JCS_YCbCr: + case JCS_BG_YCC: cconvert->pub.color_convert = grayscale_convert; - else if (cinfo->in_color_space == JCS_RGB) { + break; + case JCS_RGB: cconvert->pub.start_pass = rgb_ycc_start; cconvert->pub.color_convert = rgb_gray_convert; - } else + break; + default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } break; case JCS_RGB: + case JCS_BG_RGB: if (cinfo->num_components != 3) ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_RGB) { + if (cinfo->in_color_space == cinfo->jpeg_color_space) { switch (cinfo->color_transform) { case JCT_NONE: cconvert->pub.color_convert = rgb_convert; @@ -492,7 +517,6 @@ jinit_color_converter (j_compress_ptr cinfo) break; default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; } } else ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); @@ -501,13 +525,48 @@ jinit_color_converter (j_compress_ptr cinfo) case JCS_YCbCr: if (cinfo->num_components != 3) ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_RGB) { + switch (cinfo->in_color_space) { + case JCS_RGB: cconvert->pub.start_pass = rgb_ycc_start; cconvert->pub.color_convert = rgb_ycc_convert; - } else if (cinfo->in_color_space == JCS_YCbCr) + break; + case JCS_YCbCr: cconvert->pub.color_convert = null_convert; - else + break; + default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } + break; + + case JCS_BG_YCC: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + switch (cinfo->in_color_space) { + case JCS_RGB: + /* For conversion from normal RGB input to BG_YCC representation, + * the Cb/Cr values are first computed as usual, and then + * quantized further after DCT processing by a factor of + * 2 in reference to the nominal quantization factor. + */ + /* need quantization scale by factor of 2 after DCT */ + cinfo->comp_info[1].component_needed = TRUE; + cinfo->comp_info[2].component_needed = TRUE; + /* compute normal YCC first */ + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = rgb_ycc_convert; + break; + case JCS_YCbCr: + /* need quantization scale by factor of 2 after DCT */ + cinfo->comp_info[1].component_needed = TRUE; + cinfo->comp_info[2].component_needed = TRUE; + /*FALLTHROUGH*/ + case JCS_BG_YCC: + /* Pass through for BG_YCC input */ + cconvert->pub.color_convert = null_convert; + break; + default: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } break; case JCS_CMYK: @@ -522,13 +581,17 @@ jinit_color_converter (j_compress_ptr cinfo) case JCS_YCCK: if (cinfo->num_components != 4) ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_CMYK) { + switch (cinfo->in_color_space) { + case JCS_CMYK: cconvert->pub.start_pass = rgb_ycc_start; cconvert->pub.color_convert = cmyk_ycck_convert; - } else if (cinfo->in_color_space == JCS_YCCK) + break; + case JCS_YCCK: cconvert->pub.color_convert = null_convert; - else + break; + default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } break; default: /* allow null conversion of JCS_UNKNOWN */ diff --git a/jcdctmgr.c b/jcdctmgr.c index 0bbdbb68..fafab91c 100644 --- a/jcdctmgr.c +++ b/jcdctmgr.c @@ -2,6 +2,7 @@ * jcdctmgr.c * * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2003-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -25,22 +26,30 @@ typedef struct { /* Pointer to the DCT routine actually in use */ forward_DCT_method_ptr do_dct[MAX_COMPONENTS]; - /* The actual post-DCT divisors --- not identical to the quant table - * entries, because of scaling (especially for an unnormalized DCT). - * Each table is given in normal array order. - */ - DCTELEM * divisors[NUM_QUANT_TBLS]; - #ifdef DCT_FLOAT_SUPPORTED /* Same as above for the floating-point case. */ float_DCT_method_ptr do_float_dct[MAX_COMPONENTS]; - FAST_FLOAT * float_divisors[NUM_QUANT_TBLS]; #endif } my_fdct_controller; typedef my_fdct_controller * my_fdct_ptr; +/* The allocated post-DCT divisor tables -- big enough for any + * supported variant and not identical to the quant table entries, + * because of scaling (especially for an unnormalized DCT) -- + * are pointed to by dct_table in the per-component comp_info + * structures. Each table is given in normal array order. + */ + +typedef union { + DCTELEM int_array[DCTSIZE2]; +#ifdef DCT_FLOAT_SUPPORTED + FAST_FLOAT float_array[DCTSIZE2]; +#endif +} divisor_table; + + /* The current scaled-DCT routines require ISLOW-style divisor tables, * so be sure to compile that code if either ISLOW or SCALING is requested. */ @@ -71,7 +80,7 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, /* This routine is heavily used, so it's worth coding it tightly. */ my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; forward_DCT_method_ptr do_dct = fdct->do_dct[compptr->component_index]; - DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no]; + DCTELEM * divisors = (DCTELEM *) compptr->dct_table; DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */ JDIMENSION bi; @@ -134,7 +143,7 @@ forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, /* This routine is heavily used, so it's worth coding it tightly. */ my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; float_DCT_method_ptr do_dct = fdct->do_float_dct[compptr->component_index]; - FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no]; + FAST_FLOAT * divisors = (FAST_FLOAT *) compptr->dct_table; FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */ JDIMENSION bi; @@ -352,22 +361,17 @@ start_pass_fdctmgr (j_compress_ptr cinfo) cinfo->quant_tbl_ptrs[qtblno] == NULL) ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); qtbl = cinfo->quant_tbl_ptrs[qtblno]; - /* Compute divisors for this quant table */ - /* We may do this more than once for same table, but it's not a big deal */ + /* Create divisor table from quant table */ switch (method) { #ifdef PROVIDE_ISLOW_TABLES case JDCT_ISLOW: /* For LL&M IDCT method, divisors are equal to raw quantization * coefficients multiplied by 8 (to counteract scaling). */ - if (fdct->divisors[qtblno] == NULL) { - fdct->divisors[qtblno] = (DCTELEM *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - DCTSIZE2 * SIZEOF(DCTELEM)); - } - dtbl = fdct->divisors[qtblno]; + dtbl = (DCTELEM *) compptr->dct_table; for (i = 0; i < DCTSIZE2; i++) { - dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3; + dtbl[i] = + ((DCTELEM) qtbl->quantval[i]) << (compptr->component_needed ? 4 : 3); } fdct->pub.forward_DCT[ci] = forward_DCT; break; @@ -395,17 +399,12 @@ start_pass_fdctmgr (j_compress_ptr cinfo) }; SHIFT_TEMPS - if (fdct->divisors[qtblno] == NULL) { - fdct->divisors[qtblno] = (DCTELEM *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - DCTSIZE2 * SIZEOF(DCTELEM)); - } - dtbl = fdct->divisors[qtblno]; + dtbl = (DCTELEM *) compptr->dct_table; for (i = 0; i < DCTSIZE2; i++) { dtbl[i] = (DCTELEM) DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i], (INT32) aanscales[i]), - CONST_BITS-3); + compptr->component_needed ? CONST_BITS-4 : CONST_BITS-3); } } fdct->pub.forward_DCT[ci] = forward_DCT; @@ -422,25 +421,20 @@ start_pass_fdctmgr (j_compress_ptr cinfo) * What's actually stored is 1/divisor so that the inner loop can * use a multiplication rather than a division. */ - FAST_FLOAT * fdtbl; + FAST_FLOAT * fdtbl = (FAST_FLOAT *) compptr->dct_table; int row, col; static const double aanscalefactor[DCTSIZE] = { 1.0, 1.387039845, 1.306562965, 1.175875602, 1.0, 0.785694958, 0.541196100, 0.275899379 }; - if (fdct->float_divisors[qtblno] == NULL) { - fdct->float_divisors[qtblno] = (FAST_FLOAT *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - DCTSIZE2 * SIZEOF(FAST_FLOAT)); - } - fdtbl = fdct->float_divisors[qtblno]; i = 0; for (row = 0; row < DCTSIZE; row++) { for (col = 0; col < DCTSIZE; col++) { fdtbl[i] = (FAST_FLOAT) - (1.0 / (((double) qtbl->quantval[i] * - aanscalefactor[row] * aanscalefactor[col] * 8.0))); + (1.0 / ((double) qtbl->quantval[i] * + aanscalefactor[row] * aanscalefactor[col] * + (compptr->component_needed ? 16.0 : 8.0))); i++; } } @@ -464,19 +458,20 @@ GLOBAL(void) jinit_forward_dct (j_compress_ptr cinfo) { my_fdct_ptr fdct; - int i; + int ci; + jpeg_component_info *compptr; fdct = (my_fdct_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_fdct_controller)); - cinfo->fdct = (struct jpeg_forward_dct *) fdct; + cinfo->fdct = &fdct->pub; fdct->pub.start_pass = start_pass_fdctmgr; - /* Mark divisor tables unallocated */ - for (i = 0; i < NUM_QUANT_TBLS; i++) { - fdct->divisors[i] = NULL; -#ifdef DCT_FLOAT_SUPPORTED - fdct->float_divisors[i] = NULL; -#endif + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Allocate a divisor table for each component */ + compptr->dct_table = + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(divisor_table)); } } diff --git a/jchuff.c b/jchuff.c index 257d7aa1..d1313f67 100644 --- a/jchuff.c +++ b/jchuff.c @@ -2,7 +2,7 @@ * jchuff.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2006-2009 by Guido Vollbeding. + * Modified 2006-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -308,24 +308,27 @@ emit_bits_s (working_state * state, unsigned int code, int size) /* Emit some bits; return TRUE if successful, FALSE if must suspend */ { /* This routine is heavily used, so it's worth coding tightly. */ - register INT32 put_buffer = (INT32) code; - register int put_bits = state->cur.put_bits; + register INT32 put_buffer; + register int put_bits; /* if size is 0, caller used an invalid Huffman table entry */ if (size == 0) ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); - put_buffer &= (((INT32) 1)<cur.put_bits; + put_buffer <<= 24 - put_bits; /* align incoming bits */ - put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */ - + /* and merge with old buffer contents */ + put_buffer |= state->cur.put_buffer; + while (put_bits >= 8) { int c = (int) ((put_buffer >> 16) & 0xFF); - + emit_byte_s(state, c, return FALSE); if (c == 0xFF) { /* need to stuff a zero byte? */ emit_byte_s(state, 0, return FALSE); @@ -347,8 +350,8 @@ emit_bits_e (huff_entropy_ptr entropy, unsigned int code, int size) /* Emit some bits, unless we are in gather mode */ { /* This routine is heavily used, so it's worth coding tightly. */ - register INT32 put_buffer = (INT32) code; - register int put_bits = entropy->saved.put_bits; + register INT32 put_buffer; + register int put_bits; /* if size is 0, caller used an invalid Huffman table entry */ if (size == 0) @@ -357,9 +360,11 @@ emit_bits_e (huff_entropy_ptr entropy, unsigned int code, int size) if (entropy->gather_statistics) return; /* do nothing if we're only getting stats */ - put_buffer &= (((INT32) 1)<saved.put_bits; put_buffer <<= 24 - put_bits; /* align incoming bits */ @@ -543,10 +548,7 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; register int temp, temp2; register int nbits; - int blkn, ci; - int Al = cinfo->Al; - JBLOCKROW block; - jpeg_component_info * compptr; + int blkn, ci, tbl; ISHIFT_TEMPS entropy->next_output_byte = cinfo->dest->next_output_byte; @@ -559,28 +561,27 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) /* Encode the MCU data blocks */ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; + tbl = cinfo->cur_comp_info[ci]->dc_tbl_no; /* Compute the DC value after the required point transform by Al. * This is simply an arithmetic right shift. */ - temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al); + temp = IRIGHT_SHIFT((int) (MCU_data[blkn][0][0]), cinfo->Al); /* DC differences are figured on the point-transformed values. */ - temp = temp2 - entropy->saved.last_dc_val[ci]; - entropy->saved.last_dc_val[ci] = temp2; + temp2 = temp - entropy->saved.last_dc_val[ci]; + entropy->saved.last_dc_val[ci] = temp; /* Encode the DC coefficient difference per section G.1.2.1 */ - temp2 = temp; + temp = temp2; if (temp < 0) { temp = -temp; /* temp is abs value of input */ /* For a negative input, want temp2 = bitwise complement of abs(input) */ /* This code assumes we are on a two's complement machine */ temp2--; } - + /* Find the number of bits needed for the magnitude of the coefficient */ nbits = 0; while (temp) { @@ -592,10 +593,10 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) */ if (nbits > MAX_COEF_BITS+1) ERREXIT(cinfo, JERR_BAD_DCT_COEF); - + /* Count/emit the Huffman-coded symbol for the number of bits */ - emit_dc_symbol(entropy, compptr->dc_tbl_no, nbits); - + emit_dc_symbol(entropy, tbl, nbits); + /* Emit that number of bits of the value, if positive, */ /* or the complement of its magnitude, if negative. */ if (nbits) /* emit_bits rejects calls with size 0 */ @@ -628,12 +629,12 @@ METHODDEF(boolean) encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + const int * natural_order; + JBLOCKROW block; register int temp, temp2; register int nbits; register int r, k; int Se, Al; - const int * natural_order; - JBLOCKROW block; entropy->next_output_byte = cinfo->dest->next_output_byte; entropy->free_in_buffer = cinfo->dest->free_in_buffer; @@ -731,18 +732,15 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) /* * MCU encoding for DC successive approximation refinement scan. - * Note: we assume such scans can be multi-component, although the spec - * is not very clear on the point. + * Note: we assume such scans can be multi-component, + * although the spec is not very clear on the point. */ METHODDEF(boolean) encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - register int temp; - int blkn; - int Al = cinfo->Al; - JBLOCKROW block; + int Al, blkn; entropy->next_output_byte = cinfo->dest->next_output_byte; entropy->free_in_buffer = cinfo->dest->free_in_buffer; @@ -752,13 +750,12 @@ encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) if (entropy->restarts_to_go == 0) emit_restart_e(entropy, entropy->next_restart_num); + Al = cinfo->Al; + /* Encode the MCU data blocks */ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; - /* We simply emit the Al'th bit of the DC coefficient value. */ - temp = (*block)[0]; - emit_bits_e(entropy, (unsigned int) (temp >> Al), 1); + emit_bits_e(entropy, (unsigned int) (MCU_data[blkn][0][0] >> Al), 1); } cinfo->dest->next_output_byte = entropy->next_output_byte; @@ -786,14 +783,14 @@ METHODDEF(boolean) encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + const int * natural_order; + JBLOCKROW block; register int temp; register int r, k; + int Se, Al; int EOB; char *BR_buffer; unsigned int BR; - int Se, Al; - const int * natural_order; - JBLOCKROW block; int absvalues[DCTSIZE2]; entropy->next_output_byte = cinfo->dest->next_output_byte; @@ -918,7 +915,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, { register int temp, temp2; register int nbits; - register int k, r, i; + register int r, k; int Se = state->cinfo->lim_Se; const int * natural_order = state->cinfo->natural_order; @@ -960,7 +957,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, r = 0; /* r = run length of zeros */ for (k = 1; k <= Se; k++) { - if ((temp = block[natural_order[k]]) == 0) { + if ((temp2 = block[natural_order[k]]) == 0) { r++; } else { /* if run length > 15, must emit special run-length-16 codes (0xF0) */ @@ -970,7 +967,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, r -= 16; } - temp2 = temp; + temp = temp2; if (temp < 0) { temp = -temp; /* temp is abs value of input */ /* This code assumes we are on a two's complement machine */ @@ -986,8 +983,8 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); /* Emit Huffman symbol for run length / number of bits */ - i = (r << 4) + nbits; - if (! emit_bits_s(state, actbl->ehufco[i], actbl->ehufsi[i])) + temp = (r << 4) + nbits; + if (! emit_bits_s(state, actbl->ehufco[temp], actbl->ehufsi[temp])) return FALSE; /* Emit that number of bits of the value, if positive, */ @@ -1124,16 +1121,16 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, { register int temp; register int nbits; - register int k, r; + register int r, k; int Se = cinfo->lim_Se; const int * natural_order = cinfo->natural_order; - + /* Encode the DC coefficient difference per section F.1.2.1 */ - + temp = block[0] - last_dc_val; if (temp < 0) temp = -temp; - + /* Find the number of bits needed for the magnitude of the coefficient */ nbits = 0; while (temp) { @@ -1148,11 +1145,11 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, /* Count the Huffman symbol for the number of bits */ dc_counts[nbits]++; - + /* Encode the AC coefficients per section F.1.2.2 */ - + r = 0; /* r = run length of zeros */ - + for (k = 1; k <= Se; k++) { if ((temp = block[natural_order[k]]) == 0) { r++; @@ -1162,11 +1159,11 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, ac_counts[0xF0]++; r -= 16; } - + /* Find the number of bits needed for the magnitude of the coefficient */ if (temp < 0) temp = -temp; - + /* Find the number of bits needed for the magnitude of the coefficient */ nbits = 1; /* there must be at least one 1 bit */ while ((temp >>= 1)) @@ -1174,10 +1171,10 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, /* Check for out-of-range coefficient values */ if (nbits > MAX_COEF_BITS) ERREXIT(cinfo, JERR_BAD_DCT_COEF); - + /* Count Huffman symbol for run length / number of bits */ ac_counts[(r << 4) + nbits]++; - + r = 0; } } @@ -1562,7 +1559,7 @@ jinit_huff_encoder (j_compress_ptr cinfo) entropy = (huff_entropy_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_encoder)); - cinfo->entropy = (struct jpeg_entropy_encoder *) entropy; + cinfo->entropy = &entropy->pub; entropy->pub.start_pass = start_pass_huff; /* Mark tables unallocated */ diff --git a/jcinit.c b/jcinit.c index 0ba310f2..1e13e346 100644 --- a/jcinit.c +++ b/jcinit.c @@ -2,6 +2,7 @@ * jcinit.c * * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2003-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -29,6 +30,24 @@ GLOBAL(void) jinit_compress_master (j_compress_ptr cinfo) { + long samplesperrow; + JDIMENSION jd_samplesperrow; + + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + + /* Sanity check on image dimensions */ + if (cinfo->image_height <= 0 || cinfo->image_width <= 0 || + cinfo->input_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + + /* Width of an input scanline must be representable as JDIMENSION. */ + samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components; + jd_samplesperrow = (JDIMENSION) samplesperrow; + if ((long) jd_samplesperrow != samplesperrow) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + /* Initialize master control (includes parameter checking/processing) */ jinit_c_master_control(cinfo, FALSE /* full compression */); diff --git a/jcmarker.c b/jcmarker.c index 92aa65fe..ca2bb399 100644 --- a/jcmarker.c +++ b/jcmarker.c @@ -2,7 +2,7 @@ * jcmarker.c * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2003-2012 by Guido Vollbeding. + * Modified 2003-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -508,8 +508,8 @@ write_marker_byte (j_compress_ptr cinfo, int val) * Write datastream header. * This consists of an SOI and optional APPn markers. * We recommend use of the JFIF marker, but not the Adobe marker, - * when using YCbCr or grayscale data. The JFIF marker should NOT - * be used for any other JPEG colorspace. The Adobe marker is helpful + * when using YCbCr or grayscale data. The JFIF marker is also used + * for other standard JPEG colorspaces. The Adobe marker is helpful * to distinguish RGB, CMYK, and YCCK colorspaces. * Note that an application can write additional header markers after * jpeg_start_compress returns. diff --git a/jcmaster.c b/jcmaster.c index caf80a53..2a8ae633 100644 --- a/jcmaster.c +++ b/jcmaster.c @@ -2,7 +2,7 @@ * jcmaster.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2003-2011 by Guido Vollbeding. + * Modified 2003-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -222,8 +222,6 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only) { int ci, ssize; jpeg_component_info *compptr; - long samplesperrow; - JDIMENSION jd_samplesperrow; if (transcode_only) jpeg_calc_trans_dimensions(cinfo); @@ -251,7 +249,7 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only) /* Sanity check on image dimensions */ if (cinfo->jpeg_height <= 0 || cinfo->jpeg_width <= 0 || - cinfo->num_components <= 0 || cinfo->input_components <= 0) + cinfo->num_components <= 0) ERREXIT(cinfo, JERR_EMPTY_IMAGE); /* Make sure image isn't bigger than I can handle */ @@ -259,14 +257,8 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only) (long) cinfo->jpeg_width > (long) JPEG_MAX_DIMENSION) ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); - /* Width of an input scanline must be representable as JDIMENSION. */ - samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components; - jd_samplesperrow = (JDIMENSION) samplesperrow; - if ((long) jd_samplesperrow != samplesperrow) - ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); - - /* For now, precision must match compiled-in value... */ - if (cinfo->data_precision != BITS_IN_JSAMPLE) + /* Only 8 to 12 bits data precision are supported for DCT based JPEG */ + if (cinfo->data_precision < 8 || cinfo->data_precision > 12) ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); /* Check that number of components won't exceed internal array sizes */ @@ -339,8 +331,10 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only) jdiv_round_up((long) cinfo->jpeg_height * (long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size), (long) (cinfo->max_v_samp_factor * cinfo->block_size)); - /* Mark component needed (this flag isn't actually used for compression) */ - compptr->component_needed = TRUE; + /* Don't need quantization scale after DCT, + * until color conversion says otherwise. + */ + compptr->component_needed = FALSE; } /* Compute number of fully interleaved MCU rows (number of times that @@ -811,7 +805,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only) master = (my_master_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_comp_master)); - cinfo->master = (struct jpeg_comp_master *) master; + cinfo->master = &master->pub; master->pub.prepare_for_pass = prepare_for_pass; master->pub.pass_startup = pass_startup; master->pub.finish_pass = finish_pass_master; @@ -833,10 +827,14 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only) cinfo->num_scans = 1; } - if ((cinfo->progressive_mode || cinfo->block_size < DCTSIZE) && - !cinfo->arith_code) /* TEMPORARY HACK ??? */ - /* assume default tables no good for progressive or downscale mode */ - cinfo->optimize_coding = TRUE; + if (cinfo->optimize_coding) + cinfo->arith_code = FALSE; /* disable arithmetic coding */ + else if (! cinfo->arith_code && + (cinfo->progressive_mode || + (cinfo->block_size > 1 && cinfo->block_size < DCTSIZE))) + /* TEMPORARY HACK ??? */ + /* assume default tables no good for progressive or reduced AC mode */ + cinfo->optimize_coding = TRUE; /* force Huffman optimization */ /* Initialize my private state */ if (transcode_only) { diff --git a/jconfig.cfg b/jconfig.cfg index bb7435c9..c4548fc2 100644 --- a/jconfig.cfg +++ b/jconfig.cfg @@ -17,11 +17,17 @@ /* Define this if you get warnings about undefined structures. */ #undef INCOMPLETE_TYPES_BROKEN -/* Define "boolean" as unsigned char, not int, on Windows systems. */ +/* Define "boolean" as unsigned char, not enum, on Windows systems. */ #ifdef _WIN32 #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; #endif +#ifndef FALSE /* in case these macros already exist */ +#define FALSE 0 /* values of boolean */ +#endif +#ifndef TRUE +#define TRUE 1 +#endif #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ #endif diff --git a/jconfig.txt b/jconfig.txt index b96d3124..d1710ae7 100644 --- a/jconfig.txt +++ b/jconfig.txt @@ -2,6 +2,7 @@ * jconfig.txt * * Copyright (C) 1991-1994, Thomas G. Lane. + * Modified 2009-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -91,12 +92,18 @@ */ #undef INCOMPLETE_TYPES_BROKEN -/* Define "boolean" as unsigned char, not int, on Windows systems. +/* Define "boolean" as unsigned char, not enum, on Windows systems. */ #ifdef _WIN32 #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; #endif +#ifndef FALSE /* in case these macros already exist */ +#define FALSE 0 /* values of boolean */ +#endif +#ifndef TRUE +#define TRUE 1 +#endif #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ #endif diff --git a/jconfig.vc b/jconfig.vc index f15b418f..7d88482f 100644 --- a/jconfig.vc +++ b/jconfig.vc @@ -19,6 +19,12 @@ #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; #endif +#ifndef FALSE /* in case these macros already exist */ +#define FALSE 0 /* values of boolean */ +#endif +#ifndef TRUE +#define TRUE 1 +#endif #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ diff --git a/jcparam.c b/jcparam.c index e530c3c4..4b2bee24 100644 --- a/jcparam.c +++ b/jcparam.c @@ -2,7 +2,7 @@ * jcparam.c * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2003-2012 by Guido Vollbeding. + * Modified 2003-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -323,18 +323,17 @@ jpeg_set_defaults (j_compress_ptr cinfo) /* Expect normal source image, not raw downsampled data */ cinfo->raw_data_in = FALSE; - /* Use Huffman coding, not arithmetic coding, by default */ - cinfo->arith_code = FALSE; + /* The standard Huffman tables are only valid for 8-bit data precision. + * If the precision is higher, use arithmetic coding. + * (Alternatively, using Huffman coding would be possible with forcing + * optimization on so that usable tables will be computed, or by + * supplying default tables that are valid for the desired precision.) + * Otherwise, use Huffman coding by default. + */ + cinfo->arith_code = cinfo->data_precision > 8 ? TRUE : FALSE; /* By default, don't do extra passes to optimize entropy coding */ cinfo->optimize_coding = FALSE; - /* The standard Huffman tables are only valid for 8-bit data precision. - * If the precision is higher, force optimization on so that usable - * tables will be computed. This test can be removed if default tables - * are supplied that are valid for the desired precision. - */ - if (cinfo->data_precision > 8) - cinfo->optimize_coding = TRUE; /* By default, use the simpler non-cosited sampling alignment */ cinfo->CCIR601_sampling = FALSE; @@ -360,6 +359,9 @@ jpeg_set_defaults (j_compress_ptr cinfo) * JFIF_minor_version to 2. We could probably get away with just defaulting * to 1.02, but there may still be some decoders in use that will complain * about that; saying 1.01 should minimize compatibility problems. + * + * For wide gamut colorspaces (BG_RGB and BG_YCC), the major version will be + * overridden by jpeg_set_colorspace and set to 2. */ cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */ cinfo->JFIF_minor_version = 1; @@ -384,6 +386,9 @@ GLOBAL(void) jpeg_default_colorspace (j_compress_ptr cinfo) { switch (cinfo->in_color_space) { + case JCS_UNKNOWN: + jpeg_set_colorspace(cinfo, JCS_UNKNOWN); + break; case JCS_GRAYSCALE: jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); break; @@ -399,8 +404,12 @@ jpeg_default_colorspace (j_compress_ptr cinfo) case JCS_YCCK: jpeg_set_colorspace(cinfo, JCS_YCCK); break; - case JCS_UNKNOWN: - jpeg_set_colorspace(cinfo, JCS_UNKNOWN); + case JCS_BG_RGB: + /* No translation for now -- conversion to BG_YCC not yet supportet */ + jpeg_set_colorspace(cinfo, JCS_BG_RGB); + break; + case JCS_BG_YCC: + jpeg_set_colorspace(cinfo, JCS_BG_YCC); break; default: ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); @@ -441,29 +450,40 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */ switch (colorspace) { + case JCS_UNKNOWN: + cinfo->num_components = cinfo->input_components; + if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + for (ci = 0; ci < cinfo->num_components; ci++) { + SET_COMP(ci, ci, 1,1, 0, 0,0); + } + break; case JCS_GRAYSCALE: cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ cinfo->num_components = 1; /* JFIF specifies component ID 1 */ - SET_COMP(0, 1, 1,1, 0, 0,0); + SET_COMP(0, 0x01, 1,1, 0, 0,0); break; case JCS_RGB: cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */ cinfo->num_components = 3; - SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0); - SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, + SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0); + SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0); + SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0, cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0); - SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0); break; case JCS_YCbCr: cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ cinfo->num_components = 3; /* JFIF specifies component IDs 1,2,3 */ /* We default to 2x2 subsamples of chrominance */ - SET_COMP(0, 1, 2,2, 0, 0,0); - SET_COMP(1, 2, 1,1, 1, 1,1); - SET_COMP(2, 3, 1,1, 1, 1,1); + SET_COMP(0, 0x01, 2,2, 0, 0,0); + SET_COMP(1, 0x02, 1,1, 1, 1,1); + SET_COMP(2, 0x03, 1,1, 1, 1,1); break; case JCS_CMYK: cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */ @@ -476,19 +496,33 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) case JCS_YCCK: cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */ cinfo->num_components = 4; - SET_COMP(0, 1, 2,2, 0, 0,0); - SET_COMP(1, 2, 1,1, 1, 1,1); - SET_COMP(2, 3, 1,1, 1, 1,1); - SET_COMP(3, 4, 2,2, 0, 0,0); + SET_COMP(0, 0x01, 2,2, 0, 0,0); + SET_COMP(1, 0x02, 1,1, 1, 1,1); + SET_COMP(2, 0x03, 1,1, 1, 1,1); + SET_COMP(3, 0x04, 2,2, 0, 0,0); break; - case JCS_UNKNOWN: - cinfo->num_components = cinfo->input_components; - if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, - MAX_COMPONENTS); - for (ci = 0; ci < cinfo->num_components; ci++) { - SET_COMP(ci, ci, 1,1, 0, 0,0); - } + case JCS_BG_RGB: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->JFIF_major_version = 2; /* Set JFIF major version = 2 */ + cinfo->num_components = 3; + /* Add offset 0x20 to the normal R/G/B component IDs */ + SET_COMP(0, 0x72 /* 'r' */, 1,1, 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0); + SET_COMP(1, 0x67 /* 'g' */, 1,1, 0, 0,0); + SET_COMP(2, 0x62 /* 'b' */, 1,1, 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0); + break; + case JCS_BG_YCC: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->JFIF_major_version = 2; /* Set JFIF major version = 2 */ + cinfo->num_components = 3; + /* Add offset 0x20 to the normal Cb/Cr component IDs */ + /* We default to 2x2 subsamples of chrominance */ + SET_COMP(0, 0x01, 2,2, 0, 0,0); + SET_COMP(1, 0x22, 1,1, 1, 1,1); + SET_COMP(2, 0x23, 1,1, 1, 1,1); break; default: ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); @@ -572,8 +606,10 @@ jpeg_simple_progression (j_compress_ptr cinfo) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); /* Figure space needed for script. Calculation must match code below! */ - if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { - /* Custom script for YCbCr color images. */ + if (ncomps == 3 && + (cinfo->jpeg_color_space == JCS_YCbCr || + cinfo->jpeg_color_space == JCS_BG_YCC)) { + /* Custom script for YCC color images. */ nscans = 10; } else { /* All-purpose script for other color spaces. */ @@ -588,7 +624,7 @@ jpeg_simple_progression (j_compress_ptr cinfo) * multiple compressions without changing the settings. To avoid a memory * leak if jpeg_simple_progression is called repeatedly for the same JPEG * object, we try to re-use previously allocated space, and we allocate - * enough space to handle YCbCr even if initially asked for grayscale. + * enough space to handle YCC even if initially asked for grayscale. */ if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) { cinfo->script_space_size = MAX(nscans, 10); @@ -600,8 +636,10 @@ jpeg_simple_progression (j_compress_ptr cinfo) cinfo->scan_info = scanptr; cinfo->num_scans = nscans; - if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { - /* Custom script for YCbCr color images. */ + if (ncomps == 3 && + (cinfo->jpeg_color_space == JCS_YCbCr || + cinfo->jpeg_color_space == JCS_BG_YCC)) { + /* Custom script for YCC color images. */ /* Initial DC scan */ scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); /* Initial AC scan: get some luma data out in a hurry */ diff --git a/jctrans.c b/jctrans.c index 8813c3ea..7cd077e4 100644 --- a/jctrans.c +++ b/jctrans.c @@ -2,7 +2,7 @@ * jctrans.c * * Copyright (C) 1995-1998, Thomas G. Lane. - * Modified 2000-2012 by Guido Vollbeding. + * Modified 2000-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -143,10 +143,10 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, * if the application chooses to copy JFIF 1.02 extension markers from * the source file, we need to copy the version to make sure we don't * emit a file that has 1.02 extensions but a claimed version of 1.01. - * We will *not*, however, copy version info from mislabeled "2.01" files. */ if (srcinfo->saw_JFIF_marker) { - if (srcinfo->JFIF_major_version == 1) { + if (srcinfo->JFIF_major_version == 1 || + srcinfo->JFIF_major_version == 2) { dstinfo->JFIF_major_version = srcinfo->JFIF_major_version; dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version; } diff --git a/jdapimin.c b/jdapimin.c index 7f1ce4c0..a6e0dd9f 100644 --- a/jdapimin.c +++ b/jdapimin.c @@ -2,7 +2,7 @@ * jdapimin.c * * Copyright (C) 1994-1998, Thomas G. Lane. - * Modified 2009 by Guido Vollbeding. + * Modified 2009-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -114,8 +114,9 @@ jpeg_abort_decompress (j_decompress_ptr cinfo) LOCAL(void) default_decompress_parms (j_decompress_ptr cinfo) { + int cid0, cid1, cid2; + /* Guess the input colorspace, and set output colorspace accordingly. */ - /* (Wish JPEG committee had provided a real way to specify this...) */ /* Note application may override our guesses. */ switch (cinfo->num_components) { case 1: @@ -124,9 +125,22 @@ default_decompress_parms (j_decompress_ptr cinfo) break; case 3: - if (cinfo->saw_JFIF_marker) { - cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ - } else if (cinfo->saw_Adobe_marker) { + cid0 = cinfo->comp_info[0].component_id; + cid1 = cinfo->comp_info[1].component_id; + cid2 = cinfo->comp_info[2].component_id; + + /* First try to guess from the component IDs */ + if (cid0 == 0x01 && cid1 == 0x02 && cid2 == 0x03) + cinfo->jpeg_color_space = JCS_YCbCr; + else if (cid0 == 0x01 && cid1 == 0x22 && cid2 == 0x23) + cinfo->jpeg_color_space = JCS_BG_YCC; + else if (cid0 == 0x52 && cid1 == 0x47 && cid2 == 0x42) + cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ + else if (cid0 == 0x72 && cid1 == 0x67 && cid2 == 0x62) + cinfo->jpeg_color_space = JCS_BG_RGB; /* ASCII 'r', 'g', 'b' */ + else if (cinfo->saw_JFIF_marker) + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + else if (cinfo->saw_Adobe_marker) { switch (cinfo->Adobe_transform) { case 0: cinfo->jpeg_color_space = JCS_RGB; @@ -136,23 +150,12 @@ default_decompress_parms (j_decompress_ptr cinfo) break; default: WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); - cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ break; } } else { - /* Saw no special markers, try to guess from the component IDs */ - int cid0 = cinfo->comp_info[0].component_id; - int cid1 = cinfo->comp_info[1].component_id; - int cid2 = cinfo->comp_info[2].component_id; - - if (cid0 == 1 && cid1 == 2 && cid2 == 3) - cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ - else if (cid0 == 82 && cid1 == 71 && cid2 == 66) - cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ - else { - TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2); - cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ - } + TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2); + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ } /* Always guess RGB is proper output colorspace. */ cinfo->out_color_space = JCS_RGB; @@ -169,7 +172,7 @@ default_decompress_parms (j_decompress_ptr cinfo) break; default: WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); - cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ + cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ break; } } else { diff --git a/jdapistd.c b/jdapistd.c index 9d745377..7f3a78b2 100644 --- a/jdapistd.c +++ b/jdapistd.c @@ -2,6 +2,7 @@ * jdapistd.c * * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2002-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * diff --git a/jdarith.c b/jdarith.c index 6e32d230..efdb26d3 100644 --- a/jdarith.c +++ b/jdarith.c @@ -1,7 +1,7 @@ /* * jdarith.c * - * Developed 1997-2012 by Guido Vollbeding. + * Developed 1997-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -395,6 +395,8 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) /* * MCU decoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, + * although the spec is not very clear on the point. */ METHODDEF(boolean) @@ -743,6 +745,17 @@ start_pass (j_decompress_ptr cinfo) } +/* + * Finish up at the end of an arithmetic-compressed scan. + */ + +METHODDEF(void) +finish_pass (j_decompress_ptr cinfo) +{ + /* no work necessary here */ +} + + /* * Module initialization routine for arithmetic entropy decoding. */ @@ -758,6 +771,7 @@ jinit_arith_decoder (j_decompress_ptr cinfo) SIZEOF(arith_entropy_decoder)); cinfo->entropy = &entropy->pub; entropy->pub.start_pass = start_pass; + entropy->pub.finish_pass = finish_pass; /* Mark tables unallocated */ for (i = 0; i < NUM_ARITH_TBLS; i++) { diff --git a/jdcolor.c b/jdcolor.c index 939df757..a31c2861 100644 --- a/jdcolor.c +++ b/jdcolor.c @@ -2,7 +2,7 @@ * jdcolor.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2011-2012 by Guido Vollbeding. + * Modified 2011-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -19,12 +19,15 @@ typedef struct { struct jpeg_color_deconverter pub; /* public fields */ - /* Private state for YCC->RGB conversion */ + /* Private state for YCbCr->RGB and BG_YCC->RGB conversion */ int * Cr_r_tab; /* => table for Cr to R conversion */ int * Cb_b_tab; /* => table for Cb to B conversion */ INT32 * Cr_g_tab; /* => table for Cr to G conversion */ INT32 * Cb_g_tab; /* => table for Cb to G conversion */ + JSAMPLE * range_limit; /* pointer to normal sample range limit table, */ + /* or extended sample range limit table for BG_YCC */ + /* Private state for RGB->Y conversion */ INT32 * rgb_y_tab; /* => table for RGB to Y conversion */ } my_color_deconverter; @@ -32,22 +35,44 @@ typedef struct { typedef my_color_deconverter * my_cconvert_ptr; -/**************** YCbCr -> RGB conversion: most common case **************/ -/**************** RGB -> Y conversion: less common case **************/ +/*************** YCbCr -> RGB conversion: most common case **************/ +/*************** BG_YCC -> RGB conversion: less common case **************/ +/*************** RGB -> Y conversion: less common case **************/ /* - * YCbCr is defined per CCIR 601-1, except that Cb and Cr are - * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. - * The conversion equations to be implemented are therefore + * YCbCr is defined per Recommendation ITU-R BT.601-7 (03/2011), + * previously known as Recommendation CCIR 601-1, except that Cb and Cr + * are normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * sRGB (standard RGB color space) is defined per IEC 61966-2-1:1999. + * sYCC (standard luma-chroma-chroma color space with extended gamut) + * is defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex F. + * bg-sRGB and bg-sYCC (big gamut standard color spaces) + * are defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex G. + * Note that the derived conversion coefficients given in some of these + * documents are imprecise. The general conversion equations are * - * R = Y + 1.40200 * Cr - * G = Y - 0.34414 * Cb - 0.71414 * Cr - * B = Y + 1.77200 * Cb + * R = Y + K * (1 - Kr) * Cr + * G = Y - K * (Kb * (1 - Kb) * Cb + Kr * (1 - Kr) * Cr) / (1 - Kr - Kb) + * B = Y + K * (1 - Kb) * Cb * - * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B + * Y = Kr * R + (1 - Kr - Kb) * G + Kb * B + * + * With Kr = 0.299 and Kb = 0.114 (derived according to SMPTE RP 177-1993 + * from the 1953 FCC NTSC primaries and CIE Illuminant C), K = 2 for sYCC, + * the conversion equations to be implemented are therefore + * + * R = Y + 1.402 * Cr + * G = Y - 0.344136286 * Cb - 0.714136286 * Cr + * B = Y + 1.772 * Cb + * + * Y = 0.299 * R + 0.587 * G + 0.114 * B * * where Cb and Cr represent the incoming values less CENTERJSAMPLE. - * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * For bg-sYCC, with K = 4, the equations are + * + * R = Y + 2.804 * Cr + * G = Y - 0.688272572 * Cb - 1.428272572 * Cr + * B = Y + 3.544 * Cb * * To avoid floating-point arithmetic, we represent the fractional constants * as integers scaled up by 2^16 (about 4 digits precision); we have to divide @@ -58,9 +83,9 @@ typedef my_color_deconverter * my_cconvert_ptr; * For even more speed, we avoid doing any multiplications in the inner loop * by precalculating the constants times Cb and Cr for all possible values. * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); - * for 12-bit samples it is still acceptable. It's not very reasonable for - * 16-bit samples, but if you want lossless storage you shouldn't be changing - * colorspace anyway. + * for 9-bit to 12-bit samples it is still acceptable. It's not very + * reasonable for 16-bit samples, but if you want lossless storage you + * shouldn't be changing colorspace anyway. * The Cr=>R and Cb=>B values can be rounded to integers in advance; the * values for the G calculation are left scaled up, since we must add them * together before rounding. @@ -84,11 +109,12 @@ typedef my_color_deconverter * my_cconvert_ptr; /* - * Initialize tables for YCC->RGB colorspace conversion. + * Initialize tables for YCbCr->RGB and BG_YCC->RGB colorspace conversion. */ LOCAL(void) build_ycc_rgb_table (j_decompress_ptr cinfo) +/* Normal case, sYCC */ { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; int i; @@ -108,24 +134,84 @@ build_ycc_rgb_table (j_decompress_ptr cinfo) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32)); + cconvert->range_limit = cinfo->sample_range_limit; + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ - /* Cr=>R value is nearest int to 1.40200 * x */ + /* Cr=>R value is nearest int to 1.402 * x */ cconvert->Cr_r_tab[i] = (int) - RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); - /* Cb=>B value is nearest int to 1.77200 * x */ + RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.772 * x */ cconvert->Cb_b_tab[i] = (int) - RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); - /* Cr=>G value is scaled-up -0.71414 * x */ - cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x; - /* Cb=>G value is scaled-up -0.34414 * x */ + RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS); + /* Cr=>G value is scaled-up -0.714136286 * x */ + cconvert->Cr_g_tab[i] = (- FIX(0.714136286)) * x; + /* Cb=>G value is scaled-up -0.344136286 * x */ /* We also add in ONE_HALF so that need not do it in inner loop */ - cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + cconvert->Cb_g_tab[i] = (- FIX(0.344136286)) * x + ONE_HALF; } } +LOCAL(void) +build_bg_ycc_rgb_table (j_decompress_ptr cinfo) +/* Wide gamut case, bg-sYCC */ +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + int i; + INT32 x; + SHIFT_TEMPS + + cconvert->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cr_g_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(INT32)); + cconvert->Cb_g_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(INT32)); + + cconvert->range_limit = (JSAMPLE *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ + /* Cr=>R value is nearest int to 2.804 * x */ + cconvert->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 3.544 * x */ + cconvert->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS); + /* Cr=>G value is scaled-up -1.428272572 * x */ + cconvert->Cr_g_tab[i] = (- FIX(1.428272572)) * x; + /* Cb=>G value is scaled-up -0.688272572 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + cconvert->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF; + } + + /* Cb and Cr portions can extend to double range in wide gamut case, + * so we prepare an appropriate extended range limit table. + */ + + /* First segment of range limit table: limit[x] = 0 for x < 0 */ + MEMZERO(cconvert->range_limit, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); + cconvert->range_limit += 2 * (MAXJSAMPLE+1); + /* Main part of range limit table: limit[x] = x */ + for (i = 0; i <= MAXJSAMPLE; i++) + cconvert->range_limit[i] = (JSAMPLE) i; + /* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */ + for (; i < 3 * (MAXJSAMPLE+1); i++) + cconvert->range_limit[i] = MAXJSAMPLE; +} + + /* * Convert some rows of samples to the output colorspace. * @@ -149,7 +235,7 @@ ycc_rgb_convert (j_decompress_ptr cinfo, register JDIMENSION col; JDIMENSION num_cols = cinfo->output_width; /* copy these pointers into registers if possible */ - register JSAMPLE * range_limit = cinfo->sample_range_limit; + register JSAMPLE * range_limit = cconvert->range_limit; register int * Crrtab = cconvert->Cr_r_tab; register int * Cbbtab = cconvert->Cb_b_tab; register INT32 * Crgtab = cconvert->Cr_g_tab; @@ -166,19 +252,21 @@ ycc_rgb_convert (j_decompress_ptr cinfo, y = GETJSAMPLE(inptr0[col]); cb = GETJSAMPLE(inptr1[col]); cr = GETJSAMPLE(inptr2[col]); - /* Range-limiting is essential due to noise introduced by DCT losses. */ - outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; + /* Range-limiting is essential due to noise introduced by DCT losses, + * for extended gamut (sYCC) and wide gamut (bg-sYCC) encodings. + */ + outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; outptr[RGB_GREEN] = range_limit[y + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS))]; - outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; + outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; outptr += RGB_PIXELSIZE; } } } -/**************** Cases other than YCbCr -> RGB **************/ +/**************** Cases other than YCC -> RGB ****************/ /* @@ -198,9 +286,9 @@ build_rgb_y_table (j_decompress_ptr cinfo) (TABLE_SIZE * SIZEOF(INT32))); for (i = 0; i <= MAXJSAMPLE; i++) { - rgb_y_tab[i+R_Y_OFF] = FIX(0.29900) * i; - rgb_y_tab[i+G_Y_OFF] = FIX(0.58700) * i; - rgb_y_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; + rgb_y_tab[i+R_Y_OFF] = FIX(0.299) * i; + rgb_y_tab[i+G_Y_OFF] = FIX(0.587) * i; + rgb_y_tab[i+B_Y_OFF] = FIX(0.114) * i + ONE_HALF; } } @@ -244,6 +332,9 @@ rgb_gray_convert (j_decompress_ptr cinfo, /* * [R-G,G,B-G] to [R,G,B] conversion with modulo calculation * (inverse color transform). + * This can be seen as an adaption of the general YCbCr->RGB + * conversion equation with Kr = Kb = 0, while replacing the + * normalization by modulo calculation. */ METHODDEF(void) @@ -387,7 +478,7 @@ null_convert (j_decompress_ptr cinfo, /* * Color conversion for grayscale: just copy the data. - * This also works for YCbCr -> grayscale conversion, in which + * This also works for YCC -> grayscale conversion, in which * we just copy the Y (luminance) component and ignore chrominance. */ @@ -466,7 +557,9 @@ ycck_cmyk_convert (j_decompress_ptr cinfo, y = GETJSAMPLE(inptr0[col]); cb = GETJSAMPLE(inptr1[col]); cr = GETJSAMPLE(inptr2[col]); - /* Range-limiting is essential due to noise introduced by DCT losses. */ + /* Range-limiting is essential due to noise introduced by DCT losses, + * and for extended gamut encodings (sYCC). + */ outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */ outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */ ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], @@ -516,6 +609,8 @@ jinit_color_deconverter (j_decompress_ptr cinfo) case JCS_RGB: case JCS_YCbCr: + case JCS_BG_RGB: + case JCS_BG_YCC: if (cinfo->num_components != 3) ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); break; @@ -532,8 +627,10 @@ jinit_color_deconverter (j_decompress_ptr cinfo) break; } - /* Support color transform only for RGB colorspace */ - if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB) + /* Support color transform only for RGB colorspaces */ + if (cinfo->color_transform && + cinfo->jpeg_color_space != JCS_RGB && + cinfo->jpeg_color_space != JCS_BG_RGB) ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); /* Set out_color_components and conversion method based on requested space. @@ -544,13 +641,16 @@ jinit_color_deconverter (j_decompress_ptr cinfo) switch (cinfo->out_color_space) { case JCS_GRAYSCALE: cinfo->out_color_components = 1; - if (cinfo->jpeg_color_space == JCS_GRAYSCALE || - cinfo->jpeg_color_space == JCS_YCbCr) { + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + case JCS_YCbCr: + case JCS_BG_YCC: cconvert->pub.color_convert = grayscale_convert; /* For color->grayscale conversion, only the Y (0) component is needed */ for (ci = 1; ci < cinfo->num_components; ci++) cinfo->comp_info[ci].component_needed = FALSE; - } else if (cinfo->jpeg_color_space == JCS_RGB) { + break; + case JCS_RGB: switch (cinfo->color_transform) { case JCT_NONE: cconvert->pub.color_convert = rgb_gray_convert; @@ -560,21 +660,29 @@ jinit_color_deconverter (j_decompress_ptr cinfo) break; default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; } build_rgb_y_table(cinfo); - } else + break; + default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } break; case JCS_RGB: cinfo->out_color_components = RGB_PIXELSIZE; - if (cinfo->jpeg_color_space == JCS_YCbCr) { + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + cconvert->pub.color_convert = gray_rgb_convert; + break; + case JCS_YCbCr: cconvert->pub.color_convert = ycc_rgb_convert; build_ycc_rgb_table(cinfo); - } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) { - cconvert->pub.color_convert = gray_rgb_convert; - } else if (cinfo->jpeg_color_space == JCS_RGB) { + break; + case JCS_BG_YCC: + cconvert->pub.color_convert = ycc_rgb_convert; + build_bg_ycc_rgb_table(cinfo); + break; + case JCS_RGB: switch (cinfo->color_transform) { case JCT_NONE: cconvert->pub.color_convert = rgb_convert; @@ -584,7 +692,25 @@ jinit_color_deconverter (j_decompress_ptr cinfo) break; default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } + break; + default: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } + break; + + case JCS_BG_RGB: + cinfo->out_color_components = RGB_PIXELSIZE; + if (cinfo->jpeg_color_space == JCS_BG_RGB) { + switch (cinfo->color_transform) { + case JCT_NONE: + cconvert->pub.color_convert = rgb_convert; break; + case JCT_SUBTRACT_GREEN: + cconvert->pub.color_convert = rgb1_rgb_convert; + break; + default: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); } } else ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); @@ -592,13 +718,17 @@ jinit_color_deconverter (j_decompress_ptr cinfo) case JCS_CMYK: cinfo->out_color_components = 4; - if (cinfo->jpeg_color_space == JCS_YCCK) { + switch (cinfo->jpeg_color_space) { + case JCS_YCCK: cconvert->pub.color_convert = ycck_cmyk_convert; build_ycc_rgb_table(cinfo); - } else if (cinfo->jpeg_color_space == JCS_CMYK) { + break; + case JCS_CMYK: cconvert->pub.color_convert = null_convert; - } else + break; + default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } break; default: diff --git a/jddctmgr.c b/jddctmgr.c index 0ded9d57..9ecfbb51 100644 --- a/jddctmgr.c +++ b/jddctmgr.c @@ -2,7 +2,7 @@ * jddctmgr.c * * Copyright (C) 1994-1996, Thomas G. Lane. - * Modified 2002-2010 by Guido Vollbeding. + * Modified 2002-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -368,7 +368,7 @@ jinit_inverse_dct (j_decompress_ptr cinfo) idct = (my_idct_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_idct_controller)); - cinfo->idct = (struct jpeg_inverse_dct *) idct; + cinfo->idct = &idct->pub; idct->pub.start_pass = start_pass; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; diff --git a/jdhuff.c b/jdhuff.c index e548e689..6920e207 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -2,7 +2,7 @@ * jdhuff.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2006-2012 by Guido Vollbeding. + * Modified 2006-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -627,6 +627,22 @@ jpeg_huff_decode (bitread_working_state * state, } +/* + * Finish up at the end of a Huffman-compressed scan. + */ + +METHODDEF(void) +finish_pass_huff (j_decompress_ptr cinfo) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8; + entropy->bitstate.bits_left = 0; +} + + /* * Check for a restart marker & resynchronize decoder. * Returns FALSE if must suspend. @@ -638,10 +654,7 @@ process_restart (j_decompress_ptr cinfo) huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; int ci; - /* Throw away any unused bits remaining in bit buffer; */ - /* include any full bytes in next_marker's count of discarded bytes */ - cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8; - entropy->bitstate.bits_left = 0; + finish_pass_huff(cinfo); /* Advance past the RSTn marker */ if (! (*cinfo->marker->read_restart_marker) (cinfo)) @@ -846,17 +859,15 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) /* * MCU decoding for DC successive approximation refinement scan. - * Note: we assume such scans can be multi-component, although the spec - * is not very clear on the point. + * Note: we assume such scans can be multi-component, + * although the spec is not very clear on the point. */ METHODDEF(boolean) decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ - int blkn; - JBLOCKROW block; + int p1, blkn; BITREAD_STATE_VARS; /* Process restart marker if needed; may have to suspend */ @@ -873,15 +884,15 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) /* Load up working state */ BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + /* Outer loop handles each block in the MCU */ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; - /* Encoded data is simply the next bit of the two's-complement DC value */ CHECK_BIT_BUFFER(br_state, 1, return FALSE); if (GET_BITS(1)) - (*block)[0] |= p1; + MCU_data[blkn][0][0] |= p1; /* Note: since we use |=, repeating the assignment later is safe */ } @@ -1517,6 +1528,7 @@ jinit_huff_decoder (j_decompress_ptr cinfo) SIZEOF(huff_entropy_decoder)); cinfo->entropy = &entropy->pub; entropy->pub.start_pass = start_pass_huff_decoder; + entropy->pub.finish_pass = finish_pass_huff; if (cinfo->progressive_mode) { /* Create progression status table */ diff --git a/jdinput.c b/jdinput.c index 2c5c717b..0199553e 100644 --- a/jdinput.c +++ b/jdinput.c @@ -2,7 +2,7 @@ * jdinput.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2002-2009 by Guido Vollbeding. + * Modified 2002-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -196,7 +196,7 @@ jpeg_core_output_dimensions (j_decompress_ptr cinfo) /* Hardwire it to "no scaling" */ cinfo->output_width = cinfo->image_width; cinfo->output_height = cinfo->image_height; - /* jdinput.c has already initialized DCT_scaled_size, + /* initial_setup has already initialized DCT_scaled_size, * and has computed unscaled downsampled_width and downsampled_height. */ @@ -216,8 +216,8 @@ initial_setup (j_decompress_ptr cinfo) (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); - /* For now, precision must match compiled-in value... */ - if (cinfo->data_precision != BITS_IN_JSAMPLE) + /* Only 8 to 12 bits data precision are supported for DCT based JPEG */ + if (cinfo->data_precision < 8 || cinfo->data_precision > 12) ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); /* Check that number of components won't exceed internal array sizes */ @@ -537,6 +537,7 @@ start_input_pass (j_decompress_ptr cinfo) METHODDEF(void) finish_input_pass (j_decompress_ptr cinfo) { + (*cinfo->entropy->finish_pass) (cinfo); cinfo->inputctl->consume_input = consume_markers; } @@ -646,7 +647,7 @@ jinit_input_controller (j_decompress_ptr cinfo) inputctl = (my_inputctl_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_input_controller)); - cinfo->inputctl = (struct jpeg_input_controller *) inputctl; + cinfo->inputctl = &inputctl->pub; /* Initialize method pointers */ inputctl->pub.consume_input = consume_markers; inputctl->pub.reset_input_controller = reset_input_controller; diff --git a/jdmarker.c b/jdmarker.c index ce8b713c..3fbe5c16 100644 --- a/jdmarker.c +++ b/jdmarker.c @@ -2,7 +2,7 @@ * jdmarker.c * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2009-2012 by Guido Vollbeding. + * Modified 2009-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -269,8 +269,8 @@ get_sof (j_decompress_ptr cinfo, boolean is_baseline, boolean is_prog, /* We don't support files in which the image height is initially specified */ /* as 0 and is later redefined by DNL. As long as we have to check that, */ /* might as well have a general sanity check. */ - if (cinfo->image_height <= 0 || cinfo->image_width <= 0 - || cinfo->num_components <= 0) + if (cinfo->image_height <= 0 || cinfo->image_width <= 0 || + cinfo->num_components <= 0) ERREXIT(cinfo, JERR_EMPTY_IMAGE); if (length != (cinfo->num_components * 3)) @@ -350,6 +350,9 @@ get_sos (j_decompress_ptr cinfo) /* Detect the case where component id's are not unique, and, if so, */ /* create a fake component id using the same logic as in get_sof. */ + /* Note: This also ensures that all of the SOF components are */ + /* referenced in the single scan case, which prevents access to */ + /* uninitialized memory in later decoding stages. */ for (ci = 0; ci < i; ci++) { if (c == cinfo->cur_comp_info[ci]->component_id) { c = cinfo->cur_comp_info[0]->component_id; @@ -493,6 +496,8 @@ get_dht (j_decompress_ptr cinfo) if (count > 256 || ((INT32) count) > length) ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + MEMZERO(huffval, SIZEOF(huffval)); /* pre-zero array for later copy */ + for (i = 0; i < count; i++) INPUT_BYTE(cinfo, huffval[i], return FALSE); @@ -735,12 +740,13 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data, cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]); cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]); /* Check version. - * Major version must be 1, anything else signals an incompatible change. + * Major version must be 1 or 2, anything else signals an incompatible + * change. * (We used to treat this as an error, but now it's a nonfatal warning, * because some bozo at Hijaak couldn't read the spec.) * Minor version should be 0..2, but process anyway if newer. */ - if (cinfo->JFIF_major_version != 1) + if (cinfo->JFIF_major_version != 1 && cinfo->JFIF_major_version != 2) WARNMS2(cinfo, JWRN_JFIF_MAJOR, cinfo->JFIF_major_version, cinfo->JFIF_minor_version); /* Generate trace messages */ diff --git a/jdmaster.c b/jdmaster.c index fef72a21..6f42d3c5 100644 --- a/jdmaster.c +++ b/jdmaster.c @@ -2,7 +2,7 @@ * jdmaster.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2002-2011 by Guido Vollbeding. + * Modified 2002-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -51,7 +51,8 @@ use_merged_upsample (j_decompress_ptr cinfo) /* jdmerge.c only supports YCC=>RGB color conversion */ if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || cinfo->out_color_space != JCS_RGB || - cinfo->out_color_components != RGB_PIXELSIZE) + cinfo->out_color_components != RGB_PIXELSIZE || + cinfo->color_transform) return FALSE; /* and it only handles 2h1v or 2h2v sampling ratios */ if (cinfo->comp_info[0].h_samp_factor != 2 || @@ -158,9 +159,11 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo) cinfo->out_color_components = 1; break; case JCS_RGB: + case JCS_BG_RGB: cinfo->out_color_components = RGB_PIXELSIZE; break; case JCS_YCbCr: + case JCS_BG_YCC: cinfo->out_color_components = 3; break; case JCS_CMYK: @@ -273,10 +276,19 @@ master_selection (j_decompress_ptr cinfo) long samplesperrow; JDIMENSION jd_samplesperrow; + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + /* Initialize dimensions and other stuff */ jpeg_calc_output_dimensions(cinfo); prepare_range_limit_table(cinfo); + /* Sanity check on image dimensions */ + if (cinfo->output_height <= 0 || cinfo->output_width <= 0 || + cinfo->out_color_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + /* Width of an output scanline must be representable as JDIMENSION. */ samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components; jd_samplesperrow = (JDIMENSION) samplesperrow; @@ -521,7 +533,7 @@ jinit_master_decompress (j_decompress_ptr cinfo) master = (my_master_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_decomp_master)); - cinfo->master = (struct jpeg_decomp_master *) master; + cinfo->master = &master->pub; master->pub.prepare_for_output_pass = prepare_for_output_pass; master->pub.finish_output_pass = finish_output_pass; diff --git a/jdmerge.c b/jdmerge.c index 37444468..a6bde33c 100644 --- a/jdmerge.c +++ b/jdmerge.c @@ -2,6 +2,7 @@ * jdmerge.c * * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -103,17 +104,17 @@ build_ycc_rgb_table (j_decompress_ptr cinfo) for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ - /* Cr=>R value is nearest int to 1.40200 * x */ + /* Cr=>R value is nearest int to 1.402 * x */ upsample->Cr_r_tab[i] = (int) - RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); - /* Cb=>B value is nearest int to 1.77200 * x */ + RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.772 * x */ upsample->Cb_b_tab[i] = (int) - RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); - /* Cr=>G value is scaled-up -0.71414 * x */ - upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x; - /* Cb=>G value is scaled-up -0.34414 * x */ + RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS); + /* Cr=>G value is scaled-up -0.714136286 * x */ + upsample->Cr_g_tab[i] = (- FIX(0.714136286)) * x; + /* Cb=>G value is scaled-up -0.344136286 * x */ /* We also add in ONE_HALF so that need not do it in inner loop */ - upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + upsample->Cb_g_tab[i] = (- FIX(0.344136286)) * x + ONE_HALF; } } diff --git a/jfdctint.c b/jfdctint.c index 1dde58c4..a2ef2031 100644 --- a/jfdctint.c +++ b/jfdctint.c @@ -2,7 +2,7 @@ * jfdctint.c * * Copyright (C) 1991-1996, Thomas G. Lane. - * Modification developed 2003-2009 by Guido Vollbeding. + * Modification developed 2003-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -165,16 +165,18 @@ jpeg_fdct_islow (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * cK represents sqrt(2) * cos(K*pi/16). + */ dataptr = data; for (ctr = 0; ctr < DCTSIZE; ctr++) { elemptr = sample_data[ctr] + start_col; /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + * rotator "c1" should be "c6". */ tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]); @@ -196,47 +198,49 @@ jpeg_fdct_islow (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS); dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); /* c6 */ /* Add fudge factor here for final descale. */ z1 += ONE << (CONST_BITS-PASS1_BITS-1); - dataptr[2] = (DCTELEM) RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), - CONST_BITS-PASS1_BITS); - dataptr[6] = (DCTELEM) RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), - CONST_BITS-PASS1_BITS); + + dataptr[2] = (DCTELEM) + RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */ + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) + RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */ + CONST_BITS-PASS1_BITS); /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * cK represents sqrt(2) * cos(K*pi/16). * i0..i3 in the paper are tmp0..tmp3 here. */ - tmp10 = tmp0 + tmp3; - tmp11 = tmp1 + tmp2; tmp12 = tmp0 + tmp2; tmp13 = tmp1 + tmp3; - z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ /* Add fudge factor here for final descale. */ z1 += ONE << (CONST_BITS-PASS1_BITS-1); - tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ - tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ - tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ - tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ - tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ - tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ - tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ - tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ - + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* -c3+c5 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ tmp12 += z1; tmp13 += z1; - dataptr[1] = (DCTELEM) - RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS-PASS1_BITS); - dataptr[3] = (DCTELEM) - RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS-PASS1_BITS); - dataptr[5] = (DCTELEM) - RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS-PASS1_BITS); - dataptr[7] = (DCTELEM) - RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS-PASS1_BITS); + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp0 += z1 + tmp12; + tmp3 += z1 + tmp13; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp1 += z1 + tmp13; + tmp2 += z1 + tmp12; + + dataptr[1] = (DCTELEM) RIGHT_SHIFT(tmp0, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) RIGHT_SHIFT(tmp1, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) RIGHT_SHIFT(tmp3, CONST_BITS-PASS1_BITS); dataptr += DCTSIZE; /* advance pointer to next row */ } @@ -244,12 +248,13 @@ jpeg_fdct_islow (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pass 2: process columns. * We remove the PASS1_BITS scaling, but leave the results scaled up * by an overall factor of 8. + * cK represents sqrt(2) * cos(K*pi/16). */ dataptr = data; for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + * rotator "c1" should be "c6". */ tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; @@ -271,47 +276,49 @@ jpeg_fdct_islow (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp10 + tmp11, PASS1_BITS); dataptr[DCTSIZE*4] = (DCTELEM) RIGHT_SHIFT(tmp10 - tmp11, PASS1_BITS); - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); /* c6 */ /* Add fudge factor here for final descale. */ z1 += ONE << (CONST_BITS+PASS1_BITS-1); + dataptr[DCTSIZE*2] = (DCTELEM) - RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), CONST_BITS+PASS1_BITS); + RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */ + CONST_BITS+PASS1_BITS); dataptr[DCTSIZE*6] = (DCTELEM) - RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), CONST_BITS+PASS1_BITS); + RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */ + CONST_BITS+PASS1_BITS); /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * cK represents sqrt(2) * cos(K*pi/16). * i0..i3 in the paper are tmp0..tmp3 here. */ - tmp10 = tmp0 + tmp3; - tmp11 = tmp1 + tmp2; tmp12 = tmp0 + tmp2; tmp13 = tmp1 + tmp3; - z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ /* Add fudge factor here for final descale. */ z1 += ONE << (CONST_BITS+PASS1_BITS-1); - tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ - tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ - tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ - tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ - tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ - tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ - tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ - tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ - + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* -c3+c5 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ tmp12 += z1; tmp13 += z1; - dataptr[DCTSIZE*1] = (DCTELEM) - RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*3] = (DCTELEM) - RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*5] = (DCTELEM) - RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*7] = (DCTELEM) - RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS+PASS1_BITS); + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp0 += z1 + tmp12; + tmp3 += z1 + tmp13; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp1 += z1 + tmp13; + tmp2 += z1 + tmp12; + + dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) RIGHT_SHIFT(tmp1, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) RIGHT_SHIFT(tmp2, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*7] = (DCTELEM) RIGHT_SHIFT(tmp3, CONST_BITS+PASS1_BITS); dataptr++; /* advance pointer to next column */ } @@ -338,10 +345,11 @@ jpeg_fdct_7x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* cK represents sqrt(2) * cos(K*pi/14). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * cK represents sqrt(2) * cos(K*pi/14). + */ dataptr = data; for (ctr = 0; ctr < 7; ctr++) { @@ -472,10 +480,11 @@ jpeg_fdct_6x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* cK represents sqrt(2) * cos(K*pi/12). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * cK represents sqrt(2) * cos(K*pi/12). + */ dataptr = data; for (ctr = 0; ctr < 6; ctr++) { @@ -585,12 +594,13 @@ jpeg_fdct_5x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* We scale the results further by 2 as part of output adaption */ - /* scaling for different DCT size. */ - /* cK represents sqrt(2) * cos(K*pi/10). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * We scale the results further by 2 as part of output adaption + * scaling for different DCT size. + * cK represents sqrt(2) * cos(K*pi/10). + */ dataptr = data; for (ctr = 0; ctr < 5; ctr++) { @@ -695,11 +705,12 @@ jpeg_fdct_4x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* We must also scale the output by (8/4)**2 = 2**2, which we add here. */ - /* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * We must also scale the output by (8/4)**2 = 2**2, which we add here. + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. + */ dataptr = data; for (ctr = 0; ctr < 4; ctr++) { @@ -737,6 +748,7 @@ jpeg_fdct_4x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pass 2: process columns. * We remove the PASS1_BITS scaling, but leave the results scaled up * by an overall factor of 8. + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. */ dataptr = data; @@ -787,12 +799,13 @@ jpeg_fdct_3x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* We scale the results further by 2**2 as part of output adaption */ - /* scaling for different DCT size. */ - /* cK represents sqrt(2) * cos(K*pi/6). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * We scale the results further by 2**2 as part of output adaption + * scaling for different DCT size. + * cK represents sqrt(2) * cos(K*pi/6). + */ dataptr = data; for (ctr = 0; ctr < 3; ctr++) { @@ -869,8 +882,9 @@ jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT. */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT. + */ /* Row 0 */ elemptr = sample_data[0] + start_col; @@ -935,11 +949,12 @@ jpeg_fdct_9x9 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* we scale the results further by 2 as part of output adaption */ - /* scaling for different DCT size. */ - /* cK represents sqrt(2) * cos(K*pi/18). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * we scale the results further by 2 as part of output adaption + * scaling for different DCT size. + * cK represents sqrt(2) * cos(K*pi/18). + */ dataptr = data; ctr = 0; @@ -1084,11 +1099,12 @@ jpeg_fdct_10x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* we scale the results further by 2 as part of output adaption */ - /* scaling for different DCT size. */ - /* cK represents sqrt(2) * cos(K*pi/20). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * we scale the results further by 2 as part of output adaption + * scaling for different DCT size. + * cK represents sqrt(2) * cos(K*pi/20). + */ dataptr = data; ctr = 0; @@ -1248,11 +1264,12 @@ jpeg_fdct_11x11 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* we scale the results further by 2 as part of output adaption */ - /* scaling for different DCT size. */ - /* cK represents sqrt(2) * cos(K*pi/22). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * we scale the results further by 2 as part of output adaption + * scaling for different DCT size. + * cK represents sqrt(2) * cos(K*pi/22). + */ dataptr = data; ctr = 0; @@ -1430,9 +1447,10 @@ jpeg_fdct_12x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT. */ - /* cK represents sqrt(2) * cos(K*pi/24). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT. + * cK represents sqrt(2) * cos(K*pi/24). + */ dataptr = data; ctr = 0; @@ -1596,9 +1614,10 @@ jpeg_fdct_13x13 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT. */ - /* cK represents sqrt(2) * cos(K*pi/26). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT. + * cK represents sqrt(2) * cos(K*pi/26). + */ dataptr = data; ctr = 0; @@ -1794,9 +1813,10 @@ jpeg_fdct_14x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT. */ - /* cK represents sqrt(2) * cos(K*pi/28). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT. + * cK represents sqrt(2) * cos(K*pi/28). + */ dataptr = data; ctr = 0; @@ -1995,9 +2015,10 @@ jpeg_fdct_15x15 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT. */ - /* cK represents sqrt(2) * cos(K*pi/30). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT. + * cK represents sqrt(2) * cos(K*pi/30). + */ dataptr = data; ctr = 0; @@ -2173,10 +2194,11 @@ jpeg_fdct_16x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* cK represents sqrt(2) * cos(K*pi/32). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * cK represents sqrt(2) * cos(K*pi/32). + */ dataptr = data; ctr = 0; @@ -2275,6 +2297,7 @@ jpeg_fdct_16x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) * We remove the PASS1_BITS scaling, but leave the results scaled up * by an overall factor of 8. * We must also scale the output by (8/16)**2 = 1/2**2. + * cK represents sqrt(2) * cos(K*pi/32). */ dataptr = data; @@ -2380,10 +2403,11 @@ jpeg_fdct_16x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* 16-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/32). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 16-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/32). + */ dataptr = data; ctr = 0; @@ -2475,12 +2499,13 @@ jpeg_fdct_16x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) * We remove the PASS1_BITS scaling, but leave the results scaled up * by an overall factor of 8. * We must also scale the output by 8/16 = 1/2. + * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). */ dataptr = data; for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + * rotator "c1" should be "c6". */ tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; @@ -2501,43 +2526,43 @@ jpeg_fdct_16x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS+1); dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS+1); - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); - dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865), - CONST_BITS+PASS1_BITS+1); - dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065), - CONST_BITS+PASS1_BITS+1); + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); /* c6 */ + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */ + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */ + CONST_BITS+PASS1_BITS+1); /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). * i0..i3 in the paper are tmp0..tmp3 here. */ - tmp10 = tmp0 + tmp3; - tmp11 = tmp1 + tmp2; tmp12 = tmp0 + tmp2; tmp13 = tmp1 + tmp3; - z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ - - tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ - tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ - tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ - tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ - tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ - tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ - tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ - tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* -c3+c5 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ tmp12 += z1; tmp13 += z1; - dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0 + tmp10 + tmp12, - CONST_BITS+PASS1_BITS+1); - dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1 + tmp11 + tmp13, - CONST_BITS+PASS1_BITS+1); - dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2 + tmp11 + tmp12, - CONST_BITS+PASS1_BITS+1); - dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3 + tmp10 + tmp13, - CONST_BITS+PASS1_BITS+1); + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp0 += z1 + tmp12; + tmp3 += z1 + tmp13; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp1 += z1 + tmp13; + tmp2 += z1 + tmp12; + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+PASS1_BITS+1); dataptr++; /* advance pointer to next column */ } @@ -2564,10 +2589,11 @@ jpeg_fdct_14x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Zero bottom row of output coefficient block. */ MEMZERO(&data[DCTSIZE*7], SIZEOF(DCTELEM) * DCTSIZE); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* 14-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/28). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 14-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/28). + */ dataptr = data; for (ctr = 0; ctr < 7; ctr++) { @@ -2727,10 +2753,11 @@ jpeg_fdct_12x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Zero 2 bottom rows of output coefficient block. */ MEMZERO(&data[DCTSIZE*6], SIZEOF(DCTELEM) * DCTSIZE * 2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* 12-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/24). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 12-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/24). + */ dataptr = data; for (ctr = 0; ctr < 6; ctr++) { @@ -2866,10 +2893,11 @@ jpeg_fdct_10x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Zero 3 bottom rows of output coefficient block. */ MEMZERO(&data[DCTSIZE*5], SIZEOF(DCTELEM) * DCTSIZE * 3); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* 10-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/20). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 10-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/20). + */ dataptr = data; for (ctr = 0; ctr < 5; ctr++) { @@ -2999,17 +3027,19 @@ jpeg_fdct_8x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Zero 4 bottom rows of output coefficient block. */ MEMZERO(&data[DCTSIZE*4], SIZEOF(DCTELEM) * DCTSIZE * 4); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* We must also scale the output by 8/4 = 2, which we add here. */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * We must also scale the output by 8/4 = 2, which we add here. + * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + */ dataptr = data; for (ctr = 0; ctr < 4; ctr++) { elemptr = sample_data[ctr] + start_col; /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + * rotator "c1" should be "c6". */ tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]); @@ -3032,47 +3062,49 @@ jpeg_fdct_8x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << (PASS1_BITS+1)); dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << (PASS1_BITS+1)); - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); /* c6 */ /* Add fudge factor here for final descale. */ z1 += ONE << (CONST_BITS-PASS1_BITS-2); - dataptr[2] = (DCTELEM) RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), - CONST_BITS-PASS1_BITS-1); - dataptr[6] = (DCTELEM) RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), - CONST_BITS-PASS1_BITS-1); + + dataptr[2] = (DCTELEM) + RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */ + CONST_BITS-PASS1_BITS-1); + dataptr[6] = (DCTELEM) + RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */ + CONST_BITS-PASS1_BITS-1); /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). * i0..i3 in the paper are tmp0..tmp3 here. */ - tmp10 = tmp0 + tmp3; - tmp11 = tmp1 + tmp2; tmp12 = tmp0 + tmp2; tmp13 = tmp1 + tmp3; - z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ /* Add fudge factor here for final descale. */ z1 += ONE << (CONST_BITS-PASS1_BITS-2); - tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ - tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ - tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ - tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ - tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ - tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ - tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ - tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ - + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* -c3+c5 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ tmp12 += z1; tmp13 += z1; - dataptr[1] = (DCTELEM) - RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS-PASS1_BITS-1); - dataptr[3] = (DCTELEM) - RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS-PASS1_BITS-1); - dataptr[5] = (DCTELEM) - RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS-PASS1_BITS-1); - dataptr[7] = (DCTELEM) - RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS-PASS1_BITS-1); + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp0 += z1 + tmp12; + tmp3 += z1 + tmp13; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp1 += z1 + tmp13; + tmp2 += z1 + tmp12; + + dataptr[1] = (DCTELEM) RIGHT_SHIFT(tmp0, CONST_BITS-PASS1_BITS-1); + dataptr[3] = (DCTELEM) RIGHT_SHIFT(tmp1, CONST_BITS-PASS1_BITS-1); + dataptr[5] = (DCTELEM) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS-1); + dataptr[7] = (DCTELEM) RIGHT_SHIFT(tmp3, CONST_BITS-PASS1_BITS-1); dataptr += DCTSIZE; /* advance pointer to next row */ } @@ -3080,7 +3112,8 @@ jpeg_fdct_8x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pass 2: process columns. * We remove the PASS1_BITS scaling, but leave the results scaled up * by an overall factor of 8. - * 4-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + * 4-point FDCT kernel, + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. */ dataptr = data; @@ -3099,7 +3132,7 @@ jpeg_fdct_8x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Odd part */ - tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ + tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ /* Add fudge factor here for final descale. */ tmp0 += ONE << (CONST_BITS+PASS1_BITS-1); @@ -3134,12 +3167,13 @@ jpeg_fdct_6x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* We scale the results further by 2 as part of output adaption */ - /* scaling for different DCT size. */ - /* 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * We scale the results further by 2 as part of output adaption + * scaling for different DCT size. + * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12). + */ dataptr = data; for (ctr = 0; ctr < 3; ctr++) { @@ -3234,12 +3268,13 @@ jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* We must also scale the output by (8/4)*(8/2) = 2**3, which we add here. */ - /* 4-point FDCT kernel, */ - /* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * We must also scale the output by (8/4)*(8/2) = 2**3, which we add here. + * 4-point FDCT kernel, + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. + */ dataptr = data; for (ctr = 0; ctr < 2; ctr++) { @@ -3323,10 +3358,12 @@ jpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) */ /* Even part */ + /* Apply unsigned->signed conversion */ data[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5); /* Odd part */ + data[1] = (DCTELEM) ((tmp0 - tmp1) << 5); } @@ -3350,9 +3387,11 @@ jpeg_fdct_8x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) int ctr; SHIFT_TEMPS - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + */ dataptr = data; ctr = 0; @@ -3360,7 +3399,7 @@ jpeg_fdct_8x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) elemptr = sample_data[ctr] + start_col; /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + * rotator "c1" should be "c6". */ tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]); @@ -3382,39 +3421,43 @@ jpeg_fdct_8x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS); dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); - dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865), - CONST_BITS-PASS1_BITS); - dataptr[6] = (DCTELEM) DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065), - CONST_BITS-PASS1_BITS); + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); /* c6 */ + dataptr[2] = (DCTELEM) + DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */ + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) + DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */ + CONST_BITS-PASS1_BITS); /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). * i0..i3 in the paper are tmp0..tmp3 here. */ - tmp10 = tmp0 + tmp3; - tmp11 = tmp1 + tmp2; tmp12 = tmp0 + tmp2; tmp13 = tmp1 + tmp3; - z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ - - tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ - tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ - tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ - tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ - tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ - tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ - tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ - tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* -c3+c5 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ tmp12 += z1; tmp13 += z1; - dataptr[1] = (DCTELEM) DESCALE(tmp0 + tmp10 + tmp12, CONST_BITS-PASS1_BITS); - dataptr[3] = (DCTELEM) DESCALE(tmp1 + tmp11 + tmp13, CONST_BITS-PASS1_BITS); - dataptr[5] = (DCTELEM) DESCALE(tmp2 + tmp11 + tmp12, CONST_BITS-PASS1_BITS); - dataptr[7] = (DCTELEM) DESCALE(tmp3 + tmp10 + tmp13, CONST_BITS-PASS1_BITS); + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp0 += z1 + tmp12; + tmp3 += z1 + tmp13; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp1 += z1 + tmp13; + tmp2 += z1 + tmp12; + + dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS-PASS1_BITS); ctr++; @@ -3541,10 +3584,11 @@ jpeg_fdct_7x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* 7-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/14). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 7-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/14). + */ dataptr = data; ctr = 0; @@ -3721,10 +3765,11 @@ jpeg_fdct_6x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12). + */ dataptr = data; ctr = 0; @@ -3870,10 +3915,11 @@ jpeg_fdct_5x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* 5-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/10). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 5-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/10). + */ dataptr = data; ctr = 0; @@ -4015,11 +4061,13 @@ jpeg_fdct_4x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* We must also scale the output by 8/4 = 2, which we add here. */ - /* 4-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * We must also scale the output by 8/4 = 2, which we add here. + * 4-point FDCT kernel, + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. + */ dataptr = data; for (ctr = 0; ctr < DCTSIZE; ctr++) { @@ -4057,12 +4105,13 @@ jpeg_fdct_4x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pass 2: process columns. * We remove the PASS1_BITS scaling, but leave the results scaled up * by an overall factor of 8. + * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). */ dataptr = data; for (ctr = 0; ctr < 4; ctr++) { /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + * rotator "c1" should be "c6". */ tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; @@ -4084,47 +4133,49 @@ jpeg_fdct_4x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp10 + tmp11, PASS1_BITS); dataptr[DCTSIZE*4] = (DCTELEM) RIGHT_SHIFT(tmp10 - tmp11, PASS1_BITS); - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); /* c6 */ /* Add fudge factor here for final descale. */ z1 += ONE << (CONST_BITS+PASS1_BITS-1); + dataptr[DCTSIZE*2] = (DCTELEM) - RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), CONST_BITS+PASS1_BITS); + RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), /* c2-c6 */ + CONST_BITS+PASS1_BITS); dataptr[DCTSIZE*6] = (DCTELEM) - RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), CONST_BITS+PASS1_BITS); + RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), /* c2+c6 */ + CONST_BITS+PASS1_BITS); /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). * i0..i3 in the paper are tmp0..tmp3 here. */ - tmp10 = tmp0 + tmp3; - tmp11 = tmp1 + tmp2; tmp12 = tmp0 + tmp2; tmp13 = tmp1 + tmp3; - z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ /* Add fudge factor here for final descale. */ z1 += ONE << (CONST_BITS+PASS1_BITS-1); - tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ - tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ - tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ - tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ - tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ - tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ - tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ - tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ - + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* -c3+c5 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ tmp12 += z1; tmp13 += z1; - dataptr[DCTSIZE*1] = (DCTELEM) - RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*3] = (DCTELEM) - RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*5] = (DCTELEM) - RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*7] = (DCTELEM) - RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS+PASS1_BITS); + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp0 += z1 + tmp12; + tmp3 += z1 + tmp13; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp1 += z1 + tmp13; + tmp2 += z1 + tmp12; + + dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) RIGHT_SHIFT(tmp1, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) RIGHT_SHIFT(tmp2, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*7] = (DCTELEM) RIGHT_SHIFT(tmp3, CONST_BITS+PASS1_BITS); dataptr++; /* advance pointer to next column */ } @@ -4150,12 +4201,13 @@ jpeg_fdct_3x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - /* We scale the results further by 2 as part of output adaption */ - /* scaling for different DCT size. */ - /* 3-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/6). */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * We scale the results further by 2 as part of output adaption + * scaling for different DCT size. + * 3-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/6). + */ dataptr = data; for (ctr = 0; ctr < 6; ctr++) { @@ -4255,9 +4307,10 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT. */ - /* We must also scale the output by (8/2)*(8/4) = 2**3, which we add here. */ + /* Pass 1: process rows. + * Note results are scaled up by sqrt(8) compared to a true DCT. + * We must also scale the output by (8/2)*(8/4) = 2**3, which we add here. + */ dataptr = data; for (ctr = 0; ctr < 4; ctr++) { @@ -4329,18 +4382,23 @@ jpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); - tmp0 = GETJSAMPLE(sample_data[0][start_col]); - tmp1 = GETJSAMPLE(sample_data[1][start_col]); + /* Pass 1: empty. */ - /* We leave the results scaled up by an overall factor of 8. + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. * We must also scale the output by (8/1)*(8/2) = 2**5. */ /* Even part */ + + tmp0 = GETJSAMPLE(sample_data[0][start_col]); + tmp1 = GETJSAMPLE(sample_data[1][start_col]); + /* Apply unsigned->signed conversion */ data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5); /* Odd part */ + data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp1) << 5); } diff --git a/jidctint.c b/jidctint.c index dcdf7ce4..76fe5d9c 100644 --- a/jidctint.c +++ b/jidctint.c @@ -2,7 +2,7 @@ * jidctint.c * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modification developed 2002-2009 by Guido Vollbeding. + * Modification developed 2002-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -165,6 +165,8 @@ /* * Perform dequantization and inverse DCT on one block of coefficients. + * + * cK represents sqrt(2) * cos(K*pi/16). */ GLOBAL(void) @@ -184,9 +186,10 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, int workspace[DCTSIZE2]; /* buffers data between passes */ SHIFT_TEMPS - /* Pass 1: process columns from input, store into work array. */ - /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* Pass 1: process columns from input, store into work array. + * Note results are scaled up by sqrt(8) compared to a true IDCT; + * furthermore, we scale the results by 2**PASS1_BITS. + */ inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; @@ -223,15 +226,16 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, continue; } - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ - + /* Even part: reverse the even part of the forward DCT. + * The rotator is c(-6). + */ + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); - tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); @@ -256,25 +260,25 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - + z2 = tmp0 + tmp2; z3 = tmp1 + tmp3; - z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ - z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* -c3-c5 */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* -c3+c5 */ z2 += z1; z3 += z1; - z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* c1+c3-c5-c7 */ tmp0 += z1 + z2; tmp3 += z1 + z3; - z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* c1+c3+c5-c7 */ tmp1 += z1 + z3; tmp2 += z1 + z2; @@ -288,15 +292,16 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS); - + inptr++; /* advance pointers to next column */ quantptr++; wsptr++; } - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ + /* Pass 2: process rows from work array, store into output array. + * Note that we must descale the results by a factor of 8 == 2**3, + * and also undo the PASS1_BITS scaling. + */ wsptr = workspace; for (ctr = 0; ctr < DCTSIZE; ctr++) { @@ -330,15 +335,16 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, } #endif - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ - + /* Even part: reverse the even part of the forward DCT. + * The rotator is c(-6). + */ + z2 = (INT32) wsptr[2]; z3 = (INT32) wsptr[6]; - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); - tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ /* Add fudge factor here for final descale. */ z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); @@ -346,7 +352,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp0 = (z2 + z3) << CONST_BITS; tmp1 = (z2 - z3) << CONST_BITS; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -364,21 +370,21 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, z2 = tmp0 + tmp2; z3 = tmp1 + tmp3; - z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ - z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* -c3-c5 */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* -c3+c5 */ z2 += z1; z3 += z1; - z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* c1+c3-c5-c7 */ tmp0 += z1 + z2; tmp3 += z1 + z3; - z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* c1+c3+c5-c7 */ tmp1 += z1 + z3; tmp2 += z1 + z2; @@ -2835,9 +2841,11 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, int workspace[8*8]; /* buffers data between passes */ SHIFT_TEMPS - /* Pass 1: process columns from input, store into work array. */ - /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* Pass 1: process columns from input, store into work array. + * Note results are scaled up by sqrt(8) compared to a true IDCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 8-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + */ inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; @@ -2851,14 +2859,14 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, * With typical images and quantization tables, half or more of the * column DCT calculations can be simplified this way. */ - + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) { /* AC terms all zero */ int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; - + wsptr[DCTSIZE*0] = dcval; wsptr[DCTSIZE*1] = dcval; wsptr[DCTSIZE*2] = dcval; @@ -2867,23 +2875,24 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*5] = dcval; wsptr[DCTSIZE*6] = dcval; wsptr[DCTSIZE*7] = dcval; - + inptr++; /* advance pointers to next column */ quantptr++; wsptr++; continue; } - - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ - + + /* Even part: reverse the even part of the forward DCT. + * The rotator is c(-6). + */ + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); - tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); - + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); z2 <<= CONST_BITS; @@ -2893,44 +2902,44 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp0 = z2 + z3; tmp1 = z2 - z3; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; tmp12 = tmp1 - tmp3; - + /* Odd part per figure 8; the matrix is unitary and hence its * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. */ - + tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - + z2 = tmp0 + tmp2; z3 = tmp1 + tmp3; - z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ - z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* -c3-c5 */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* -c3+c5 */ z2 += z1; z3 += z1; - z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* c1+c3-c5-c7 */ tmp0 += z1 + z2; tmp3 += z1 + z3; - z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* c1+c3+c5-c7 */ tmp1 += z1 + z3; tmp2 += z1 + z2; - + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - + wsptr[DCTSIZE*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS); @@ -2939,7 +2948,7 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS); wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS); - + inptr++; /* advance pointers to next column */ quantptr++; wsptr++; @@ -2948,6 +2957,7 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 2: process 8 rows from work array, store into output array. * 16-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/32). */ + wsptr = workspace; for (ctr = 0; ctr < 8; ctr++) { outptr = output_buf[ctr] + output_col; @@ -3109,6 +3119,7 @@ jpeg_idct_14x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 1: process columns from input, store into work array. * 7-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/14). */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -3164,6 +3175,7 @@ jpeg_idct_14x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 2: process 7 rows from work array, store into output array. * 14-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/28). */ + wsptr = workspace; for (ctr = 0; ctr < 7; ctr++) { outptr = output_buf[ctr] + output_col; @@ -3304,6 +3316,7 @@ jpeg_idct_12x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 1: process columns from input, store into work array. * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -3346,6 +3359,7 @@ jpeg_idct_12x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 2: process 6 rows from work array, store into output array. * 12-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/24). */ + wsptr = workspace; for (ctr = 0; ctr < 6; ctr++) { outptr = output_buf[ctr] + output_col; @@ -3480,6 +3494,7 @@ jpeg_idct_10x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 1: process columns from input, store into work array. * 5-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/10). */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -3520,6 +3535,7 @@ jpeg_idct_10x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 2: process 5 rows from work array, store into output array. * 10-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/20). */ + wsptr = workspace; for (ctr = 0; ctr < 5; ctr++) { outptr = output_buf[ctr] + output_col; @@ -3639,8 +3655,10 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, SHIFT_TEMPS /* Pass 1: process columns from input, store into work array. - * 4-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + * 4-point IDCT kernel, + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT]. */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -3675,31 +3693,34 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[8*2] = (int) (tmp12 - tmp2); } - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ + /* Pass 2: process rows from work array, store into output array. + * Note that we must descale the results by a factor of 8 == 2**3, + * and also undo the PASS1_BITS scaling. + * 8-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + */ wsptr = workspace; for (ctr = 0; ctr < 4; ctr++) { outptr = output_buf[ctr] + output_col; - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ + /* Even part: reverse the even part of the forward DCT. + * The rotator is c(-6). + */ z2 = (INT32) wsptr[2]; z3 = (INT32) wsptr[6]; - - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); - tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); - + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ + /* Add fudge factor here for final descale. */ z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = (INT32) wsptr[4]; - + tmp0 = (z2 + z3) << CONST_BITS; tmp1 = (z2 - z3) << CONST_BITS; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -3717,21 +3738,21 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, z2 = tmp0 + tmp2; z3 = tmp1 + tmp3; - z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ - z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* -c3-c5 */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* -c3+c5 */ z2 += z1; z3 += z1; - z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* c1+c3-c5-c7 */ tmp0 += z1 + z2; tmp3 += z1 + z3; - z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* c1+c3+c5-c7 */ tmp1 += z1 + z3; tmp2 += z1 + z2; @@ -3793,6 +3814,7 @@ jpeg_idct_6x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 1: process columns from input, store into work array. * 3-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/6). */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -3823,6 +3845,7 @@ jpeg_idct_6x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 2: process 3 rows from work array, store into output array. * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */ + wsptr = workspace; for (ctr = 0; ctr < 3; ctr++) { outptr = output_buf[ctr] + output_col; @@ -3924,6 +3947,7 @@ jpeg_idct_4x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, * 4-point IDCT kernel, * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT]. */ + wsptr = workspace; for (ctr = 0; ctr < 2; ctr++) { outptr = output_buf[ctr] + output_col; @@ -3979,7 +4003,7 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp10; + INT32 tmp0, tmp1; ISLOW_MULT_TYPE * quantptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); @@ -3994,18 +4018,18 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - tmp10 = DEQUANTIZE(coef_block[0], quantptr[0]); + tmp0 = DEQUANTIZE(coef_block[0], quantptr[0]); /* Add fudge factor here for final descale. */ - tmp10 += ONE << 2; + tmp0 += ONE << 2; /* Odd part */ - tmp0 = DEQUANTIZE(coef_block[1], quantptr[1]); + tmp1 = DEQUANTIZE(coef_block[1], quantptr[1]); /* Final output stage */ - outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, 3) & RANGE_MASK]; - outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, 3) & RANGE_MASK]; + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; } @@ -4036,6 +4060,7 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 1: process columns from input, store into work array. * 16-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/32). */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -4134,69 +4159,72 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[8*7] = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS); wsptr[8*8] = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS); } - - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ + + /* Pass 2: process rows from work array, store into output array. + * Note that we must descale the results by a factor of 8 == 2**3, + * and also undo the PASS1_BITS scaling. + * 8-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + */ wsptr = workspace; for (ctr = 0; ctr < 16; ctr++) { outptr = output_buf[ctr] + output_col; - - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ - + + /* Even part: reverse the even part of the forward DCT. + * The rotator is c(-6). + */ + z2 = (INT32) wsptr[2]; z3 = (INT32) wsptr[6]; - - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); - tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); - + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ + /* Add fudge factor here for final descale. */ z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); z3 = (INT32) wsptr[4]; - + tmp0 = (z2 + z3) << CONST_BITS; tmp1 = (z2 - z3) << CONST_BITS; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; tmp12 = tmp1 - tmp3; - + /* Odd part per figure 8; the matrix is unitary and hence its * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. */ - + tmp0 = (INT32) wsptr[7]; tmp1 = (INT32) wsptr[5]; tmp2 = (INT32) wsptr[3]; tmp3 = (INT32) wsptr[1]; - + z2 = tmp0 + tmp2; z3 = tmp1 + tmp3; - z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ - z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* -c3-c5 */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* -c3+c5 */ z2 += z1; z3 += z1; - z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* c1+c3-c5-c7 */ tmp0 += z1 + z2; tmp3 += z1 + z3; - z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* c1+c3+c5-c7 */ tmp1 += z1 + z3; tmp2 += z1 + z2; - + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) & RANGE_MASK]; @@ -4221,7 +4249,7 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) & RANGE_MASK]; - + wsptr += DCTSIZE; /* advance pointer to next row */ } } @@ -4254,6 +4282,7 @@ jpeg_idct_7x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 1: process columns from input, store into work array. * 14-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/28). */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -4341,6 +4370,7 @@ jpeg_idct_7x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 2: process 14 rows from work array, store into output array. * 7-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/14). */ + wsptr = workspace; for (ctr = 0; ctr < 14; ctr++) { outptr = output_buf[ctr] + output_col; @@ -4437,6 +4467,7 @@ jpeg_idct_6x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 1: process columns from input, store into work array. * 12-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/24). */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -4520,6 +4551,7 @@ jpeg_idct_6x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 2: process 12 rows from work array, store into output array. * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */ + wsptr = workspace; for (ctr = 0; ctr < 12; ctr++) { outptr = output_buf[ctr] + output_col; @@ -4601,6 +4633,7 @@ jpeg_idct_5x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 1: process columns from input, store into work array. * 10-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/20). */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -4676,6 +4709,7 @@ jpeg_idct_5x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 2: process 10 rows from work array, store into output array. * 5-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/10). */ + wsptr = workspace; for (ctr = 0; ctr < 10; ctr++) { outptr = output_buf[ctr] + output_col; @@ -4750,9 +4784,11 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, int workspace[4*8]; /* buffers data between passes */ SHIFT_TEMPS - /* Pass 1: process columns from input, store into work array. */ - /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* Pass 1: process columns from input, store into work array. + * Note results are scaled up by sqrt(8) compared to a true IDCT; + * furthermore, we scale the results by 2**PASS1_BITS. + * 8-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + */ inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; @@ -4789,16 +4825,17 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, continue; } - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ + /* Even part: reverse the even part of the forward DCT. + * The rotator is c(-6). + */ z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); - tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); - + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); z2 <<= CONST_BITS; @@ -4808,7 +4845,7 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp0 = z2 + z3; tmp1 = z2 - z3; - + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -4826,21 +4863,21 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, z2 = tmp0 + tmp2; z3 = tmp1 + tmp3; - z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ - z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* -c3-c5 */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* -c3+c5 */ z2 += z1; z3 += z1; - z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* -c3+c7 */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* c1+c3-c5-c7 */ tmp0 += z1 + z2; tmp3 += z1 + z3; - z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* -c1-c3 */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* c1+c3+c5-c7 */ tmp1 += z1 + z3; tmp2 += z1 + z2; @@ -4861,8 +4898,10 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, } /* Pass 2: process 8 rows from work array, store into output array. - * 4-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + * 4-point IDCT kernel, + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT]. */ + wsptr = workspace; for (ctr = 0; ctr < 8; ctr++) { outptr = output_buf[ctr] + output_col; @@ -4900,7 +4939,7 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS+PASS1_BITS+3) & RANGE_MASK]; - + wsptr += 4; /* advance pointer to next row */ } } @@ -4932,6 +4971,7 @@ jpeg_idct_3x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 1: process columns from input, store into work array. * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -4974,6 +5014,7 @@ jpeg_idct_3x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Pass 2: process 6 rows from work array, store into output array. * 3-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/6). */ + wsptr = workspace; for (ctr = 0; ctr < 6; ctr++) { outptr = output_buf[ctr] + output_col; @@ -5037,6 +5078,7 @@ jpeg_idct_2x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, * 4-point IDCT kernel, * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT]. */ + inptr = coef_block; quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; wsptr = workspace; @@ -5106,7 +5148,7 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp10; + INT32 tmp0, tmp1; ISLOW_MULT_TYPE * quantptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); SHIFT_TEMPS @@ -5117,19 +5159,19 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - tmp10 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]); /* Add fudge factor here for final descale. */ - tmp10 += ONE << 2; + tmp0 += ONE << 2; /* Odd part */ - tmp0 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp1 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]); /* Final output stage */ - output_buf[0][output_col] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, 3) + output_buf[0][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; - output_buf[1][output_col] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, 3) + output_buf[1][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; } diff --git a/jmorecfg.h b/jmorecfg.h index 2407edbe..679d68bd 100644 --- a/jmorecfg.h +++ b/jmorecfg.h @@ -2,7 +2,7 @@ * jmorecfg.h * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 1997-2012 by Guido Vollbeding. + * Modified 1997-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -15,13 +15,22 @@ /* * Define BITS_IN_JSAMPLE as either * 8 for 8-bit sample values (the usual setting) + * 9 for 9-bit sample values + * 10 for 10-bit sample values + * 11 for 11-bit sample values * 12 for 12-bit sample values - * Only 8 and 12 are legal data precisions for lossy JPEG according to the - * JPEG standard, and the IJG code does not support anything else! - * We do not support run-time selection of data precision, sorry. + * Only 8, 9, 10, 11, and 12 bits sample data precision are supported for + * full-feature DCT processing. Further depths up to 16-bit may be added + * later for the lossless modes of operation. + * Run-time selection and conversion of data precision will be added later + * and are currently not supported, sorry. + * Exception: The transcoding part (jpegtran) supports all settings in a + * single instance, since it operates on the level of DCT coefficients and + * not sample values. The DCT coefficients are of the same type (16 bits) + * in all cases (see below). */ -#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ +#define BITS_IN_JSAMPLE 8 /* use 8, 9, 10, 11, or 12 */ /* @@ -77,6 +86,48 @@ typedef char JSAMPLE; #endif /* BITS_IN_JSAMPLE == 8 */ +#if BITS_IN_JSAMPLE == 9 +/* JSAMPLE should be the smallest type that will hold the values 0..511. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 511 +#define CENTERJSAMPLE 256 + +#endif /* BITS_IN_JSAMPLE == 9 */ + + +#if BITS_IN_JSAMPLE == 10 +/* JSAMPLE should be the smallest type that will hold the values 0..1023. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 1023 +#define CENTERJSAMPLE 512 + +#endif /* BITS_IN_JSAMPLE == 10 */ + + +#if BITS_IN_JSAMPLE == 11 +/* JSAMPLE should be the smallest type that will hold the values 0..2047. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 2047 +#define CENTERJSAMPLE 1024 + +#endif /* BITS_IN_JSAMPLE == 11 */ + + #if BITS_IN_JSAMPLE == 12 /* JSAMPLE should be the smallest type that will hold the values 0..4095. * On nearly all machines "short" will do nicely. @@ -252,7 +303,10 @@ typedef void noreturn_t; * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. */ -#ifdef HAVE_BOOLEAN +#ifndef HAVE_BOOLEAN +#if defined FALSE || defined TRUE || defined QGLOBAL_H +/* Qt3 defines FALSE and TRUE as "const" variables in qglobal.h */ +typedef int boolean; #ifndef FALSE /* in case these macros already exist */ #define FALSE 0 /* values of boolean */ #endif @@ -262,6 +316,7 @@ typedef void noreturn_t; #else typedef enum { FALSE = 0, TRUE = 1 } boolean; #endif +#endif /* @@ -299,11 +354,12 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean; #define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ #define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/ #define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -/* Note: if you selected 12-bit data precision, it is dangerous to turn off - * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit - * precision, so jchuff.c normally uses entropy optimization to compute - * usable tables for higher precision. If you don't want to do optimization, - * you'll have to supply different default Huffman tables. +/* Note: if you selected more than 8-bit data precision, it is dangerous to + * turn off ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only + * good for 8-bit precision, so arithmetic coding is recommended for higher + * precision. The Huffman encoder normally uses entropy optimization to + * compute usable tables for higher precision. Otherwise, you'll have to + * supply different default Huffman tables. * The exact same statements apply for progressive JPEG: the default tables * don't work for progressive mode. (This may get fixed, however.) */ @@ -314,7 +370,7 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean; #define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ +#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? (Requires DCT_ISLOW)*/ #define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ #undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ diff --git a/jpegint.h b/jpegint.h index c0d5c142..18bb8879 100644 --- a/jpegint.h +++ b/jpegint.h @@ -2,7 +2,7 @@ * jpegint.h * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 1997-2011 by Guido Vollbeding. + * Modified 1997-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -211,8 +211,8 @@ struct jpeg_marker_reader { /* Entropy decoding */ struct jpeg_entropy_decoder { JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, - JBLOCKROW *MCU_data)); + JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)); + JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); }; /* Inverse DCT (also performs dequantization) */ diff --git a/jpeglib.h b/jpeglib.h index 0a6dac44..f4fbf23e 100644 --- a/jpeglib.h +++ b/jpeglib.h @@ -2,7 +2,7 @@ * jpeglib.h * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2002-2012 by Guido Vollbeding. + * Modified 2002-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -39,12 +39,12 @@ extern "C" { #define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */ #define JPEG_LIB_VERSION_MAJOR 9 -#define JPEG_LIB_VERSION_MINOR 0 +#define JPEG_LIB_VERSION_MINOR 1 /* Various constants determining the sizes of things. - * All of these are specified by the JPEG standard, so don't change them - * if you want to be compatible. + * All of these are specified by the JPEG standard, + * so don't change them if you want to be compatible. */ #define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */ @@ -157,16 +157,21 @@ typedef struct { /* The downsampled dimensions are the component's actual, unpadded number * of samples at the main buffer (preprocessing/compression interface); * DCT scaling is included, so - * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE) + * downsampled_width = + * ceil(image_width * Hi/Hmax * DCT_h_scaled_size/block_size) * and similarly for height. */ JDIMENSION downsampled_width; /* actual width in samples */ JDIMENSION downsampled_height; /* actual height in samples */ - /* This flag is used only for decompression. In cases where some of the - * components will be ignored (eg grayscale output from YCbCr image), - * we can skip most computations for the unused components. + /* For decompression, in cases where some of the components will be + * ignored (eg grayscale output from YCbCr image), we can skip most + * computations for the unused components. + * For compression, some of the components will need further quantization + * scale by factor of 2 after DCT (eg BG_YCC output from normal RGB input). + * The field is first set TRUE for decompression, FALSE for compression + * in initial_setup, and then adapted in color conversion setup. */ - boolean component_needed; /* do we need the value of this component? */ + boolean component_needed; /* These values are computed before starting a scan of the component. */ /* The decompressor output side may not use these variables. */ @@ -215,10 +220,12 @@ struct jpeg_marker_struct { typedef enum { JCS_UNKNOWN, /* error/unspecified */ JCS_GRAYSCALE, /* monochrome */ - JCS_RGB, /* red/green/blue */ - JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ + JCS_RGB, /* red/green/blue, standard RGB (sRGB) */ + JCS_YCbCr, /* Y/Cb/Cr (also known as YUV), standard YCC */ JCS_CMYK, /* C/M/Y/K */ - JCS_YCCK /* Y/Cb/Cr/K */ + JCS_YCCK, /* Y/Cb/Cr/K */ + JCS_BG_RGB, /* big gamut red/green/blue, bg-sRGB */ + JCS_BG_YCC /* big gamut Y/Cb/Cr, bg-sYCC */ } J_COLOR_SPACE; /* Supported color transforms. */ diff --git a/jpegtran.1 b/jpegtran.1 index 0ad1bbc8..2220f7a5 100644 --- a/jpegtran.1 +++ b/jpegtran.1 @@ -1,4 +1,4 @@ -.TH JPEGTRAN 1 "28 December 2009" +.TH JPEGTRAN 1 "13 September 2013" .SH NAME jpegtran \- lossless transformation of JPEG files .SH SYNOPSIS @@ -156,15 +156,23 @@ image region but losslessly preserves what is inside. Like the rotate and flip transforms, lossless crop is restricted by the current JPEG format: the upper left corner of the selected region must fall on an iMCU boundary. If this does not hold for the given crop parameters, we silently move the upper -left corner up and/or left to make it so, simultaneously increasing the region -dimensions to keep the lower right crop corner unchanged. (Thus, the output -image covers at least the requested region, but may cover more.) +left corner up and/or left to make it so, simultaneously increasing the +region dimensions to keep the lower right crop corner unchanged. (Thus, the +output image covers at least the requested region, but may cover more.) +The adjustment of the region dimensions may be optionally disabled. The image can be losslessly cropped by giving the switch: .TP .B \-crop WxH+X+Y Crop to a rectangular subarea of width W, height H starting at point X,Y. .PP +A complementary lossless-wipe option is provided to discard (gray out) data +inside a given image region while losslessly preserving what is outside: +.TP +.B \-wipe WxH+X+Y +Wipe (gray out) a rectangular subarea of width W, height H starting at point +X,Y. +.PP Other not-strictly-lossless transformation switches are: .TP .B \-grayscale diff --git a/jpegtran.c b/jpegtran.c index 7e8ef0ce..5269344e 100644 --- a/jpegtran.c +++ b/jpegtran.c @@ -1,7 +1,7 @@ /* * jpegtran.c * - * Copyright (C) 1995-2012, Thomas G. Lane, Guido Vollbeding. + * Copyright (C) 1995-2013, Thomas G. Lane, Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -66,8 +66,8 @@ usage (void) fprintf(stderr, "Switches for modifying the image:\n"); #if TRANSFORMS_SUPPORTED fprintf(stderr, " -crop WxH+X+Y Crop to a rectangular subarea\n"); - fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n"); fprintf(stderr, " -flip [horizontal|vertical] Mirror image (left-right or top-bottom)\n"); + fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n"); fprintf(stderr, " -perfect Fail if there is non-transformable edge blocks\n"); fprintf(stderr, " -rotate [90|180|270] Rotate image (degrees clockwise)\n"); #endif @@ -76,6 +76,7 @@ usage (void) fprintf(stderr, " -transpose Transpose image\n"); fprintf(stderr, " -transverse Transverse transpose image\n"); fprintf(stderr, " -trim Drop non-transformable edge blocks\n"); + fprintf(stderr, " -wipe WxH+X+Y Wipe (gray out) a rectangular subarea\n"); #endif fprintf(stderr, "Switches for advanced users:\n"); #ifdef C_ARITH_CODING_SUPPORTED @@ -187,7 +188,8 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, #if TRANSFORMS_SUPPORTED if (++argn >= argc) /* advance to next argument */ usage(); - if (! jtransform_parse_crop_spec(&transformoption, argv[argn])) { + if (transformoption.crop /* reject multiple crop/wipe requests */ || + ! jtransform_parse_crop_spec(&transformoption, argv[argn])) { fprintf(stderr, "%s: bogus -crop argument '%s'\n", progname, argv[argn]); exit(EXIT_FAILURE); @@ -336,6 +338,21 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, /* Trim off any partial edge MCUs that the transform can't handle. */ transformoption.trim = TRUE; + } else if (keymatch(arg, "wipe", 1)) { +#if TRANSFORMS_SUPPORTED + if (++argn >= argc) /* advance to next argument */ + usage(); + if (transformoption.crop /* reject multiple crop/wipe requests */ || + ! jtransform_parse_crop_spec(&transformoption, argv[argn])) { + fprintf(stderr, "%s: bogus -wipe argument '%s'\n", + progname, argv[argn]); + exit(EXIT_FAILURE); + } + select_transform(JXFORM_WIPE); +#else + select_transform(JXFORM_NONE); /* force an error */ +#endif + } else { usage(); /* bogus switch */ } diff --git a/jversion.h b/jversion.h index 232085f1..a6e3ac73 100644 --- a/jversion.h +++ b/jversion.h @@ -1,7 +1,7 @@ /* * jversion.h * - * Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. + * Copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -9,6 +9,6 @@ */ -#define JVERSION "9 13-Jan-2013" +#define JVERSION "9a 19-Jan-2014" -#define JCOPYRIGHT "Copyright (C) 2013, Thomas G. Lane, Guido Vollbeding" +#define JCOPYRIGHT "Copyright (C) 2014, Thomas G. Lane, Guido Vollbeding" diff --git a/libjpeg.txt b/libjpeg.txt index 292a1270..4243c246 100644 --- a/libjpeg.txt +++ b/libjpeg.txt @@ -95,8 +95,8 @@ use.) Unsupported ISO options include: * Lossless JPEG * DNL marker * Nonintegral subsampling ratios -We support both 8- and 12-bit data precision, but this is a compile-time -choice rather than a run-time choice; hence it is difficult to use both +We support 8-bit to 12-bit data precision, but this is a compile-time choice +rather than a run-time choice; hence it is difficult to use different precisions in a single application. By itself, the library handles only interchange JPEG datastreams --- in @@ -225,7 +225,7 @@ For best results, source data values should have the precision specified by BITS_IN_JSAMPLE (normally 8 bits). For instance, if you choose to compress data that's only 6 bits/channel, you should left-justify each value in a byte before passing it to the compressor. If you need to compress data -that has more than 8 bits/channel, compile with BITS_IN_JSAMPLE = 12. +that has more than 8 bits/channel, compile with BITS_IN_JSAMPLE = 9 to 12. (See "Library compile-time options", later.) @@ -1273,9 +1273,10 @@ Special color spaces The JPEG standard itself is "color blind" and doesn't specify any particular color space. It is customary to convert color data to a luminance/chrominance color space before compressing, since this permits greater compression. The -existing de-facto JPEG file format standards specify YCbCr or grayscale data -(JFIF), or grayscale, RGB, YCbCr, CMYK, or YCCK (Adobe). For special -applications such as multispectral images, other color spaces can be used, +existing JPEG file interchange format standards specify YCbCr or GRAYSCALE +data (JFIF version 1), GRAYSCALE, RGB, YCbCr, CMYK, or YCCK (Adobe), or BG_RGB +or BG_YCC (big gamut color spaces, JFIF version 2). For special applications +such as multispectral images, other color spaces can be used, but it must be understood that such files will be unportable. The JPEG library can handle the most common colorspace conversions (namely @@ -1292,22 +1293,25 @@ jpeg_set_colorspace(). Of course you must select a supported transformation. jccolor.c currently supports the following transformations: RGB => YCbCr RGB => GRAYSCALE + RGB => BG_YCC YCbCr => GRAYSCALE + YCbCr => BG_YCC CMYK => YCCK plus the null transforms: GRAYSCALE => GRAYSCALE, RGB => RGB, -YCbCr => YCbCr, CMYK => CMYK, YCCK => YCCK, and UNKNOWN => UNKNOWN. +BG_RGB => BG_RGB, YCbCr => YCbCr, BG_YCC => BG_YCC, CMYK => CMYK, +YCCK => YCCK, and UNKNOWN => UNKNOWN. -The de-facto file format standards (JFIF and Adobe) specify APPn markers that -indicate the color space of the JPEG file. It is important to ensure that -these are written correctly, or omitted if the JPEG file's color space is not -one of the ones supported by the de-facto standards. jpeg_set_colorspace() -will set the compression parameters to include or omit the APPn markers -properly, so long as it is told the truth about the JPEG color space. -For example, if you are writing some random 3-component color space without -conversion, don't try to fake out the library by setting in_color_space and -jpeg_color_space to JCS_YCbCr; use JCS_UNKNOWN. You may want to write an -APPn marker of your own devising to identify the colorspace --- see "Special -markers", below. +The file interchange format standards (JFIF and Adobe) specify APPn markers +that indicate the color space of the JPEG file. It is important to ensure +that these are written correctly, or omitted if the JPEG file's color space +is not one of the ones supported by the interchange standards. +jpeg_set_colorspace() will set the compression parameters to include or omit +the APPn markers properly, so long as it is told the truth about the JPEG +color space. For example, if you are writing some random 3-component color +space without conversion, don't try to fake out the library by setting +in_color_space and jpeg_color_space to JCS_YCbCr; use JCS_UNKNOWN. +You may want to write an APPn marker of your own devising to identify +the colorspace --- see "Special markers", below. When told that the color space is UNKNOWN, the library will default to using luminance-quality compression parameters for all color components. You may @@ -1325,6 +1329,8 @@ set out_color_space to override this. Again, you must select a supported transformation. jdcolor.c currently supports YCbCr => RGB YCbCr => GRAYSCALE + BG_YCC => RGB + BG_YCC => GRAYSCALE RGB => GRAYSCALE GRAYSCALE => RGB YCCK => CMYK @@ -2585,10 +2591,10 @@ different sizes. If the image dimensions are not a multiple of the MCU size, you must also pad the data correctly (usually, this is done by replicating the last column and/or row). The data must be padded to a multiple of a DCT block in each component: that is, each downsampled row must contain a -multiple of 8 valid samples, and there must be a multiple of 8 sample rows -for each component. (For applications such as conversion of digital TV -images, the standard image size is usually a multiple of the DCT block size, -so that no padding need actually be done.) +multiple of block_size valid samples, and there must be a multiple of +block_size sample rows for each component. (For applications such as +conversion of digital TV images, the standard image size is usually a +multiple of the DCT block size, so that no padding need actually be done.) The procedure for compression of raw data is basically the same as normal compression, except that you call jpeg_write_raw_data() in place of @@ -2614,22 +2620,22 @@ The scanlines count passed to and returned from jpeg_write_raw_data is measured in terms of the component with the largest v_samp_factor. jpeg_write_raw_data() processes one MCU row per call, which is to say -v_samp_factor*DCTSIZE sample rows of each component. The passed num_lines -value must be at least max_v_samp_factor*DCTSIZE, and the return value will -be exactly that amount (or possibly some multiple of that amount, in future -library versions). This is true even on the last call at the bottom of the -image; don't forget to pad your data as necessary. +v_samp_factor*block_size sample rows of each component. The passed num_lines +value must be at least max_v_samp_factor*block_size, and the return value +will be exactly that amount (or possibly some multiple of that amount, in +future library versions). This is true even on the last call at the bottom +of the image; don't forget to pad your data as necessary. The required dimensions of the supplied data can be computed for each component as - cinfo->comp_info[i].width_in_blocks*DCTSIZE samples per row - cinfo->comp_info[i].height_in_blocks*DCTSIZE rows in image + cinfo->comp_info[i].width_in_blocks*block_size samples per row + cinfo->comp_info[i].height_in_blocks*block_size rows in image after jpeg_start_compress() has initialized those fields. If the valid data is smaller than this, it must be padded appropriately. For some sampling factors and image sizes, additional dummy DCT blocks are inserted to make the image a multiple of the MCU dimensions. The library creates such dummy blocks itself; it does not read them from your supplied data. Therefore you -need never pad by more than DCTSIZE samples. An example may help here. +need never pad by more than block_size samples. An example may help here. Assume 2h2v downsampling of YCbCr data, that is cinfo->comp_info[0].h_samp_factor = 2 for Y cinfo->comp_info[0].v_samp_factor = 2 @@ -2671,8 +2677,8 @@ Then call jpeg_read_raw_data() in place of jpeg_read_scanlines(). The decompression process is otherwise the same as usual. jpeg_read_raw_data() returns one MCU row per call, and thus you must pass a -buffer of at least max_v_samp_factor*DCTSIZE scanlines (scanline counting is -the same as for raw-data compression). The buffer you pass must be large +buffer of at least max_v_samp_factor*block_size scanlines (scanline counting +is the same as for raw-data compression). The buffer you pass must be large enough to hold the actual data plus padding to DCT-block boundaries. As with compression, any entirely dummy DCT blocks are not processed so you need not allocate space for them, but the total scanline count includes them. The @@ -2928,10 +2934,10 @@ This does not count any memory allocated by the application, such as a buffer to hold the final output image. The above figures are valid for 8-bit JPEG data precision and a machine with -32-bit ints. For 12-bit JPEG data, double the size of the strip buffers and -quantization pixel buffer. The "fixed-size" data will be somewhat smaller -with 16-bit ints, larger with 64-bit ints. Also, CMYK or other unusual -color spaces will require different amounts of space. +32-bit ints. For 9-bit to 12-bit JPEG data, double the size of the strip +buffers and quantization pixel buffer. The "fixed-size" data will be +somewhat smaller with 16-bit ints, larger with 64-bit ints. Also, CMYK +or other unusual color spaces will require different amounts of space. The full-image coefficient and pixel buffers, if needed at all, do not have to be fully RAM resident; you can have the library use temporary @@ -2953,27 +2959,34 @@ Library compile-time options A number of compile-time options are available by modifying jmorecfg.h. -The JPEG standard provides for both the baseline 8-bit DCT process and -a 12-bit DCT process. The IJG code supports 12-bit JPEG if you define -BITS_IN_JSAMPLE as 12 rather than 8. Note that this causes JSAMPLE to be -larger than a char, so it affects the surrounding application's image data. -The sample applications cjpeg and djpeg can support 12-bit mode only for PPM -and GIF file formats; you must disable the other file formats to compile a -12-bit cjpeg or djpeg. (install.txt has more information about that.) -At present, a 12-bit library can handle *only* 12-bit images, not both -precisions. (If you need to include both 8- and 12-bit libraries in a single -application, you could probably do it by defining NEED_SHORT_EXTERNAL_NAMES -for just one of the copies. You'd have to access the 8-bit and 12-bit copies -from separate application source files. This is untested ... if you try it, -we'd like to hear whether it works!) +The IJG code currently supports 8-bit to 12-bit sample data precision by +defining BITS_IN_JSAMPLE as 8, 9, 10, 11, or 12. +Note that a value larger than 8 causes JSAMPLE to be larger than a char, +so it affects the surrounding application's image data. +The sample applications cjpeg and djpeg can support deeper than 8-bit data +only for PPM and GIF file formats; you must disable the other file formats +to compile a 9-bit to 12-bit cjpeg or djpeg. (install.txt has more +information about that.) +Run-time selection and conversion of data precision are currently not +supported and may be added later. +Exception: The transcoding part (jpegtran) supports all settings in a +single instance, since it operates on the level of DCT coefficients and +not sample values. +(If you need to include an 8-bit library and a 9-bit to 12-bit library for +compression or decompression in a single application, you could probably do +it by defining NEED_SHORT_EXTERNAL_NAMES for just one of the copies. You'd +have to access the 8-bit and the 9-bit to 12-bit copies from separate +application source files. This is untested ... if you try it, we'd like to +hear whether it works!) -Note that a 12-bit library always compresses in Huffman optimization mode, -in order to generate valid Huffman tables. This is necessary because our -default Huffman tables only cover 8-bit data. If you need to output 12-bit -files in one pass, you'll have to supply suitable default Huffman tables. -You may also want to supply your own DCT quantization tables; the existing -quality-scaling code has been developed for 8-bit use, and probably doesn't -generate especially good tables for 12-bit. +Note that the standard Huffman tables are only valid for 8-bit data precision. +If you selected more than 8-bit data precision, cjpeg uses arithmetic coding +by default. The Huffman encoder normally uses entropy optimization to +compute usable tables for higher precision. Otherwise, you'll have to +supply different default Huffman tables. You may also want to supply your +own DCT quantization tables; the existing quality-scaling code has been +developed for 8-bit use, and probably doesn't generate especially good tables +for 9-bit to 12-bit. The maximum number of components (color channels) in the image is determined by MAX_COMPONENTS. The JPEG standard allows up to 255 components, but we diff --git a/missing b/missing index cdea5149..db98974f 100755 --- a/missing +++ b/missing @@ -1,7 +1,7 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. @@ -160,7 +160,7 @@ give_advice () ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff --git a/rdjpgcom.1 b/rdjpgcom.1 index 97611df8..d7741fb9 100644 --- a/rdjpgcom.1 +++ b/rdjpgcom.1 @@ -1,4 +1,4 @@ -.TH RDJPGCOM 1 "02 April 2009" +.TH RDJPGCOM 1 "13 September 2013" .SH NAME rdjpgcom \- display text comments from a JPEG file .SH SYNOPSIS diff --git a/structure.txt b/structure.txt index 44e48ca8..98e20c7c 100644 --- a/structure.txt +++ b/structure.txt @@ -1,6 +1,6 @@ IJG JPEG LIBRARY: SYSTEM ARCHITECTURE -Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. +Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. This file is part of the Independent JPEG Group's software. For conditions of distribution and use, see the accompanying README file. @@ -170,16 +170,16 @@ can be simplified a little if they work on padded data: it's not necessary to have special cases at the right and bottom edges. Therefore the interface buffer is always an integral number of blocks wide and high, and we expect compression preprocessing to pad the source data properly. Padding will occur -only to the next block (N-sample) boundary. In an interleaved-scan situation, -additional dummy blocks may be used to fill out MCUs, but the MCU assembly and -disassembly logic will create or discard these blocks internally. (This is -advantageous for speed reasons, since we avoid DCTing the dummy blocks. -It also permits a small reduction in file size, because the compressor can -choose dummy block contents so as to minimize their size in compressed form. -Finally, it makes the interface buffer specification independent of whether -the file is actually interleaved or not.) Applications that wish to deal -directly with the downsampled data must provide similar buffering and padding -for odd-sized images. +only to the next block (block_size-sample) boundary. In an interleaved-scan +situation, additional dummy blocks may be used to fill out MCUs, but the MCU +assembly and disassembly logic will create or discard these blocks internally. +(This is advantageous for speed reasons, since we avoid DCTing the dummy +blocks. It also permits a small reduction in file size, because the +compressor can choose dummy block contents so as to minimize their size +in compressed form. Finally, it makes the interface buffer specification +independent of whether the file is actually interleaved or not.) +Applications that wish to deal directly with the downsampled data must +provide similar buffering and padding for odd-sized images. *** Poor man's object-oriented programming *** @@ -345,9 +345,10 @@ The objects shown above are: require context rows above and below the current row group; the preprocessing controller is responsible for supplying these rows via proper buffering. The downsampler is responsible for edge expansion at the right - edge (i.e., extending each sample row to a multiple of N samples); but the - preprocessing controller is responsible for vertical edge expansion (i.e., - duplicating the bottom sample row as needed to make a multiple of N rows). + edge (i.e., extending each sample row to a multiple of block_size samples); + but the preprocessing controller is responsible for vertical edge expansion + (i.e., duplicating the bottom sample row as needed to make a multiple of + block_size rows). * Coefficient controller: buffer controller for the DCT-coefficient data. This controller handles MCU assembly, including insertion of dummy DCT @@ -651,8 +652,8 @@ contain quantized coefficients everywhere outside the DCT/IDCT subsystems. quantization a la JPEG Part 3.) Notice that the allocation unit is now a row of 8x8 coefficient blocks, -corresponding to N rows of samples. Otherwise the structure is much the same -as for samples, and for the same reasons. +corresponding to block_size rows of samples. Otherwise the structure +is much the same as for samples, and for the same reasons. On machines where malloc() can't handle a request bigger than 64Kb, this data structure limits us to rows of less than 512 JBLOCKs, or a picture width of diff --git a/testimg.bmp b/testimg.bmp index 012223eb67e30448ecb29b2c8ce501f98c0d464c..11aa0cbf4115728832db78699bb26ef9f1c55718 100644 GIT binary patch delta 9997 zcmZXZdr(`~oyVs!PSl9XGR7E@Dz;@%90i%;T!w9ZwpkjSJ1eUh35HFnKW5KgQcxlbGVI!^(NgU|O?d51lBA#CTb%an}oOicQPx z_j|5HobEZ&y;tb!oX`3G9_O6PAAf$|AAf$|P*u*idW=0rRaJdz6OO7{j(3kbUp3Oc zcjFfakM!2m3_FH*tzYc>u<$}(-^^1NMdQj6(VJ7)Fj?Sqx=}0K70%^S;Y6*d&>IWB z@%ZBn1^=MOcNTo>cJr1%G?3SohgUTF?&^x-Q}TI}m9yw=yZC|+3k^p3IpMH&T3vL#y4=ya|ChH-zvqXoqk89p~iaZ{ix z&?URiL&tetT^Sm2ZRMj+%!hjBRkccXOc3e;qIvb7uSC%k*b=ZvK_moFBoLUy zh5I*eo1dR&*BXc#qBK$-oU5wdhIxjMNSqo+&E(|p41_sz_1fw6G*Pj5`hj&Xyn!By z+|WLw4Le`qbT(R`4~d@DR}h2;7}4SkSZE*CsHTmShgeZm@zw*Il^(iB2$e7J@MxT` z>KUOr8V&SuI3UpZzH7jlxp)NfJmIdX87s(gXyQmI8lBO`XkMeUk)JB`YDGnd24rzs z^57~O4o}pHC;9G*iXZEWw}nFU8V4wP=(`XpBtDNX?V-7RUa-c&P>U$`lp;6F{Ib;mI_{++`e1ycGG^c zK)j3@Rb$7BWw;7e)mOm87Rf*s7Siw~EB_!G9<)NPtXd$HCJg!TH#mHiv8U<}m*7!Z z6C&Iuq1P&~NduNQIVQLF9sRu6Y}OZ9!bO%M7Sb`c2?p<0D;fihFed%0*chsCMoGo) zzbxb;mR1gka(&4YD&mfENhFHLECg4lWIZDfewEA7%OtRiVb{2F6ZFd4QItp|;zjXz z!ktJ+E{%<`SmX@IsDsZ38XJ*{ii?eIi=`3WXBjjS&5Yttxdp#jWZQ>d{8@3Ym<>#*W4V z%z+}2yH@;f?v`z|3&V=OBYQ5VC;OxTb1z~1nLyY4cyi5_T~lLI8iREo!~gZq&EDGD zoWwK`?C~&;@wgYKFl$y4X{`Yao-gOKsvacKj3Mq3<3QelJoysWzF~LvAjH%VjUo$3 zWy~{GSN)x79KDX=$;mClV>8s};*lCgzUAAK&%6h;oE&?d9VH$IqxK?Xk%Yt;aK z7#LuJLMqT#%okTdD4L2mTHyr&4;;u7`&X|O6NbVkrQ1+8DV=tP_cXz)tEvuPdX1Au zra-FR-buLj*v!n##YwSo)n<2&-yic&+wIg2ipi6vAU}p7APtIQk#O+z5K^YzxZfC+ zSW+#?L@IFoVpVx1DSBvABq$z3@ab~!agOVm+k5p3POVyjYQw{md`-S#+|Z194#ff0 z{Qi{Rdb@70j>5$gl8%S$Rd^b7fYay#VW%5us=}>z!^cJ{Al$N88Nq&p>4!8FO1`p( zrgG_OBYU^rqty{$NwUeYsq-_)Q5PM^o9n~|V@^F7x4##=o=T-|->yS}d>JkRvOqJb z-d!T*7KLTPAfa1MeroZE3QG$2>P_Ov>J86mK$=)^HbO!$>2g(b6YsuuPXvH#YHXNB z93ER-T-8T1q=Eu~t=#T7w)VQ;Z);B7HZ2fL3MU2AVgYFadc`Fb?W)BpGFd_brWF&%Ms#;t%aq0BEsged99(GJRCU>pEqM)$vmG!%ZImxUO6L}9j ztthGHX49awB4oO!P@At7&6earwCeTh#DvIS^ITYSCnC|AWIW0^Y{J^D3i5n$PvXY% zWY~cNXwBDppr_*>3m7?bFjTXTalOM@HpxkvO!Zgo+m>iYVLe z{UV;fJU(4>g57shdOfjKQA0a8vDC) zX#^$2yNe1hTTdpfB9P{-h01AWIB#rkHMyj(yvP? zAdSVKA3z-a{HTpzrXpm!b(u3c_EEN2SV7Hh~dnE zltnUHfduIWa0ISY6|;sox^AZw5cb83wFe8XWk5{XYE#dt!<<61aMJG_j+3jN*=^K2 zJ9^ZY3fDgczGX8{ZrIi}b z<%r{{=UZb#Ln&K7xHdsKss~rBn>LY;;sH&2Nx%)-ECC)CaN$LBQ^j1eibm7+FxBHK zY@V=EO34>e!O1d*d31ed`=bekd2|iDa6cCA(Lf+HcLrOJDTs*F<9Kz?W$RFzHAU%U z>GuG$S!ziABxY7b8vLFFL%uHy9daP|$s$ovglOhsnnsov%b%p#DX5PV#c)Qr-gw+_MugZ+l!rXV2sBH|zkmwl0#(jVhFOxq&)(3%Hmb`t|dfBnhkpR8^jN+w;dB*=ovAWR9nLOc>S+p>aXqE`zK zsam`M+Wo%*YmS;<3?t_ej)ekhXL-qwSfOL?y|A8ck9u+Y>&KAroKbF;y8;7wd6tg` z!rnbUZEb7o)+JrRU@!@se$dI7P&_z8wjEzFB}LP6V0^j|3uQunmGEx(u6XO=2I|I~ zEc5a*;Ic_2F;-56rx%B(hNos``i{L(1vqT%<(mJaye>=FyPa6Vv&aA-h=h^4h03wkY??Uy?$y(aeW$M# zHcY5^A_J-@$pX;|E}B#kM}iG>Qy8P8^7DHslPHR!dDP?&wW zc+sT8@h;L_U_(P#Pm2;qJ4>TV$#{h@CAiO5JaM?;%$YL{yGK+cx5lohGZ4tL+}y7$L8pH3flUHZG)jh&vT-pi*)p>&vB-wENgjcvRq{bKR`KFS&J;vL&0NS& z{Fp^F^9yWkswNH}E|@5uufUepVktr(ga@!extxRjf&#}UPZA0e5SXa)PYB%R^z@(| z%PCaN(@2*o-ykB>9ak`MVYPfm+ET)3P+5))BIX6)6z?xC#xn?jI0u*!r|p+7`>ziT z-ENk%6QfY7v@8~w7?rT&AiaxI7U$OG63$+SS4y3PZj+bZp6!)D+6Q?A1M&oCdadxm zn#GbZd+qk2A?s~xzx8%of3tzMQBpcE1!+FSqh`7wT_3vC4MG#C%(Pr3Wg#d^c=~H$ zabweg?`GWRUJ{8y5OA0?jvwm4h93}?MAM!<8?4Q6ng0GH5)zXVIIt{(b%;R{?S!LZ zv!&}y@SeCBDqfpILBz+!0qGZ6=~X@Y$c|fj##`ExL_A+8@(wNRTv}SNrK;cWzOBQ$ z0B>2~p6oA)?1?XJ=t5#rm?to?9!CwY<;2ZJl5^q?qxq;TTJd#60 z0h{)BJR_s{cmULBvHMdCk>*tYY-Q!_tWL%TQI-cAMA~t&$iFBH*nYqnOj+4w2x-p2 z;JKf8c9S?^r7NIx$YZ8o?5vk7ulWjvq%HwVUKAl>_gn94wzXAOzF*S9IhEncxJc@f z-9a3JI-L&6NE&zpg^9@(b9R!=aN)F)y4b}JA2}fB2c|i#l;eaqQLs~#465b{fq*4y zX^c88;o9q_L146$BwaeifJzKW5-jP)Y_H=R91umPK$4gpZj2Y6>QI5@Fd4MhnN0VY z21WB`pC*XxuN(lx$QH7M@az)a7!BZQ93Hj8DQmCChGvQ2vKd&3!T68`dzuu)aDf6z z4pP*aVqR)twI^SgTt~FjS9(uo)sa%Myu1(u4O6rm+Roxw^r@89a7bY5@!=Arr?m005CTMQk>) z(RN@Z`wodqo7e6~l!R10M-G2PhnQL522q4aVo&RA35TYQTlS}DM_bA^h=MUG!ERSK zyG>)s8mp6@X}1r;JJDs#loo%p9m=S#4KRD8+4Zb?I4EVuXuJ4w{vhD&DDv)^#c*5( zB{NWi;=!Vm`bW}f6FZODY!QPY$YqRS!Inlbr3VM?)LM28#nZNkP4Rfde?LamL;APS z7rSFY{}^;gB2a^61*m%T2XF(YJAQen&E@d`B8_pQZ&aR9Y&PU%4AW$ifWc10gJOs* zd>UDR1t11X4BwhyA}q1QC#C*yD4QBI22Fa34-6y(ngEM$`A-l4)Vtm09DjFm2?VxO z44q~q&`{*$K1~^H=)vI0@9az>PkIcSaOc9pr&|9IB~3z)E8ioA>@S7&P=V&A>eK-O z(Ejq09QexpXIO&*IGr6R?z7kTwCOw)b}n_| z_RggxgCPP1(lNZ#5t||C35uU@@r64GQIE=37DOU|2Niv?b6~K4-eA7odb=Mwu)7oi zvX#b2!TLZ*rEMIkqIBlx19sGt?-}jHZ+50l(mn9Cf|Vq6_+i;W=uqFGcSCf(A&KOu z4}qv0YVcdhfG74Hd{_vPLgwp3%?lVNsx6fTK##ao00s#31O~`pFraflxLklCjR9^; zhtwE6onqg&jvR1v{3w}RR1Qhp9T@eW-A+KEPZZURZv83z5Z%hY&={*$QcxD*ul0&# zB&`#K_?;Mje$XSflpph=nQ|<_ulPdc1W$Y+uKX27@LPqtQ-nfrpqdg!m(taG4?WDw7>wk#DL^1 z04sT1sQE$hcE!({pwPdzx3`a@?NZq`jL^X(i59H6v+u%wH zOq((kM#au;zi7A#Wyi-wd;4GKd~iZ!d%bGL%j_TOE-7ijM3!O0Z#o6c*LD2k2hr+XUl|_`0W#OKCibvG(X=F@?xL;x0cz; zLzR`f7Br5eq&2QJZLnd|r)!`~sW1YQsr%Eall3>*C`*}WKT%rhyW>rSI-cz?dxzS( z+2oBIXmnQEO8YIt5VNoW+bXR+O%HM5snc}~1r{-Wld*8e8`Af{r($TUW%dTjp+ko% zrO|2kh!)ZuEF0y};RyIBBF8Z14>oJq)y?$6}md&BHLzRG` zSK^0k1XDJf;)UeG-xWn1eY(GXysYfpty{OwmEmyW)`=72Pn-KL>~FzgL5Ao|KK+t96xvb+_~?a zXm79by@g!jy_17BSKm1FPUWE%ovsA(qd+U#fK4*%;e>x>@PV=|vNNT$iSnA0&)+P2 zVdJGAZ)N$-*5k*Izk8y6u3W7zZwfVeb6RiET}n#0?(g0S8kjQ@OrjyAQm!u0rp<=` zjYO0MVXPf^dh74LKso)|)~(0CcLL6*HeESeTiZ$pX=y<-E`zQGBB3E{br=_v4JC*N zpvtG>e`1ZmO-_bK_(DoWJ(q!Ie&$5|g^Y(A|R6&Yu&+ zX81Is=)|>W-?x8^yKy_3=bkZ=PR%md4WlKvpSLrULv$2Fe^C6!b=KZc@W$HO*3~da z(zS$X)RW|9Gi}AzjKB1Bx401Ep3(1*j*c2c|Mv5?qetKP{Josk*~%8z64U(>Tr+}o zO7-k4f(so$GoG;W=zQ+NmQ_dB{^U(-HQL9D9__>RA~vhF^+t6H6ueC)3J(?z`J?%w zt?qp3t8ZRkeIwP@f*k-?G#SibHofw?Q=bX4rPYJ$}!c3o$&%y_ZY;l8a~{Z+y`SWb$T|zN3aw`g~Msz zOHQmW)v@Az$$k4=ot~vkJ6Lw4WJt-##C_fH1=0D!Z;N5BrB2rpEr$7NFoyjR{90=X zC+KG|h}IYX!-R)0^dNT1L2w}n+rXy6;T~T@Lk9aXE-d`NCzi>!DInRp$Ifx zGjhWcOfI<|k(M#(M5AZwL7fYqlg<661)+TVvm9({6;ZG+vEq@W^6Q0tb6fro4u-hlBgDyWf>EsL?IT4I5%Kdj)bkqiounGKe!IUHmU&?CJv$<+@bO| z9kd#x-SwnRcI`rZh?hFGJYFYZs(-AsvnH_%t;^zk%wkeAwTB(cL}FMkWzwa96Kq;$ zpZC32Kxg;dt9!+jbk6TQ?{nUB?&S|}KJ$>vJ zp$%WYa;&qw)9LITSXlU|>(v`wU6;1^3-7~L(V3N3c{<-b9d3t1 z`(*Aj&plU}+c2wqKwomZTiliwLwmcS-4MqKFGIW?f5zM6VlM01%^muH9voB{$R>Bl za);j4y5S8b0ZK2Stm(?T+0~UV_CNf>-jN2kiR!L$Py?B=%I$TyS2?u$hTLaz^$r!U z3SYvv;w>tI0WE`rXuu(EKK#r!dA0+3WQxKk;Fg2Es5A%(5nNx5JC84#z5o+@M#kgT%qeP^85GB@|8Q3?lp? zEmi9rbspE_jMldjc>Pwz42DR-8SkThLg=WYO~pK)A|n)V|^BoE8K z3>CL{-5_#QIligY;z%2IFt%7MgupZ`4rmyO6pD)rk8XU9SvtaD1_>zf(#svLDwJt79<>t+hC!_l}!O* z7*eP`-Y$NmDcnjVvycW>QA=13bKvx@C!ctEDP&AGvab5lM_pYD`J-_02Jz6>^7fCE zpFU7!ahs~tLV!wfIO5(o$|_K5Wf@f3pxe!Dvul>X3@CIN2l1V+JzXkygcTH=c(=(m z8eDqWrN6TJU*P48Oc1Jf6J+{mK^5umvos>1)gHhH<<61*OOI&Bs+Q4|I6^yF4#wTy zOc;p`)D}hq2H`M}q8$BYFdPw;tBbbILM^4x(BgM|0Xab5;aYw5%U2YGGhpXP??CmM zh5RM9wKdL>OI^oL)zp~7CewM7#l%G+RN%X}$W|E60{~b9N3?S1(lG9i>1PKr%z+7>X%rO7d9&GnwFi z6XhMZwxJMV^je^q#qDS))H^H&?-GuJK}VLVUHmCKM_97+9wT?rwxkr8YUF_MW|`^Mq445>*%W)jOfJ_U1Pm!UQ=FZ>n+Dbm4BQ>P+wY`2O*R_&>T|Py=gzDW zV&VhN{%BI!OpuHU#n5E2Kpn5e;{K+r)fdjX4M)7+9z2piuUV9^nA_ z2@#TASI9g|;~yE)InudlWT5x%z}^1sibfj_m6wm~_`tj~D=Vv{!e7EPQLC?#rQ zDuu{YWjTM|09!*SWU1Lg7o>t%C`Z%-&PQPEKV?5A{zLcp^NyvBuy&K$bBLNefR85tQprGKgxGcV%m zJiT#!5y+b7Do{#*HU^r%B1?`xAg>XgqMW-*tL3Dw)w`|)kHlFpBEv?z_&dF0yW*!X zs8}b(=*UvY1gu|{Wh9?P6ytKAJ{O#KO9T~ltis57%Tt*Rf z%?!Wy#&Qgm)d0XKO)V@eP*$hK$zywn%=!BITg}b2_S$sq{7U7Bi3Su% zpw5@-`h*e!4BqR6&7samd6l`XmFF(MHkw&4WHJWMNUF}S-p=4ggA^- z6vx^9(dbhdL?R^3h!LI}t4eCM^6)9WxW5j9DVd6nyp!F-ytvfMGplbPkFRLm$tEv{ zV0i}`^sd~idHLdV&H6pNe(Y~f8`F)AX&@CDjTP5Q{7H;W6ygCEZ_7YTLtI1!-;r!J zg{{LPnX@a(%EpnRou!`b}*E8MZK-o93p zE`ngBTTyxtgcMprjPeVVdy@~6d!zXT#Ra0VZulcfn8~rKn!;T1oAtY+9qRl?4&x!o zi9SqgnLwba_0WyiMpp{Q8je)I`iwq2dnNbf%dhpWm>$bHcf5XUuxJh;?bf92ARQbW zWIiDFD2&nZ2ZS1>;c2D;kxd(En1Mumt4vx~p?D|vMOKmKLwYHxEHgWXar1y_(bYtA zfSMQ>5UZHeCw4qi7!G#KTse37E=`w8FCe#bWY^k3B#*f{J7Lz^yY017MGvJpM45#I z-d+wjNIA5sjyS25NP5YnIR4naXc$nWAqj~0bcB*Mbl?(rqLtP+84(d;>?5bw>^L9? z-N9hs<-Gju&J`k#Y&>|Yxu`h}2Qr`CZcon}D|$djY$Z`TBF12)BeER95#@Q>aUezM zAe!^`MWGlg2m2}Nsp5g|BIX0w5VQHRc*?*S8R*K(mEG=D-(NLT*@dYJf-1uH@2MYb zPNb#oImkvk4s*4}3M0re>OnjpCYkan4B|{-B~|?>*4Y$y;Wh3;f*~97JPJIX6i7c+ z!*IaWdi8St@+=RZb#^+}Rli!<;J|%VOM7_c+?EshWK^fKy#L?ouN5U46X{yJy?_Ai z-60(2Fq#z&OGrFbLtsY7A11;FBK7z>4GEYXeLgB2CK|s>VsT)V&?2eONI_}|(9G~x zBe)Yw{a2sMou&JnmX;RVsmdD*qhKoU|JOZl)`Duzu1OWxb@mWxrvuj<5+B7DlPf_f zX#76;BqEIQsubu3&nfR|IG@iJk3C-TD24v|MUxZk|QI%5NrdUmtD#}_xr5p`HN4rTZJYK=G138}( z9G_H~AQ26LFv)aww3l-OnaDYE`qHb%8(=Ri{4D1!hR0j(T|aPh*Y=G+sBes<7VX`s zls!}sTC^{Q2q)yT+of7#4`9?W0GS@JSR`2%WoGgDi@?#8ymYdsT5eimg)|51CUb$+e$K046*!PQf@EJ0_^y8O11@%YH{NFhx~(-zEnFc zr+$))g$swT(;#ep@7&piuCq7uDu-dJ_Bfua(374x9&sd-&51?~HR1tGiZu(7UbJKU zVclWOxC&r2LuCpfJ*E;a$);%bK(stn$pKY4NIeu_WpFt`gl+P5*D%&V=gw6gxB|Gi zw>?go!C?8=ke&43pR4T-!Q~)gu>cA26g~|FRAR4@^MRHTjH-p2it+~U6vkour!7QfpmTYXMq#q0H+BD||$fqhu zd|>4b)20!6A)eSMu@vmpx2U?8JBFncaopQ2LWm4nHe-R&2MMt2pp`j4Z6(}>9 zvf+jCl54mNsZZ4Md_zI&W^>`7#uR$7QWfO=5>BEOAo(k?IEoLGP)VUF@Uz<~R%+q5 zqz`L^ti`E-u1H{)WW;K+9}%`0b?LlHv(F+&h8!C)1qO4Ire4n9>>TZGNg)O|CQrnX8e2EgYVq9)p8?3@Jofb>nYw{=N_bo0; z^K)e%PR?Pxr19c{@Uv;DJtU$wr2=peY zcmhH^Lhnj?#9Kvv3=v%p+`!1dgC>jN}7uvlBCAc-`82|A_Sw+ zAOUMq8V|A`STq`pV!{DU$}UM2yaHAy4QiT(j8YzES;P;YJ`xS{h*eF2go~mufkOF9 z8-^mZuJE?R<1Lox&RfPFsj;rknzEwTWJ*vdo7Ec8XfV4+APcc*Fj$R)B@BWGAZqg& z3S)`U_)w2g)NTwYd4t;1LJ4fkg}j2xcpB-BTaaDx_|$C~+j(m+Fq zS{f2i02qcAZ#z6kPr^F1aY2a3WgvFFmAMRm~#UrXquww;XcIB9xR)*QrLAd$bgM@K1h_x zQKqDrUE_&h;WM?4O$#zb2X{LtFtN0_ zgC>9dhtx@(T~hnM1QLr8LJ5?XAWq1WN-avU`6(21-ALCF9olh4ib-~#PyF|@N1|Ga z1)738gE){Swe*Jq0Xdd+Xo-Ix|8%(Lu1a1@Xi`3(&n`_d1sHsg!Ur`ZS_V+KB?9yz zdw3S@y4d_}X1_ylz0KJHW4u}K@-~b5-`*fk4oHh^Q;nVdM=nCd<#}ou3V3^R8;}eOJm!s7A zAR4=X7qKvf0!0^Od`{2s=^qO2AXGqT%&ZBToG-Vw=)0*YYOJ!;;4&mF7^2DP)= zv5WQf33~xrj!A=Q5CDcaC>pH9R8J3DAw%FwTTTvw=Id+o(OI_-NpU1T$wy@tmmsF(vu zeMi^%h2de8Xf!Ha4{0L&33SeBBMG4QCfnbJ#=z?8*wdKck7Xo*Ri?=lu z7oYhw@Vifc_i2FIp>SdSXC9+PpxK-?h_MD`e7+oXgscFy;gB?Ufj+6jQh92SE@IN9 zMyQC<=U)G|jQW2uG&HoW>CTzJr)TcmxjqxX^ZD=?x4{0aG2g;y)9DnE@I$b3e)3W9 zsRKSMW-ts0go=Yja~4eC%Mrh}|ER$hDBd=-8QZqv;yZXXH5Jdy1dw{h!ebnZu-0s@ zp$EdG5?bk_C~*Gu`7o!bO=xs>&TQx_8v+fGP#*D)<0myk+qO0RqG@Odbr=5`(I7W- z!ZV|8e^!wOx`LcuED&1oApi(4dQykh$lOZB&#$S!r+?=pl4=b^unv{s@sIoNJa7TeOz>w5`G}h-6`?meG615G9p`oo!@L~7@ zs#5%CMtu>h)e3JZy~Zz~Eu4ZrqaJ%C1hAN0;?&9&>U`oG&dwUL1MN5vC`A3U3#61F zC}I0=;YQzzwG;i2CI#%M8a0!e=zK)e2MZ!;@s3%7r16N{=l}Uzs1UeZF;!0B0x=8N z{9}mMEQZX^L?ZH+NL^`ZsXY`UD`TSxpbyqX<&xb)?b7w-RRYHQ{pU~C{6wj8=!<3e zrl#RD0l$AYWS-UH9w73U$-2@{O0f*JQ?!@*4s^r`$oCv<`Sw4Sq~6qx$JlQRW?87nir6t(aD8Q~Ex0 z-#=!9rN*)nk;q@_CQyzZJzB~{YGvpzCnByC^-;w!NyOY|_6=>`{KYg4F0#NEqN(`I z#f!*8L9O|IqOq)Qa^e%J4b@R}2#!rkA>*Rxi~1y8w>bVn_wLOo(|??v-aIWfPfv@t zhKh?X+H7#tn7O&Wv2hY~@4k!r>M+0KMT(%0^=+24GtK2bI?@yXG5OY0(5{DkU5HB<)*ITmkuB;g@1-snVS+3AZsa`Lw)e}$S)PQTSu?7}~LfM?EXPTZQL3Xj%lG*-3;^%u_x5LF~ut}%wOL@Qfe z?6!SQBW&fT_YCddzyIphEuU@K^6M>IPM$pZ9_qB&E?l@6-f7ONpD0CSt-LI>?gJwR zp$^ZKU`_ZMvnnX$>*=DNA&e*M~`zyCd! z`dD51G*%iUfPgiSDFKIU@8dh4De*r$fBr&#^=S2_g%dY#9B7>>l&=@=+<6c}mC~gs5C=TK&YT(?oJxcSWwOX%AXET?@QBxY&qwtZ4V8tAO}K1rK{B)c!R z531YkDe)`M#gYTLr`GSRU;FNa758FoSjf;1rKzH_QcVm|>9f{hagO{!#V5LVU6S&S zpZffRtojd2>+nDe^CAXl4C|hB+2kZ-r%ri7$WeWm2HIY{yy?X8&)nF<6(mqQ1l$@zAIXQhfeWJ1AQt|6=H~(NFt-&ua@1jWa_W7d5qO!8aG&R84 zTJ1rKj-iqDT?VjmRhTZK9y5zEAva-xc!<*25mp)3~am{|jN^m~Nbl z#pY2jzAJuS`OyYX>M*|I^A&Is#5Z_G;4g4>9`U9;Q0O_FLT9*DbOv`r_#YEGvh=k` z$Q~1I`+rkN@xoelk!D$mR?M(9hF+#XznERrzx3}$Jfxs!6ND8rN`q25q-%qU$Yai` zp>=d;8tSH|Ffkh?^esmiy`Qbcof zAttInG2sbC$kXO|8g~@J$g@aKQ);I~OU+F^uHY6Qa?{ajv=MT?p`d^}4qaFYN diff --git a/testimg.ppm b/testimg.ppm index bd78ef8e..1377eef2 100644 --- a/testimg.ppm +++ b/testimg.ppm @@ -1,4 +1,4 @@ P6 227 149 255 -0/-0/-10.21/51.51.62/72.83/83/83/:3-:3-:3-:3-:3-:2/91.91.80-80-91.91.:2/80-80-80-80-80-80-80-80-6.+6.+6.+5-*5-*4,)4,)4,)4,)4,)4,)4,)4,)4,)4,)4,).+$/,%/,%0-&1.'2/(30)30)63,63,74-85.85.96/:70:70A;/B<0D>2F@2IA4JB5KC6KD4MD5MD5MD3NB2OC3OC3PD4QE5T>1Y?2b@4nB5}E6ŒG8šG9¥E7²F9ºF9¿E8ÆF;ÉF>ËF?ÌG@ÌG@íCNíCLíCLíDKíDIïBFñ>Bõ@â?@×?<Ñ=;µ@.µ@.µ@.´?-´?-³@-²?-°?-­@,ªA.¦A-¢B,A*›A)˜@*—A*’?/’?/’?/‘>,‘>,’<+’<+’<+”?+”?+”=*”=*”=*•>+–?+—@,”?:•>7—=4Ÿ?1©B3³D3¼D3¿D4º?/¶@2­E8žH;‡H9mB2T8*D3#:659549547326216005//50-72/72/72/61-61-50,50,50,.0-.0-.0-//-//-0/-2.-3--5,-4+,4*+4(*7(+=.1E69LUPdUPdUPd0/-0/-10.10.40-51.62/72.83/83/83/:3-:3-:3-:3-:3-91.91.80-80-80-80-91.91.80-80-80-80-80-80-80-80-6.+6.+5-*5-*5-*4,)4,)4,)5-*5-*5-*5-*5-*5-*5-*5-*/,%0-&0-&1.'2/(30)41*41*63,63,74-74-85.96/:70:70@:.A;/C=1E?3H@3IA4JB5JC3LC4LC4KB3MA1MA1NB2OC3PD4P>0U?1^A3jC4xD6†D4“D5žB3¨B3°@2¶@4¼B7ÂC:ÄE<ÆF=ÇG>èAKèAIèCIêDHíDGïBDó@D÷>Cø;Aø9@ö9?ð.‘>.‘>,=+’<+’<+”>-“>*“>*”=*”=*•>+–?,—@-“@8•>5˜>3Ÿ?1«A3µD4½D3ÁC4¼A2¸B6­E8œI;…G:kA3S9*D4$<66;55:4493382271161.61.72/72/72/61-61-50,50,50,.0-.0-.0-//-//-0/-2.-2.-3--5,-4*+4(*5)+<-0C47I:=h<;vDC†JI’LJST§`h¨k{rŽ‘{¢„°|†»y†½lv«[\ŒQHsQBkOFaOFaNI_RN_[Yfnotƒ‡ˆ”™•™ž—š ”™‘ƒ~ojk[]\JVUCXQaXQaXQa/.,/.,0/-10.40-40-51.51.72.72.72.92,92,92,92,92,91.80-7/,7/,7/,7/,80-91.80-80-80-80-80-80-80-80-6.+5-*5-*5-*4,)4,)4,)4,)5-*5-*5-*5-*5-*5-*5-*5-*1.'1.'2/(30)30)41*41*52+63,63,63,74-85.96/96/:70?9-@:.B<0D>2G?4H@3H@3H@3I@1I@1I@1K?1K?/L@0MA1NB2MA1QA2YB2dC2qC3|C2‰A2“@0™<+ :+©;,¯>0¶@4¼C8¿F=ÀG>à?Eá@FãBGæCFêDFðCEõADù?Dú;@û:?÷:@ñ=@è@@ÜA=Ñ@;É>7³@-³@-³@-²?,²?,²?-¯>,®?,ª?-©@-¥@,¡A+A,˜@*—A*–@)’?/‘>.‘>.‘>.=+=+=+’<+“=,“=,’<+’=)“>*“>*”?+•@,”B7–?5š>3£>2­A4¹C5¿D5ÂC4ÂD6ºF9¯I=›I=‚F;gA4P:,B6&=77=77<66:4493383072/72/62/62/62/52-52-41,41,41,,1-,1-.0-.0-//-//-0/-2.-5//4..5,-4*+4*+9-/>24C79_83l?:|E@ˆIB’NK›Z^œft”n‡Œwž€~¯zƒºs¹dm¤UU‰NEtO?lMBbPEcQHcMH^NK\[[estx…‰ˆ‡Œ†Š†…†Š|xzlghXZ[KVTEZT`ZT`ZT`.-+/.,/.,0/-10.40-40-40-51.61-61-61-81+81+81+81+50-50-4/,4/,4/,4/,50-50-61.61.61.61.61.61.61.61.3.+3.+3.+2-*2-*2-*1,)1,)4/,4/,4/,4/,4/,4/,4/,4/,30+30+30+41,41,52-52-52-52-52-63.74/850850961961>8,?9-@:.B<0E=2E=2F>1F>1G=1G>/F=.I=/I=/J>0L@0L@0JD4NE4TD4^D3hE2sB1~A/‡>-Œ9'”9'9)£<-¬@3³E8·I<ºJ>Ù@CÚACÝCEâDEçCDîACô@Cø>Aü;@û:?÷:>ð=@åA?ÚB=ËA7Ã>5°@,°@,°@,°?-¯>,¯>,®?,¬>-ª?-¦?,£@-Ÿ@,œ@+˜@*–@)”@(‘>.‘>.‘>.=-=-=-<*<*=+=+<*<*=+“=,”>-”>-”B6–?5›?2¦@2²B4½C6ÂB5ÄB5ÄF:½H>­K@˜J@|F:aA4K;.?9+@86@86?75>64:5294183073062/62/62/32.32-21,21,21,-2.-2.-2./1./1.00.00.10.5106005//5,-4+,6,-:01>45W6-b<3qA7}D9„H@ŒRQŽ_i‹iƒs˜|z¬u~·myµ^g¢RQŠMDyM?rN@dPEgQFfLC^GBVNLZ^^fjnquzvx}vz€vwzokoa`bUWYKTUG]V^]V^]V^.-+.-+.-+/.,0/-10.3/,40-3/,4/+4/+4/+4/+6/)6/)6/)4/,4/,3.+3.+3.+3.+4/,4/,50-50-50-50-50-50-50-50-3.+3.+2-*2-*2-*1,)1,)1,)4/,4/,4/,4/,4/,4/,4/,4/,41,41,41,41,41,52-52-52-52-52-63.63.74/850961961<5+=6,?8.@9/B:/C;0C;0C;.D:.D:.D:.G;-H<.I=/J>0K?1GH6KH7PG6XG5aF3jD1uB/|?,‚;)‹:'’;(š=,£B2«G7±K<´M>ÒDBÔDCØDBÝEBâC@ê@@ð>>÷:>û:=ú9<õ;>í?>áB>ÓC:ÅA5º?0¯@-®?,®?,®?,­>+­>+¬>-ª?-¨?,¤?-¢?,ž?+š?*–?+”?*“>)?.?.>->->-Ž=,Ž=,Ž=,Ž=,Ž=,Ž=,Ž=,<,=-‘>.‘>.”B4—A4@1ª@3¶B5ÁC7ÆA8Å@7ÁB;¸G?©KCJ@uE;Y>3C9-78*@86@86?75>64=53:5294173062/43/43/32.23.12-12,12,,2.-2.-2.-2./1./1.00.00.3205105104..2,,4+,7./901P5*Y9,e>/n@1tB7|KGƒYcƒg~p—xx¬s{¹js¶]e¦TT”OG‚LAyPAjPAhMAeJA`GBYHEXKKWMPU^bc`fbcha`f\Z`TWZOUYKWYL`WZ`WZ`WZ,,,,,,---.-+/.,0/-10.3/,2.+2.+3.*3.*3.*3.*3.*3.*3.+3.+2-*1,)1,)2-*3.+3.+3.+3.+3.+3.+3.+3.+3.+3.+2-*2-*2-*2-*1,)1,)1,)0+(3.+3.+3.+3.+3.+3.+3.+3.+41,41,41,41,41,41,41,41,41,52-52-63.74/850850850;4*<5+=6,>7-@7.A8/A9.A9.C9/C9-C9-F:.G;/H<.J>0K?1FI8GH6MH5TG6[F3dC0lA.t?-{<*‚;)Š;*“=,šA1£F5ªJ:­M=ÉE@ËFAÑFAÖE@ÞC?å@>í==ó9<ø:<÷9;ó;=ë?=ÝB=ÌD8¼A2±>,«@,«@,¬?+¬>-¬>-©>,©>,¨>.¥>-¢?, ?,›>,—?+•>*“>)‘?)>->->->-Ž=,Ž=,Ž=,<+Ž=,<+‹<+‹<+‹<+Œ=.>/Ž?0’C2—A2 @2­A5»B9ÃC:Ç@:Å@9»@9³H@¥NGNEoG=R@4?;039-A75A75@64>63<4194083/74/63.43.34/23.13.02-02-02--3/-3/-3/.3/.3/02/02/11/11/32032040/2.-1-,4..5//H4)M5)X8+a<,f>2nGBzYb‚lƒ€uŸ{|´u|Àmu¾bi±[[¡SLLBQAnN?jI=cH>`HB^FCX@BO2K?3DG6EF6KE5PD4VC2^C2e@.m>,v=,|;)ƒ:)Š;*“=.›B2¢F7¦I:¿D<ÂF>ÇG>ÏF>ØE>âC?ì@>ó<>õ9:ó9:ï;<å@<×B;ÆD6´A/¨=)©@-©@-©@-¨?,¨?,¨>.§=-¥>-£>, ?.ž?-š?,—>,“>*‘?*>)>->->-Œ=,Œ=,Œ=,‹<-‹<-‹<-‹<-‰<,‰<,Š=-‹=0‹=0Œ>1‘D2–C1¡A3®B6¼C:ÅA<ÇB=ÃB=»EA³PJ¥XPŽZOqSIVI@BD97A6A83@72?61=60<4194083/63.43.43.34.13.13.02-.3-.3--3/-3/-3/.3/.3/.3/02/02/00.11/22021/0/-/.,2.-3/.?0)C1'K3'T8,Z<2dGCw]hƒsˆ­„„À|ƒËszÈkq¿ed°VSšJC‡N>kK5.>5.>5.>5,B8/B8/C9/E8/G:1I<3J=4K?3EC6FB6IC5NB4TA3\@2b>0h=-q<.w9*}8)…7*Œ:,•=/›B2 D5µE9¸F;ÀG<ÈH=ÒH>ßF@èC?ð@@î:9î:9é=;àA;ÑD:¾E4¬A-¢?(¦A-¦A-¥@.¥@.¦?.¥>-¤?-¤>/¢>.Ÿ@.œ?.˜?-•>+‘?*>)>+>->->-Œ=,Œ=.Š=-Š=-Š=-Š1‹?2‘D2–C1¢B4®B6¼C;ÄC>ÄC>¾D?»PJ²[T¥e\‘f]s_TYUJFNC>KA@70@72>71=6094.83-63,63.43.34.34.13.13..3-.3-.3--3/-3/-3/.3/.3/.3/.3/02/.0-00.22022000.0/-0/-10.8,,;,)B1*K7.S<4^IHtbn‡z–Џ‹Ê‚ˆÒy€ÐrwÈik¸XV¡GD‹I^C@[ABV>DP>EMGQSKWUQ^WU`XS_UR^TT^SV`UaZHaZHaZH,-/,-/------------.-+.-+/.,/.,1-*0,)0,)0,)/+(0+'/+*/+*/+*/+*/+*/+*/+*0,+/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+1-,1-,2.-1-,1-,1-,1-,1-,1-,1-,1-,0,)1-*2.+3/,3/,3/,3/,3/,3/,3/,3/,3/,40-51.62/73081+92,:3-;4.=4/>5.>5.>5.?4.?5,@6-C6.D7.F90G:1H;2F?5H@5J@6N@5R>3W<1\:0a7+k9.t8-|8+…9,;/“=0˜?1›?2¨@3¬B5´D8¾E:ÊG=ÕF>ßD?çB>ë?=íA?çD?ÜE>ÉC8¶C1§B.¡B,¢A.¡@-¢?,¢?,¡=-¡=-¢>. ?.œ<,š=,˜=+•>-“=,=+Ž=*Œ>*‹<+‹<+‹<+‰<,‰<,‰<,‡;-‡;-‰=/†½F@¾C>¾DA»KG·XR¯f]£qfth|rfik^S_SCSHQJBLE=D=5<8/95,74-63,33+43.34.23-13.02--2,,1+,1+-2.-2.-2.-2.-2.-2./1./1.02/02/11/11/11/11/11/11/5*2;/3A32C4/J;6]OOymy‹…Ÿ’‘½”–Ӕ݂‰×tzÈjn¸_b©YZPHmHBdA>]>>X?AVBHVLU^U`bbqnn}xv†|p€ulyoguh_k_T`Ta[Eb\Fc]G,-/,-/,-/,-/---------.-+/.,.-+.-+0,)/+(/+(/+(/+(.*).*).*).*)/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+0,+1-,1-,1-,1-,1-,1-,1-,1-,1-,1-,0,)0,)1-*2.+3/,3/,2.+2.+2.+2.+2.+2.+3/,40-51.62/80-91.:2/;30=4/>50>50=4-?4.?4.?4.B5-C6.E80G:2H;3H>5J=5L=6O>6Q=4V;2Z90_7/h8.p7.y6-‚8-‰9.’;1–<1š>1¢@3¦A5ªB5³E8¾E:ÉF<ÔE=ÜC=âC?ãD@ßF@ÕF>ÄF8±C2£B/›C-ŸB0 A/Ÿ@.ž?-ž?-Ÿ>-ž>.ž>.š=,™=.–=-“=,=+>-Œ=,‹>,Š=+Š=+‰<,‰<,‰<,‡;-‡;-…<-†4†@6‡A7ˆB8‘H7•F7£G:±I@¹HB¹FAºJFµTM²dZªreŸ~op~|mlteYgZJZOPLAKI=EC7@>2=:1:7.44*11)23+23-12,/1,/1,.0+.0+.0-/1./1./1./1./1./1./1./1.02/11/11/11/11/11/11/11/5*:9-9<15?53H?:^VTxszŠˆž‘“º”—Εׄ‹ÓxÆpyºkt¯en¥__yXZsSUjRWjU]j\gmguvr‚v‡€‘‡ƒ•‰}v†yp€sfteXfW_YA`ZBb\D,-/,-/,-/,-/,-/---------.-+.-+.-+-,*/+(.*'.*'.*'.*+.*+.*+.*+-)*-)*-)*-)*/+,/+,/+,/+,/+,/+,/+,/+,.*+.*+/+,/+,/+,0,-0,-0,-0,-0,-0,-1-.1-.1-.1-.1-.0,+0,+1-,2.-2.-2.-2.-1-,1-,1-,1-,1-,2.-3/.40/51080-91.:2/;30=31=31=4/=4/?40?4.?4.A4.C60D7/F91G:2H;5J;6K<7N=6P;6S:5V72[60c60k6.t5,}7/‡9/Ž:0”<0˜<1œ@3ž@4¢@3§A3±C6¼C8ÇD:ÎC<ÖF>ÚG@×HBÍH?¾E:­C3ŸB0™B.B/œA.›@-›>-›>-›>-›>-œ?0˜<-–=-”=,“=.>-Œ=,Š=+Š=+‰<*‰<,‰<,‡;+‡;+…<-„;,ƒ;-„<0‚<0‚<2‚>3ƒ?4…A8†C:‡D;“K<–H; H>­JDµIF´KG´SM¯_V®rg¥qœz{Šwr€ocqbVdWPQCMN@HI;DD8@@4::055+/0(01)01+/0*/0+./*./*//-//-//-//-//-//-//-//-//-//-00.00.00.00.00.00.00.00.6*>6+;8.6;63HE>_^Yyz|Šœ“²’–ÃŽ•Ë„Æ}ˆ¾{‰¸|‹´|Œ°ˆ—yƒq~‡o|‚n}€o‚€yއƒ™‹¡”‘¨˜¦”ˆŠƒ–ƒ|{j{iXiW\V<^X>`Z@-.0-.0-.0-.0-.0-.0......---.-+-,*-,*,+).*'.*'.*',*++)*+)*+)*+)**()*()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+-+,-+,-+,-+,.,-.,-.,-.,-/-./-./-./+*0,+1-,1-,1-,1-,0,+0,+0,+0,+0,+0,+1-,2.-3/.40/91/:20;31<42=31=31=31=31>3/>3/>3/@3-A4.C60D71E82G83H94I:5L:6M:6N94Q83T50^72e60o6/x8/ƒ90Š:/’;1•=1™?4™?4›?2@1¥A2­C5¸D7ÀD:ÉF<ÌG>ÌIAÄH>¶F:©C4B0—B.˜A.˜A.˜?-—>,™>,™=.™=.™=.•<,”<.“=.=-Ž<.Š=-Š=-ˆ<,ˆ;)ˆ;+‡;+‡;+„;,„;,ƒ;-‚:,;/€<1€<1>5ƒ@7ƒC:…E<†F=’M>•I<œH>¨IC¯LG¯PL¯\Tªj^§€o y˜š‚Žœƒ„–€z‹ym{lam_UYHQUDKO@EI:@D6;=057,13(01)/0*/.).-).-).-+/.,0/-/.,/.,/.,/.,/.,/.,/.,/.,0/-0/-0/-0/-0/-0/-0/-0/-8*A6):3-1961HJ=bfX{€y‰‘“Œ“£–²Œ”¸ƒ³±…™²¤¶ªµ•§§¤£Œ ž‡ž–‚™}˜‰œ‹ˆ£”°š–²›”­—‹£‹…›†’~k|iUfSXT7ZV9^Z=+/2+/2-.0-.0-.0-.0-.0...------.-+-,*-,*,+),+),+),*+,*+,*++)*+)**()*()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*++)*+)*+)*,*+-+,-+,.,-.,-/-./-./-./+*0,+0,+0,+0,+0,+/+*.*)/+*/+*/+*/+*0,+1-,3/.40/91/:20;31<42=32=32<20<20=20=2.=2.?1.@2/A4.B5/C60D63C84D95G96G96H94K84N51V72_60h70r7/}:1†<1=2>2˜?7—?5—?5—?3šA3£C5ªD6³E8ºE;¿F=ÀG>»F=°D8¤B5™@0–@/–A-–A-–?,•>+•<,•<,–=-–=/”<.’<-=-Ž<.‹<-‰<,ˆ<,ˆ<,‡;+†:*†:*†:*ƒ:+‚:+‚:,€:.;0€<1€=4?6‚B9ƒD;†G@‡HALA’H?˜HA¤KGªOLªWQªf]¥wh¡Œw˜›€’¥‰Š¤‡„ž…|’}t‚qlte\eRV_LMVCEL0-?1.@2/A30A30?61@72@93A96A96B94E74G51O61W6/a6/j8/u9.€0•>7•>5“?5’@4•B4™C4ŸC4¥D4ªB5²C8´E:±E;©C7 @4˜?1•?2“A,’?-“=,“=,“<+“<+”<.”<.“;-’E5:@29<134,22*1.)/+(/*'0**3*+4+,1++1++1++1++1++1++1++0,+1-,1-,1-,1-,1-,1-,1-,/.,;(;5(23+(56$CL-\hDt„`…”wŽ›‰’ž”Ÿšž–¥—•µ¡Æ¤¦Ð¨¥É¯¦Ê°§Ë¯¢Éª—¿‹³ˆ°‹³ŽŽ²Ž²¬Š„¢€€™{wŽrdx]MaHQQ5QQ5RR6,03,03,03,03./1./1./1./1/////////0/-/.,/.,.-+.-+/-..,-.,--+,,*++)*+)**()+)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)**()*()*())'()'(+)*+)*,*+-+,.,-.,-/-./-./+*/+*/+*/+*/+*.*)-)(,('0,+0,+0,+0,+1-,2.-40/40/:12;23;23<34=32<21<21;10<1/<1/<1/=/,>0->0-?1.@2/;60;62;83<94=:5=:5?82A60F5.O4-W5+b6+n8,x:-<,„<.’:6‘<5=5Ž@4A4‘B3•B2™@0Ÿ?1¦@4ªB7ªB9¥@6?5—=2•?2‘@-’?-‘>,’<+‘;*‘;,“;-“;-‘;,<.;-‹<-‰;.‡;-„;,„;,…9)…9)…9)‚9*‚9*9+~8,}9,=1€=4€@7B9„E>…HCˆKFŠMHŒIAŽGA˜JF¢SOª\X«h`©{n£Žy—Ž©ˆ…¯‹«ˆ~£„€˜€‹w{nixacr[ZhQP]IIUACL;>D60-?1.?1.96/:729839839:4:94;83>71A2+I2*S2)^4(j6)s8*|:*~;+84:5=4Œ@3‹B3A1@/”>-˜<-Ÿ=0¥@4¦A7¢@7œ>4—=4•=3‘@-?,=+<*‘;*‘;,‘;,’<-‘;.<.;-Š;,ˆ:-‡;-„;,„;,…9)…9)‚9(‚9*9*€8*~8,}9,€>2?5€@7‚C<ƒG?†IDˆMGŠOIŒICHD˜MJ¥UT¬a^­ng«s¤•€–¡ƒŠ¬‰‚°‹|«‡|£„™y‚ql{dgv__nWXeQP\HIRAAG9=@579.66.41,1,)1)'2()3)*4*+2)*2)*2)*2)*2)*2)*2)*0**1++1++1++0,+0,+0,+0,+0,+:&27(+4."47=HRb1l~J€’b‰™rŽ|Ÿ‚ŠŸ~Ч{·€˜Æ…œÎ…œÉ¢šÉŸ™Èž”׉¸Š®€‚°‹¶ˆ‚¬~ˆ¯ƒ‡ª€~œvuml„dZnRG[?IL/GJ-DG*/0*/0*/0*01+01+01+21,21,32-63.63.63.52-50,4/+4/+8.,7/,6.+5-+4,*2-*1++0,-0,-.,/--/-,1,+0*+/)*.()./(0/(//(//(//(//)-.)-.*+/+,-,*-,(.-).-)-.(./)./)--/--/---.../-.0/-2.+3.+2-)4,)5.(7.)8/(;0*;1(<2)<5+=4+>5.>5.>5.=4-<3.<1-=2.<1-<1/;0.=/.>0/>0/?11H-&C1';5)2:++=-(=.-;.45-?-+H()R%(X((Z.+Z8.[A2\G6wC-{B.„C1A3’?1•;0–:/”8+“;-‘>.‘B1‘D0‘D0B.?,<*Ÿ63›83”:2Œ<1…@1B0|A/|A/‚C2„A1ˆ>1‰=0‰;/ˆ:.‡9-‡9-v:/|@5u=0n9)s@/s@/t<+{@0{<-ƒ?4ˆD9‹H?ˆLA„NBQC€RC—HK•TRd]…ue{…lw’sz|€£ƒ‰¦ˆŽ¥‰’¤Œ‘¥Œ‡¤ˆy¢‚kŸ{awhŽea†]\zV[sS]mR[cLVTEPH=J;6G53B,/=&,:#+:#-9#/8".#/-#-,$-,&*+))+-(.1'/2'/4'06&14'14'13'32(32(30(3.)-0,-0,)//'=>0WZErx\‹gœs‹žpŒ¢qŒ§r‹¨r‰ªs³{›¾†£¿Ž ¾Œ›¹‡’²€‹­{†ªz„ª{…ª~„§}…¥€€ž|z“vr‰oi{e[jWLZIKO@CG8>B3/0*01+01+01+12,12,21,32-43.63.74/74/63.61-50,50,7/,7/,6.+6.,5-+2-*1++0,+0,-/-./-0--/-,1+*/)*.()-/(//(//(//(//)-/)-.*+.*+/+*-,*.-).-)/.*./)./)./)..0....../-./.,/.,1-*3.+3.*5.(6/)8/(90);0*<2)=3*>5,>5,>5.>5.>5.=4-<3,=2.=2.<1-;0.;0.;0.=/.>0/?10F/'D0)A3*=4+96-85.83-<1-?-+D*)K)(P*'U.)[4-_:1c?3s@+xA-€A0‰?2‘?4”;3”:1“;19.‹<-Š>.ŠA0‹B1B/ŽA/@/š93—:3’;2‹=1„?0‚@0@/?/„A1†>0‰=0‰;/‡;.„:-‚:,‚:,w9.x<1s9-n9)r?.s>.q9*u:,}=1„@5‰E:‹H?‰K@†MB„PCQC›DJ›QR–d]vfƒ‡p}”w~ ƒ¦…ˆ§ˆŽ§Š’¦‹“¥Œ£‰‚Ÿƒwœ}o˜xa•g\`VƒZU}XWyXWpSPbJKVECI;@A998340-0,+/+,.)--(,*,+)+***,+),-(,/)-2(03(03(02(02(10)1/*1-*1,+3,+32-12./0,)--%9:,TWBox[€‹i‡–o†™l†žnˆ£p†¤p„¥pŠ­w“¶€›¹‡˜¶„“³Œ®{†«xƒ§w‚¨yƒ¨|ƒ¦|„¤{x’uqˆnh{eYjWL[HGK<@D5:>/12,12,12,12,23-23-43.43.54/74/85085085083/72.61-80-80-7/,6.,6.,3.+2,,1-,1-./-.0.1..0--/,+0+*/*).1'//(//(//)-/)-/)-.*+.*+0,+0,+/.*/.*/.*0/*/0*/0*/////////0./0/-1-,1-*2-)4/+70*90+:1*<1+=3*>4+?5,?6-?6-@7.@70?6/>5.=4->3/=2.<1-;0.;0.;0.;0.<1/=20C2*E0+H/+L,-N+/M*.J*/E+.A-,@.*@/(C/(M/'Y0*d1-j30i;+o;-w;0=4‰<4Ž;5Ž94:4‹;2‡=2†>2…@1†A2‰A3ŒB5C6‘=2=1Œ>1Š>0†>/…=.…=.†=.ˆ<.‰;.ˆ:-‡9,„;,€;+~=+z=*}=3z<1v:/u;-x@1x@1v<.v;-?3„B6ŠF=‹H?ŠJA‡KA‡NC†PDDHQQšc^’ug‰„n‘t~}€¥ƒ„©‡ˆª‰©Œ“§Œ‘£‰‹ƒ„˜€”{a›k[•eXaV‰`W…`W]QtVMiPC[E=RA6F9/<2*5-&1+%.)$-(1&*1&*1&*1&*1&*1(-2).1+//*0-+0,+0+,0),1(-1&.1&.14.24.0.*'**"66*PUAmv[~‰i€k~“h™jƒŸn€ n~ m€¥q‡¬xŽ®|‹­zˆªw„©v§t€¦u¦w€¥y¤y€¢}}›yw’sp‡mh{eYkUL[HEG:=?28:-23-23-34.34.34.45/54/54/650961961:72:72:51940940:2/91.91.80-7/-4/,4/,3/.3/.3/01/01/00.1..0--/,,.2).2).2).0*.0*,0*,0*,/+*1-,1-*0/+0/+10+10+10+10+11111100010.10.2.+2.+3.*91.92,;2+<3,>4+@6-@6-A7.A8/A8/B90A8/A81@70>5.?4.=2.=2.<1-;0.;0.<1/=20=20?5,E2.O-.W(0]#/\"0W#/L'.C/.:3-55);5)E1(U.'c+*l*+e;/j;1s=3}<6…;8‰;9Š;7ˆ:6‰>9†?9…B9ƒC9…B9†B9‡A9‰@7†B/†B/‡@.‡@.‡>-ˆ<,‰:+‹9+‹8*‹8*ˆ9*…9)€<)z=(w?(t@(ƒ=3{7,x8,z3/>3/=2.=2.=20=20>31>31>7/C41O/2Y*2_%3`#2Y%1N+1B3077-39+68*?5)N1)]-)e+)c;3h<3r=7z=:‚<<†<=‡;;…;:‚;9>8€A:C;‚C<ƒB<…@9„?8E/D/C.ƒ@-†=,‰<,‹9+Œ9+Œ6)Š7)†9)‚;)~=)w?(sA(qB(…6/|/'8/ƒ?4w5)s5*}A6}C7E9G<ƒI>„J?…K@‡LDŠOGŒSJycL~hSoYu]}bˆi„•u‚ |¥~|©€~¬…­†€ª„¥€|ž}{˜yn}ŽlyŒlwŒkwŒmt‰joƒgl~dbqZ[hTSZHIK=B@4=6,8/&5+":&(8%'6&'2&&0(&-)(++)).*'+*&,*&,*'+*'+,)*,**,**,-#$2*(50,85,BC5UZFfpWn}^tˆcqŠbt‘ex˜iw›ks™hs›iwŸmz¢mx lwŸkv¡ly£q{¥u{¥w|£wxžuzœww–tqŽom†hd{_WkPJ^CFB9>:195,560560671671782782872872983<94=:5>;6>;6?:6>95>95?74?74>63=52;62:5294194184184195484373243132021/6-.6-.6-.6-.6-.4..4/,4/,40-40-40-52-32-32-43.43.431431542540841850940:5/=60?6/@7.B8/C9/F90G:1H;2F<3F<3F<3F<3E;2C90B71A60@5/@51>50=4/=4/>42?53?53=82A64I35Q16V.6U-5R/5J22A62::08<.9;-?9)H6*P4)U3)]2+c4.k62t76}77‚89ƒ7978}75{:6|=8{?7@9ƒ@:…@;†?;|E0}D0€C0‚A/…=.‡;-‰:-ˆ9,‡8+…9+‚:+<+{>+x?+uA+tB+‹2,‹2,¡LE§XQŠA8|90‚F;€J>yH:zJ<{M@|NA~NB‚PE‡UJYN_uNgwRtzX€{^Š|b“i›s›—|™zˆ |ƒ¨¬ƒ|¬‚x¨~t£yq vŠpˆo†nƒŽp€p}px‹ms‡kk~bgu\_iQWZGPM0%:,+7,*5+)1,(-,'+.').((/().(+-*,,*/+*3)*6',7&,9&,2)$<3,E>4JF:QR@]bLgqVizXmƒ]j…\j‰]p‘bq•eo•do—eršhu krhq›itžlx¢rz¤vy¢vyŸvvštw™tu”rokj…fc|^UlOJ^BHA9@91;4,671782782782893893983:94:94=:5>;6?<7?<7@;7@;7@;7B:7B:7A96@85=84=84<73<73<74<74<74;74:6395284173080.80.80.80.80.80.61.61.61-52-52-52-63.63.54/54/540540651952:72=84=82@93?80A8/C90D:0E;1H;2I=1I=1H>4H>4H>4G=4F<3D:1B8/A60B71@70@72?61?61@72@72A83=84@85B86D97E:8G96G96E:4C90B90B:/B:-D;,F:*H;*H;*].&b0)n3/x73ƒ98‰;;Š<<‰>;‹A>†A<?6}=4~;3‚;5ˆ=8Œ>:~C3€B3€A2ƒ?2ƒ=1„<0ƒ;/;/;.|=.{=.|>/|>/|>/}>/}>/—.*£;8ÎkfÙ~y­ZTŒC<ˆLAN@tJ:qM=pQ?qR@tSB{VD‚[J‰_OUOe€Uz~[‘y_¥ra³of»rk»xo¶…vªz ›~•£€Œ¦ƒ¦~}¢yyŸvŒr‹rˆ‘r„“r€•t|–sv”ps’pl‹ig„eby\\lQU_GMP;ED0A<)>3-<3,92*41(01).1(+1'+0)/0*2/*6,*:*+@'+D%+G$+H#+A7+LC4WP@[XE`bLgmQiwVj{Wl‚[g‚Wf†WjŽ^n”an”an–bršfržko›hnšiqœnw¡sy¢vxžuu›ts—su—ts’pn‹li„cb{[TmMH`@MD=E<5@707827828938938939:4:94:94;:5>;6?<7@=8@=8A<8A<8A<8A<8A<8A<8@;7?:6>95>95=84>95>95>95>95=84<73:51940:0.:0.:0.91.91.91.91.72.61-61-63.63.63.74/74/74/540651961;83<94?:4@;5B;3A8/B90C9/E;1H<0I=1J>2K=2K>5K>5J=4J=4F<3E;2C90B8/B92B92A81@72@72@93A:4A:4?74>95=<7>?7?@8@@6D@5J=4J70N5.Q6-Q6+O8*M:+I<)H=)l3(r6,~;3‰@:•DA›HDŸJGŸLH QJ—MDD;„;2‚8-…7-Œ91;4…?7…?7†=6…<5ƒ=5€=4|>3y?3vA3uA3uA3y?3}=3ƒ:3‡83Š73Ÿ%$´<;í{zþ•’Åhc–G@‰K@wI:mNfW@jX@r\E}aL„eQj{O{{U™w\´l`Ì^_ÚR\áM[àO^êmuÜxxÎ…~¿€²–€§—}ž•x˜“u•Žr”r‘‘u”u‡–u—s{–sx–rq‘lp‹hiadtW]gLVX@LJ3GB.L40H3.D3,?2*:1(70&40'40'81):/+?-+C++H(+M%-O$-Q#-PE1[P:d^FgfJilOnuTm{Wl~Vk„Zg„Vg‡Vm]p•ap—br™dvhrœlo™km—ip™mwtyŸxw›wt–us•tu”tsqoŠki„cb{[TmMGa>SJCKB;F=69:49:49:49:49:4:;5=<7=<7=<7?<7@=8@=8A>9C>:D?;D?;E@8C>8D=7B;5B;5B;5B;5B;5B;5A:4A:4A83A83A83@72@72>71>71>71<71<71;60:5/85085074/74/761961961:72<71=82A:2B;1C:1E;1F<2J>2K?3L@2N@3N@3M@7M@7L?6K>5I<3F<2E;2E;2B90A81A81?80?80?82@93@93<5/LE?IB:E<5OB:K:2J3+\>6Z5-`5.`4+^/'\0%b8,g@1gB2‹I;G;–I?žLAŸF>›>7š=6žD;¥ND£QE¨VH«YK£PBš@5˜:0ž=4’9;9:Œ67†54„96ƒ@:{@8o?3oC6lB4m?2u:274Œ35’-3–(1ÏEEèbaÅEDÍWUáyv«VO†F<‚WGlS=f\CedFgfHgbEm_DyeL†nVŽdK­p]ÍphÞW]å8Kð(Dü&Hþ+Lþd02b22\31L)'D'#I2,J70F5.E2,E0+H0.I-,I)*O+-V24VK/`W:f_BgdEkoLu}Xu„]oWj„WlˆXnŽ]q“`s•bu˜bušdv›eq–ks˜ms˜oq•os•rw™xz™zy–zx•yqŽrm‡jj„ghƒdazZTnKIc@TKBSJAPG>9:49:49:49:4:;5;<6>=8?>9>=8@=8A>9A>9B?:D?;D?;D?;FA;E@:E@:E@:D?9D?9E>8E>8E>8E>6E>6D=5C<4D;4D;4C:3B92B92B92B92A81A81@91@93>71<71;60;60:5/85.74-74-96196/96/;60<8/>:1A:0C:1C;0E;1G=1J>0L@2M?2NA1NA1N@5N@5M?6J=4I<3H;2E;1E;2C:1B90A81@91@91@91?;2?;2C:3G81I0,V..j68u99{;;†ECƒD?„H@…I?†G>ŽJA›NH£PL¥MK’E3”C2šB4 B6 >36-7+¡<0£C5›@.™@. E3¦F6©E5¯H9¸N@´KR¯GN¥@F™9=‘8:Š?<€A:r@5k?2uK=€NC@:‚,-“(0µ8FÒK\àJIáMMÌ>=Ã>?Ò_\µXQ„@5€UDvbJa]@Z_?ekIonOshJ{fK†kPÌ]VÚ][êSZó7SD=]P.dY9ga?ifCnrMz‚[z‰bt†^r‰]oŠ]oŒ^qŽ^u’bw•cw•cw•cr’mw—rz˜vy–w~˜}ƒ„…‡ƒ›…™ƒz’|q‰ql„jhc`yYTnKJdAWQEVPDUOC8938938939:4;<6<=7?>9@?:@?:B?:C@;C@;C@;D?;D?;D?;FA;FA;FA;E@:E@:G@:G@8F?7IB:HA9H?8G>5F=4E<3E<3D;2D:1D:1D:1C:1D;2D;4D;4C<4?80?80<71;60:5/:5/94.94.96/96/96/;7.<8/@9/A:0C;0E;1F<0I=/K?1M@0M@0NA1M@0N@5M?4L>3K=2I<3H;2E;1D:0C:1C:1A:0A:2?;2@<3@<3A=4SE–I?•MA›OB¬RJÃSRÏNSÒENœE2B0 @0¥?1¦:-¥7*¦8+§=/¬E4¡>+˜7$:%¥>+®@/³B2¹C5§/8±9B¹DL¾KR¸NRªLL“B>}:1u;/q9,s5*2-›47º8@?:A@;BA4G=3F<2E;1D:0D:0E;1E;1D;2E<3E<3E<3@91?80?80<71;60:5/:5/:5/96/96-;7.;7.=9.@9/C;0D<1F<0F=.J>0L?/M@0M@0O?/O?/O>4O>4N=3K=2J<1G:1G:1D:0D;2D;2B;1B;1@<3A=4A>5A>5Q9/X+&‰:?ÅP`ãOeñOfíPcÐGO¢20”:/Ž?.–C3®F=ËFGÞ>Hã2B§H6§F5©B3®@3°?1²>1³B4´D6²G5«B/£<)¤;&©<(­:(¯5&®3$¸7<»8>½7>½6=¿9@?:BA4G=1H<0G;/E;/E;/E;/E;1E;1D<1D;2D;2@9/@91@91?82<71;60;60:5/;7.;7.;7.<8-?8.A;/C;0D4N=3N=3J<1I;0G;/F90D:0D<1D;2B;1@<1A=2A>5B?6C@7_4-t42¯KSâYiðH_ð:Qá2C½#+¬/)š9(;&•=)¬@3ÈA=Ý:?ä0;¨D4¨B3«?2®>2´?5¹C7½G;»J<¬>/ª?-¨=+¨:)ª9'²:*¹;-¼ÃLDËTLÑTNÙKJÝ>Cã3>è.<Ù5+Û7.Ò0+Ò94Á82µ@9µ[P”UDxO9~dI„lPbF]F®eTÍqdÛsjübÿ?eÿAiÿBkÿBmÿAmÿ@oÿ@oÿ@qÿAqÿBnÿ=hÿEmÿJpöGhíMièZrÛbs½YcŒ@D]($M-"PC2PR=CO76H.WH1eYCujT€{gŽy˜œ‹”Œ‡”ƒ~‰—ˆŽœŒ™ˆ‡’‚Š“‚—žŽ¤¨—²¶§¸¼®¿Á¶ÀÁ¹ÂþÅÅÃÃÃþ¾¾²´³¢©¢—Žy‡vh{e\sWTmONiHTYBUZCW\E560560671782893:;5=<7>=8@?:B?:C@;DAGB>GD=GD=HC=ID>IE0I=/G>/G>/F<0F<0E;/E;1D<1C:1B90A:2@91@91?82<71;60;60;7.;7.;7,<8-?8.A;/D0K?/M@0NA0P@0O?/O@-P>2N>1M<2L;1I;0H:/F90C9/C;0B<0B;1@<1A=2A?3B@4C@7t50–FEÆY_ßUbã@Qä5FÚ0;À*+¯1%Ÿ9#•;!”: ¡=&·=.Æ90Ê2- :,¢:-¥9-¨6,°91¸A9»E;·E:­?2«@0§<,¤6'ª6)·=0ÄD9ÊG=¾9*Î@4áD=ïA@öDâ<@×?>ÎC>ÍJB×RMåZWéPRìELï;Gõ6F÷2Dø/Bû1Gÿ6Lø:Tø:Tø:Tû:Wþ=\ÿ?aÿBeÿDiûhú?júAm÷@nõ?oò>mï=mÿFnÿ:aÿ>dÿInÿJløMmòSoæXnëp‚Å_j˜ILt:6\6-O9+OD2SN:`PArdWˆ|p”Ž‚Ÿœ“¦§¡¡¦ ”˜”Ÿ›¨¤¦¯¬¦¬ª¤¦¥§§¥µ´°ÄÀ½ÍÉÀÒÍÇÕÐÌ×ÏÍÖÍÐ×ÎÓÑÊÑËÆÌ¿½À°²±˜Ÿ˜€Œ€m~k^u[VoQSlNU_DV`EWaF560560560560671893:94;:5=<7@=8A>9C@;DAHC?HC?GD=HE>ID>ID>JF=LE=MF2G=1F<0D<1D<1C:1B;1A:2@91?82?82<71<71<8/<8-<8->7-@:.B:/D2B@4@@4+)¨JKÁSV¾=BÀ/6Ç.3Ä./»0)ª1 £9!›=!–=˜= ¡=#¥;#¦6"6- 8/¢5.¦3,®71·@:¹B<²@6±B7­A5¨7È`UÑq¤eSŽWC‡N:¡XGÊe[ãa_ëPTëBIùDKí@DÞ@?ÑB<ÅB8ÁB9ÌIAßPLìKPô@Kù9Hý7Hþ5Hø3Eö7G÷=K÷9R÷9Rø7Rú7Uý7Xÿ9]ÿHC?ID@HE>HE>ID>JE?JF=MF>MF2G=1E=2D<1C:1C:1A:2A:2@93?82<71<71<8-<8-<8-?8.@:.B:/D2??3@@4”67Á]_ÈZ[¯78®,,µ/,±,#°0#¯8$®B(©G* G'šF$šF$–C!”? Ÿ81£;2¦92¨50°:6¹B>¹D=±>7«<3¨<2¦»72»:Ê<$á:*ñ.(ÿ$&ÿ'ÿ'ÿ%ÿ%(ù,)ñ2*ë5*è3(è2'ê/&ì-%Ü=(Ñ2Þ>0Ñ5)Ê7/Â?7¯C9Çqd²m]–YF™VE¿i\ÝlfãSSë@Hù?Lï4¹6,½4.Î44ïBHø8Gÿ2Fÿ3Hÿ5Iú7GöYÿ=Xÿ:Wÿ6Wÿ5Yÿ5\ÿ6_ÿ7eÿ;kÿ:mÿ;oÿtû>vôEbýNkÿTqúIfð?\ÿRqÿfƒÿf€ô^wêbváky×s{Ärvªfe”ZV‰TN’€~¨™–¾°°Ä»¼ÆÁÅÈÇÍÅÈÑÀÄÏÆÌØÈËÚËÍÜÓÐáÚÖåäÜëêßïîáòòäãõççöçêóâèñàêïßêìÜéå×äÓÉÒþά©—y‡vi|f`w[\uWbqRapQ`oP201312423653875984984983;:5<<4==5??5AA7CC9EE9EE9HH@HH>HH3B90E<5C:5@85?74@86?67>56:44F85E76B87@78>:;<:=<<>==????A@,§B0©D2©D0©B/¨?,«>*­<*µ=-¾C4ÅF7À>0·3&Í6+Ì8,Ì:-Ì=/Ï=.Ô(Þ9%Ô4Ï4 Î9%Å8&¾6&Æ@4ÕQEÒIAÜMIïUUüVXýJPø9Aü4?ÿ9DäCHßCFÓAAÆ?;¹=3®=/ª?/ª@0¿Q@ÉQCÑLCØC=å??÷@Eÿ>Gÿ8CúGMúENûEQþESüARú=Sü>XÿCbÿGiÿBhùHH7H?8F=6C:5C<6A:4?74?74@85>95=84;63>3/=4/>42<74=98<;9=<:>=;@?;C@9G@6J@4L@0O@-P?+P>(=B,?A,E=0H92K63J46F35A57>=;8=69?5?A4C=-J9)^B4sRC¼K=¬;- 2#¡6&£:'8$ž9%£?(¡;%¦=(­@,³@-¶=,·9*¸6(¹5(¦;+¤:*£9)¥;+¦?.©B/«B/«@.­?.«:(±<+¿E6ÆH9Á?1¼8+½7+Ï5+Ï7,Î:.Ï;/Ó=/×;/ß8/ç4/ð0-õ--÷-+ò/+ê4)ß8(Ö;'Ï=&á:'Ù7"×8%Ô=*Ì;*Á5&Ã;/ÍG<ÐG?ÙJFèPOóPQôGKò;@÷:Aÿ?GàDGÜDCÓB?Å>8·;1¬;-ª<-©>.µF5ÅM?ÓNEÜGCã?@ñ>Bý>Fÿ>H÷DJ÷CLúDPÿFTýBSú=Sü>XÿBaÿFhÿCiü?iù@lùBpûGvüJzþL|ÿIxÿHtõKpðRsò]zö`{ùXwýMqÿCkÿAlóCjÝJgÉ^p®pugNI†‚v´”‡Ì²¥äÔÇëäÜèéäéêîéçòíáõöâûýàüÿâýÿçþÿìÿÿòþÿ÷üþúûþûöýúõü÷ôúôôøïðôëîñèëïæëäÞâÜÖØÊÆÅ²²°ž ›Ž“Œˆ…ˆ…–†‰€†}/.,0/-10.21/43/540762761:94::2<<4>>4@@6BB8CC9DD8IF=IG;JH;KJ8MJ7NL7NL7OL9KI:NKBTSQ_^dihxmm…lkŠihˆcYd[QZQGPJ@IH>FG>CC=A@::1>:1=90:3-94.;60=82=:3>;4?<5?<3C?4F@4I?3L@2O?0P?-Q>-P>*3@&7?'<=+A;-B8/A62>42;31=85B:7H94O2.[+)o-.Š:= EJª9+¢2$Ÿ1"¤9'¥<)ž7$8$¢<&¤;&¨=)±A-¶A/¹>.»<-¾:-À:.®>0¬<.©9+¨:+ª<+¬>-­>-¬=,²?-®9(¸>/ÊL=ÊH:¼6*º2&Å;0Ó5*Ô6+Ò8,Ô:.×;/Û9.â7/é2,ñ/-õ.+õ.+ñ0)ç2'Ý6&Ó8$Ì:#à7$Ü5#Û8'Û>-Ó=.Æ7)Å8.ËA7Ç<5Ì?8ÙEAåKIìIJëCCí?Að@CÜDC×C?ÏB;Â=4¶:.­9*ª;*«<+ª9)¿E8ÔNEÝIEâ?@ëXÿ@_ÿDfÿCiþDmÿFpÿIwÿK{ÿL|ýK{ÿCvÿGwÿJtúNtþZ|ÿa€ýUvòCdüHkÿRvÞ=\ÎH`Úz†µ}~\F;„r³‹Õ³§óÛÑúíåøóðøøú÷ôýôëüüêÿÿéÿÿëÿÿíÿÿòÿÿ÷ÿÿûÿÿýþÿþúÿýùÿûøÿøöþõöýòöûðôúïóðçêåßáÓÏξ½¹­®¨¢¥œ£™£—¤ªœŸ¥—œ¢”/.,/.,0/-10,21-32.54/650872991;;3==3??5AA7BB8CC9IE<0?=1@<0?<-A;+F?/H?.K?/M@/O?/P?/Q>/P=.<@)=?*?>,?<-?;0=:3;:5:94<94D95N43[*-o&--8¨3C¶7H§7)¥7&§9(ª?-¨?, 9&Ÿ9#¤;&¥:&«<)³>,¹@/½>/Â<0Å=/Ç=0¹@5¶=2²:,®8*¯9+°:,²:,²:*¶;,¹;-ÄB4ËE9Ç?3¾1'À2(Ê:1Ú3+Ø4*Ù7,Ú8-Ü8.ß7,æ3,ì1,ó0,õ.+õ.)ï0(æ1&Ú4$Ñ6 Ê8Ü/Ú0Ú4$Ý;,ØVßetû §Í‘]=2aP@©wlÑ¥œöÔËþêãÿôòÿþÿÿüÿùóÿüïÿÿïÿÿðÿÿòÿÿôÿÿ÷þÿûýÿüûÿýùÿüøÿúøÿù÷ÿö÷ÿôøÿôøþó÷öëïìãäÚÔÔÉź¹´³´¬±´©²µª¶¾³°¸­¬´©10,10,0/+0/+10,21,43.54/77/880991;;1==3??5AA7BB8KD:LF:OG:QJ:RK9SL9RM:QK=OKBVTUfdowx††¨»“ÃŽ‘ÆŠÀ‡‚¸{w©rlœid_[~UPnNJaJGXEBM?=B;7696196-86*86)581692891;;/><-?<+C<)D<'I>*J?+L?,M@/M@0M?2M?4L>3M?4K?3F<2B90=909:25<44>57<5>:1H3.\0/{48œ;D¯9E²2Aª<+ª<+«@.¬A/©@-¥<'¥<'©>*§8%­:'µ<+¼=.Á;/Å;.Ê<0Ì<1ÁA6¾>3º:/·7,·7,¸8+¸8+º8+»7+ÇA5ÍC8Å8.Á1&Æ3)Ë7-Í6-à2+ß3)á5+â6,ã5,ç4-ê2*ð/*ö/,ø.*ô/)ì0'ã1#Ù4!Î6É7Ú/Ù/Ù2"Ù5)Ù9-Ô:0Ö?6ØE=ÕF>Í@9Ç<5Ë@9ÖKDÙNGÐF<Å;1Å=1Ä<0ÀCí>EóBJûJTÿJYýFXúCYýB]ù@_ûBdþFjÿJsÿOxÿOzÿLyýIxÿGwÿRÿQ}ÿIqûImÿStÿVtøNiëD^äF]èYkÿ—¢ÿ¶¼î žˆKFd2)©jcÍ–ôÇÁÿãÞÿòðÿüýÿýÿú÷ÿý÷ÿÿöÿÿöÿÿøÿÿùÿÿüÿÿýýÿýúÿüøÿûøÿúøÿø÷ÿ÷øÿõ÷ÿôøÿôøýñóóéêäÜÚÖÑÍÍÊÃÉÉ¿É˾ËÍÀÇÑȾȿ·Á¸84163.52-30+30+41,52-63,85.96/:70<90>;2@=4B?6B?6KC8ME:PF:SJ9TK:UL;SL<=;:6;8396/267465672880<:-A<)D>(G?(I?&J?)IA,JA0IA4IA6HA9G@:R9?ž46§<*¨=+ª?-ª?-©>,©>*¬?+¯@-«8%²9(¹:+¿:+Ã9,É9.Î:0Ò;2É>7Æ;4Ã81Â8.Â8.Ã9/Â8.Ã6,Ä7-ÑC9Ò?5Ä0&Ã,#Ð7/Ö<4Î4,æ1*æ1*ç2)è3*ê3+í2+ð/*ó.(ø.*÷-)ò/)ì2&ã3$Ø5"Ï7 Ì7Ü5#Ù3#Ø2$Ö2&Õ5)Õ7,Õ;3Ö?8ìYRáRJÓHAÊD;ÉF<ÊJ?ÅG;½?3¼;(¼;(º;*¹:)·:(¸:+¼>0¿A3ÁA6Á<5Å<6ÏA?×EEÝGIãJMèMQëADì?EðCIúJTþN[üJZüF\üF]øA]ùBaýEiÿJpÿNwÿOzÿMxÿKxÿR{ÿR{þOvýOtÿVwÿ]{ÿSoîD^øUjîQd÷dtÿ’žÿ‹“òƒ‰Ç`c­KL²keÏŽˆñ¼¶ÿÞÙÿðìÿúúÿüþýûÿüûÿþûÿÿûÿÿûÿÿüÿÿûýÿûûÿûøÿûøÿüùÿûùÿûúÿøúÿöøÿòõÿðóûìïòææçÝÛߨÒÛ×ÎÝÛÏàÞÑàáÓÚãÞÏØÓÅÎÉ<94;8385052-41*41*52+63,74-85.96/;8/=:1?<3A>5B?6KA7MC7RF8UI9WK;WK;UL=SJASJK[Xcnl‚‚‚¨‘”Çš Þž§ì¡©ò¡¤óž í™›æ•˜ß”•Ö̈‰¿‚ƒ±zz rq‘fd|XWiPN\IGRFCJDBG=?K==G;:?;:8<92A;-D=*F@*F@(GA)GB.ED2CC7BC=AC@>BAG9HH,©>,ª?+­@,¯@-°?-°=*±8'¶8)½9*Ã9,È8-Ì8.Ò91Õ;3Î;4Í:3Ë81Ë81Ì92Í:2Ì70Ë6/Ó<3Õ>5Ò91Ì2*Ð3*Ù;2Ú<3Ó5,è0(é1)ì1*î1+ñ0+ò/)ô-(ö,(÷-)õ.)ñ0)ê2(â5%Ù6#Ò7!Í8 Õ8%Õ8%Õ5%Ñ4%Ò4(Ô6+Ô7.Ð7/ãNGèXPçZQØRIËH>ÃE9¼B5·?1¹<&¹<&¹<(¸;'¸9(º;*À>0Ä@4ÉD;Æ?9É@:ÑFCÕIHÖHG×IHÛJMìCFêADíDIöKSüQZýN]ûL]üJ`öD^÷DaùFfýIlÿNuÿOxÿOxÿNyðYzðWvóVuüYxÿ]{ÿZuûQkòI`ýWköUgêN\ö^kâKZçSaçSaåQ_¸jfÉ‚~窧ÿÓÑÿëèÿôòÿøùÿÿÿùýÿùüÿûüÿüüþüúûýùøüøõü÷ôÿú÷ÿûøÿüúÿûúÿøøÿòõýîñúëîðââëÝÝäÙÕâÙÒæßÕëçÛñîßóñâêóðÜåâÏØÕ@=6=:3:7074-52+52+52+63,74-74-96/;8/=:1?<3@=4A>5M@7OC7RF8WJ:XK:YL-C@-CB.BC3AE7>E=€UE’YFL7A+“A+«@,®A-®A-®A-°A.²A/²=+°7&µ7(¼8)Â8+È8-Í6-Ñ7/Õ8/Ù;2Ò73Ñ61Ñ61Ò72Ô94Ô94Õ81Ó6/ÞA:Ö8/Ñ3*Ø7/Þ=5Þ=5Û8/Ù6-ë0'ì0'ï0(ò/)õ.)ø-)ø+(ø+(ø-)ô/)ð1)é4)á5'Ù8&Ó8$Ï8#Í8$Î9%Î7$Ï6&Ð7)Ô8,Ó7+Î4*Ì3+ãNGôd\ë`YÔOFÂB9¸<2´:/·?&¸>&·=&¸;%º9&½9*Á;/Ä>3ÌC9ÊA9ÎE?ÕKHÓLIÎGDÌFEÐJIéFGæCDéDHòMSùRZùR\ùN^úOaõG^õGbøGdûIiÿNrÿRvÿRyÿRyå[uë\xõ`}ü_|øUpõMgùPgÿYnÿ[mÿbsóL]úSdøM_ÿRgüI_ýE]³d`¾tqÚš˜ûÈÅÿåãÿîëÿõôÿÿÿûÿÿùÿÿùÿÿúÿÿüþýýüúýùöýøõÿøõÿùöÿúøÿúùÿööþððøêêõåæìÜÝèÚÙæØÕèÞÕðèÝùóåþûêÿþíòûúâëêÔÝÜA>5@=4?<3=:1;8/96-74+63*52)52)63*74-:70=:3@=6B?8J@6OC7RF8VI9WJ9XK;ZL?[NHTIMXR`gd|}©’Ì—Ÿçž©ù¤°ÿª³ÿª³ÿ¬³ÿ«³þª±ùª®õ¨«î§«êŸ¡Ü™šÒÁ±ur¡he’]Z…XR~YP{YQxVOpOG_E?M?:@?;8@@6>>2@B5@F:>E=:C>9CB*®?,±@.³@.´?-¶=,¹;,º6'¿5(Ä6*Ë7-Ñ7-Ö8/Ú91Û81×84Ø95Ù:6Ú85Ø61Ø61Û83Ý:3æC<à=6Ú70ã@7þ[Rÿlcÿ]Tã@7é1'î2)ò1*ô/)õ*&÷'%ø(&ú*(ø-)ó0*í2)ã1%Ú0#Ó1"Ò5$Õ:(É=&É=&Ë=)Ï<*Ñ;,Ò9+Ô8,Ó6-Ú@8Ð71ÜGAôc^ãXQÉB<Å@9·3.´<#¶<$¹<&º<&½:(¿:)Ä<.Ç=2È>4ÌC;ÙPJßXTÓOJÁ@;¿@:ÊKEäFEäFEèJKïPTòQWïNVïKVñL\ùRdøOf÷Ke÷JfüMnÿRsÿRvÿPtê[wêZuðZuú[wÿ]xÿZsÿWnÿViÿctþVgÿ\mÿYlõDXùBXÿMeÿIb·nh­hcËŽ‹èµ²ùÑÏÿêéýïîúù÷øþüøÿÿøÿÿøÿþúþýþþüÿûøþöôþùõÿû÷ÿùöÿöôÿööÿõõöèèçרäÔÔÞÐÍãÖÐñçÝüôçÿøèÿüéÿÿí÷ÿÿèñðØáàC?4B>3A=2?;0=90;7.:6-95,73*73*73*83-:5/=82@;5B=7I?5LB6QE7UH8VI8YI9YK>ZMEUKLXP_ebyz¦‰É”œäš§ö ¯ÿ«´ÿ¬µÿ­·ÿ¯·ÿ¯·ÿ¯¶ü¯³ú¯²÷§ªí¢£ä˜˜ØŒŠÉ€~½uq®ie¢b^›cVŽbU‹]TƒWOtNHdFCTBAIAAA;=8@C9ß<7ß<7â=9æA=èC=éB<èA;ç@:èA9ä@7Ü8/Õ1'Ø6+ëI>þ\Qô?4î6,ê+#î)#ù,)ÿ./þ,-ø((ú0.õ4/ï7/ç6,Ü4)Ö2&Ó3%Ò5&Å='Ç<'É<(Ì;(Í:(Ï7)Ï6(Ð4(Õ8/Ï5-Õ<6åPJçSOÛLHÏA?º/,¹=%º>&»='½<'¾9(À8(Ã9,Ä:/È>4ËB:ÕOFÜWPÒQKÃD=¿B<ÆKDáIFáIFåMLëSRíTVëPVéNVìOZ÷VføUhùSiúRküRmÿSqÿStÿRsïNoøTvÿ\|ÿ^{ÿ[vÿUoýQgûReüUføQbÿZhÿZjôM^úRcÿWiôI\§ha™\W·€{Ù©¥ïÇÅýáÞùêçýøõøýùøÿÿ÷ÿÿöÿýùÿýÿÿýÿûûÿö÷üùòþùõþùõþöóÿ÷õÿõõøêéêÜÛäÖÓÝÐÊáÔÌïåÙüõåÿùçÿýéÿÿì÷ÿýèñîÙâßEA5EA6C?4A=2?;0=9.<8-;7.84+84+73*83-:5/=82?:4A<6G>5JB7ND8RF6TG6WG7YI:YKBWKKXP[b^wsuž…ŠÂ™Þ—¤ó¬ÿª´û¬¶ý®¸ÿ±¹ÿ²ºÿ´»ÿ³ºÿµ¹ÿ¯²ùª­ô££ë™—àŽŒÕ‚€Éxt¾qm·l`¢i]dY“^V‡VQyNKhEDV@@J76;?=>HBBKABN?BYFJmX_}fnt¤}¬§‚®¬}§´w ¾p—Âc…ÃRpÅE^ÔI\×EPÊ9<¾3,»7(¸;%³; ¯<*¯<*°;)³;*·<,»<-À<-Ä<.Ä6*Ë8.Ô<1Û>5á@8á>7à<3á:2Ü73Ù40Ø3/à93èA;ìE?êA<å<5ã<4Û4,Ø4*Û7-Ô2'Ì, Ö6*èH<÷I>ò@6ï4-ð-)÷+*ý+,ý+,ø*,ñ))ì/+è3,â5.Ü4+Ö2(Ô2'Ô2'Ç:&È;'Ê<(Î;)Ñ;*Ò:,Ô8+Ô8,Ñ4+Ø;4Õ:5Õ<7çONîXYÙEEÅ02¾=(¿<(¿<(¿:'Á9)À8*Á7*Á7,Æ>2ÇA6ÏJAØUKÑRIÄH>¿E:ÃH@ÚIDÙHCÝLGäSPåSSâPQâMQåNWòXdöZhý[pþZrýUoûQlýPnÿRpÿFmÿOvÿZ}ÿ[{ÿVqÿSkÿVkÿ[mûYhúYhü`mö`kî\fñenífmÚT[’cY}ND™lfØ’ß¹¶ñÓÑôàßþöôøú÷÷ÿý÷ÿÿöÿýùÿýÿþÿÿýÿÿ÷ûúúòüùôüùôýøôÿùöÿøöùîìñãâçÙÖÝÐÈÜÒÈîäØýöäÿûèÿýçÿÿè÷ýùêðìÝãßIE9HD8FB6D@4B>2@<1?;0>:/:6-95,95,94.:5/<71>93@;5E>6HA7LD7QE5RE4UF3WG7WIC_@EmDJ€OU•]f¦jrÇe˜ÍkœÏl›Ïf‘Í]…ÎTyÌFgË8UÌ0Hß>PäBMÔ:<Æ7/Ã@.ºB*®/Û?0Ü@3Ü@3Ò6*èKBåJEÎ50àFFóZ\áHKØ?BÆ=-Ä;+Ã:*Ã:*Ã:*Ã9,Á9+À8,Â<0Â>2ÈF9ÏOBÎPDÄH<¿C7¾D7ÑF?ÑF?ÕJCÛPKÝROÙMLÚKMÜKPëX`ó[hüaqÿauûWoõOgõMgúPkÿJuÿOyÿSwÿRqÿSmþ[pÿcuÿixÿguüaoôbmìelàglÔjjÉjh¼c_dVeH:_Tª‡Í«©åÇÇïÚÙÿóóùøöøþü÷ÿÿ÷ÿÿûÿÿÿþÿÿüÿÿ÷þûüôúûóûúõþûöÿýùÿûøþôòøíéêßÙÞÔËÝÓÇíæÖÿøåÿþèÿÿæÿÿçõúóêïèáæßLI:KH9JG8HD8FB6D@4B>3A=2=9.<8/;7.;60;60<71>93?:4B?8EA8JD8NE4PE1TE0VG4XH9ZMEVMR[Whkl‹~‚²‰“Ð’Ÿå™§ò§­÷©¯ù«±û­³ý°´þ°´þ°´þ¯³ý«®û¨«ø¥§ô ¢ïšœé“•⊌ل†Ó…É{u½mj­dd _a”X[†QQsNHbUFY_CRlBLEO˜LV¬U]¼[dÅ]fçJuéNxæPuàLn×FcÒ?YÍ5JÊ+?Ú5EçAMéFKÙ><Í>6ÊH8¿J6°B)·>-¸=-º<-½>/Ã?2ÊB4ÐD7ÕE:ÙE9ÚB7Û>5Û:2Ù6-Ù5,Ú3+Ù2*Ô1*×4-Û60Ý90ß80Þ7/Ý6.Ü5,Ö/&Ù5+Ø6)Ï2#Í1"Ò9)Õ>-Ó<+Ö=-æD7÷KAÿD?û56÷)-÷)-ù.2ø67í55â30Ú1,×/,×/,Ù0-Û/-ã80â:1â:1â<0à<0ß=0Ü?0Ú>1Ñ7+ïWLù`XÓ;6Ó;:èOQÞEHèOTÍ=2Ê:/Æ8,Æ8,Æ:-Å;.Ã;-À:.¾:-¾<.ÁB3ÇH9ÇI:ÂD6¾@2¼>0ÊE<ÊE<ÎI@ÕPI×RMÔNKÓKK×LOçZ`ð^hüfrÿhxü]qóOgóMeùQjÿPzÿQxÿQpûSmø\qûhxûjw÷epüfró_kí_kêkrÝsu¿lh¦f\¡l^ujXVI8kXJ–{t¾ŸœßÁÁïÕØþîïûõõúüûúÿÿùÿÿýþÿÿýÿÿûÿÿ÷ÿýÿ÷ûþõûüöÿþùÿÿúÿþúÿûõÿ÷òñèáäÜÑáÙÌðé×ÿúæÿÿæÿÿãÿÿäöùðíðççêáQK=PJ3Õ;1Ö8/Õ4*Ö3*Ø4+Û4,Ü5-Ú9/Ý<2à=4ß<3Ý90Ü5-Ü5,Ý6-Ò.$Ý;.Ü<.Í1"Å.Í8$Ð=)Ì;&Ë:'Ò9+á:1ó=9ÿ@@ÿ;?ÿ27ô+1ê,.ß+,×+)Ó+(×/.Þ44ä88è:;ó55ò64î73é6/ã7-Ý5*×5(Ñ5&Í5'çPEÿmcÛHAÈ42×CCÓ>BêUYÙB;Ô=6Ì70Æ6-Ç9/Æ<1Ã=1Á=.»9)»<+½@.¿B0¿B0¾?.¼=,»<+ÃC8ÄD9ÈH=ÏPGÒSLÐOIÐOJÔOPç_cîaiûitÿm|ÿdu÷UjõRgýWoÿSxÿUtûWpð_pñoyôy~êmsÞXaïamò`mïaoðs{숊ɂ|¥wjšyhhpYMO:^WGƒqg±•’Ý¿¿ñÔØýéëþôõýûþûÿÿúþÿýþÿÿýÿÿûÿÿöÿüÿøùÿõúýôÿÿúÿÿúÿÿúÿý÷ÿþöùðçíåÚéâÒôïÜÿûåÿþåÿÿãÿÿâøúíòôçîðãSM=RL4D=5B;3A:4@93A:4A96B:7@A;CC;IE:NG7QF2RF.UF/WH5XJ=RHFXR\jh€}§‹’Æ’žÚ–¤å¥¦ù¦§ú©ªý«¬þ¬­ÿ­®þ¬­ý«®û¨¬ö¦ªó¤¨ñ£§î¡¨î §ë¤è›¢æ™žâ’šÛŠ”Ò…Ê‚ŽÂ‚‰·‚©‡yšŽmˆšczªWi¾P]ÓKWäGPí?Hñ9Aî;6é<5âB6ÙH7ÎJ5ÅG1ÂD.Å@/ãUGàG?Ú;7Ø64Ø88Ö:;Ï98Ê66¼=.¾<.¿;.À;,Â8+Ä6*Æ3)È1&Í5*Ð3*Ñ3(Õ2)×3*Ù5,Ý6.Þ7/Ü>3Ý<2Ü;1Û8/Û7.Ú6,Ø4*×3)Õ3&Ó3%Ñ4%Ï6&Ò=)Ñ>*Ê9$À2Æ;(È5%Ó3'ç60ü;<ÿ=@ÿ7=ù27ê-1à..×--Õ0.Ü44ã9:é;=ë;>ý.4ú/3ö01î1/æ1*Þ2(Õ1%Ï3$È2#Ð>/új_ãTLÈ95Ð@@Ë:=ãRUçJEÝB=Ò93Ê5.Æ8.Å;0Â<0¿=-¹<*¼?-½@.¼?-º;(º;(½<)¾=*º>2º>2ÀD8ÈLBÌPFÊNFÌMGÐNLçbcêbføhqÿo{ÿhxøYm÷Ujþ[pÿXsü\tìbqãktç€í‰‡ãyyØ_dñhrÿl|öcsíkwø‘•餟À–Š¥‹z\pWFRRLÿ4:èB*âD)ÙH)ÎN+ÃO(¹L%¶H%»D&ÛWBÚF8Ú;5æ>>íBHé>Fß5>×08ÈF8ÇE7ÈD7ÉA3Ç=0Æ8,Æ3)Ç0%Ê0&Î1(Ó2(Ö3*Ù5,Ù5,Û4,Û4,áC8Û=2Ø7-Ø7-Ü:/Ý9/Ù5+Õ1'Ù7*Ð0"Ì0!Ð9&Ì9%Æ5 Ç9#ÑE.Á:&É:)Õ7+â3.í//÷05þ5;ÿ;BÿIMúGJîDDæ@@ä>>ã9:ã28á.4þ'/û(/ø*.ó-.ë0+ã2*Û5)Ô7(Æ0!¾/óeYê]TÌA<ÓEDÊ;=ÝNRïPMäFCÕ:6Ê5/Æ8.Ä:/À,¼A/½B0º=)·8%º9&¾;)Á>,²8+²8+¸>1ÁG<ÅK@ÄIAÆICÊJGå`aæ^bñdlÿlxÿix÷ZköTiýZoú^tòcuãgqØqrÝ…é”ꋇåruùq{ÿxˆõ`sßXgóŠ‘ý¶´Ö«¢¬•…TnSAS;PTCkaWž†‚Ý¿ÁõÖÛøßåÿóùÿûÿÿþÿüýÿýüÿÿüÿÿúÿÿôÿùÿø÷ÿôöüòüÿøýþøüüôÿýöÿÿöÿþôûõç÷ñáüúåÿþåþýáýþßÿÿãÿÿñýþîüýíXO@XO@WN?VM>TKñ8>æ=@ÙD@ÑHBå;Dà;BÞCGÉ99ÌB@ËD@½/-ÞHIëHKîAGï;Dì8Aé:?â<>Ú<;Ô<9ÏA=É>9ÊC=ÑLCËK@¼>2³7+¹;-¹9,¾8-Å7-Ê3,Ï0,Ô/-Ý11á34çA1à9)Ü1 á1"é8(ê;*ã6%×2Ñ2Ì4Ê5Ç4 É3"Ì3%Ñ3(Ô3)Í.(Ï2+Î6+Ì8*Ë8(Í7&Ð7%Ø6'ß3'é2,ð31ò01ð+2í*2í+4ï-6ú+1÷*/ñ+,î.-ë4.ä8,Ú7(Ð5#Ã.Ä3 çXHèZLÊ<2ÞOGÄ5/ÚIFÝQRÚLKÒDBË<8È80Ç7,È9+Ê;+È;)Å:'À9%½:&»<)º=+¸=+¶=,³9.µ;.¹=1½?1½?1¿@1Â@2ÅA4ïk_õqeêd[ômiùroécbðjiútuÿk|ûivñdmï_hòaføgjõnkîqk÷|wÿ}ƒþYjÿ[wîZpû¬±«°œaŸz]sMIZ6LR6snX£–†Ë·®íÕÓÿîðÿõ÷ÿ÷ûþøüüüþþÿÿþÿÿþÿÿýþÿæÿòàÿëâýêìÿð÷ÿôûÿôþÿóÿþñÿýïÿûîÿùèÿùæÿøãÿùãÿùáþúáýÿþþÿÿþÿÿYPAXO@XO@VM>UL=TKDë:Bè7?ä7;Ü89Õ:8Ð;7ÓF?Ç<5Å<4ÌG>ÌLAÁC7¶;,·9+¹7*½7+Å7-Ë4-Ñ2.Ø3/á53æ66á?0ß<-Þ6)à4&á6%á6%Û4"Ó4Ð:"Ê:"Æ:#Æ;&É<*Í;,Ì8,Ì5*Ö3.Ö5-Ñ7-Î8*É6&Ç4"Ë4!Ð3"Ø2$ß1(å/+ç.,è,-æ,1æ-3ç.4î*,î,-í0.é2.á3*Û5'×7'Ò9'Ó@,»*ÔE5Î?1ÙF>êWPØC?ØBAåWVâRRÛKJÔC>Í=5É9.È9+Ç8(È;)Ä;(Á:'¾;'½>+º?-¹@/¶>-²9.µ;0·=0¹=1º?0½?1ÁB3ÅC6ëi\òmdçb[ðkfõolèbañklûuvÿp€ÿo|öirë^fêY^òadøqnù|vöyuÿx~ùRdÿUríXnö¥«¥¨“X”n[tLN_;QZ;us\ª×úøàÜÿôóÿúûÿúûÿûüüüþúþÿûÿÿúþÿûüþçÿñáÿêáýçéÿìóÿòøÿóýÿòÿÿóÿýïÿýíÿúëÿöåûóàúòÝûõßý÷ßúúøüüúÿÿýZQBYPAYPAWN?VM>UL=TKCß>Câ;CØ7=Õ?AÏA@ÉD?Â=8Ã96ëWWàBCæ=Bé:Aæ7<Þ58Ö66Ñ96Ì;6ÕHAÅ:3¾5+ÅA5ËK>ÆH:»=/¶8)¹7)¿7+Æ8,Î7.Õ60Þ63æ87ë;;Ó5)Ö6*Ú6*Ü6*Ý5(Ý7)Ú:*Ö?,Ã5¼5¸6 ¸7"»9)¼8+¼4(º0&é=;å>8Þ=5Ô*ÓB/Â1 æTEÐ<0ÚA;ÞC?èJIòTSèVVçSSãOMÝIEÖC;Ï<2Ê8+Å6&Ä7&À7%¼7$»:'¹<*·>-µ=,²=,°:.±;/²<.µ=/·=.º?0ÀB4ÃE7Ü\Oêg]äaYñlgöpoçabìfgòkoäP`ï^kôhqòemñ`eödgûqqúzwövsÿnuõJ]ÿMjïUmñœ¡ŸžŠPˆcVoEOd=Va?ww]¯¤’âÐÄÿíæÿ÷óÿûøÿýûÿþüûÿüûÿýûÿýùÿû÷ýùãÿëÜþãÚøÞàúáèûåïüèöýëýþîýúëÿúêÿ÷èúñàòê×ðèÕôìÙùñÜýùöÿûøÿþû\PB\PB[OAZN@YM?YM?XL>XL>UI;TH:SG9RF8RF8RF8RF8RF8JF=KGÓ>@ÐFCÅA<¸71Å>:ê[WÝABä?Cç=@ã:=Û89Ó97Î=8ÌA:ÏE;Ã9/»2(À/¸9(¼8)Â8+É:,Ò:/Ù80á83è;7ì=:Ô3+Ö3,Ù5,Ý4-Þ6-Þ7.Ú:.Ô>/Æ9(Á<)½>-¹>.»=/½=2Á>6Ã>7ó?>î?<æ?7Ù=1Í:*Æ9%Æ;$È<%Ï<(Ï8'Ï2#Ñ1%Ó2(Õ4,Ñ2,Ï0*Ñ3*Ó5*Ñ7+Ï7)Ê7'É8%Ê<(Ì>*Ê<(Î=,ô^PàF<Ò3/Ò.-è?BþUXÿvuÿroÿjgö^YçPIÕA7Ç5(½.Ä8'À9&»8&¹:)¶=,µ=-±>,°<-­<.­<.®=/°<-±;-¶>0¼B3ÁE9ÉMAß`Wâa[ôpløtrå`aä]aå^dÙFVçYeógpôgo÷dlýjpÿstúxvõssûenóCXÿEbðRkë’˜œ—ƒN‚\Ql?Ri?ZhDy|_°ª”èÛËÿôêÿùðÿúóÿýöýÿùûÿúùÿúöÿøòüóîøïÔüÚÎóÒÊëÌÏìÎ×îÒàïØéòÝóöãöõãûõåüõãõìÛíáÑéÝÍíáÑóç×úõïü÷ñþùó\PB\PB[OA[OAZN@YM?YM?YM?WK=VJcî7Uí8IçAEßFAØIAØIAÞFCæAGð;Jõ9JãDI×>AÐ@?ÏJE¾?8²3,ÇD<âTPÜDCáACä>@â>?Ü>=Ô@<ÏE;ÌH<Ç=2Á7,½5'½9*¿=-¿=-»<+½<)À;*Ç;,Î<-Õ;/Û8/à70ç83ë95ã:7â64â22å31æ42ä50Û2+Ò1)É2'Ç9-Ä<0¿90¼5/¿52È<;ÒDCó57î66å61Ø5,Ë5&Ã6"Á9#Ã;#É>'Ê9&Ë5$Í5'Ñ9,Ó;0Ò:/Ï8-Í?1É;-Ä8'Ã7&Ã:'Å<)Å='Æ;&Í>-Í:*Ø>2ãB:Ö.+æ::á14å26Ò73Ö;7ÞC>åJEêQIêSHèTHäUGË?0Æ>.¾<,º<-¶>.³@.°?/®?.«=0«=.¬<.¬<.­<,±=.·A3¼D6ÆLAÞbZâc]ðnlôrrå`cå`eæ`gúixûozõltí`hñ^fÿkqÿw{ÿ{|öpqø^hö@Wý>]óOh懠•ƒX†aXuE\vIgwP‚ˆfµ±–éáÌÿùéÿüíÿýñþÿóûÿôøÿöôÿóíûìäòãÝëÜÁëŻ㾺޺¿Þ¼ÆáÀÍâÃØæÌãëÓìîÙôñÞøñßóêÛìàÒèÚÍìÜÏñáÔòçáòçáóèâ[OA[OA[OAZN@ZN@YM?YM?YM?XL>XL>WK=VJPI?QI>SK>UL;XM9YM7YM7XM;WK=ULGYSWc_nmkƒtt–|~§ƒ†³†‰²‡Š·ŠŒ¿‹ÈŽÏŽŽÔÕÓ”Ó‹Ê‚‰¿{‚¶u|²ov­gp«ck©€n~ey­ZvÏMoê?cú2Vÿ0Lû6Gð@CâGBÙLB×MCÝIGèCJõÍID¸<4¯5*ÉI@ÕLF×CAÜ>=Ý:;Û;;Ù?=ÔE=ÌH<ÇI;Á7*Á7*À8(¾9(¼9'º9&½:(À;(Ä;)Ê=,Ò<-×;.Ü8.á6.ä6/è5.ê24è.1ê+0ð/2ö37÷69î45æ21Ø/,×31Ô63Ï42Î/3Ð/5Û5?ä=Gõ,2ñ.2è2/Ü3,Ñ5(É8'Æ;&Æ>(Ä9$Æ8$Ë8&Ò:,Ø?1ÛA5ÚB5ÙA6ÎI8ÇB1¿<*½:&Á<)Ã?*Å<)Ä9&Ì;*Î6)Î0'çB<Ý1/ñ>Aå.2à'-Ò3-Ó4.Ö71Ö92Ò8.Í5*Æ2&À1#ÎE5ÆA2¼=.µ:+±9)®:+ª:,ª:,ª/«=.«<+¬=,°?/µA4ÉSGàg^ßd_èkiînoæchðjqõoxüp}ýt~õmwîcj÷dlÿqzÿw|ûsuökpöXfûAYÿ:[õKfâ}…©˜†l”ojŠXo‰ZxŠ`—r¶·˜âÜÂúôÞüúåÿÿïûÿïõÿïîÿëçúäÜïÙÐãÍÉÛū٫¨Ó¦¨Ñ¥¯Ô©¶Ô®¼Ö±ÇÚºÒßÁàæÌêéÔòíÚòéÚïáÖìÛÑëØÑíÚÓèÛÒæÙÐåØÏZN>ZN>ZN>ZN>YM=YM=YM=YM=XL@çE@ÝJBÚKCÞHGéBLó8ÏE;ÆF9¿E6Á8(Ã:*Â:*¿:'½8%½:&¿:'Á:&Ä9&Ë:)Ò;*Ù9+Ý7+á5+ä3+ç4-í)-ò)/ù,3ÿ.4ÿ07ÿ18ÿ28ý58ú7;õ8<ò9?ò9Aô9D÷6Gû6Hü5Jø)1õ,2î02ã4/Ø7-Ï9*Í<+Ì=,È7&Ï9*Ø2á?4â>4â?6â?6ÑN<ÍH7ÇB1Â=,¿:'Á:'Å9(È9)Ç3%Ó9/á@8ëD>Þ0/á-.ì38í38×4-×6.Ù80Ø:1Õ;1Ó;0Î:.Ê:/ÖL?ÌF:¿?2´9*¯7)«7*©8*¨8*ª<-¬>/­?0­=/«<+«<+­<,¯>0ÀKAÚc[Ýc^èkiðosëhnõrzüvïer÷oyør{öjsÿlvÿvÿu}öioõfl÷RbÿA[ÿ6YôFaÝt{²›‰€¤~z›f{—f€–h‘u­±ŽÌË­áàÄéëÓî÷ÜåóÙÙíÑÎçÉÅÞÀ¼Õ·´Ë®®Å¨•Ã’”‘˜Ä“¡È™§Ë¬Ë¡µÎ§ÁÒ®ÎÙ»ÙÝÄåãÎìåÕïáÖëÚÒçÒÍäÏÊÞÐÇÚÌÃÕǾ[N>ZM=ZM=ZM=ZM=ZM=YLXL>YNø<=íA=äE?àGBãDHèAKï=Mô:OÒBAÑGDÅA<ÂH=¯;.°5É83È.,Ç)&É.*Í:3ÌC9ÂD6¸@0Ã:(Ã<)Ã<)Á:'À;(Á=(Â;'Ã8%Ä6"Ê7%Ô8)Ù7*Ý5(á3(å3)è3*û03ÿ58ÿ7<ÿ38ÿ,2ÿ&-ÿ'-ÿ)1ÿ,3ù'0ô%/ú'6ÿ+=ÿ(Aÿ:ú2ö".ô&0î+1æ0/Ú1,Ò4+Ï5)Ð6*Ô6+Ü90æ>5ì>7ë:4é61è50é61ØL?×K<ÒF7Ê>/Ä6(Â3%È6)Í9-Í5*Ô6-æC<à74à21Ò ì89ê35Ó2(Ô3)Ò4)Ñ5)Ï5+Ì5*È5+Å7+ãYNØRFÊH;¾@4¶=ê@AéBIêCMëANê>NÌA<Å@9¾?6µ?3®=/±=0¿E8ÒMDÇ61Ô;6Ï1.Í2.ÖC<Ç?3´6'·?.½6#Á:'Ã<)Â;'À9%Á:&Ã:'Ç:&Ë:'Ð9(Ô7(Ö3$Ú."à/%ì7.ô=5ø72ù30ú.-û)(ý%&ÿ#%ÿ"'ÿ"'ÿ$*ù )ú!,ÿ%7ÿ'<ÿ;ÿ4ÿ3ý)7ð".ç"+ä*-Ý--Ó+(Ò-)Ü41â62é54ï64ó55ó12ñ-.ï+,í++Õ<4Ò91Ñ:1ëTK»"Ä+#ßF>È.&Ì/(Þ<7èE@â:7Ø/,Û.*ã41é:7Ý?3×;.Ï5)Ë3&Ì5*Î:.Ë;0Æ8.ìbWàZOÈD8¹6,º:/·9-¯3)²6,¯1%°2&®2&®4'¯7'²:,²<.³=/°:.ºC;Ö\Wìppñsvøv~ûyƒõq|ÿ{„ûx€øu}üs{ÿr~ÿq}ÿlxûisøbmôI\ÿ=\ÿ8[ñ:VÖek²–‡¦}~¡i|šd}•c‡—j”ŸuŸ¥ ¨ƒœ¨„’£Š£|€Ÿvx›qw›o|r t„£w¯uƒ³y‰¹½„“¾†—¾‡œ¾‹¢½§¼“¯½š¾Â§Ï̹ßÓÇãÒËÜÇÄÖ¾¾Ê»´Á²«¹ª£ZM1ÐB6Ü?6è?8ôA=ö=;ø:<÷:@ô7½=4¶<1°õ6;ú3:û06ú-2û.3ý14þ36×4/Ü:5Ù72æDAæDAÎ/+Ñ2.Á"Ö41á?<èE@à=8Ø3-Ù2,Ý60à91Ò<-Ï9*É5'È4&Ê8+Ë;0Ê<2Æ9/ícYáXNÉ@8¼3+À:1Á;2½7.À:1Á4+¾4*½4*»5*¸6(´6(²7(°6)´;0»B9ÓYTèllïqtöw~þ|†øv€ÿ|„ûyøv~þuÿsÿo}ÿiwùeqùanöI]ÿ<\ÿ9\ô=YÕdh«y€œsu˜`t’\w]cŠ•k—p‹•p…”mp†_lˆ_fŠ\g^j_q•ey›i}l€­r„²tЏz»}½‘½‚–½„›»‰›µ†¡³­¶—¾½¨ÏÆ·ØÇ¿ÖÁ¾ÒººÅ·¶º¬«²¤£\L<\L<\L<\L<\L<\L<\L<\L/ÇE5ÐG7ÚC8ä?9ó=<ú9>ü9Aú:Eò>GæAH×@EÏ@B¿<4¸90±8-«:*¨9(«:*»?3ÏF<ÙD>Ø96Ú65Ü:7ÜC=ÝOEÍI<²4%À9&Á:'Ã<)Æ=+Ç>,È=*É:)Ì9)Ï8'Ï2#Ó/#ß4*î=3ô?6ñ91í2+Ú7&Ý6&à3#å/"é-"î+%ñ,&ò+(ó++ð(+ò'-ú(5þ%8ÿ5þ2ÿ3ð(5ô.;ô4?ò8Cï;Dðå+6ñ1<ô/9ù-8ù+5ù,3ø-1ö.1ö01Ù1.ä<9Û64à;9ÿljæBAÒ.-Ð.,Û97á?<àA=Û<6Õ7.Ô6+Ô6+Ó5*Å8&Ã6%Ã6%Ä8)Ç;.Æ<1Æ<2Å;1ëaWáTMÉ<3¿0(Ë;3Ï?6Î;3Ñ>6Ú=8×<7Ô=4Ï<2É;/Â:.»7*¶6)·;/»@8ÏTMãgeíorøz~ÿˆý{…ý{ƒùzúx€ÿwÿsÿl}ÿftøbnø]kõG^ÿ:Zÿ9\÷AZÐ_c›gkŠ^e†Oh…Ol„Rt…X{ˆ\}ˆ^x„\q‚X`yO_P`†UeYm•`uœg{ j€£m­p…±tˆ¶v‹¹y‹¹yŒºz‘º~”º‘±•¬€›©†©­’ºµ¢Ç¹°Ë¸²Ì´²¶­®ª¡¢ —˜[K;[K;[K;[K;[K;[K;[K;[K;ZJ:ZJ:ZJ:[K;[K;\L<\L<\L<]K=]K=]L<^M=^M;^O<^O<^O<`P@^Q@]P@\NC\NE[NF\OI]PJ`NdcSmfX{g^‰ohœzu¯„|¸†{µ™…º¥…´¯€ªºy¡ÈxŸÓušÍc‹¾OyêAFà@@ÕA=ÌF;ÈJ;ÉJ;ÐF9ÜB:î@?ø;Aþ:Dü7õ>8ð50è-&×:)Ú8)Ý5(à2'æ/'é.'é,(é,*ç+*å(,è)1ï+7õ';ö";ú=ÿ"A÷8Gä(6ç/;ÿP\ÿ`lÿP\ò^N>^N?^N?_OB`PC`OEbM\cPdcUodZle‘vr¤~w«‚v¦“~©¬†«Â‰©ÐžÛw“âk‡ÝXuÓFfÿ=MüDPðJNÞJHÌG>ÇG<ÍG<ÙD>èBBó>Cù>Gø@HðCIÞDDÍB=À?9½A5µ=/®:+ª;*©:)­9*º<.Ì?6áFBä<;ïABíAAÞ:8ãJBæXLÔL>È@0À8(»3#Á8(È<-É:*Ë7)Ð8+Î0%×3)à8/é;4ï:3î50ë0+è+'Û4,ß4-ä2.ë31ð43õ45ö58õ6;é/4ç.6ê0=î2Cò.Fõ*Gý,Lÿ1TðPî3Dî2Aî3>ê5<æ89Ü73Ð3*Ç/$Ì2*È-(Ñ61óXT÷\ZóXVÜ@AâHHÜB@Õ<7Î70Í6-Ï8-Í9+Ê7'Æ3!³:%²9$´;(¸=-¹;-¶6)»8.Ä>5ÛNGÙEAÎ50Ð1-á>9è?:ã81ä71ð/0ï11ì42é73â92Ø:/Ð9.È:.¾6*º7-ÈIBÜ_Yënlû}€ÿ…‰ýƒõv}õx~ùzÿx‚ÿsÿj{ÿdtö_nðUeôF]ÿ6Vÿ7ZúF_ÀTRvaBJoRÿ-Hÿ:QþCTéDKÒ@AËA>ÎDAÖEBãEFêAFï@EïBFçDEÚEAÉC:¿?4º@3±;-©8(¨9(©:)®9(º:-Ë;3èIEë??î;>æ68Û2/ÞA:îZPõg[ÙQCÉA3¾4'À6)Ç9+Ê8+Í6+Ò8,Ñ0&Ü5-æ;4ë:4ê40è/,ê-+í-,ó4;õ3;ø3<þ2=ÿ1>þ0=ý0?ù0@ô1Añ2Dò5Kó5Oó0Põ-Qþ1Xÿ:dá7B÷O\ÿanÿ`nþXfùQbòEXé8Jó@Sê:GÝ2;Ò/2È3-Á9-º=+µ>(Æ9/¿2(ÙJBúkcÝLGáPMÍ<9Ï;9àLJÔ@<Ê7/Ê7-Î(«;%­=)²?-±9)®4'º:1ÊC=ÕHAØC?Ô72×2.ç;7ì:6è2.ë2-÷)+÷+,ô.-ð3/é61â:1Ú<1Ò>2Â6)º4)ÅB:×XRçjhú|}ÿ†‰þ€„õv}öyú{‚ÿx„ÿqÿh{ýbtõ^oîSe÷I`ÿ9Xÿ9[ûI_ºQNmZ:Em8ZvCa|InSv†Y|‡]Šbg‚—lœl{ m|¤o}¨p~ªo‚ªnƒ©l…©lˆ«qˆ®qˆ°r†³r„³oƒµn„¸p‡¹t‹µv‰¬tŒ¦wš¨„°´™ÈïØÌ¾àÏŽÃÓ«±Á›¡±ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\M:\M:\M:`J<`J<^K<_L=^M;_N<_N<^O<^O<_P;_P;aPHÿ$Hÿ0Qÿ;UñÇA6¾>1·?1¯9+¨7'¨:)¬=*²=,À>1Ñ>7ß=:ç79æ/3ã/0á32Û94åNEülaïj[ÙQCÆÍD>Á61É;7ãUQÕF@É91È8-É:,È9(È:&É;%ªB)¦<&¦<&¬=*©8(¬3(¼=4ÒMFÕGCÝEBÛ96Ü30é73í41ì/+ó2-ÿ)/ÿ*/ý--ö0/ï4/è7/ß;1Ø>2É:,¼4(À;2ÏNHßb^÷yzÿˆŠÿ„†ùzú}ƒü}„ÿx„ÿn~ÿdwù^pò[léN`öHaÿ8Wÿ7YøH]²JGcS1Al6ZtDf~NuˆZŽc…f‡’jˆ—n‰žs‡¤t‚§t§r}¨p}©n©mƒ©l…©k†§n‡ªp†¬o…¯o°l³k‚¶n…·p‡´s‡­rŒ¨wœ¬…²¹šÈƱ×οÞÐÅ·¿Ò¤¬¿’š­ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\M:\M:\M:`J<`J<^K<_L=^M=_N<_N<^O<`Q>aR=bQ=bQ=bR;bP:aO9`N8jNMgNRbQ[cWkjfuv’}}™y‘’{¯ŒËƒ‡ã{|ùqsÿgjÿTXÿAGÿ#Mÿ.Tÿ7Wù9Pé>NàEM×EHÑ?B×BDÚACÜ@AÛA?ØC?ÏB9Å?4¿=0·?1¯9+©8(«=,°A.·B1ÇC7×D=Ú64å57ã,0ç02è88Ó0+Ï5-éUKÿznæ^RÎD7É=0Ê<0É6,Í6+Ö90Ú70ß82ä71ç40é1/í10ò53ø87ÿ=ÿ>ÿ>ÿ>ÿ=ÿ=ÿ<ü=ò:ï@ð$Ið&Nï$Qó%Uÿ0eÿ=sÿgrþalôXeîR_ïQ`îM]â?RÖ1Bß:JÑ4?¿-0±-(¦5'ž>&–C%E"¯7&²9(ÒWHº<0ÁA8º7/º3/ÍC@ãXSÕHAÈ91Ä6*Å6&Ä5$Ä6"Ç9#¦B*¢<%£:%§<*¦7&©3'½A7ØSLØIEáGEÞ:8ß2.ê41î1-ï.)ù4.ÿ'-ÿ',ÿ)+ö*)í-(ä1*Ü5,Õ9-Ð>1½3(¼7.ÉHBÙ\Xôwuÿ‰‰ÿ‡‰ý~…ý€†þ†ÿx„ÿl|ý`sõZlïXiãHZóE^û4Sÿ3RóCX«E@\L*?j4Uo?d|LwŠ\†“h‹–l˜pŽtŽ£xŽ«{†«x©t|¨mz¦i}¥g¥h‚¦h…¤k…¦m„ªm‚¬l®j}±i€´lƒ·oˆ·sˆ°tެxœ®„²¹šÄ«ÐǶÖÈ»²½Óž©¿‹–¬]K7]K7]K7]K7]K7]K7]K7]K7^L8^L8^L8^L8^L8^L8^L8^L8\J>]K?]M@\L=ZM=ZO=\Q?^SA_T@_R?^Q@aQAcRBdQCdNAcM@pKEjKIfOUgZknl„v|ž}†¯ƒŠ´Š…®Ÿ‰­¸Š¦Ìƒ”Þ{~îumøl]ûfRðN[æDQä>LéANïCQí>Ké:Gê4Á;/¼8+ :$¬C0¬=,®6(Â?5ÑD=Ð;5Ó61Û83Ü71Ý6-Ý7)Ü9(Ý='Ù;"Õ7à74õPLõXOÛD9Ç8(Ì?.ÒC3Ñ;-Ò4+ðGDâ.1ï4;ö4?ï+9ÿ@Qí(9þ&+ÿ*-ÿ*-÷"û#$ÿ()þ((òð"ú+1ì )î&1ò.<ç$5ÿYnë+@ÿ`jÿ^iÿYcûT[öPTìHIÛ@;Ê:1ÅA2½F2®D.Ÿ;$”5–7#˜;)œ=+§81«83ÁEC¿;9¾23Æ45È44×CAÜKFÚKEÑD;È:0Ä4+È4*Ì3+Ì2*·?1³9,®.#­'¶,"Æ7/ÓC:ÚG=äPFßE;Ù80Ü1*ç/-ô01ý/3ÿ.4ò14ó12ô01ó/0ó0.î1+é4+à8-Ö=/¾2#¾?0·>3Õ`Wçtqÿù…†ôŠŒþ…Œÿwˆÿe}ÿ[wÿXuÿSoûJgûDcö7Y÷9]ç>[Ú]k„C=PI/F`;Xw^N?^N?[N>ZO=\Q?^SA_TB]QA]P@_OB`NBbPFcOFcOFkLGjMOgS\h_rnoŽw~ª~ˆ»…ŠÁ›–Ì¢Œ»«£»wŽÕx‚í|x÷uhöjYüZgóN\ìFRòHUöJVõERï?Jë;Eä9Aà:>Ú::Õ=:Î?7Ç>4À+ª?-¨9(²:,ÁA6Å<4Ç7/Õ<7Ó40×4-Ø4*Ø4(Ú7&Û:&Û;%Ù;"Þ52æA;ëMDàI>Ð>/Ç8(Ê8)Ó;.Ý<2öJFæ/1ò5<ø6Aò.<ÿ?Pì'8ö$'÷%(û),ý+,ü*+ù'(ø((ø*,ð$'í%(ê%,þ:DÚ'ð4CüATÞ#6ÿluÿblþZcüW]õOSæBCÙ;8Ñ>6¾8,¾E4¹H6¨?,–1)Ž()ž-'°:6ÑTRÎHGÃ54Æ45Ò<=ëWUØGBÖGAÏB9Ç9/Ä4+Ê6,Ð7/Ò5.Â?5À:1À5.Â3+É4.Ð83Ø?9ÞE=ãJBÞA8Ù6/Ü1*æ0-ó11ü03ÿ.3ò14ó12ô01õ/0ó0.î1+é4+à8-×>0¿3$¼=.¶=2Ó^Uévsÿù…†õ‡Šþ‚Šÿu…ÿe|ÿ[vÿWtÿQoþIhúAaö8Zö=_æF`ÅQ\{?7NH.Ga>Yx=e‡Ks•Yx›awbz¢f|¥i}¦j|¥i|¥i|¤h{£e{¡d}¡c}¡c¡d{¤l}¦n}©l}ªi}ªe}­c¯c‚±cƒ±f‡²k‡¯pˆ«u‹«|¬„©‰‹¤†z…‡doqR]_]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8^K<_N>aP@`P@]P?[O?[O?[RC[QE[QE\OF\OG_PKcQOfTRhTUiTQiVXi]kmi„sv¡zƒ¼ŠÍ‰Ö—‘ÙŸ‹Êª‚¶º}ŸÒ‘烅ð~tïveÿ`k÷S\íGQðFQöHR÷EQô@Kî=Gå6=à7:Ù99Ô<7Í@7ÅA4½?0¸=-©@-¨=+ª;*¸B4ÅI?À;2»0)Ì92Í6/Ò5.Õ7,Ù7*Ù7(Ú7$Ü:%Þ<'ß3/Û4.âA9éOCÜH:Ç6%Æ3#Ù@2á>5õHDé13ó4;ú6@ø4@ÿES÷3Añ),í"&î#&û03÷--ï''í%%÷12ì(*ø7:è+1â)1ë3?ÿR^ï=KÿYiúafñV\îOTðMRêEIÞ:;Õ74Ô?9À6,¿?2»C5²>1ª8-¥3)Ÿ,%œ' ˜% §0*ÆFCÂ::¼,,È44×ABô^]Ò>:ÒC;ÐA9Ë=3Ì9/Ô=4Ú@8Ý@9ÙA>×=;Ü>=ãA?ã?>à;9ã?=ëIDàA;Û=4Ø5,Û2+å2-ð31÷12ú/2ó04ô02ö01õ/0õ/.ð0+é4+à8-Ø?1À4%¸9*´;0Ð[Rízwÿ’’û‡ˆøƒ‹ü~‰ÿr‚ÿcyÿZtÿTqÿMmÿFgü=_ø:^ôBbåQg§?Fn<1OK2KcA[z?h‡Lr“Zu˜^tš_wŸc{£gz£gy¢fy¢fy¡cx byŸb{Ÿa| b}Ÿby¢j{¤j{§h{¨e{©azª^|­^®`…³hеnвs‰¬t†¦w‚žvy“pn‡gVb`COM4@>^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^L6`N:aP<`Q>]P?ZN>YPAXPEXOH[RM_UTcWYeX_iYcl\fm]hlbclemolrtšx¶~†Ï„ŒßŠŽç‹‡ÞŠÙ¬‰É³­½y’Í{ßyê†vÿnrÿbgùU\öLUöFPöBMó>Gð;Dæ5;á7:Û97Ò=7ËA6ÄB4»B1·?.©;,­=/¯>0»G:ËRGÇH?¹6.º1)È91Í81Ó;0Ú<0Û;-Ù6%Ü6&à9'á40Û2-à=4ëOCãK=Ñ;,Ð8*àB6Þ7.ð>:é/0ò16÷4<ü8BÿNZÿKWý>Cò38â$&í/1ê,,ð22ç+*é0.ò::Ñæ37Ü-2ç9BïENÿYcôLYÔ?AÚADßCFá>CÞ9=Ü89Ø88Ó:5É83Â91½:2ÀA:ÍNHÖVSÐNNÆAB¯82µ:5ÏKGØNLãQRïYZêRQñYXÉ51Î>6ÑC9Ð@7Ó?5ÚA9àC<àA;íCñ:?é58í=?øLJà93Ú70Ø4+Ü3,ã5.ì30ò21ô01ô04ô02ö01ö.0õ/.ñ0+ê3+à8-Ù@2Â6'µ6'²9.ÉWMî}yÿ“’û‰‰þ€‹ý{‡üoücwÿXqÿNmÿFhÿ?cþ8\ù=`íIdÙYhˆ25d<0SQ8TgG`}Ej‰Ps’Yt•\u˜^wby¡ey¢fw dv awŸavž`xŸ`zž`{Ÿa| by¢hz£g|¦fz§bz¨_z¨]|«]~­_†²eеmŒ³rŠ­s†¦u€œstŽii_RaZDSL8G@^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;_K2_M5aO9_P;\O>ZN@XPEXQKYQO^X\g`hnfsshysg{sg}tfnnzor…rw•v|¬y‚Ã~†×ƒŠåˆ‹ì’뛌ߞƒÆžt¢¡kƒ®mq¾vjÈ{iþllÿklÿfiÿ]`üQWöEMð;Bí5=è59ã68Ý98Õ>7ÎA7ÅC5¼C0¶A-¬8+´@3¯;.°;1ÇRHÓ]SÈNCº;2¾90Á7,Ì9/Ö>1Ý=1Ú6*Ü4'á7(á2-ã60ä=5åE9âF9ÜC3ÝA2á?2Û0&ì62ì0/ð-1ò-4ú7?ÿOYÿZdÿ[_ÿOSá.1ã03ß--÷EEè66Ü,,Û-.ë>@Û25Ù37ÿchÞ=CÊ*2Ê-4¾()Ô;=àAEÚ7:Ù37á8;Ü89Î..Ì43Í<9ÓHEÝSSì`c÷hnõdkî[e¿B<ÆE@å^[÷igÿopÿjjåKK×=;É4.Ñ>7ÕE<ÖC;Ó?5Ö<4Ø93Ø7/ö0=ò,9ó+6õ-8ò*5î+3õ8<þJKà3/Û4.Ø4+Ü4+â5.ê40ï4/ð3/ö/4ö/2÷/1ø-0ö..ñ0+ê3+â7-Û?2Å9*²3$±8-ÃNEî}yÿ’‘üŠŠÿ}‹ÿw…ùl|öatùUmÿHgÿ>bÿ8_þ4\õ@aâMcÂWap/+\A0XX>]lMbIl‰St’\u–_v™_xžcy¡ex buŸ`uŸ`u_vž_wž_zž`{Ÿa| by£d{¥f|¦dz¨`y§^y¨Z{ªZ}¬\€¬_…¯g‡®m‡ªp…¥sƒ t{•nrŠffvi[k^RbU_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<`L1aM2`N6^O:[N>YOE[RMZTT_ZahbprmzuŒ{t“yr“zp“yo”ov’pyšt}¨w€·zƒÈ~…Õƒ‰á‹‹å”ã—ŠÒ™„¼¡ƒ§ª„“«~yŸl[ŽX>ÈH?ÕPIäVRìVUòRRôJMî=Cè38ì7<ç9;à;9Ø=8ÑA8ÈC4¿B0¹@-³9.ºA6«5+£.$¼J?Øh\×eZÊVI·=2¸6)¾4)Î:0Ù;0Ü5,ß3)ä6+á/+å61ã;2Ü:/Ü?0ãF7ãC3ß9+ß1&ê3-ð31ï-.î*.ô17ÿEJÿS[ÿ_dÿ\aâ9<â9<Õ+.ôJKâ89×//Û55Ì()Ë(+÷YZÛ?BÔ9=Ð7:· %Ã))Û=>åBEÝ49Ù,2Þ17Ú/5Í(,Ò37äKNöaeûhnùcl÷_kû_mý_nÒNIÔOJè]ZêVTçMMãGHÑ32Î31ÙA<àKDãPHßKAØA8×:3×50Õ2+ÿ,;þ+:ü(7ø%4÷'4û/:ÿ=CÿILà1.Ü3,Û4,Ü5,á4-ç4-ì5/ï4/ö/4÷/2ù.1ù-0ø..ò/+ë3+â7-Ù=0É;-³1#°7,¹D;ìyvÿþŠ‹ÿyŠþqõhxó`söTlüCcÿ7^ÿ3_ÿ3\óDcÒM^ JMb6+TE0W[@^kMc~Kk‡Tt‘[w•_x™`{ždz cvž`s›]s›\s›\tœ]v^wž_{Ÿa| by¡bz¤b|§b{¦_x¦[x§Yz©Y{ªZ~ª]ƒ­e…¬i†ªm‰§s‰¥u„s|•mv‡unmfwe_P=_P=_P=_P=_P=_P=_P=_P=^O<^O<^O<^O<^O<^O<^O<^OÏcWÔh[ÔfYÁPB¹?2¹5)Ç7,Ô:0Ù5,ß2+ç6.ã0,ã4/â7/Ü8.à>1åC4â?0Þ4'æ4*é1)ò2/ð..ï-.ò14ô68ü?CðOTúY^éFKõRW×47ëFJÝ8<åBEÚ7:Î.0Ð15ãIKÑ8;Î8:¸#%Ñ<>Ü89ä;>ê=Aç6<â-4Þ)2â19çÿ/>ý)7ÿ-:ÿ9CÿAHûABã1/ß4-Ü5,Ý5,á4-æ3,ì5/ð50÷.4ù.2ú.1ù-0ø..ò/+ë3+ã7-Ø:.Ì>0´2$±7,±<3çtqþŠŠþŠ‹ÿr†ýj}ñbtð]pôRjûBbÿ6`ÿ5aÿ8_ïKfÁN[z;6Y?.LH/TZ@]cIbzJj„TrŽ[v”^yšc{ždxžas›\p˜Yp˜Yq™Zq™Zt›\uœ]y_zž`x¡_y¢^z¥^y¤\x¤Wv¥Uw¦V{§X~ª]‚¬d„«h†¨l‡¥o†¢r€šmx‘gr„lk}ecu]_O?_O?_O?_O?_O?_O?_O?_O?^N>^N>^N>^N>^N>^N>^N>^N>eQ6cR8aP<]P@ZPG\TR_Zab^otrŠyx˜€¨ƒ°~~²yx±wv°xw³t}Âw€Ã}…Æ‚ˆÆ…ŠÂÀ—–¾ ¼¬§»¶¬´¾³¯È¸©Ð¿¥Õ¡ϼ”Dz‡·kS®\F¤G5©=0ÂH=áVQðVTòNOì?Aë=?è<<ä<;ß=:×=5Ï;1Ë8.¿82Á<5¹:3·>5ÀPDÅYMÅ]PÎgXÐdWÁM@º:-Å8.Ò91Ø3-ß2,è50æ40á2-à5-ã<3çC7æC4â:-à3%ê5*è-&ð0+ð.,ò21ò44ç.,è00áEIõY]öW\ÿpuåDJéHNÞ=Cü[aÿouÝ>Cÿ~‚ÿmqêQTÔ>@Å02Ñ<>øEIî9>ð7=ø=Fô6@è-8ö>Jÿ\hÿmwÿitÿdl÷]gú^kÿapÿ]nüWhî_YãOKâJGÕ74Ò0.Ù54Ó/.Ø95ßD?ãJDáJAÙ@8Ó6/Ö5-Ü71â94ð$0ý/<ÿ1=ø*6û/:ÿ>Eÿ>Cì44â3.Þ5.Ý6-Ý5,á3*è3,ï4/ò5/÷.4ù.2ú.1ù-0ø..ô.+í2+ä6-×9-Ï@2µ1$²6,°7/èpoþˆˆÿŠŒÿkƒücxð]pïZnôPiýAdÿ7aÿ8dý=bæPi°QW^2'RG3DH/PV`P@`P@_O?_O?_O?aQAbRB_O?]M=]M=aQAcSCbRB`P@eS;aP<_O?^QH[QOZSZeapsq‰xxšz|¥~€±€¹}¼xy¹rs¶no²qwÏv{̓̋Ȗ—䤾²±¹½¸²ÌŲÓÍ­ÙЩÛУÛÑ ÝÑ¡ØÌšÒÆ”Õ¦Š·gŸ_FËzgØte¾G?ØQMøbaìILç>Aä79æ9;ã99Ü75Ù61Û94È95À50ÇB;¹=5¾I?ÄXK·PAËeVÎdVÊYKÃG;Ä:/Í6-Ù6/â5/å3/á/-ß2,â70ä=4à<0Û8)Ý5(å8*å/$ê/(î.)ð0-ï20ë40è51æ40Ó8<åJNõY]ëOS×7?×6>ùX`ÿ~†ÿ~†ÿowÿgoÿipÿfjõ\_ïY[ô^`ÿRYÿCKü8Bü7A÷1>ï+9î/>ñ=IÿS_ÿ`kÿgpÿepþboÿbpÿ`oÿ[lìTOßFA×85×31Ù10×/.Ú21Ü86áD=ÜB:Ø?7Ö<4×90Û81á83ä84ô5=ó4;õ3;÷4<ø5;ó49ë33ã1/Þ3,Ý6-Þ7.à5+ä3+é2,ñ1,õ2.ø/5ø03ú/2ú.1ù//õ/,î3,å7.à@4Ë9,½7+®/&·<5ÒXWÿ˜šù~ÿhÿe|ö]rîRhòHeÿAeÿ9bÿ5`üJlÕRd‰==K. >>&?I.IO5]]EWlAcxMqˆZx’by–`t•\r–Xq˜Wl•Sm–Rn—So˜Vr™Xt›\uœ]uœ]tœVtWv Xw¡Wv¢Uv¢Uu¡Tt S{¥[{£\zŸ\u—Zn‹Uc}MXrCSj>AW1?U/`P@`P@`P@_O?`P@aQAbRB`P@_O?`P@bRBcSCbRB`P@fVF_QD\OF_TRcZ_f`nmkƒwv˜wy¢{}°}¸x|»qt·lo¶ln¸oq»suÙ|}Ù‰ˆÔ˜—Ш§Æ¹¶½ÉƵÓÏ©Ý×£âÜžçßžæÞäÜžâÙ ÙÒœÑʖѼ¸€¦~dÄ‹wÉ}m¶VJÓ`Y÷qnîZZêJLä>@é<>ì>@è:;ã56á34Õ=:Ë73Ê?8¹6.·>3¼L@³I;Å^OÛp`ÒaSÄH<½5)Ä0&Ö5-Ý4-Ü/)â43å95å<7à<3Ü8.Ù5)Ý5(ã5*í6.ï4-î1+ë0+ç0,ã2,á4.Þ5.Ò9;×>AäIMóW[ü\dü\dþ]eÿ`kôR]ïMXñQ[ÿ_gÿjqÿflô[`ëRU÷07ó+5ô+5ù-9ó&5è/ç'6í7DüP\ÿ[dÿclÿemÿepÿdoý[hõP^åFBÞ<9Û64ß63á53Þ20Û2/Û62à>9Û>7Ö<2×:1Ú91ß82å95è96é9;ê7:ë7:î79î79ì57å31Þ3,Û4,Û7-Þ7.á6,å2+ì1*ó0,ø1.÷05÷03ú/2ù.1ù//õ/,î3,ç6.ß=2Ò>2Â8-µ2*·82ØZ[ÿ“õw{ÿa{ÿ^v÷WqöOkøFfý=bÿ:cú=cëLhºJVw<8F5#7=#9C(DH/UP`rJnƒXw_v“]t“Zp”Vn•Tk’Ok”Pl•Qm–Ro˜Vr™Zsš[sš[tœVuWuŸWuŸUtžTržQqPq›Qn˜Pl”NhŒLbFXu?Nh8F]/@W+@W-@W-AX.YL<[N>^QA^QA^QA^QA_RB`SCaTD`SC_RB`SCaTDaTD`SC^QAbUM^QK[QPcYakesqm„vu•y{¤y{®y~¶w}»ns·ei°bf°jn¸rvÀ}zᇃᖔߩ§Ù¼¸ÏÍÊÃÝØ¸çá­êå¡ïéŸðêžíæžéá¢âÛ¤×Ï ËĘ´°“¦œ˜„k§„p¥p`œRG»]UÞmi÷usð^_çHLæ@Dí@Dí=@ë7:ç36Ü>;Ô;6ÔA:Â70·7.µ?3­=/µG8Új\Þj[×\MÊB6Å2(Ñ4+Ú6-Ú1*Þ44éA>ìGCà=6Õ2)Õ1'Ú2'Þ0%è3*é1)ç.)æ/)ã2,â7/á=4âA7Ã-,Ê43ÜCEðVXú^bùYaóS]òP[èFQêHSðNYü\fÿmvÿmtôY_ÜAGó*2õ,4ý1<ÿ1>÷*9ï&6ö6EÿJX÷ISõOY÷W_ü_fÿdkÿai÷Q[éBJÞ95Þ63ã75é<8ë<9ç85â51Ý60Ý:3Ù;2Ö90×90Û81á83ç:6ì:8à;9â:9ã99ç98è88å84à40Ú3+Ú6,Ú8-Ü8,á6,å3)ì/)õ/,ú0.ô15õ13ø02ù.1÷//ó0,î3,ç6.Ý9/ÛD9Æ9/»4.´0,â`bÿƒˆônuÿ_zþWsúPmþLlýDfø8_ö9_ðGf×ReDJi=4K@,7@%8@(ED/LE2N^9YkEg|Qr‰[tZqUmRkMi‘Kh‘Ki’Lk”Pm–To–Up—Xq—ZuWuWtœUrœTpšRm—Mk•Kj”LdGaˆE\~AUt;Li3E_/AX*>U'B\/E_2Ic6WJ:ZM=\O?^QA]P@^QA_RBaTD`SC`SC`SCaTDaTD`SC_RB]P@YNR[PVbXcjcsqm†vu•xz£z|­w|´sy·mr¶bi±]c­ag±lr¾v|È‹‡æ”‘褡淴áÇÄ×ÕÒËáÞ¿èå²ëç¨ïê¦îé¥éã¥ãܨÛÒ§Ëß¾µ–Ÿ§˜š…‰v—‚q—se™cW³i`Ïrmû‹‰õutë[[çKNéCGî?Dî;?í8=ß:8Ý;8ßD?ÓC;Ã:0¹;/¯7)¦2#¾J;ÚbRék]ÛSGÉ9.Í3)Ö5+Ø4+Ù33ñMLý[XíKFÙ80Ö3*Û4+Þ2(à-&á,%á,%ß,'Ý0)Ú6-Ø<0×?2À0(Ä4,Î:6ÙCBßFHàEKäGPìLVñQ]öVbøXdû[gÿgpÿmuôY_Ø=Cñ.2ò-4ô-4ò*4í%2ì(6ûô@?ð<;ç85à72Ü92Ø:1×90Ù80Ü71ã73ê86ì87Þ<9ß;9â:7ä;8æ:8ä84Þ5.Ø4+Ù7,Ú8-Ü8,á7*å3)ì/)ô/)ù/+ó25ô23õ12÷/1÷//ó0,î3,ç6.Ü8.ßG<É90¾3.´-*îfjÿy€ójrÿ`{ýTqþKkÿFjÿ=cö3[î<^äPhÄXe…DBbE7WP=DH1@D-JH3JB/IW4Sc?btLmƒUp‹XoŒRkŽNiŽKgIg‘Ih‘Kj“Mk”Pm–To–Wp–YtœVs›Uq™Sn—Qj”Lg‘IeŽHdG`‡D]AWy=Rq8Mi6Lf6Ne7Pe:Lf6Oi9Sm=UH8WJ:[N>\O?]P@]P@_RBaTD_RB`SCaTDaTD`SC_RB_RB_RBTLY`Xgnf{tp‰xt•xw¡xz«y{´sy·jqµ`g¯\b¬`f°kq»v|Æ~„Ε”äžžè­­é½¼æËÉßÕÓÔÝÜÊãàÁåâ¹çã¶æß³àØ³ÚÑ´ÐůÀ´¤¯¥™”œ‰ˆ†y‰}qwk›sk§ngºoi扄î~ósróedòVYòLNðCEî>Aå95â:7äB=ÞE?Ì<3Æ=3ÂB5­1%¬1"ÇI;ÛYKÖN@Ì=/Î8*Ò6*Ñ3'Ö34õUUÿkhú]XâE>Ü;3ß;2ã80â4-ä1,â1+Ý0)Ö/'Ì0$Æ/$Â0#Ã9,À4'Á3)Ë:5×CAÛEGÛBGÛ@HàDOìOZóVaòVaú^iÿgoóYaÝDIð88í55ï26ð18ò3;÷9CÿHSÿVaä6?Ý4;Ý7;êAFøKOüIMô;@ê05å61ë95ñ;8ó;9ó;9ð:7é73â70ß;2Ü;1Ù;2Û:2ß82ä73è64ì65á<8ã;8ä;8è:9è;7æ95á6/Û4,Ú8-Û9,Ý9-á7*å3)ë0'ò/)÷0+ð45ñ33ô22ô01ö0/ò1,î3,ç6.Þ7.ÞD:Ê7/¿1-¾21÷jpÿrzøhrû]vúPmÿCfÿ_L;_ZFQP;KI4PI6MB0DR1M[8[kFf|Nm…SmŠPlŒMhHfŽGgHg‘Ii’Lj“Ol•Sn•Vo•Xt™Vq˜Un–Pj’LfIcŒFaŠF_ˆDZ@X|?St;Pn8Pj:Tk=XmB[pEUp=Vq>Wr?RE5UH8XK;ZM=[N>\O?^QA`SC`SCaTDaTDaTD`SC`SCbUEdWG]Ulje|yu}yœzy£wyªvx±sw¶lqµcj²[c¬]e®hp¹w}LjІՙܡ¦à¯²å»¿åÆÇãÍÏÞÔÓØ×ÖÑÙ×ËÙÕÉ×ÑÅÒÉÂÌÂÀŹ»´§®¥˜¡‡Œ†xzuwvqulg~mfŒoib[œa[¾sm×zuï{ü|yÿrpýccöSTîHHñB=ê>:ã<6àA;Ñ:1ÒD:ÝTJÂ>2¸6)¼:,Â=.È?/ÏA3×C5×?1Ñ8*Ð23èLMú_]ñXSßD?Ø;4Û81à70æ92ç92ç92â92Ú9/Ñ9.È9+Ä8)®)¸3"È@2ÓI>ÒE>Ë;:Ì7;Ð9@Ï8AâHTïUaðYbõ^g÷`iêU[ØCIè?:ë?;ñAAúGJÿMRÿQYÿT]ÿV^á4:Ú/5Ú03ç7:ô=Aù:?ø48÷/2é61ï95ð95í41í1/ê20ç40á4.ã<4à=4Þ=3Þ;2à93ä73è43ë33æ:8ç98ê88ì89ì87é75ã4/Ü4+Û7-Û9,Ý9-ß7*ã2(è0&ï0(õ0*î45ð43ó32ó11ô1/ò1,î3,è5.à90Ù<3Ì70Á0-ÑAAÿnuýku÷coïSkóIfÿ;cÿ1`ÿ3bÿRJ7QF4MB0AL.GU4Sc>`rHgMj‡MjŠKh‹GeFfŽGfHgJi’Nk”Rl”Um“Vq–So”Qj‘NgŽKcŒH`‰E_ˆF_†G\‚E[~DWxAVr?Uo?YpB]rG_tKYtAYtAXs@NB2QE5UI9WK;XL\P@^RBaUEbVFbVFaUE_SCaUEfZJj^Nkg‚up|x›{y¡wx¨vw­pt±jo±ah®^f¯_g°em¶pxÁ~…͉ؖܙ¡Ï ¨Öª±Û´¹ßº¿ß¾ÂßÂÄÝÅÆÛÆÃÖÅÁÒÁºÌ¼³Æ»¯Å´¨¾¦˜±—‰¢†‡‰qqstpqogevhe†nj`Y”e_š[T·g`×tnî{vÿ{wÿwsÿhfù[ZÿQKöGBè=6èC=Ø;4ÛG=ê\RÅ;0Ä<0½7+¾6(Ç>.ÑD3ÔC2ÔA1×A0Ò8:Ø>@ÜDCÛC@Ö=8Ó91Ø7/Þ7/å:3æ93å:3â;3Û>5ÕA5ÑE6ÌG8¬.¼;%ÌK8ÑL=Æ=3»0+¿10Ë8>ÕBJáKVëU`ðZeð]eìYaßLRÐ?DÑ4+Ö8/ß<7ê@@ñDFôEJñBIî?Fâ5;ß26ã36ï8<õ79ù14þ-2ÿ.4ë40ð95ò64ì0.è,*è/,è2.á2-ä=5à=4ß>4ß<3ã:5ç85ì65í55ì57ì57í57ï56ï56ì42å2.Þ1*Þ7.Ü:-Ý:+Þ8*á3(ç1&í1(ò1*í55î53ñ42ó11ó1/ò1,î3,è5.ã;2Ò4+Ò;4Æ20çUVÿpxùcnñ[gãKbóEfÿ7bÿ+]ÿ1bÿ@hÞKe­RYd8/ZI7SN:UN;[P>VI8M@0MA1=H*CN.K[6Xj@ayGf‚HhˆIgŠFeŠDc‹BcEeŽHgLh‘Oi‘Rj’Tn“Pl‘NhLd‹Jb‰H_ˆF_‡H`‡H_…H_‚H]~I]yH]wH`wKcxOdyP[vA[vAZu@MA1PD4SG7VJ:WK;YM=[O?]QAcWGdXHdXHbVFaUEcWGj^NpdTvq‘yu˜xvtsŸrr¤su®lp¯bg«Za©^f¯em¸lt½u}ƈДڕœâš¤ÈŸ©Í¦°Ô¬´Ù°µÛ±µÚ²´ÚµµÛ³±Ö²®Ñ®¦Ë«¡ÄªžÂ¦˜»™‹®‹{Ÿ|y€dbgidhbY\g[[xeauXRe]ˆOHŸVO»aY×jcóvpÿ}zÿwuÿljÿZUÿPJñD>ôMGàB9ßF>êWOº,"¼2'½5'Ç=0ÑE6Ë>-Á2!É8%ÙF4ÞDFÒ9;Ë32Ë62Ó;6×<7Û<6á<6æ;4å82à5.Ø4+Ï5+Ê8+Ä<.Â>/ÑU;ÅI/»='½;+Ã=2Ä;5Â65Â37ÜKRÞLVâOYåS]éWaæU\ÝLSÒCGÉ5)Ð8-Õ81Ú64Ý55ß58á4:ß28å8<å6;ì9=ö8É53øceÿpyô\hêR_ÞHaõGhÿ:eÿ*]ÿ/aÿ@hÓE]–AFQ-!UJ8PN9OH5\O>YH8L<-NB2:D)?J*GU2Rd:]sBcEf†GeˆDcˆBa‰@a‹CcŒFeŽJfMgPhRlPkOfLcŠIaˆG_‡H_‡H`†I\‚G]€H]~I`|Ka{Ld{Of{Rg|S]xC^yD_zEAC8CE:IF=OH@RGAWI@]M>`O=aQ:aS9`T>_VGaZTfaeljwro€wožzt¢~wªzu«ro¨hf¥a`¢^^¦ba­hg·qoÃ|xÏ…€Ú‰ã—í–ó¢žÙ£ŸÚ¥¡Ü¦¢Ý§¡Ý¦¡Û¥ Ú¦žÙ¥Ö£œÒ¢™Ð¡˜Íž–É—ÁŒ‚´ƒy«mrvghlc_`e[ZlYUtUP€ULVK–RG¨ZN²ZP½\SÔmdç|tò…~üˆðxyõyyæabÜPQ×EEñYVÎ61È1(Ç5(Ä7&Â6%Ã8%Æ9'Ì:+Ð<.Õ?1Ô8+Ö=/Ø?1Ó;-Í5'Í4&Ø:.ã?5à90á90Þ7.×7+Ï7)È;)Ä@+ÁC,Ä;3È?7ÍD<ÏF>ÌC;Å<4»2*µ,$Ä>5ÍG>×QHÞXOá[RßYPÖPGËE<Ìÿ)<ö*6í.6ç48å;;Ü94Ü:5Ý<4à;5ã:5æ93é73é62ì25ì44ë54è64ä71ß7.Ú6,Ø6)Û9*Û:(Û:&Ü9&ß8%á8%â7#â7#í41ï4/ñ4.ó3.ó4,ï5)ê6(å8*à:.Ø7/×96Ý>BÿlyÿasþRlöGdÿIjû5Yÿ5]ÿ;eú=cãPj©LVT)":1 9<)EF4RL>PH;BC39E15K4FGHJ#MQ,U\:\jGcuOf}QeNc…Hb‡BaŠ>cŒ@eDjIl‘Nm‘Qj’IiFgŒFf‹Ff‹Hf‰Ic…Ic‚GdƒJdIc~Gc~Gd€FfFe~Dc|BX}8[€;^ƒ>[K>^M;`O;`Q:^S?^WGa\Vhcinlyrqƒtnšvpžtp¢pm¢gfŸaaŸ]^Ÿ\\¤ed°kjºtrÅ}{φ‚ÙŽˆà”Žè˜’ì›—Òœ˜Ó™Öžš×™Ö—Õœ–Ò•Ñž–Ñœ”Íœ“Ê›’Ç™‘Ä“‰»ˆ®€w¦tmtkdkf]`e[YiZSoWMzVJŠVI›UK°\RºYRÁXRÓf_Þqjãvoêwý‡…ÿˆ‡÷uuðfdäTSíYUÇ2+Â/%Æ7)Ã7&À7%Á8%Ä9&É:*Ï;-Ó=/Ö8,Õ9,Ó:,Ò:,Ñ9+Ñ9+Ô8+Ø8,ß;1à90Ü8.Ø8,Ð8*Ç:(¿;&¼;%¿4-Á80Æ=5É@8ÊA9È?7Å<4Â91¾5-Ç>6ÑH@ØOGÚQI×NFÌC;À7/Ê8Ñ9"Û8)å4,ï./ö*3û(7ÿ(:ÿ+Bÿ*Bÿ)Aÿ&Aÿ$@ÿ >ÿ=ÿ<ÿ8ÿ9ÿ$;ÿ);÷-9ï29ê7;å;;Ü94Ü:5Ý;6à;5ã:5æ93é73é62ì25í36ë54è64ä71ß7.Ü5,Ø6)Û9*Û:(Û:&Ü9&Þ9%á8%â7#â7#é4-ê3-ì4,ì4*ì4*ë5(æ6)á7*ÞcŒ@eDiŽHkMlPl’IjGhGf‹Ff‹Hf‰Id†JdƒHe„KdIc€HdHeGeGfEd}C\<_„?b‡B69.:<1??7E@:KB=OE/Ô>/Î6(Ë/"Ú:.Û7-Ù7,Ö8,Ñ9+É:)Â9&¼8#¾4*À6,Â8.Ä:0Ç=3Ê@6ËA7ÌB8Å;1Ê@6ÏE;ÐF<ÒH>ÑG=Ê@6Â8.Í6!Ô7&ß7,é3/ñ03ø,5ý*9ÿ*<ü'=ü'=û%=ù#;û!:ü8ü7þ7ÿ6ÿ6ÿ#8ý*;ù1<ñ6=é9;ã;:Ü86Ü:5Þ;6à;5ã:5ç85é73é62ï26î47í55ê65å61ß6/Ü5,×5(Ù9)Ù9)Ú9'Û8%Ý8%Þ7$à7$à7$â4+â4)å4*å5(ã6(â7&Þ7'Û8)Ý=1Ï2+×98ÿltÿ]nþPið=[ÿJlÿ5\ÿ=eü4[ô<`êTq«?Oa#(H1+79+-8'18&:;)B=*A<(@>)@B*?GY`4s~T€Œfw‡bi~Ub|MaI`ƒC`…?aŠ>cŒ@hŽEjJkMlPn”Kk‘HhGgŒGgŒIh‹KfˆKf…Je„Ke‚Jc€HeGf‚Hf‚GeFcDb‡BeŠEhH06*58-;<4A>9G@:KB;RE.Ð?.Ë8(Ç/!Ò6)Ó5)Ô4(Ò6)Ñ9+Í<+È=*Ä;(Æ9/Æ9/Æ9/Æ9/Ç:0È;1É<2Ê=3ÒE;ÒE;ÐB8Ë=3Ë=3ÏA7ÏA7Ë=3Ñ4#Ø6)â5.ë31ò/5÷+6û(7ü)<ù&9÷&;÷&;ø'<û&<ý%<ÿ$:ÿ#:ÿ!7ÿ"7ü%7ù-9÷5>ñ:?ç9:à87Ü86Ü:5Þ;6à;5å95ç85ê65ë54ñ27ð37î66ê65æ72á6/Ü5,×5(Ø8*Ø8(Ø9&Ù8&Ú7$Ü7$Ý6#Ý6#Ù6'Ú7(Û8'Ü9(Ü9(Û:(×:'Ö:+Õ;/Î3.éIKÿo{ÿVjøDaö=_ÿCiÿ/[ÿ7`û=cëLlÆOe€0=G >3--3'+8'2=,=B.B@+C;$G="MA'R_*q}MŸp—¨|ƒ˜mj„W_{J]~E_ƒCa†@b‹?fCk‘Hl‘Lm‘Qm‘So•Ll’IiŽHhHhJiŒLhŠMiˆMf…LdƒJdGe‚Hf„Hh„If‚EeDf‹FiŽIl‘L-3'17-7:3<;6B=9G?UOCZUQa_dhgukkƒllˆjg’baXV‡PP†QQXYš`cªfj´orÁuxÉ|Ѓ„Ö†‡×‰ˆØŠ‰×Œ‰ØŒŒÌ‹‹ËŠ‰Í‰‡Ð‰…ш„ÑŠƒÓ‰‚ÐŒ„Ï‹„È…Á†º†²‡¥}x–vpŠ“ScƒQ\qUT`^RVcOTbH_]DvUB’LB¼RRÖPWàPYé\dèejâljâwqâvláphõ~vÿ‚{ÿ‡~ôkaÉ?2À8(À;(¿='¾='¿='Â;'Å:'Ç8(Ê8)Ü8/Ú7.Ô8,Ï9+Ê;+È;*Ç:)É7(Ï9+Ñ7+Ô8,Ó7+Ï7*Ì8*Ë<,Ë>-É=0Ê<0Ê<0É;/È:.Æ8,Å7+Å5*Ð@5Ð@5Í=2Ë8.Ë8.Î;1Í:0É6,Ò.$Ù0)ä2.î23ô/8ù-9û+;ü+>ü-?û.?ú0@ü/@þ/Aÿ.?ÿ-?ÿ->ÿ)9ý)8ø*7õ0:ó6=ì9=ã77Ú53Ü86Ü:5Þ;6â:7å95ç85ê65ë54ò38ñ48ï56í76æ74á6/Ú6,×5*Ö9*Ö9*Ö9(Ø9&Ø9&Ù8&Ú7$Ú7$Ô9%Õ:&Ô<'Õ=(Ô=(Ô=(Ó>*Ó=.Ð8-Ù;8ÿ^eÿaqÿPi÷;\ÿAiû6aÿ/]ÿ.WøIjÛYq•>NX'-?+,730*1)-9-5@/:B+<<"B;VG(iV6v‡P£lª¾‹¨¾Ž¥wo‹[aK^F`…BcˆBeŽBj“Go•Lp•Po“So“Uo•Ll‘KiŽHgŒGiŒJiŒLi‹NhŠNf…Je„IdƒHfƒIg…Ih†Hg…Gf„FgIi‘Kl”N*2%.4*470894<;7B=:HA;KD(À>(Á=(Ä;(È;)Ì9)Î8*Ú3+Ù6-Ö:.Î:,Ç:)Â9'Ä;)É=,Í>.Ö@2ÙA4×=1Ï7*Ê4&Ê8)Ë<,È:,È:,É;-Ê;-Ê;-È9+È6)Ç5(Ê6*Ï;/Ò>2Õ>3Ö?4Õ>3Î7,Å.#Õ)%Ü-*ç02ñ29ø0;ü/>þ/?ý0Aú0@÷1@ö2@ö0=÷/:ù-9ú,8ü*7ý/<ù/;õ0:ñ2:í6;æ68ß55Ù42Ü86Ý:5ß:6â:7æ87é77ê67ë54õ49ó49ð69í76æ74ß6/Ú6-Ö6*Õ7+Ô8)Ô8)Ô9'Õ8'Õ8%×8%×8%Ï:$Î<%Î>&Í?'ÍA(ÍA*Î@,Ï=.Ð71éIKÿgrÿOdÿHfû7]ÿAmý/_ÿ1^ø1XåOj¹Wfh39@*,?994443524925>-2<#29ECl`8Ž}R™±u©Á‡µÎ—­È•’®}v”be†Q_ƒF`…Bc‰@gDo•Jr˜Or—Rq•Up”Vo•Ll‘KhGf‹Fh‹IiŒLi‹Ni‹Og†Kf…Je„If…IhˆIjˆJi‡Gg…EhJk“Mn–P(0#*2'/4-350664<87@<9C>8IEû3>ú0>ú0@ø/?ò.<ï/<í/9í07í.5ï,2ò+2ò)/õ1;õ3<ò5;ì59ç47á55Þ65Û75Ü86Ý97ß:6ã:7æ87é77ê67ë46ö5:ô5:ñ7:î87æ74à72Ù6-Ô6+Ñ8*Ð8*Ð9(Ð9(Ð9(Ñ8&Ñ8&Ó8&È:"Ç;"È>$Ç?%ÇA(Ç@*Ê>-Î;1Õ:6üU\ÿ_oÿGcÿ>bÿ8cÿ6gÿ0cÿ4\òCbÈMa…BIL44:97<<>948>58<7379+3="8DS[,ƒPª£o«Èˆ¯ËŽ¯Ì’¦Ã‘¯}{™ggˆQ^‚E^ƒ@c‰@iDo•Js™Ps˜Sq•Uo“Un“MkJgŒGeŠEgŠHh‹Ki‹Ni‹NfˆLd†Id†Ig‡Hi‰JjŠIi‰FhˆEi“Kl–No™Q&.!(0%-2+130333756:97>;6GD=DD*½<'»8$¾5#ÑB2ãOAäN@ØB4Í7)Ë7)Ð>/Ê;+É:*Ç8(È6'È6'Ê6(Î8*Ð8+Ó;.Õ;/Õ9-Ó5*Õ7,Ü;1Ý<2Ú9/ë7:ñ8=÷:Aü8Bü4A÷.>ò,;ï,:í/;é19è38é58í57ñ48ô36ö45î49ï6;í9<é69â45Ý33Ý86ß;9Ü86Þ97á98å99æ89é69ê67ë46ö5:ô5:ñ7:î79ç85ß82Ø7/Ó7+Ð8+Í9+Í:*Ì;*Í:*Í:*Í:(Ï9(Ä: Â: Ã=$Á?%Â@(Ä@+É=.Í81ßhŽCo•Jr˜Or—Rp”Tn’To“MkIgŠFeˆFf‰Gh‹Ki‹Ni‹NfˆKe‡Jd‡GeˆHgŠHh‹Gh‹GfŠDj”Lm—OpšR(0!'/"(-&+-*.0/333775:94==5?@8DE?JLKQQYVWiZ\s]^|YW†[Y‹^]–ee¥nn¸wxÊ€Ú„„䊌ðŠŒðŠŠì†‡ä‚‚Ü€Ô‚€Óƒ‚Ò€„ĄǃƒÉ„„ΆƒÒˆƒÕ‹ƒÖŒƒÒŠ€ÇŠ€½‰±…~ €xwpxkeec^XpZMm[Mi\Kf^Kd_IcaHfbGl`FlR;„UA£^O¿aYÑYXßPTñQ[ÿXbôkcæYRÔD<Î70Ñ7/×;/Ø/Å@/Á@-¾=*¼9'Â9)¾0"êVJáJ?Å.#Ñ=1Î2Ü<0Ù7,Û7-â>4éE;øAFó8?ð3:ö4?ö2>ñ-;ï,:í2=ì7@æ5;ã68å78é99ð:9ñ86ò65ï==î<<ê:<æ89á77ß76Ü75Ü75Þ97á98ã99æ::é9;ì9<í9<ï8<÷6;ô5:ñ7:í9:è:9à;5×90Ï7,Ë7+È9)Ç:)Ç:)Ç:)Ç:)È;*È;)Á9!Ä>%½;#µ5»:$ÈE3Í@6Ê0.ÿ^eÿVgÿHcÿ;\ú0Xø/[ý5cÿc‡?iDn”Im•Ll”Nk’Qj‘RjŽHfŠDc†Bc†Df‰Gh‹Kg‰LdˆJg‹MhŒNg‹Kf‹HeŠEf‹EjIm“Jp›SrUtŸW*0")/#).'+-(-/.222553782;<4>@5BC;HJGOPTSUaXYm[[s\Z‚^]‰da–kj¦us¼}Ї‡á‹‹íŒòŒ‹ñ‰‰í…„ ڀ~Ò€σ€Ï…†Æ†‡È‡ˆË‰ˆÎ‹‡ÑŒ†Ð…ÎŽ„ÉŠ€½‰³†{£‚x‘{s€tknkd^e\SbaLb`Ke^Kh]Ii\Ij^Hk_Gm_EraG{]CŽ[Fª[LÆWPàQS÷PXÿS`ìWQãKFÛ>9×50Ú5/Ý90Ü8,Ø8*Ó8&Ñ8&Ñ8&Ô8)×7)Ü5,à3,ã2,Ë1'Ë4)È9+Æ=-ÄA/Á@-¾=*¾9(Â9)Ë<.åQEÜH<È4(Ì:-È:,Á5&Ê=+Ê=+Ê;*Ì;*Ë:)Î8)Ï7)Ï6(Ó7*Ö8,Ù7,×3)Õ1'Ø1(ß7.å=4ûBHò7>í07ï/:ò0;î.;ì1<ê6?ã6<Ü36×32ß:8îEB÷JFøEAõ?<è:9æ:8å97â96á85à85á98á98à87â88å99ç9:é9;ì9<í8=ì7<ô5:ò59î68ê88æ:8Ý:5Ó91Ë7-Æ8*Ã:*Â:*À;*À;*Á<+Á<+Á<+½9"Á?)¹;$²5¸;'À>];2@>/3A05?4E=:X;?T-0X51ZI7bjEu[бpšÄ|žÈ|š¹}š¹€™·ƒ©yr`YuESq?\{B_>b†>iCm“Fl”Kk“Mh‘MhQhŒFeˆDc†Bc†DgŠHiŒLhŒNg‹MiOiMiŽKgŒGgŒGfŽGj’Im•LnœQoRr U-1"-1#,/&,.).0-11/34/45-9;0<>1@B5EH?KMLQRWUTbXWi\Yx^]fcŽpm¢zx¹…‚ÏŠáíŽñŽŒïŠˆé‡ƒá~Õ|Í}È}Ç…‡ÄˆˆÆŠŠÊŒŠËŒŠËŒ‡ÇŒ„À‹‚¹‰€¯†|¡€v‘{p€ujpod`i_Ue\MXeK]bKa_Jh[HmZIp[Hq\Go]EtcItZ?‚V= WDÅYMäTSûNTÿIUß@<Þ<9Ý84ß61á6/á6.Þ6+Ú7(Ö6&Ó8&Ó8&Õ8'Ø6)Ý5,á3,ä1,Ç5(Å6(Â9)Á<+Á@-Á@-À=+À8(Ã5'ÜJ=ÜE:ÕA5Îë7@ê=CÜ7;áAAìNK÷ZUüZUùRLïB>è62à72à74à74ß74à85á96ã;8ä::á77ä88æ89è8;é9<ë8<ì7<ì7<ò38î47ì57ç77â:7Ù:4Ï8/Ç7,Â8+¿:+½;+»<+»<+»<+»<+»<+º9$¾@*³9$°7$¶;+´2%Ã40îOTÿZiÿH`ù8Uó6Vó>]ñFfçHfÞEat?9e?6QA2@C04?.29)>5,O61K*#W:,j\Bˆ_«t”½{“ÃyÃv•²|œ¸…™µ…€šm\uKHa7Nh9[xB_}?c„?hŒBl’Ej“Gh’JgLeMe‰Cd‡Cc†BeˆFh‹IjŽNkOjŽNkOkOiMhJgHi‘Hl•Ip™Ms¡Vt¢Wv¤Y25$13&02'01+12-23.34.46+9;-;>-?B1DF9IJBNNNRQWTR]XVd\Zoda~nl”zw®„ÄŒ‰Ø‘Žå”‘ì“펋扅ڂÎ{Å|¿‚}¿ƒƒ¿……Á‰ˆÂŠÃ‹ˆ¿‹„¸‡®…}¦…{€vŽzm~sfmoa`k^Vi[NgZJVdJZbJa_JjZJpYIsYJtZIs]FqY?tU9†T;§ZFÌ\PæRNóEGù:AØ3/Ü41á51ä50ã5.â4+à6)Û8)Ö7$Ó8$Ñ8&Ô9'Ø6)Ý5*à3,ã2,Â8+¿7)»7(¼:*¿=-Â>/Ã;-Ä8+Æ3)ëTKÔ;3Ì8.ÑA6¾4'À<-½>-Ã7&Ä8'Æ9(Ç:)Ê8)Ë7)Ì6(Í3'Ó5*Ô3)Ö2)Û4,ã:3é>7ì?9ë>8è47ì59ï6;î5;ê2:æ39ä7=á<@óUVûc`ÿnjÿidóVQäA<ß61à3/Þ71Þ71Þ71ß82á85â96å97æ::å78æ89è8;é9<ë8<ë8<ë8<ë8<ñ48î68ê67æ87à;7Ö<4Ì9/Å8.½9,º;,¶;+µ<+´<+´<+³;*³;*³:'·@,­8&¬9'±;-«+"Ã54ÿ_gÿSdýE]ó;Uí1B2SE*okHŠ“f•¬t´t‹¹q‹½t¡¹‰¡¸Š§}l‚\K_:BV1Lc7Yq?_{@dƒ@i‹Ak‘Di’Fg‘IdJbLc†Bc†Bd‡CgŠHjMkOm‘Qn’Rj‘Pj‘Nj’Li‘Jg‘Gi“Gm—KqœMu¥Yv¦Zx¨\78(78*66,56056156167/68+;>-=@+@C.DG4IK=NNFQPNSQTVUSYY[a_lkius›€}´ˆ…ÈŒ‰Ö•’ã”äÞ‹‡Ó„Æ}º|µ€{±~¸‚º‡„»‰…¸Š„²†¨z›€xs‡znzrfjm_\j[Tk[NjZKjYI^bK_aKe^Kk[KpZLtZKw\Kz[G{WAƒS=—U?³XFÍSFÝF?å76ê01Û2-ß3/â5/å4.ã2*à2'ß5(Ü9(Ô7$Ð9$Ï:$Ñ:'Ô8)Ù7*Ý5,à3,½>-¹:)µ6%·8'½;+Â=.Ç;.É6,Ñ80ö\T×=5Ë4+ÏA5¸3$·:(¹@-Â9)Ã:*Æ:+È:,Ê;-Ì:-Ï8-Ñ7-Ñ3*Ò1)Ö1+Þ71ç;7ë>:è;7æ74é77ï;<ðê7=ê7=ð69î79ê7:ä::ß=:Ö=7Ë;2Ã;/¸9*´;*±<*¯<)­=)¬<(¬<(¬<(«:(¬=*¤9'¥:*©9-«0)ËAAÿgr÷L^÷E[ðBYèF[ÛN^ÈT]´VW§SQSU@LN9JG4JE1FD-AA'>C#@G%MU.^g,?=.==1==5=<7;<6;=2;=/?B-@D+CG,GI1KM8NOASPITQLYXDZ[M_^Zgepqo‡{y¡ƒ€·‡…ƌӋՊъ…ǃ€¹~z­zw¤{u¡zw°|y°€|®~©‚~£y•|t‰zrvkqrffm`Zl[QlZNl[KmZKmZIg^Mi]Mi]Mj]Mn]Ms^My^M€[I“`OšWG§N@¹I=Æ@5Ð6.Ù0)á0*á51â5/ã4/â4-à2)ß3'Ü6&Ú;(Ð9$Í;$Ì<$Í<'Ñ:)Õ9*Ù7,Ü5,ºA.´;(¯6#°5#¹:)Â=.É;/Í6-Û>7ùZTåHAÐ90Ì@3¸6&«4 ±>)¿7'¿7'À7'Ã7(Å7)É7*Î7,Ð8-Ù<3Û:2Þ93å<7ê>:ê=9ç85ã41è96ë<9ê::è8:ì>@øORÿccÿqpùheàUPÈ=8¿2+È5.Ö;7à<:â:9à<3á:2á:4á83ã73ä65å55æ68é69é69ê7;ë8<ë8>è7=è7=ç6<ð8:ì8;è8:ã;:Ý>:Ó>7É<2À+>467>O#Jh4gTt•\„›c‹™dŽ›f‘¢l•¬t•²x„”pn}\Q`C=J09F,BO3O_;Xi=czDgBkŠDk‘Dh’Fe‘F`G`Gf†Ci‰FjKlMlOkOm‘Ql“Rm”Qm”Qm–Pl–Lk—Jm™JržOu¢Qy¬]y¬]x«\CB0DB3DB6EB9CC;CC;BB8AD3CG0EH-GJ-JM0OO7RQ?TREURI[\:\\@\]Kaa_ihvrq{z¦~µ†‚¿ˆƒÃˆ„Á„¸{­ysŸtp•qmŽol£rn¡tq wršwrtoƒskxrilmb^l_Vj\OlZLn[Lo\Kq\Kq\KrZNq[Nn\Nl_Ol`PqaQy_N†[KŸ_S¦OE°A8½:2È5-Ï1(Ø1(Ý5*â70á6/á4-á3*à4(ß5(Ù6%Ô9#Í;"Ê<$È>$Ê>'Í<'Ò;*Õ9,Ø8,·D/±<(¬5!­4!¸9(Ä<.Ì9/Ï5-Ú83ñNIòSMÙB9ÌB5½@.¥2¬?(À;,Á9+À8*À6)Å7+É9.Ï;1Ô;3áD=ãA<ä?;ç>;é=;é;:è88ç77æ93æ95å84é;:ôJJÿ\[ÿdc÷caË=9¿82»4.Ã81ÓB=ÞE@ß=;Ù42â;3â;3â92ä84å84æ66é77é77ê69ë6;ë6;ë8<ë8>è7=è7=ç6<í68ê69æ89à;9Û>9Ñ>6Æ<1¾<.²8)®;)ª;(¦;'¤;&¡;%¡:' 9&ž?-”7%š=,—:)˜3'ÂQKíkmï\fïN^ìI\àHWÎJU·SS¡]RŒfQ‚jP=Sg{Fh‚Cl‹Ek‘Di“Gc‘Fa‘G^Gi‰FlŒImNn‘OlOjŽNkOk’Qp—Tp™SpšRo›Po›NqNv£Rw¦Uz­^z­^y¬]GD3HE6HF9HE±61Á3/Î5/Ö5+Ù7*Û8)ß6/ß4-à3,à4*â6*Þ7'Ø7%Ï7 Ì<"È>"Æ>$Ç?'Ê>'Ï<*Ó:,Õ9,µE/­='¨3¬3 ·8'Å;.Ì9/Ò5.Ò/*ä?;ûYTàI@ÎD7ÆI7¥5®D,ËF7ÉD5ÉA3É?2Í?3ÒB7ÚF<àG?ßB;à>9à;7à74â64ä65ç77é99é>7ç:4ä73è<:ñIHñMLØ=;¹(%¸-(¼5/Å@9ÌC=ÐA;Ö=8Ý>;ã?>á:2á:2â92ä84æ95è96ë99í9:ë7:ë6;ì7<ë8<ë8>è7=ç6<æ7<ì59è58å78ß:8Ù<7Ï<4Ä<0º:-°8(«:(¨;'¤;&¡:'Ÿ:&Ÿ:&ž9%š?,4"—>,“:*“1&Ì\X÷y|æT_ðTbèI[ØDRÃGO®SPšbS†lS{rSC[C?H3B7%O6"_K0prJ€£iˆÇ€yÃt{¾qu¢]oƒHy}J‡†Xy|O\d5:D)3=$4>&WN?XO@YPAZQB\SD]TE]TEcZKbYJbXNcXRg\Zmacsfmwjs|n{~p}s€s€~p}wjtobli\fcb]a`[a^W_\U_[R^ZOa[ObZMe\Kg\Ji\Ii]Gk\El]Fm]Dm]D_gOkiTqZH{M@•RI©WL®TI³WH¦N:¢G2¢?*ª;(¾:.Ò72à23å,1Þ7.Þ7.Þ7.Ü8.Ü8.Û7-Ø6+Ø6+×7+Õ7+Õ7+Õ7+Ô8+Ô8+Ô8+Ô8+¸=.·=.°8(§2!ª2!´;*½>/Â:,Æ6+Í6-Ô:2ÜB8àI>ÖG9Ç;,¹1!ßOGÙIAÔE=ÓE;ØH?ÜG@àC>á<:ã54ê67ï8:í9:ç77à72Ý:3Ü>5ÎKAÈE;½=0µ7)°5&³8)¹>.ÀA2Á;/Ê<2Õ>5ß=8ç;9î79ò67ô68æ7>æ7>æ7<å8:å99å97ã:5ã:3Þ5.ß6/ã81ä84å97ç98ç9:ç9:ë;>ç9;á99Ü<<ÖA=ÌC;ÀB6´@3¦;+¢=+>,™<*–;(•:'”9&“8%‡F2‡>/†/%”-(ÀIKèkoçlqÊWZ¶OP©TQŸVO˜YP•[P–]R™^Vœ`XMb!:O3JOf x’I˜²h¡½r »t™²pƒ›akN\lEWdHS\GHN@=C9;<,AB4=?2:=2,¯:)½9,Ì70Ø42Þ22Ý6-Þ7.Ü8.Ü8.Û7-Ú8-Ù7,×7+×7+Õ7+Õ7+Ô8+Ô8+Ô8+Ô8+Ò9+¸>/·=.®9(¥2 ¦3 ²:)»=.¿;,Æ:-È4*Ì3+Ó;0ÜE:ßPBÞRCÚQAÝE@Ø@;Ñ<6Ð;5Õ>7Ø=8Û96Ý33é69í68ï79í68é77å97â=9á?:ÆC9¿?2¸:,±6'¯5&²8)¸=-¿@1ÅA4ÍA4×@7ß=8å97ê67ï56ô68ç6<ç6<ç7:æ89æ87å97å95ã:3â92ã:3ã:3ä;6æ:8æ:8å99å99æ9;ä:=à<=Ú?=Ñ@;Å?6¸<2¬;-¥;+ <,œ=+—<)–;(’:&‘8&7%z;)€8)‰5*ž;5ÁQPÚceÔ]a¹MM­NL¤SOYP˜\R—^S—^U˜_V™^VSg*Sg(^r3zO—°l¥¾z™²nˆ¡`j‚Fau@Sf9IY5FP7?H59?358/;<,AB4=?2:=2;A5:C2@M3Rc?]uCgƒHqLp”Jm“Hk“Jk“Lh‘Km‘Tn’To“Sm”Qk“Lj”Hl—Hm˜HpJnžJp Ls£Ou¦Tx©Xx©Xx©Zm–\b‹QY‚H]TE]TE]TE]TE]TE]TE]TE]TE[RC\SD]TE^UF_VG`WHaXIaXIe]He]Jd[Jd[Le[Qf[Uh]Yh\\i]]j^`k_ak__i]]f[YbWU`USYVMWTKTQHRNCQMBSOCWQCXRB^WG^WEaYFc[Fg\Hi^Hk`Jk`J^cOmhUy_PˆXN¤[T³VQ´HE¸E>¹@7¸>3·<-·9*¼8+Ã9.Ê:/Ï;1Û7-Û7-Û7-Ü8.Ú8-Ù7,Ø8,×7+Õ7+Õ7+Õ7+Ô8+Ô8+Ô8+Ò9+Ò9+º@1¶>.®9(£2 ¢3ª:&µ=,»=.Ä?0Å7+Æ2(Ê3(Ð<0ØF9ÛM?ÝQBÜ87Ø43Ô20Ô52Ù:7à>;å=<é;<ï8<ï5:ì27ê24é56å97á<8à=8¹;-·9+±6'®4%­5%°8(µ<+»=.ÈD7ÏC6ÖB8Ü=7â96è64í55ò67ê5:é6:é69ç79ç77æ95å:3å:3ã:3ä;4ã<6ã<6ã;8â:9á99à88Ý9:Þ;<Û@>ÕA=É>7º:1­7+¥7(¡;,œ=+˜=*”<(’;(9&8%Ž7$u8%y6%ˆ9,¢E=ºROÂVT¹OO¬HH¤LHœSL˜ZO—^S–bU—aW˜_V˜]UgxB{ŒU“¦n¥¸€«À‡ž³zz‘YYp:?R$AS)AQ-?L0:C.6<.690581:;+@A3=?29<1;A59B1@M3Qb>_wEi…Js’Nr–Lo•Jm•Lm•Nk”Np”Vq•Uo–Sn–Pl”Kk•Il—HmšIpJpJp Lu¤Sx©Xyª[u¦Wq¡U_ˆNVEOx>aXIaXIaXIaXIaXIaXIaXIaXI_VG`WH`WHaXIbYJcZKd[Ld[Le]Ff^Gf^Ig_Lg^Of\Pf\Rf\Sh]Wh]Wh^Uh^Ug]Se[QdZNdZN]YNZVKVRFRNBPL@PM>RO@UO?WQAYTA[VC^WDaZGd]Jf`JgaKadSleUt]O‹[Q«b\»YXºDD¾9:Æ;8É:6Ç80Â8-½8)¼:*½@.¾C1Ù7*Ù7*Ú8+Ú8+Ú8+Ø8*Ø8*Õ8)Õ8)Õ8)Ô8)Ô8)Ô8)Ò9)Ò9)Ò9)»A2¶>.¬9'¡4 2¢8"¬=)µ@.¼>/Á9+Ä6*Ç4*Ë7+Í;.Î0å26á14Ý02Ý34à88å;<ë=?î;?ï6<í38ì/5é05ç47ã77Û64Õ30±7(°6'®6&¬7&¬7&®9'²:)µ:*ÃA3ËA4ÔA7Ü?8â:7ç85í76ð67í6:í6:í68ë76ê86è94ç:4æ;4â92á:2ß:4à;7Þ:8Ý98Û97Û89Ö<:Õ@<ÓB?ÊA;»;2¯6+¥5'ž7(œ;*—<)“<)‘<(:&8$Œ7#Œ6%z@,v5#6'™E;¬OH¬MI©LG¨PLPH–VL“ZO“_R“bT•aV—aW™`W~‹]™©z­½Ž¦·Š¡ts†YN`8/A->3B%:F.=F3;A3:=2;<4<=79:*?@2<>19<1:@49B1?L2Pa=`xFj†Kt“Os—Mq—Lo—No—Pm–Pp—Tq˜Up˜Ro—Pm•Ll–Jn™JoœKqžMrŸNt£Sy¨X|«]w§[mSd”J[„LS|DNw?cZKcZKcZKcZKcZKcZKcZKcZKcZKcZKd[Ld[Le\Mf]Nf]Nf]Nf_Eg`Fh`IiaLiaNi`Oh_Ng^OjaRi`Qi`Qh_Nh`Mh`Mh`KiaLb_P^[LYVGTQBPM>NKTQ>VS@YVC\YF^[H^]I`aSf^QmWJ†[R­hcÁb`ÄLMÌ@CÔ:<×79Ö74Î70Á9+·>)²D+°H-×7)×7)Ø8*Ù9+Ù9+Ö9*Ö9*Õ8)Ô8)Ô8)Ô8)Ò9)Ò9)Ò9)Ò9)Ò9)¼A2¶>.«:( 7"™5š7 ¢>&¯B-±<*º;*Â:,È8-Ë8.Î:.Ð<0Ò>2ò5<î3:é27ã36â46â46â46ä15ì5:ì39ê38ê5:æ8:Ü66Ñ2/Ç,(®9(­:(­:(«:(«:(«:(¬9&¯7&¸:+Á<-Í?3Ø?7à=8æ:6ê86ì87ï56î66î66í74ë84ê93ç:3æ;3á:2ß;2Þ=5Ü=9Û=:Ù><Ø=;×==ÌA<ËB<ÆA:»<3­7-£5(ž7(š;)–;)“<)=(Œ;(Š9&‰8%ˆ7$‡6#}C/s4"y4$“G:¤RG¡NFžNE¡WN˜UL’XL[NŒ\NŽ^R”`U—aW›bYƒŽd˜¤|©ƒ€Žj]kJDS42@&$2-:&0;*5=.9?36:;3::29:*>?1;=08;09?38A0>K1Pa=ayGk‡Lu”Pt˜Nr˜Mq™Pq™Ro˜RršSršSršQp˜Om—Km˜Ip›LržOt Qv¢Sx§Y{©^z¨_qŸVd’JY‡?]†NVGQzBe\Me\Me\Me\Me\Me\Me\Me\Me\Mf]Nf]Nf]Ng^Og^Oh_Ph_Pg`Fh`IiaJjbMjbMjbOjbOjbOjbOiaNh`Kh`Ih`IhaGibHjcGe`Mb]J^XHXRBSM=MJ9KH7IH6KJ8LK9LM;NO=PQ?QTASVESVEYYM]WKcQEzXN¡ha¸eaÇUUÛORÞ=Cã8>à67Õ62È:.¹@+­E*¦I*Ô7(Ô7(Õ8)Ö9*Ö9*Õ9*Õ9*Ô8)Ô8)Ò9)Ò9)Ò9)Ò9)Ò9)Ò9)Ñ:)¼@4µ=/«<+ :$—7’6š<#¦B*°C.¹@/¿;,Ã7*Å2(Ë4+Ó:2Ù@8ó1<ð2<î5=ë8>ç:>å;>ä:=ã9<á48ä5:å8<ä;>Þ;<Ò86Å1-¼-'«<+«=,«>*©>*¨=)©<(©:'«8%¯6%¹7)Å;.Ñ=3Ù<5à;7ä;8è;7ð75ï75ï75î84ì94é;4è;4å=4â>5à?7ÞA:ÚA;ÙA>ÕA?Ñ??Ñ??¾B:»@8µ<3ª8-¡5(›5'˜8(•<*‘;*<)Š<(‡:&†9'„7%ƒ6$‚5#y<)r3!}:*—OA£YLœRG•OE–VJ”ZN[MŒ[M‹[OŽ\Q”^T™`Yœa[s}Xyƒ`r|ZU`B9F,/;'0;+1;03=44;35<4:?8?B9?A6<<277+89)>?1:27@/=J0O`HO?HO?PPDVRGYOChREYM˜UL³RLØXWàGJçï:Aì?CæBCáACÞ@AÚ>?Ï12Ñ56Ô::Ò<;Ê;7¾73µ4.¯3+¥>+¥>+¥>+¦?,¥>+¤>(¥<'¨;'ª7$²7'¼8+Å8.Ì8.Ö92Þ<7ä?;î85î85î84ì94ë:4è;4å=4â>4âA7ÝC9ÚC<ÕB;ÐA=Ê?<Ç=;Ã<9®>3©:/¢8+œ6(˜7'”8)‘:)Œ;(‹=)ˆ=*…<)ƒ:'‚9&€7&6%~5$v4$x5%…B2˜UEœXK“QCPD•ZL’ZM[NŽ]OŽ\Q’\R•\U˜[V™\W`hCX_=JS4>G,6?*2=-4>35?74=88>:=B/;9*78(=>0:26?.=J0N_;`xFk‡Lu”Pu™Os™NršQršSp™SqœMrNqœMp›LošKrNu¡Ry¥X«`~©az¥]qœUf‘L_‰G[ˆE\‰Hb‰RY€ISzCh_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Pg^Oh_Ph_Ph_Ph_Ph_Pi`Qi`QmcWlbVjaRi`Qh_Pg^Og^Mh_NiaNiaLiaLiaJh`IhaGhaGhaGh`Kg_Je_Ib[H\WCUR?PM:ML:EF4DG6DH7BI9BI9BJ;BJ;BJ;JJ@QQERPAUNÄYSÛQOãCEå8:ß55×:3Ê>/¸>)¬<$Ï8'Ï8'Ð9(Ò;*Ò;*Ò;*Ò;*Ò;*Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)½=2¶:.­<,¥>+˜9#Œ59ž@' :$¯<)¾?0È;1Ì8.Ñ7/Ù<5àA;ð;Bï>FëBGãCEÖ@?Ê;7À50»1.·0,¼51¾:5»<6³:2©9.£9,¡9,Ÿ>+Ÿ>+ ?,¡@-¡@-¡A+£>*¤=*©<(­:(²7(¹5)Á4*Ë80Ö?8ÝD>é:5é:5è;4è;4ç<4ä=4á?4Þ@5ÝC9ØD:ÒC;ÊA9Ä?:¼;6¸85´73ž9-™7*•5'’6'‘:)<*‰:)„9&†=*„=+=*€<)~:'|7'{6&{6&y1#€8*ŒG8–RE’PB‹K?ŽSE™_SXKZN’\R–]T—\V˜[V˜YT—XSV^7EM(6@8A&>G27@E>GJ?GI;BC1?>);;#78(=>09;.69.8>26?.E5>F7?G8=H8AE4HK6YS;_F0€K9Àj]Ýf`åSSçDEè@@ã?=Ö=5É=0Â>/É3$Ë5&Ì6'Í7(Í7(Î8)Ñ;,Ó=.Ò<-Ò<-Ò<-Ò<-Ñ;,Ñ;,Ñ;,Ñ;,¸3,·7.±;-¦;)˜8"‘7’8š:"«B-±<+¹7)Á4*Í6/×<7âC?êHCëBGéDHÝCCÉ:6»61´80®8.§5+ª:/¨9.¤8. 8-›9,–:+’<+>-˜=*˜=*™>+š?,›@-œA.žB-¡@-¡<*¥:(«7(°6)¶6+¾8-Å;1Ê=4ß:4á<6â?6ã@7âA7ßA6Ú@4×@5ÚG=ÒE;ÇA6»;2±6.ª3-¤1,¢1+”;-’:,:+:*‰:)ˆ;)…<+„=+~:'|9(|9({:({:(z9'x6&w4$z, A4˜NC“MAŽL>RE‘VHŽRG˜\R˜\R‘UMTL™ZU—XS–WR `^R[0IQ(AK&BK,>H/7@-2=-4>34;3HPEX^RW[LLO?1;=0:=29?34=,;H.Pa=bzHlˆMu”Ps—Mq—Lp˜OršSqšTpJqžKrŸLrŸNsŸPv¢U{§\ªb‚­fx£^i”O_‰G]‡G`ŠJfŽOhRd‰U[€LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj^^j_]j_]j_[j_Yj`Wj`Vj`Vj`TjaRjaRjaRjaRjaRjaRjaRj_Kh`Kg_Jg_Jd]J^YEUR?ONE5?E7>F7>F7=E6BF8>E5=F1DN5HK0PB'yS<¹ubÉdXà_YíUTêFGä>>â@=Û>9Ñ82Ì:+Î<-Ï=.Ð<.Ï;-Î:,Í9+Í9+Î:,Î:,Î:,Ð:,Ð:,Ð:,Ð:,Ð:,È?9ÆA:½A7®=/6#•2•2™3¦5#²7(Á;0ÑA8ÞE?æIDéJFìJGÞBCÛEDÎC@¼;5®9/¨>1¢A1œ?.œ@1™@0–>0’?/Œ?-ˆ?.„A.ƒB.‘;*‘;*’<+“=,”?+”?+–?,™>+Ÿ@.¡=-¤:,§9*¬8+±8-¶:0¹:1Ð90Ò;2Õ>5ÕA7×C7ÖD7ÔD9ÑE8ÊB6ÃA4¹=1°:0¨8-¢5.5,œ5.Ž=,Œ=,Š;,ˆ;+†:*„;*<,€=,~;*|;)y:)y:)x9(w8'u6't5&„1)‘C9˜NC‘K?ŒJ>PD’TIRG“SJšWQ˜UO™UR\X”WTŽSO—\XT]0Zc8_j@[eBIT66C)4@*0:-;H.Pa=c{IlˆMu”Pt˜Nq—Lq™PršSqšTq¡Kp LpJqžMt Qx¤W|§_ªc{¦aošUcŒJ]…Fa‰JeNeNc‹Ld‰U[€LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj^`j^`j^^j_]j_[j_Yj`Wj`Vj`Vj`Tj`Tj`Tj`Tj`Vj`Vj`VlaMk`LiaLiaNf_La\I[VCTQ@ML:HI9DG6AE6AE6?E7>D6=C5=F57@-?H3EM5AA%QA']E³u`³WHÙbZðebîRSéEFìFHèBDÝ79È9+É:,É:,É:,É:,Ê8+È6)È6)Ê8+Ë7+Ë7+Ë7+Ë7+Ì8,Ì8,Î7,Â3/¾5/¸5-¬3( 0"›0Ÿ1 ¥4$»A2ÇC7ÖG?ãKFçLGéJFåFBâC?ÕCCÏDAÁ@:°;1£=/žC1™F4•G3’E3E2ŒC2‰B0ƒB0B/{B.xD.Š8*‹9+‰:)Š;*‹<+<+Ž=,<*–?.–=-›;+9* 8+¥9-©:/«;/¼7.¾90Á;0Ä>3Å?3Æ@4Ä@3ÁA4¸:,²:,ª9+£7+7+™7,–8.–91‰=-ˆ<,…<+„;,‚:+€;+<+<,};+z;*z;,w9*v8)u7(t6's5&Œ91”F<—MBŽJ?ˆHMKB3;I27C-EJ3IG0K<%mN9—dO§`NŸA5ÆSLçc_ð^^îRUíJMêDHç>CÉ;/Ç9-Å7+Å7+Ç9-Ê:/Ë;0Ë;0Ñ>4Ñ>4Ñ>4Ò>4Ó?5Ó?5Ó?5Ó?5Ó?=ÑB>ÍD>ÆF=ÁG<ÂI>ÆN@ÎPDÙSJÞOGäLGäIEåFCâC?àA=ß@<ÔFDÊC?º?7«<1ž>.—D2“H3‘J6‹G4ŠF3‡D3„C1B0zA.wC.uB/†8+…9+…9+†:,†:,‡;-‡;+ˆ;+‰:+‹:)Ž8)8*•9,™<-=/ž>0«9/­8.®9/°:.°:.²:,¯9+®8*¨7)¥7*ž7(›6*•7+’8-9/;0†=.…<-ƒ;,9*:+~9*}:*};-|:,z;,y;,w9,s8*q6(q7)q7)B8”G=‘K?ŠH<‡I<‹OD“UJ—TL—PLSP˜QO–RO—\X_Xh^žzn™k…’fu‚VYh=CR)?O(P`B'=A&;>#78(:;-79,9<1;A57@/MKH/JH1Q?+e>-”ZL¬`S›>6œ4+µ@9ØXUóigödeëRUèINìKQ×J@ÓF<Í@6Ë>4Í@6ÒD:ÕG=×G>ÚJAÚJAÝJBÝJBÞKCßJCàKDàKDëRTéSTãTPÜSMØSLØSLÛTNàUNàLHâHFäEBäB@äB@äB@ãEBãEBØJHËD@¹>7ª>2žA2–C1F3I6‰F3‡D3†C3ƒ@0@1}?0y@/x@1ƒ9.ƒ9.‚:.‚:.ƒ;/ƒ;-ƒ;-ƒ;-9*‚9*…9+‡9,‰:+;-<.=/›;/œ:/ž9- :.¡9,¢8*¢8*¢8*Ÿ8)œ8)˜8(”8)9*Œ:,ˆ:-‡;-ƒ;-‚:,9+~9*}8)}7+|8+{9+z8*y9-x:-t9+q5*o5)q7+r:-G;ŽH<‰I=„I;…K=ŒRF“WMšWO˜QMžTQ™RP•VQ’`YˆbW‚h[ŠwhivKZi>JY.AR&IZ0Wi?dvLj|TXjDL\8?M,:D)C-=@-:=*89):;-68+8;0H-NC-b=-„D:¯VP¶MJ¡++´:9º=;ÑTPòpnýwvñehêY^ò]cáVOÚOHÒG@ÎC<ÑD=ÔG@ÖGAÖGAÙHCÚIDÚIDÝIEÞJFÞJFàKGàKGãGJáGIÝGHÙGG×HD×HDØGDÝEBàBAåABé@CêBBèBBäB@ßA>ÜA=ÚJIÌB@»<6®>3¢@3—A2B0D3‰A2ˆ@2ˆ>1…=1‚<2€<1=1}=1ƒ:3;3;1;1€<1€<1=/=/=/€.™9)•9*“:*Ž;+Š;,‡;+ƒ;,€;+‚:,9+7)~6*{5){5)z6)z6+x6*x8,w9.s7,o5)o5)r:-u=0ŽL>‰K>„J<‚M=…QC‹VH’XM—WN”MIœRQšTR•[We\y_PcXFb]IBP,?M)?O(K\2_qGk~QcyKVk@M_7@R,6E&7D*=F1=D4:=27:19:*:;-68+8;0G*SA+{E9¦NL¸EH»5<¾19Ë@EÄ?@ÊJIÞb`îrpïopçbeáZ^ÛRJÕLDÏD=ÍB;ÏD=ÒE>ÐC<Î?9ÒC=ÓB=ÔC>×C?×C?ØD@ÙEAÚEAà?Dß@DÞDFßFHßIHàJIãIIæFHçACëADîAEîACéAAâ@>Ù>:Ö=8ÛEGË=<»73°;4¦@4˜?1>0ŽA1‰=/Š<0‰;1‰92‡81†93…:4„;4:4:4€<3€<3<3}=3}=3|<0{=0{=0{=.{<-z;,y:+z8*z8*€:0‚:.„:-ˆ:.Œ:.‘;.”<.–=-’9)‘:):*Š;*‡;+ƒ;,<+}<*€8,€8,~6*}5)|4(z4(z4*y5*u3'v6,v8-r6+n4(n5*s:/v@4‹PB†N?N=R@…VF‰XIŽUJ‘RI“NI™RP”SO‘\VŠfZl\LML7BL3@O.KZ9WgC`rJezOdzLVl=G]/AV+7I#0A!5C*=F5QJ:MG7IC3GA13M*>G*[B.PGºVVº7?»'3ÜBNÐ:CÄ9>»;:ÂHGÓ][ßgf×[]ÇILÓJDÏF@ÌC=ÎC>ÒGBÒGBÐB>Ë=9ÒC?ÓB?ÔC@ÕDAØDBÙECÙECÚFDá>Cà?DÞBEßEGáGGàFFàBCâ=AëADí>Cì;Aê<>æ>>ãA?ßD@ßFAÙ@CÉ78¹30±:4§?4š>1=/Ž?2Š;.‹9.‹80‹61Š71Š73‰84‰:5:3:3:3~;3|<3|<2{=2{=2u9.v;-w<.w<.x=-x=-y;,y;,{;1};/~8,7*„6)‡5'‰6(‹5&7(‹8(‹:)ˆ;)…<+<,~=+{<*€8,7+~6*|4(|4({2)y3)y5*t1(u5+v8-r6+n4)n5*t;0xB6ŒTE„Q@P>‚UB„YHˆYI‰SGNG˜SN˜RPPKˆVO‚bUeZHFK4;K0IX;[jKgxVewQYnCSi;Me5I`28M"-B*;2@):E7;B;8<;7;<<=-<=/79,9<1=C77@/6C)DU1Rj8_{@mŒHp”Jq—LršQtœUr›Uq¢Qt¥Vu¥Ys£Ym›Sd‘N\‰HZ„DdŒNa‰J`‡HcŠIfJiŽIeŠDa‡>`‚PWyGPr@i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTo\Nq_QtdUrdWnbTj`Th`ShbTgaSebQa^K[VBVQ;TN6NH.GA'RD)N=#cI2iV²zm·ng³[W¸PQ¶BEÁ@EÉ@GÑBFÖDGÚEIÜGIÝGIÔBEÔBE×BDÙEEØDBÒC;ÎD:ÌH;ÄF7ÃH9ÆH:ÊG?ÐEB×BDÜ?FÞ=EâBDâBDâBDâDEâDEãEDãEDãEDâDAâC@áB?â@>ã?=ã?=ã?=å@>ÎE?Ä?8¶:2©80Ÿ:0•>4Œ@3ƒ?2A4|@5}?4<3ƒ:3‡83Š73Œ72…<-…<-…<-„;,ƒ;-‚:,‚:,‚:,9-9-9-~:/~:/~:/~:/~:/~80~80}90}90}90}90|90|90|90|90z:0y9/y9/x8.w9.w9.w8/w8/v7.t8.s7-r6,q5+p6+l2'q7,m4)l3(o6+m4)q8-H=ULƒTL†QK‹PJNJ•NL˜NM—PL”SM‹UK†\NdOkaFTW8JX5N_;gT`zMWpFTkARg@O`0CA4B@4@<12:/2:/4:.5;-9=.A,>D*T^4ÉE9ÈF9ÊG=ÍG>ÒGDØCEÜAEß?GáCDáCDáCDâDEâDEáFDáFDáFDàEAáC@àB?ßA>àA=àA=â@=ãA>ÑFAÉB<¼=6¬:0 90“;/‰=0=0A4|@5}?4<3ƒ:3†91Š71Œ72…<-…<-„;,„;,ƒ;-‚:,‚:,‚:,9-9-9-~:/~:/~:/~:/~:/}90}90}90}90}90}90|90|90|90z:0z:0y9/y9/x:/w9.w9.w8/w8/t8.s7-r6,r6,p6+p6+k1&q7,m4)l3(o6+l3(p7,~H<‚SK„TJˆQJ‹PJ‘PL•OM–PN–RO‹OG…SH€[K{ePsiPhkLdrOgxT\uKXoEPf?Ka:K_:K\:GV7CP42><03;03;05;/6<09=/A,>D*Q[9^mDmPpŒRr’Sq™RsSsŸRxža|¢exžak‘T`†I]ƒF]ƒF\‚E`†Ia‡Jc‰Le‹NdŠMbˆK`†I^„G]MRtBIk9i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtbTo_Pm]Pm_ToeYog\keYhbVfbVpl`{xi~{jzgzuapiVf`JPVÔG@ÖGCÚFFÛEFÝDGáCDßCDßCDßCDàDEßECßECßECÞDBÞE@ÝD?ÜC>ÜC=ÜC=ÝB=ÝB=ÕF@ÎE=ÃC:³>5¢:/’8-ˆ9,<-€A2~@3}?2=1ƒ:1†91ˆ81‹80…<-„;,„;,„;,‚:,‚:,‚:,€:.9-9-9-~:/~:/~:/~:/~:/}90}90}90}90|90{8/{8/{8/{;1{;1z:0y;0x:/x:/x:/x:/t8.t8.s7-s7-r6,q5+o5*o5*k1&o6+m4)k2'n5*i3'm7+}G;†QI‡PIŠQJŽQL‘RM“RN•TP’UPVO‡[P^OtbNoiQnrWjwYfwWPf@K_:EY6BV3EV6GV7FU8ER8?I1*7;*:<.<>0<=/:;-5<45<46<26<09=/<>0=@-=C)MV7Zi@h|KlˆNpOq™RuŸSt Sz cw`n”Wc‰L\‚E\‚E\‚EZ€C_…Ha‡JbˆKdŠMc‰La‡J_…H]ƒF[}KPr@Gi7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtdWqaTm_Rk_SkaWlcZle[jf]jf]wuiˆ„y‘•’Œ|‰‚r€ygZfNLV>AI2CF1ED0D?,I=-TD5M:+O8*R6*T7)X8+];/a?3eA5‹KAœSL­UQ¶NK½EDÇABÓCCÛEF×?>Ø@=×B>ØD@ÙEAÚFDÛEDÛEDßCDßCDÞDDÞDDÞDDÝEDÝEBÜGCÛFBÚE?ØE>ØE>×D=×D=ØE=ØE=ÖC<ÔE?ÊE>»@8§;/–8,‹9+…;.‚@2@1~?0=/;/„:/‡9/‰90„;,„;,ƒ;-‚:,‚:,‚:,9+9-9-9-~:/~:/~:/~:/~:/~:/}90|90|90{8/{8/{8/y9/x8.{;1y;0y;0y;0x:/x:/v:/v:/s7-s7-s7-r6,p6+o5*o5*n4)j1&o6+l3(h2&k5)h2&l6*|F:ŠOGŒPHQIRMSN’UPWPŽYQ‰]R…aUy_PiZGd_IciOZgKN]@EU8AQ4=M0G2:A/7>,9=,9=.8<-7;,6=66=66;46<29<1;=/dxGj†LpOs›Tw¡Uw£T{¡dr˜[e‹N\‚EZ€C\‚E\‚EZ€C_…H`†Ia‡JbˆKa‡J`†I^„G]ƒFY{INp>Ef7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTseXugZsg[mcYjaXle]snhzwp~w† –©¥œ«§œª£™£‘œ”‰v~i`hSLSADK9AJ7>G4>G4BI7GNBÛ?@ÛAAÛC@ÚEAÚEAÚEAÚEAÞDFÞDFÞDFÞDDÝEDÝEDÛEDÙEAÚFB×FAÕF>ÔE=ÓF=ÓF=ÓF=ÔG>×@9ÕB;ÏD=ÁB9®>3œ:-‘;.‰=/„?0?/~?0=/<-„:-†:-ˆ:.ƒ;-ƒ;-‚:,‚:,‚:,9+9-9-9-~:/~:/~:/~:/}:1}:1}:1|90|90|90{8/y9/x8.x8.v8-y;0y;0x:/v:/v:/u9.u9.u9.s7/r6.q6.p5-o4,n3+m4+m4+j1(o6-j4*h2(j4*g1'k5+zF;MGNH‘PJ’SLUOŽWPŠZP…ZQ{YMv\OkZJ]UBYXDY^HOYA>L3;G18D.5A+5A+8D.=I3AM7EN;BK8?H5.5<,4;+5;75<56;56;48;2:-;@)GP1Ra:buGi…Kq‘PuVy£Wx¤Uzcn‘W`ƒIZ}C[~D^G^G]€F`ƒIa„Jb…Kb…Ka„J`ƒI_‚H^GW{KLp@Bf6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTmaUndXpf\lcZkd\rmg„|‘‹¥¤ ³²®ÄÁ¼ÉÆÁÉľÅÀºÀ¹±¹²ª¤œˆ‚tfcTPQAEI8=F38E18G45F35F44E36D58D6;E:?G<@H=<6(L0–=/Œ=.†>/‚?/€>.=-<-ƒ;,„;,‡;-‚:,‚:,‚:,‚:,9+9-9-~8,~:/~:/~:/~:/}:1}:1}:1}:1z:1z:1y90y90x8/v7.v7.v7.u9/u9/u9/s9.s9.s9.r8-r8-q6.q6.p5-o4,n3+m4+l3*l3*h2(l6,i3)f2'h4)e1&i5*xD9’KE’MF“PJTLVO‡XNYO|\Os\Nk[L_XFUTBPS@JQ?@I64@,3<+2;*09(09(2;*5>-9B1-;@*CL/O^7_rDi„Mr’SwŸXy£Wv¢Us–\f‰OZ}CX{A\E]€F]€F^G`ƒI`ƒI`ƒI`ƒI`ƒI_‚H^G]€FVzLJn@Ae7haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTiaVjbWkdZmf^upjˆ…€Ÿžš°°®ÂÂÀÓÒÐâáßéåäçãàãÞÚÞÖÓ×ÏÌÒº°º¤™˜†zym__YIKL:>F19E1>2J91`94ˆHH²\_È_dÍVZÐOSÕMOÚLKÜJJàHEáFBãDAåA?ÞDFÞDFÞDFÝCEÝCEÜBBÛCBÛCBÚDCØD@ÔE?ÓF?ÐF<ÏF<ÐG=ÎH=Ý>8Ú?:ÒB9ÉC:¼C8«A4™<-Œ9)‡>-ƒ>.>-€=,€=,<,ƒ;,…<-‚:,‚:,‚:,9+9-9-~8,}9.~:/~:/~:/}:1}:1}:1}:1}:1y:1y:1x90x90w8/t8.s7-s7-s9.s9.r8-r8-q8-p7,p7,p7,p5-o6-n5,n5,m4+l3*i3)i3)g1'k7,h4)e1&h4)d0%f4)uC8•JE“LH“PJTL‰WNYOx[Mp]Nj^N]WGPQAKN=CJ:9B12:+08)36-17-06,/5+/5)17+2:-4<-9D4;F6=H7*0640641622716929;0:<.:?)?H+KY5]pChƒLs“TwŸYw¡WržQiŒT^IUx@WzB[~F[~F[~F]€H_‚J_‚J_‚J_‚J^I^I]€H]€HUvKJk@@a6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcToh^ng_lh_tqj…„¡ ž¼¼ºÏÏÏÎÏÑààâòòòúøùû÷öøòòñìéêåâïÍÃàÀµÅ©¥€sbaZGML7CH2AI4AH6BF7BD7C@9D<9C98C772?5;@9@93H/+c76QR³giÇmmÂ[\ÉYWÑUS×QNÝKKåGFèBBê@AÞCGÞDFÞDFÞBEÞBEÝADÜBBÜBBÜDCÙCB×C?ÔC>ÒE>ÐE>ÏF<ÐG=â@;Ý@9Õ@9ÌC9ÀD:°B5›;-‹5&Š=-…=.>-€=,€=,<,ƒ<*„=+‚:,‚:,€:.9-9-~8,}9.}9.~:/~:/}:1}:1}:1}:1}:1{;2w;1w;1v:0u9/t8.s9.r8-q7,r8-q8-p7,p7,n8,m7+m7+m7+o6-o6-n5,m4+j4*j4*i3)h4)f2'k7,h4)c1&e3(b0%e3(uC8”JG“NIQJ‹TM„XOzZMq[Mh\LXUDHK:=D4=E69A208+/7*5=056157257247005.06,08-19,6A3:E5=J9>K9;J77F12A,0?*.42.420511605818:/:<.:?+WzB[~FY|DY|D\G_‚J_‚J^I^I^I]€H]€H]€HSsJHh?>^5icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUfc\gd]vsn“’ޝ¯­ÄÆÅÚÛÝìíïóôöö÷ùüüþÿÿÿÿþÿÿûúüööùôñÿÞÏöÖÇãÈ·É´Ÿ­ž‡ŠƒicbFGG-EG/DF0GD3IC5H;3F42G34M797@;;@:@;8G85cGF‘kjŔ譩ҋ‡ÇtnÀ]XÆSNÖNNâIKëEIðCGÜFHáHKÜCFÕ:>Ø>@âFIàDGÖ:;Ú@@Ú@@ÙA@ÖB>ÔC>ÑB<ÏB;ÏB;ãA<Ý@9Ô?8ËA7¾B8°@4;.8*‹>.†>/‚?.>-€=,<+=*=*9-9-9-~8,~8,|8-|8-|8-}9.|90|90|90z:1z:1z:1z:1x=5w<4v;3u:2t91r7/p7.p7.o6-m7-m7-m7-m7-l8-l8-l8-i2+m6/p92o81k4-g2*g2*h3+e0(i7.d2)^,#`0&_/%b2(p@6’LJOKŠQJ‚QJ}YMv_QfYIRO>CF5=F58C35@02=/3;04:04:077577566446135016/05..6+.9+2=/6C29H5:I68G42D./A+,20,2.-2..3-36/780:&DR1YkCh‚Ru”[wž_r›Wj•N\}HXyDTu@Tu@WxCZ{F[|GZ{F^JbƒNbƒN^J\}H_€K`L^JTrNFd@:X4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUed_onj…†¤¤¢ÁÃÂÖÚÛêîï÷ûþ÷ûþøüÿüýÿþþþÿþÿÿýüÿüùÿûøÿïÚüêÒîÞÅØÍ±À»¤£„‚ƒcgkJMP1II/EC,HA/J>2L93M85Q99;;9BA?MHE\RQyjg¢‹Ì³®åÇ¿ÿÙÏ괪̃|Àc\ÌVTÛPSãFMâ=DÕEEÕEEÙGHÞIKÛEGÖ<>Ö<>Ü@CÚ>?Ù??Ú@@ÙA@ÖB>ÓB=ÒA<ÐA;ß@:Û@;Ô?8ÌA:¿C9±A6 ;/‘9+Œ=.‡>/ƒ>.>-€=,<+€=,<,9-9-9-~8,}9.|8-|8-|8-|90|90|90z:1z:1{;2{;2{;2v=4u<3t;2s:1r90p7.m7-m7-m7-l8-l8-l8-l8-j8-j8-j8-l5.n70n91n91l7/i4,g2*e3*c1(e3*_/%^.$b2(^.$`0&n?5„IEˆQLˆWRWOrVKdRDQJ:>?/:A16A14A02>02<14<15;17:388677577557446116005./7,.8-1<.4A07E49H58G44E22D.062.40.3--2,14-45-8:-9=,7?'DQ3YkEh‚Sv”`wbp˜YfNZzHWwETtBTtBVvDYyGYyGYyG[{I_M_M\|J[{I^~L^~L\|JTmOF_A9R4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUneVneVneVddby{x—™˜²¶µÍÑÒäéìôùüúÿÿûÿÿûÿÿûÿÿýÿþþþüÿÿûÿÿúÿÿúÿüßúùÛïðÐáåÄÒØ´¼Äž©‡’j`hCRW7DG,EC.KD4MC9N?8L=8C:;SJKi`a€xv›“¼µ¯×ÐÈçÝÓúêÝÿôéÿåÛ画Äec¸ACËBIáNVÚVRÒLIËDAÎBAÔFE×EFÙCDÛBD×=?Ø>>Ù??Ø@?×A@ÕA=ÓB=ÒA<Ü?:Ù@:ÔA:ÍD<ÀD<²B7¡<2“9.Œ=0‡=0ƒ>/>.€=-<+€=,€=,9-9-9-}9.}9.|8-|8-{8/}:1}:1{;2{;2{;2{;2{;2{;2t;2s:1p:0o9/n8.m7-k7,k7,l8-l8-j8-j8-j8-j8-i9-i9-n91m80m80m80m80i7.f4+c1(c3)a1']-#_0&c4*\-#_0&sD:OK‚UPXQqSK^J?OC7?<-37(2:+/<+0<.2=/4<15;17:37:388688668557257227016/08-.8-0;-2?.6C27E48G48G48G46=53:2/4-,1*.1(13(57*6:)6>'DQ5[lHk„Zy–fwœfl”X^‡KWwEUuCRr@Rr@TtBVvDWwEWwEXxF[{I]}K[{I[{I]}K\|JXxFPfOAW@3I2icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUneVneVneVneVofWgklƒ‡ˆ£§¨¹¾ÁÐÕØåíðóûþõýÿùÿÿûÿÿüÿÿüþûýþùþýøÿþ÷ÿÿöóÿâñÿÞëùÖäòÎÛêÃÌÛ²³Â™ ¬„}‰cdnKLS4EI0HJ5KI:GE9D@7QEEk__‹€¤š™µ°­ÊÇÂÜÜÔççÝ÷óèÿýñÿøíÿÝÕú·±èŽŽÌbd±>CÃPIÉTMÉOJÃF@ÊFBÔMJØJIÑ??Ò>>Ô>?Õ?>Ö@?ÕA?ÓB?ÓB?ÒC?×>8×?:ÒC=ÌE?ÀE>±B9¢=5•;2Œ<1‡=0ƒ=1=0=-~<,€=-€=-~:/~:/~:/}9.}9.|8-{8/{8/~;2|<3|<3{;2{;2z;4z;4z;4p:0o9/o9/m9.l8-k7,j6+h6+i7,i7,h8,h8,h8,h8,h8,h8,o:4j81h6/i70j81j81e4-a0)e4-b1*].&a2*b3+Y*"_3*zNE~]XvWRiNGWC:J<3@:.:;-8<.08)/:,1<.2=/5=25;169078079468368349338138119.19..9+/:,1<.2?.5B18E4:I6;J7;C87?428.-3)-0%/1&24'48)4<'ER8_pPr‹d}šnwœifXT}EUrBTqASp@Sp@TqAUrBVsCVsCWtD[xH]zJ\yI^{K_|L\yIVsCK\JD8f\Z†|z«¡ŸÁ·µËÃÁÕÐÍãâÞîïé÷øðùöíüòèÿóéÿóíÿäß즤´if«K=³QDÁYNÇ[QÆQH¿D=ÂA<ËD@Ë@=Ï?>Ð@?ÑB>ÒC?ÒC?ÑC?ÑC?Ö>9Ô@<ÒD@ÉE@½D<¯@9 >5•<4Œ<3‡=2ƒ=1=0=/~<.=/€Qn>Qn>Qn>Qn>Qn>Sp@Sp@WtD[xH]zJ]zJ_|L_|LZwGQn>ESF6D7(6)gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXpgXpgXinrz‚…“š «´¹ÄÍÒÜåêì÷ùôþÿôþýöÿüúÿúûÿ÷ûþóøúìõöæòóãòþêôýèôüåóøáòöÛëëÏØ×¹ÅÄ¥±°’ŽregOMP;EL:EM>EODGSG~zqŸ›’ƽ¸ÙÎÌáÓÒçÛÛôêéü÷ôðïëûüöÿÿöÿþôÿúñÿôêÿçÞÿÚÒß‘}·fS¢K:²UF½WKµF;·@8ÈKEÇC>ÊC?ÌB?ÎC@ÎC>ÍD>ÍD>ÌC=Ô@<ÒC=ÎE?ÅD?¸A;ª=8ž;5•<4Œ<3‡=4ƒ=3=2=1~<0=1=/~:/~:/~:/}9.|90{8/{8/{8/|<3{;2{;2y:3y:3x92w81w81m80l7/j8/j8/i7.i7.g7-g7-g7-g7-f7-f7-f7-f7-f7-d8-i70h6/g5.f5.g6/h70g6/e6.a2*e6.^2)\0'`4+a5,i=4|PGQJBE>6:6-85,99/8:/47,36+4:.5;/5;/69.69.68-57,46+19,19,19,19,19,19,19,19,08+.9+.9+/:*0;+3>.6A17B2gw]umv‘nf‰_RwKAh;Mj:Nk;Pm=Pm=Nk;Nk;OlVsCZwG]zJ^{K_|L_|LVsCLi9=H@/:2#.&gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXqhYqhYcjpmtz„’£¬±¾ÉÍÓÞâåðòðüüòüûõþùøÿ÷úÿôüÿòúýìøùçöøãööìù÷ëúöêýöæÿôâøëØçØÁÖÆ¯À±šŸ“}vn[ZWFOQCQWKYcZbme–˜‹²²¦ÕÎÆêÜÙõããüéëÿñôÿ÷ùÿýýýþùøûôõûñúýòÿÿóÿÿóÿÿñÿãÊ¹q[¨WD¬SCµQB¹MA¿JAÂG@ÆE?ÉE@ÊE@ÊE>ÉD=ÈC<ÈC<ÒC?ÒD@ÌEAÂC=³=9¦;5œ;5•<6Œ<5‡<6ƒ=5=4<3~<0=1€<1~:/~:/~:/}9.|90{8/{8/y90{;2{;2z:1x92w81v70v70u6/k90j8/j8/j8/j8/h8.h8.h8.g7-f7-f7-f7-d8-d8-d8-d8-h6/h70i81i81h70i81j;3l=5g80k<4b6-a5,oC:xLCtI@uJA:=647036/7:18;247.14+25,58-58-57,46+46+46+46+46)/7(08)08)08)08)08)08+08+19,08+08+/7*08+19,3;.4e9Jg9Li;Nk=Nk=Li;Li;Mj
      UrDYvH[xJ]zL^{M\yKQn@Eb47@;+4/!*%gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVofWpgXpgXqhYriZhowmt|‚‹’¥®µÂÍÑÔßãäïñòþþóýüôÿùöÿ÷úÿôüÿñýÿíýÿêýÿêÿöñÿøóÿ÷ïÿ÷íÿöëÿïáöÜÍäʹƯ§”ƒ€sce]P[YM_bYovo|…€¦­¾À³ÚÖÍñãàÿìíÿñôÿñ÷ÿñ÷ÿ÷ûûúøøÿøøÿúôÿõîÿïòÿï÷ÿóÿñÖÿðÖÿȰÅ}g¢O=®Q@¸RD³C8ÀIAÄH@ÇF@ÇF@ÈE=ÇD<ÆC;ÆC;ÓD@ÐE@ÊE@¾A=±;7£74š93•<6Œ<5‡<6ƒ=5=4<3~;2<3=1~:/~:/~:/}9.|90{8/{8/y90z:1z:1y90w81v70u6/u6/t5.k90k90j8/j8/j8/i9/i9/h8.f7-f7-f7-d8-d8-d8-d8-d8-f5.i81l;4k:3j92j92m>6qB:n?7pD;g;2g;2SJŒaXTKpE<6=52913:27<5492/5+25,9<345-35*24)13(13(35(46)57*,7',7'-8(-8(-8(-8(-8(/7(19*08)08+/7*/7*/7*08+08+7@+9B-=D2=D2=A29;-35'/3$3:*JVBcr[f}a\wVLnICgA=c:He7Kh:Nk=Nk=Kh:Jg9Li;Nk=TqCWtFZwI[xJ]zLZwINk=A^05;9*0.!'%heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVg`MjeOnlWnl]ff^eeeqqy‡‘“–ž¡«³¶ÃÈËÙÝàìíï÷÷÷ûùúþýûÿþúÿÿûýþøûüöùüóúýôùÿõùúõùúôøúïúûëûýèöùÞäçÈÒÖµ¶¼š”›ymvW\fK`lTq~lƒ‘€žŽ··µËËÉââàïïíôôòøøöúúøùù÷þþüþþüþþüþþüþþüþþüþþüþþüæÿÿðÿÿûÿÿýïîЪ§ a\™D=¸MEÄKBÈC:ÊA7ÎD:ÑH>ÏJAÉI>ÆG>ÁJ2¿K4¹L5¯K4 H2”F2ŒE3‡E5‚D5C6€@4‚>3…;2‡9/Š7/6-~:1~:1}90|8/{7.z7.y6-x5,w7-w7-x8.x8.v8-u7,s5*q3(h91h91h91g80h70g6/g6/g6/f5.h6/i70j81i70h6/f4-g2,k1-k4/n70m80k9.j:.i>.iB1dC2gJ8aJ8raOyn\ƒ|j…‚qOL;4:04:04:039/39/39/28.28.17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4.05//4./4..3-.3-/4./4.05/0;32=55A77C98D86B64@22?.3@.DQ=WeN\jSSaHHV=DR8FT:Ic>Ke@Ke@Ke>JeOjAUpGYtK\vO]wR]wTWpPHaC8Q3).2&+/$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVjcPlgQmkVlj[gg_lll~~†’ž§±³¹ÁÄÏ×Úâçêðô÷ûüþÿÿÿÿþÿþýûÿþúÿÿûþÿùûüôøûòøûò÷ýóøùóøùñøúíøùéùûåòõÚáâÃÌЯ´¸—‘–vkrSYaI_kUtoŒ˜Š›©œÀÀ¾ÓÓÑççåóóñ÷÷õûûùüüúûûùþþüþþüþþüþþüþþüþþüþþüþþüîÿÿôÿÿüÿÿÿüúÿíêñ¿¸Ã}u¢J@³K@»J<ÅK>ÈJ>ÄD9½=2¿?6ÃD;ÂH3ÃJ7½M9³J7¦G5™C4D6‹F7ƒC7C8A7>5‚<4„:1†91‡81}:2}:2|91z:1y90x8/w7.v7.u6-v7.t8.t8.t8.r6,p4*o3)i81i81i81h70h70h70g6/g6/e3,e3,g5.h6/j81j81j81k92k60l71m80l:1k;/l>1j@0iD2hG6kP=gR?ufSvd‹†s†ƒrML:4:039/39/39/28.28.28.17-17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4.05//4..3-.3-.3-.3-/4.05/-80/:21=34@66B66B66B45B16C1CPAO6BP7FT:Ic@Jd?Ke@Ke>Ic3L/).2',0$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVmhTmhRmkVjk[jkcvxw‘‘™¨ª¶¾ÈÊÓÛÞêòõ÷üÿüÿÿþÿÿÿÿÿÿþÿþýûÿþúÿÿúýþøúûóõøïóöëñ÷ëô÷îöøíöøêö÷åõ÷áîîÔÛÛ¿ÉÊ«°±’“–yuy^kpZt{iˆ§œ¬¶­ÎÎÌÞÞÜïïíøøöûûùþþüþþüýýûþþüþþüþþüþþüþþüþþüþþüþþü÷ÿÿùÿÿþÿÿÿüúÿúôÿöíÿÑÄÙž•L=§Q@¬K;ª>1¸G9ÑXMÐTJ¾?6ÆD6ÇH9ÄJ=¹I=ªB7?5•A7’E=‡A9„A9@:>8~>5<4<4€;4x<2x<2w;1w;1v:0u9/t:/t:/s9.r9.r9.r9.q8-n8,l6*k5)j81j81j81j81i70i70i70h6/g5.g5.g5.g6/h70i81k:3k:3l;4k:3i:0j;1k?2lB4iD2fE2fI7lVAjYEviV†l‘Ž{€mEF439/28.28.28.17-17-17-06,17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4./4./4..3--2,-2,.3-/4./4.*5-+6.-9//;12>24@46B47D38E3?L:ER>CQ:;I28F->L3ES:H`>Jb@LdBKc?Ia=G`9F_8G`9RkDXpL]uS^vVZqTPgK=T8,C)).2',0%*.heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\kd\md]meZmfVniUljSlkVlm]pqi€‚ž¡¨º¼ÈÃÍÏÜäçóûþûÿÿúþÿüýÿýýýüûùÿþüÿÿûÿþùûüôõöîîñæëîãçíáíñãðôåñôãòôßðòÜêêÐÙØ¼ÈÇ«²±•¡¡‡‘“}‘’€œžª­¢¶»´ÀÅ¿ÜÜÚééçööôûûùýýûÿÿýÿÿýýýûþþüþþüþþüþþüþþüþþüþþüþþüüúÿÿþÿÿþÿöòïûôîÿýóÿûíÿõäêı·ƒn”Q>¡P=¸XH¸L?¸D7ÀG<Ç>4ÉD;ÈH?¿F>°?9¢;6š=8–A>?;‡@<@<}@;z?9y@9x?8v?8v=4v=4v=4u<3s=3r<2r<2q;1o;0o;0o;0l:/k9.j8-j8-i7,n72n72m61l71l71k60i70i70l:3j92h70g6/f7/f7/h91h91j?6f>4e=1f>2hC3iE5gF3cG2cJ6hV@k\GskV‡‚nŽzor_9>*28.28.17-17-17-06,06,06,17-17-17-06,06,/5+/5+/5+.3-.3-.3-.3-.3-.3-.3-.3-.3-.3--2,-2,-2,-2,.3-.3-)4,)4,*6,+7-.:01=14@25A36C2:G5Æ=7ÈA;ÈD?ÀC?´<;©98 9:›==‘==Š>>„@?|A=xA6s>6s>6r=5p>5p>5p>5n>4n>4m=3l<2j;1j;1i:0i:0i:0p62p62p62o51m61m61k60i70l;4k:3h91e90e90e90e:1f;2dB6cA5cC4dD5fG5eH6cH3_I2^L6eV?jbKrmW„ƒn„‡r[`L3;&28.28.17-17-17-06,06,06,17-17-17-06,06,/5+/5+/5+.3-.3-.3-.3-.3-.3-.3-.3--2,-2,,1+,1+,1+,1+-2,-2,,6.+5-*4,*4++5,.8-0:/2=/2=-5@06A05A-1=)1=)5A+9E/=O5AS9FY=I\@J]?J]=K^>L_?TgG\oQcvZbtZYkSK]G6G4$5"&+.$),"'*heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\lc\md]meZlfVlgSljSlnXorasvm…„Ÿ¤ª¸¿ÉÖßäîöùùÿÿûÿÿùýÿþÿÿÿÿÿþýûÿÿûÿÿúüüôóõêëíâãçÙßãÕÜãÓäéÒçìÕéíÖêìÔëëÓèæÏßÚÄÔθÔÍºÍÆ¶ËøÐÉÁÙÒÌàÛØëååòîïòòðùù÷ýýûýýûýýûÿÿýþþüüüúþþüþþüþþüþþüþþüþþüþþüþþüÿøüÿöùÿýýþÿý÷ÿýïÿøëÿõòÿøëúçÿÿíÿïÛ̧”£lX£ZG­VCªM;ÁA8ÃB<ÃD>¿D?·?>­;;£99œ:;–<<Ž>?…?=}@=wB7o>7n?7o@8n?7m>6i=4h<3h<3h<3i=4r73q62q62p62o51m61l71j81h70g80e90e:1d<2f>4f@5gA6]C4aG8cL:dM;cM8`K6]K3]M4]Q9`Y?miPss[€„mt|eFO:2>(39/28.28.28.17-17-17-06,17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,-2,,1++0*+0*+0*+0*,1+-2,,6.,6.*4,*4+*4++5*-7,.9+-8*0;+4?/5@/4?.3>-3?+4@,7F/;J3@P6DT:GWºH=ºH>ºG@·F@°C@¦=:97—<;‘=;ˆ>;€A5i=4j>5j>5k?6s63r73q62p62n72l71j81i81d8/d90c;1d>3d@4cA5cA5bB5VG4^OmmSsw^z‚jcmU2>(5C,4:039/39/39/28.28.28.17-17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1+,1++0**/)*/)+0*,1+,1++5-+5-*4,*4,+5,+5,,6+-7,,7)/:,2=/6A17B27B25@/4?.2?+5B.:G3>L5AO6ES:JX?M[BTbI]kTcqZ_lXUbPERA2>0#/#(..&,,$**heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVjdTjdVjcYkd\lc\md]lfZlfVomXmmUimVgkZembr{xŽ—œ¨±ºÊÓØäëñöþÿ÷üÿøüÿþÿÿÿÿÿúù÷ÿÿúýýõøøîðòåéëÝåéÚåéØåìÚæíÎèïÐéîÐæéÎèæÏèãÏáÚÈÙÏÃÚÍÄßÒÌìÞÛúììÿôöÿõùÿõûÿøþýýûÿÿýÿÿýþþüþþüÿÿýÿÿýýýûþþüþþüþþüþþüþþüþþüþþüþþüÿüúÿýúÿûøùýüøÿÿôÿÿðÿÿêþüðÿûùÿûÿÿôÿöæÿôßÿãÍ×­”¢sY°SA®Q?®N>°O?±OB¯J@¥C:š<4—<7‘>8‰?6ƒ@7{B7tD6qE8nG8s>:s>:s>:q>:q>:q>:q>:p?:sB=rA8l=7l=7m>8n?9r73r73q73n72m82j81i81f:1f;2d>3d@4bB5`C5]A3\@2[?1QI4[S>f^Gg_H`Y?ZS9ZS7\W:ZV;WW;knSrx^u}eUaI%37E.4:04:04:039/39/39/28.28.17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1++0*+0**/)*/)+0*+0*,1+)3+)3+*4,+5-+5,,6--7.-7,,6+.8-2=/6A39D69D67B46A1/<*2?-5B09F2:u@:s@9o>9o>9n72n72n93m;4l;4j;3g<3d<2c?3^>1dG9cG9T=-O8(M8'D/TR;PN7KI0MK2]Y>ieJeaDVU7XX<]`CosXz€fcmT=I1,:#1?(5;15;14:04:04:039/39/39/39/39/39/28.17-17-17-06,16016005/05//4./4./4./4.,1+,1+,1+,1+,1+,1++0*+0*.5.-4--4-,3,-4--4-.5-.5-+2*-4,08-5=29A6=E:?G7B25@03>-1<+2>*9E/BN8IU?O[EVbN]hWYdTLWIF5F4‰D4…D2}B0yB.s@-o?+v?:t=8u>9v?:t?9q<6r=7sA:q?8q?8q?8o>7o>7n=6n=6n=6l;4m<5m>6k?6j?6h@6eA5cA5dG9[A2^G7\I8N=+F7$G8%A4!IM4GK2DG,BE*MM1[[?abC`aBYY=dgJsw\sy_X`H8D,/;%6D-7=36<26<26<25;15;15;15;15;15;15;14:04:039/39/39/27127127116016016005/05/.3-.3--2,-2,,1+,1++0*+0**1**1*)0))0))0)*1*+2+,3,.5--4,.5-07/4;39@8?F>BIA:G69F56C13@.2?+5B.;I2?M6KXDR_KXeSVcRKWI8p;5q<6vA;sA:p>7r@9xG@n=6n=6n=6m>6l=5l=5l=5l=5g?5h@6gA6gC7eC7cC6`C5^D5aL;UB1ZI7`S@RG3C;&E=(GA+>G,BH.@F*<@%?B%LO2_`AijKaaEnqTvz_gmSHP84<%4=(=F18>48>48>48>47=37=37=36<28>48>47=37=37=36<26<26<25:449349349338238238227105/05//4..3--2,,1++0*+0*(/((/((/((/((/()0)*1*+2+070.5.+2++2+.5.5<5K:4-9/-3/-3/,2.gdUgdUheVheVheVheVifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWmlWimThpXht`hthm|wˆ—𥴻ÀÉÐÔÛáéðööûÿúþÿýþÿÿÿýÿþúþþöýýñúûí÷úéô÷âîóÝçìÕàèÐÜà¿×Ú»ÖÖ¼Ù×ÂÝ×ÉßÖÍåÛÙìàâøìðüïöÿõûÿùþÿúýÿûûÿûûÿýúþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüöÿþ÷ÿþúÿþþþÿÿüÿÿùÿÿøÿÿ÷þÿøÿÿøüÿùùÿýúÿÿøþÿøúÿõöÿóÿþìÿýéÿòßÿñÛÿðÚñÒ½³zyS3i?3i?3i?3f>2f>2f>2f>2aA4`C5`C5_C5^D5[D4ZE4VE3XI6OB/\T?oiSc^HMK4IG0LJ3;E*?H->G*48>47=37=37=39?58>48>48>48>48>48>48>47<67<67<66;56;56;55:45:438238216005//4.-2,,1+,1++0,+0,*/+*/++0,,1--2.-2.051.3/+0,+0,-2.2738=9'4.:0.5..5.-4-gdUgdUgdUheVheVifWifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWjnUiqYgs_drejyt…”—¡²¹¾ÇÎÓÚâèïõôùýùýÿýþÿÿÿýÿÿúÿÿøÿÿóþÿñûþë÷úåðõÞèîÔàéÎÛܽÕÕ¹ÑÑ·ÔѾÚÔÈáØÓêàßôéíþóùÿöþÿûÿÿýÿÿþÿÿþúÿþúþÿùþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüøÿÿøÿÿûÿÿþþþÿýþÿûüÿûúÿúúÿùùÿù÷ÿù÷ÿüùÿÿûþÿûûÿüùÿûùôîÿÿöÿþôÿýóÿüîÿ÷çùçÓéӾϴŸ¶š„•u`yVBlI5mH6rM;uP>mF7iB3gB2jE5nI9oJ:pK;oK;eA1eA1cB1cB1cB1cB1cB1bC1\G6\G6\G6ZG6YH6WH5TG4RG3PH3MH2fdM~~fprZVX@IM4HL3;E*A.;>+9?59?59?58>48>47=37=37=38>48>48>48>48>48>48>48>49>89>89>88=78=78=77<67<66;55:449338227105//4./4.-2.-2.,1-+0,+0,,1--2.-2.,1-,1-,1-,1-.21043376598:H7=L9@O<@O:8F91?2,9/.5.-4-,3,fcTfcTgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWioUiqYgs_bpcgxr‚”– ³¹ÁÊÑÕÜäéðöõúþùýÿýÿþÿÿýÿÿúÿÿöÿÿôÿÿñÿÿïúýèò÷àéïÕàéÎÙÚ»ÑѵÍË´Î˺ÖÏÅßÕÓìâãøíóÿöþÿùÿÿüÿÿýÿÿÿýþÿúýÿ÷þÿøþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüýýÿýþÿýþÿýÿþþþüþÿùþÿ÷ÿÿõýýóýýõþýøþýùÿþüÿýÿÿýÿÿþÿþùÿÿüÿÿúþúöõýøôÿþöÿþñÿþïÿûéÿóàöåÓåÓ¿Ò»©¹ŸŸƒuŽrd|]I}^JrVAaE0W;&Y=(Z?*X=(`E0`E0_F0_F0`G1`G1^H1^H1[L9ZM:ZM:XM9XM9UM8RL6QL6NL5QQ9ikS|€glrXSY?DM2>G,:G+48>48>48>47=37=38>48>48>48>49?59?5:?9:?9:?9:?99>89>89>88=78=78=77<66;55:4493382382/40.3/-2.,1-+0,+0,+0,+0,+/.,0/-10.21/32/32/32.210A.5F3;M7>P:=O7:L47I/6H.3E-6H0:L6MJ9EB1;A7;A7;A7;A7:@6:@6:@69?58>48>48>49?59?5:@6:@6:@6;@:;@:;@::?9:?99>89>89>8:?9:?99>89>88=78=77<67<6495273162/40-2.,1-+0,+/.,0/,0/-10.21.21.23-12,01):'/@-6H2;M5=O7?I.9F*?L0=J.AN2DN3HQ4LR6IN0JM0ZY;miLhdIc]C_YA_ZD`[GZUBQN=LI8=C9=C9=C989>89>8;@:;@:;@:;@::?9:?9:?9:?99>:8=95:6384162/40.3/.21.21.21-10-12,01,01-12-12$5"*<&3E/9K3XW9UT6SR3KE/JD.FA-D?,A>/@>1??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B79A6:B7;C8F;7B:7C97A66A16?.4<-39-270.5./51-7/-9+-<%.B3J7O7Z 8Y$8W+:U2:R8;P==O?>O=:L6@R8EX:EZ;DY:>U93J0(>'.5-,3++2*ZgM[hN\hP_iQakSckTglXhkXghVihVifWifWkeWmeXmeZnf[khWkhYkg[kg^jf]jf]hfZgeVgjWglVfoZerajwnzЉ𫲷ÉÓÑØÞáéìò÷úøþþùþúúÿøûþóúüï÷úé÷øæõôâíìØéæÓåâÏÜ×ÄÑ̹˾­Á´¤º¬Ÿ¼¯§Á¶²ÌÀÀÛÐÖèÞæûóþý÷ÿþûÿÿþÿþýÿüýÿüýÿüýÿþþþþþþþþþþþþþþþþþþÿþüÿþüÿþüÿýúÿýúÿüùÿüùÿýùÿýùÿþúÿþýÿýüÿüûÿýþÿþÿÿþÿÿýþýûüÿþÿÿýýÿüùÿøóøíçòåÝöèßÿïçÿûÿÿýÿÿýþÿÿýÿÿûýÿüýÿþüýÿýþÿþýÿÿýÿÿýþÿý÷ÿþîÿÿæÿÿâ÷÷ßýûââàÇ‹‡lRM0TM0QK+SJ+WN/UO/UN1TO1SO2QP4QP4PP6QM2PO3PN5PP6MO7KO6HM6EM5HQ6EN3BK.AH)BI(GM+JP,KQ-NR/PT1VZ9^aBaaE[[?VVVV>XV=YW>XW;XW9WV8VU7QK5OI3LG3ID1DA2B@3??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B7:B7:B7;C8F;76<83=51=/3B+9M*BY-Ia1Nq7Mn9Ji=Fa>AY?:L<:K9=O9DV5:@69A67B47B47C57D3:B7:B79A69A69A69A6:B7:B7:B7:B7:B7:B7;C8F;>F;>IA>J@?I>>I9?H7>F7>D8=B;>E>;A=6@85A39H1BV3Pg;ZrB]€F\}HVuIMhEBZ@9N;5G74E3XR6F;?G<>H=>I9?H7>F7>D8=B;=D=;A=6@85A39H1DX5Ri=]uEY|BXyDRqEIdA,6H2@R8L_AQfGShIMdH@W=4J329107/-4,YgMZhN\hP^jRblTemVgoZjo[lo\lm[mk\mj[nhZnhZoi]ph]liXkhYjfZie\ie\ie\ig[igXfiVchRajUerao|s{‹ŠŽŸ¦Ÿ±»ÂËÒÕÜäéðöòúüôúøñöðíðçéëÞáãÕÚÛËÒÑ¿ÌɶÉıþ«¾¹¦»´¢Ë¾®ÓŸÝÏÄæÙÑíâà÷ëíÿôúÿøÿÿ÷ÿÿúÿÿüÿþýÿýüÿûüþüþýþÿÿþþþþþþþþþþþþþþþþþþÿþüÿþüþýûÿüùÿýúÿýúÿýúÿû÷ÿúöþùõÿýüÿûúýùøüúûþüýÿýþÿþÿÿýþÿüýÿüüÿüùÿøó÷ìæòåÝøêáÿóëÿûÿÿýÿÿýþÿÿûÿÿûýÿúýÿüüýÿüýÿþýÿÿþÿÿþýÿþõÿüìÿüãÿúÝþýèÿÿëåãÌŒˆoRL2UN2TM0WN1VM.UO/WP3VQ3UQ4QP2ON2MM1PL1NM1NL3MM3LN6LP7KP9JR:LU:IR7JS6QX9SZ9U[9]c?gmI€”a’¦sŸ±š«’¡xˆ”pr|Z\bFLP7KM7LK6KI4NI5PK7TM:VP:WQ;VP:SN:QL9LI:IG:EE9CE:=>6F;?G<=G<=H8>G6=E6=C7=B;:A:9?;5?75A39H1BV3Ne9Wo?Sv2F@2IA4JB5KC6KD4MD5MD5MD3NB2OC3OC3PD4QE5T>1Y?2b@4nB5}E6ŒG8šG9¥E7²F9ºF9¿E8ÆF;ÉF>ËF?ÌG@ÌG@íCNíCLíCLíDKíDIïBFñ>Bõ@â?@×?<Ñ=;µ@.µ@.µ@.´?-´?-³@-²?-°?-­@,ªA.¦A-¢B,A*›A)˜@*—A*’?/’?/’?/‘>,‘>,’<+’<+’<+”?+”?+”=*”=*”=*•>+–?+—@,”?:•>7—=4Ÿ?1©B3³D3¼D3¿D4º?/¶@2­E8žH;‡H9mB2T8*D3#:659549547326216005//50-72/72/72/61-61-50,50,50,.0-.0-.0-//-//-0/-2.-3--5,-4+,4*+4(*7(+=.1E69LUPdUPdUPd0/-0/-10.10.40-51.62/72.83/83/83/:3-:3-:3-:3-:3-91.91.80-80-80-80-91.91.80-80-80-80-80-80-80-80-6.+6.+5-*5-*5-*4,)4,)4,)5-*5-*5-*5-*5-*5-*5-*5-*/,%0-&0-&1.'2/(30)41*41*63,63,74-74-85.96/:70:70@:.A;/C=1E?3H@3IA4JB5JC3LC4LC4KB3MA1MA1NB2OC3PD4P>0U?1^A3jC4xD6†D4“D5žB3¨B3°@2¶@4¼B7ÂC:ÄE<ÆF=ÇG>èAKèAIèCIêDHíDGïBDó@D÷>Cø;Aø9@ö9?ð.‘>.‘>,=+’<+’<+”>-“>*“>*”=*”=*•>+–?,—@-“@8•>5˜>3Ÿ?1«A3µD4½D3ÁC4¼A2¸B6­E8œI;…G:kA3S9*D4$<66;55:4493382271161.61.72/72/72/61-61-50,50,50,.0-.0-.0-//-//-0/-2.-2.-3--5,-4*+4(*5)+<-0C47I:=h<;vDC†JI’LJST§`h¨k{rŽ‘{¢„°|†»y†½lv«[\ŒQHsQBkOFaOFaNI_RN_[Yfnotƒ‡ˆ”™•™ž—š ”™‘ƒ~ojk[]\JVUCXQaXQaXQa/.,/.,0/-10.40-40-51.51.72.72.72.92,92,92,92,92,91.80-7/,7/,7/,7/,80-91.80-80-80-80-80-80-80-80-6.+5-*5-*5-*4,)4,)4,)4,)5-*5-*5-*5-*5-*5-*5-*5-*1.'1.'2/(30)30)41*41*52+63,63,63,74-85.96/96/:70?9-@:.B<0D>2G?4H@3H@3H@3I@1I@1I@1K?1K?/L@0MA1NB2MA1QA2YB2dC2qC3|C2‰A2“@0™<+ :+©;,¯>0¶@4¼C8¿F=ÀG>à?Eá@FãBGæCFêDFðCEõADù?Dú;@û:?÷:@ñ=@è@@ÜA=Ñ@;É>7³@-³@-³@-²?,²?,²?-¯>,®?,ª?-©@-¥@,¡A+A,˜@*—A*–@)’?/‘>.‘>.‘>.=+=+=+’<+“=,“=,’<+’=)“>*“>*”?+•@,”B7–?5š>3£>2­A4¹C5¿D5ÂC4ÂD6ºF9¯I=›I=‚F;gA4P:,B6&=77=77<66:4493383072/72/62/62/62/52-52-41,41,41,,1-,1-.0-.0-//-//-0/-2.-5//4..5,-4*+4*+9-/>24C79_83l?:|E@ˆIB’NK›Z^œft”n‡Œwž€~¯zƒºs¹dm¤UU‰NEtO?lMBbPEcQHcMH^NK\[[estx…‰ˆ‡Œ†Š†…†Š|xzlghXZ[KVTEZT`ZT`ZT`.-+/.,/.,0/-10.40-40-40-51.61-61-61-81+81+81+81+50-50-4/,4/,4/,4/,50-50-61.61.61.61.61.61.61.61.3.+3.+3.+2-*2-*2-*1,)1,)4/,4/,4/,4/,4/,4/,4/,4/,30+30+30+41,41,52-52-52-52-52-63.74/850850961961>8,?9-@:.B<0E=2E=2F>1F>1G=1G>/F=.I=/I=/J>0L@0L@0JD4NE4TD4^D3hE2sB1~A/‡>-Œ9'”9'9)£<-¬@3³E8·I<ºJ>Ù@CÚACÝCEâDEçCDîACô@Cø>Aü;@û:?÷:>ð=@åA?ÚB=ËA7Ã>5°@,°@,°@,°?-¯>,¯>,®?,¬>-ª?-¦?,£@-Ÿ@,œ@+˜@*–@)”@(‘>.‘>.‘>.=-=-=-<*<*=+=+<*<*=+“=,”>-”>-”B6–?5›?2¦@2²B4½C6ÂB5ÄB5ÄF:½H>­K@˜J@|F:aA4K;.?9+@86@86?75>64:5294183073062/62/62/32.32-21,21,21,-2.-2.-2./1./1.00.00.10.5106005//5,-4+,6,-:01>45W6-b<3qA7}D9„H@ŒRQŽ_i‹iƒs˜|z¬u~·myµ^g¢RQŠMDyM?rN@dPEgQFfLC^GBVNLZ^^fjnquzvx}vz€vwzokoa`bUWYKTUG]V^]V^]V^.-+.-+.-+/.,0/-10.3/,40-3/,4/+4/+4/+4/+6/)6/)6/)4/,4/,3.+3.+3.+3.+4/,4/,50-50-50-50-50-50-50-50-3.+3.+2-*2-*2-*1,)1,)1,)4/,4/,4/,4/,4/,4/,4/,4/,41,41,41,41,41,52-52-52-52-52-63.63.74/850961961<5+=6,?8.@9/B:/C;0C;0C;.D:.D:.D:.G;-H<.I=/J>0K?1GH6KH7PG6XG5aF3jD1uB/|?,‚;)‹:'’;(š=,£B2«G7±K<´M>ÒDBÔDCØDBÝEBâC@ê@@ð>>÷:>û:=ú9<õ;>í?>áB>ÓC:ÅA5º?0¯@-®?,®?,®?,­>+­>+¬>-ª?-¨?,¤?-¢?,ž?+š?*–?+”?*“>)?.?.>->->-Ž=,Ž=,Ž=,Ž=,Ž=,Ž=,Ž=,<,=-‘>.‘>.”B4—A4@1ª@3¶B5ÁC7ÆA8Å@7ÁB;¸G?©KCJ@uE;Y>3C9-78*@86@86?75>64=53:5294173062/43/43/32.23.12-12,12,,2.-2.-2.-2./1./1.00.00.3205105104..2,,4+,7./901P5*Y9,e>/n@1tB7|KGƒYcƒg~p—xx¬s{¹js¶]e¦TT”OG‚LAyPAjPAhMAeJA`GBYHEXKKWMPU^bc`fbcha`f\Z`TWZOUYKWYL`WZ`WZ`WZ,,,,,,---.-+/.,0/-10.3/,2.+2.+3.*3.*3.*3.*3.*3.*3.+3.+2-*1,)1,)2-*3.+3.+3.+3.+3.+3.+3.+3.+3.+3.+2-*2-*2-*2-*1,)1,)1,)0+(3.+3.+3.+3.+3.+3.+3.+3.+41,41,41,41,41,41,41,41,41,52-52-63.74/850850850;4*<5+=6,>7-@7.A8/A9.A9.C9/C9-C9-F:.G;/H<.J>0K?1FI8GH6MH5TG6[F3dC0lA.t?-{<*‚;)Š;*“=,šA1£F5ªJ:­M=ÉE@ËFAÑFAÖE@ÞC?å@>í==ó9<ø:<÷9;ó;=ë?=ÝB=ÌD8¼A2±>,«@,«@,¬?+¬>-¬>-©>,©>,¨>.¥>-¢?, ?,›>,—?+•>*“>)‘?)>->->->-Ž=,Ž=,Ž=,<+Ž=,<+‹<+‹<+‹<+Œ=.>/Ž?0’C2—A2 @2­A5»B9ÃC:Ç@:Å@9»@9³H@¥NGNEoG=R@4?;039-A75A75@64>63<4194083/74/63.43.34/23.13.02-02-02--3/-3/-3/.3/.3/02/02/11/11/32032040/2.-1-,4..5//H4)M5)X8+a<,f>2nGBzYb‚lƒ€uŸ{|´u|Àmu¾bi±[[¡SLLBQAnN?jI=cH>`HB^FCX@BO2K?3DG6EF6KE5PD4VC2^C2e@.m>,v=,|;)ƒ:)Š;*“=.›B2¢F7¦I:¿D<ÂF>ÇG>ÏF>ØE>âC?ì@>ó<>õ9:ó9:ï;<å@<×B;ÆD6´A/¨=)©@-©@-©@-¨?,¨?,¨>.§=-¥>-£>, ?.ž?-š?,—>,“>*‘?*>)>->->-Œ=,Œ=,Œ=,‹<-‹<-‹<-‹<-‰<,‰<,Š=-‹=0‹=0Œ>1‘D2–C1¡A3®B6¼C:ÅA<ÇB=ÃB=»EA³PJ¥XPŽZOqSIVI@BD97A6A83@72?61=60<4194083/63.43.43.34.13.13.02-.3-.3--3/-3/-3/.3/.3/.3/02/02/00.11/22021/0/-/.,2.-3/.?0)C1'K3'T8,Z<2dGCw]hƒsˆ­„„À|ƒËszÈkq¿ed°VSšJC‡N>kK5.>5.>5.>5,B8/B8/C9/E8/G:1I<3J=4K?3EC6FB6IC5NB4TA3\@2b>0h=-q<.w9*}8)…7*Œ:,•=/›B2 D5µE9¸F;ÀG<ÈH=ÒH>ßF@èC?ð@@î:9î:9é=;àA;ÑD:¾E4¬A-¢?(¦A-¦A-¥@.¥@.¦?.¥>-¤?-¤>/¢>.Ÿ@.œ?.˜?-•>+‘?*>)>+>->->-Œ=,Œ=.Š=-Š=-Š=-Š1‹?2‘D2–C1¢B4®B6¼C;ÄC>ÄC>¾D?»PJ²[T¥e\‘f]s_TYUJFNC>KA@70@72>71=6094.83-63,63.43.34.34.13.13..3-.3-.3--3/-3/-3/.3/.3/.3/.3/02/.0-00.22022000.0/-0/-10.8,,;,)B1*K7.S<4^IHtbn‡z–Џ‹Ê‚ˆÒy€ÐrwÈik¸XV¡GD‹I^C@[ABV>DP>EMGQSKWUQ^WU`XS_UR^TT^SV`UaZHaZHaZH,-/,-/------------.-+.-+/.,/.,1-*0,)0,)0,)/+(0+'/+*/+*/+*/+*/+*/+*/+*0,+/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+1-,1-,2.-1-,1-,1-,1-,1-,1-,1-,1-,0,)1-*2.+3/,3/,3/,3/,3/,3/,3/,3/,3/,40-51.62/73081+92,:3-;4.=4/>5.>5.>5.?4.?5,@6-C6.D7.F90G:1H;2F?5H@5J@6N@5R>3W<1\:0a7+k9.t8-|8+…9,;/“=0˜?1›?2¨@3¬B5´D8¾E:ÊG=ÕF>ßD?çB>ë?=íA?çD?ÜE>ÉC8¶C1§B.¡B,¢A.¡@-¢?,¢?,¡=-¡=-¢>. ?.œ<,š=,˜=+•>-“=,=+Ž=*Œ>*‹<+‹<+‹<+‰<,‰<,‰<,‡;-‡;-‰=/†½F@¾C>¾DA»KG·XR¯f]£qfth|rfik^S_SCSHQJBLE=D=5<8/95,74-63,33+43.34.23-13.02--2,,1+,1+-2.-2.-2.-2.-2.-2./1./1.02/02/11/11/11/11/11/11/5*2;/3A32C4/J;6]OOymy‹…Ÿ’‘½”–Ӕ݂‰×tzÈjn¸_b©YZPHmHBdA>]>>X?AVBHVLU^U`bbqnn}xv†|p€ulyoguh_k_T`Ta[Eb\Fc]G,-/,-/,-/,-/---------.-+/.,.-+.-+0,)/+(/+(/+(/+(.*).*).*).*)/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+0,+1-,1-,1-,1-,1-,1-,1-,1-,1-,1-,0,)0,)1-*2.+3/,3/,2.+2.+2.+2.+2.+2.+3/,40-51.62/80-91.:2/;30=4/>50>50=4-?4.?4.?4.B5-C6.E80G:2H;3H>5J=5L=6O>6Q=4V;2Z90_7/h8.p7.y6-‚8-‰9.’;1–<1š>1¢@3¦A5ªB5³E8¾E:ÉF<ÔE=ÜC=âC?ãD@ßF@ÕF>ÄF8±C2£B/›C-ŸB0 A/Ÿ@.ž?-ž?-Ÿ>-ž>.ž>.š=,™=.–=-“=,=+>-Œ=,‹>,Š=+Š=+‰<,‰<,‰<,‡;-‡;-…<-†4†@6‡A7ˆB8‘H7•F7£G:±I@¹HB¹FAºJFµTM²dZªreŸ~op~|mlteYgZJZOPLAKI=EC7@>2=:1:7.44*11)23+23-12,/1,/1,.0+.0+.0-/1./1./1./1./1./1./1./1.02/11/11/11/11/11/11/11/5*:9-9<15?53H?:^VTxszŠˆž‘“º”—Εׄ‹ÓxÆpyºkt¯en¥__yXZsSUjRWjU]j\gmguvr‚v‡€‘‡ƒ•‰}v†yp€sfteXfW_YA`ZBb\D,-/,-/,-/,-/,-/---------.-+.-+.-+-,*/+(.*'.*'.*'.*+.*+.*+.*+-)*-)*-)*-)*/+,/+,/+,/+,/+,/+,/+,/+,.*+.*+/+,/+,/+,0,-0,-0,-0,-0,-0,-1-.1-.1-.1-.1-.0,+0,+1-,2.-2.-2.-2.-1-,1-,1-,1-,1-,2.-3/.40/51080-91.:2/;30=31=31=4/=4/?40?4.?4.A4.C60D7/F91G:2H;5J;6K<7N=6P;6S:5V72[60c60k6.t5,}7/‡9/Ž:0”<0˜<1œ@3ž@4¢@3§A3±C6¼C8ÇD:ÎC<ÖF>ÚG@×HBÍH?¾E:­C3ŸB0™B.B/œA.›@-›>-›>-›>-›>-œ?0˜<-–=-”=,“=.>-Œ=,Š=+Š=+‰<*‰<,‰<,‡;+‡;+…<-„;,ƒ;-„<0‚<0‚<2‚>3ƒ?4…A8†C:‡D;“K<–H; H>­JDµIF´KG´SM¯_V®rg¥qœz{Šwr€ocqbVdWPQCMN@HI;DD8@@4::055+/0(01)01+/0*/0+./*./*//-//-//-//-//-//-//-//-//-//-00.00.00.00.00.00.00.00.6*>6+;8.6;63HE>_^Yyz|Šœ“²’–ÃŽ•Ë„Æ}ˆ¾{‰¸|‹´|Œ°ˆ—yƒq~‡o|‚n}€o‚€yއƒ™‹¡”‘¨˜¦”ˆŠƒ–ƒ|{j{iXiW\V<^X>`Z@-.0-.0-.0-.0-.0-.0......---.-+-,*-,*,+).*'.*'.*',*++)*+)*+)*+)**()*()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+-+,-+,-+,-+,.,-.,-.,-.,-/-./-./-./+*0,+1-,1-,1-,1-,0,+0,+0,+0,+0,+0,+1-,2.-3/.40/91/:20;31<42=31=31=31=31>3/>3/>3/@3-A4.C60D71E82G83H94I:5L:6M:6N94Q83T50^72e60o6/x8/ƒ90Š:/’;1•=1™?4™?4›?2@1¥A2­C5¸D7ÀD:ÉF<ÌG>ÌIAÄH>¶F:©C4B0—B.˜A.˜A.˜?-—>,™>,™=.™=.™=.•<,”<.“=.=-Ž<.Š=-Š=-ˆ<,ˆ;)ˆ;+‡;+‡;+„;,„;,ƒ;-‚:,;/€<1€<1>5ƒ@7ƒC:…E<†F=’M>•I<œH>¨IC¯LG¯PL¯\Tªj^§€o y˜š‚Žœƒ„–€z‹ym{lam_UYHQUDKO@EI:@D6;=057,13(01)/0*/.).-).-).-+/.,0/-/.,/.,/.,/.,/.,/.,/.,/.,0/-0/-0/-0/-0/-0/-0/-0/-8*A6):3-1961HJ=bfX{€y‰‘“Œ“£–²Œ”¸ƒ³±…™²¤¶ªµ•§§¤£Œ ž‡ž–‚™}˜‰œ‹ˆ£”°š–²›”­—‹£‹…›†’~k|iUfSXT7ZV9^Z=+/2+/2-.0-.0-.0-.0-.0...------.-+-,*-,*,+),+),+),*+,*+,*++)*+)**()*()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*++)*+)*+)*,*+-+,-+,.,-.,-/-./-./-./+*0,+0,+0,+0,+0,+/+*.*)/+*/+*/+*/+*0,+1-,3/.40/91/:20;31<42=32=32<20<20=20=2.=2.?1.@2/A4.B5/C60D63C84D95G96G96H94K84N51V72_60h70r7/}:1†<1=2>2˜?7—?5—?5—?3šA3£C5ªD6³E8ºE;¿F=ÀG>»F=°D8¤B5™@0–@/–A-–A-–?,•>+•<,•<,–=-–=/”<.’<-=-Ž<.‹<-‰<,ˆ<,ˆ<,‡;+†:*†:*†:*ƒ:+‚:+‚:,€:.;0€<1€=4?6‚B9ƒD;†G@‡HALA’H?˜HA¤KGªOLªWQªf]¥wh¡Œw˜›€’¥‰Š¤‡„ž…|’}t‚qlte\eRV_LMVCEL0-?1.@2/A30A30?61@72@93A96A96B94E74G51O61W6/a6/j8/u9.€0•>7•>5“?5’@4•B4™C4ŸC4¥D4ªB5²C8´E:±E;©C7 @4˜?1•?2“A,’?-“=,“=,“<+“<+”<.”<.“;-’E5:@29<134,22*1.)/+(/*'0**3*+4+,1++1++1++1++1++1++1++0,+1-,1-,1-,1-,1-,1-,1-,/.,;(;5(23+(56$CL-\hDt„`…”wŽ›‰’ž”Ÿšž–¥—•µ¡Æ¤¦Ð¨¥É¯¦Ê°§Ë¯¢Éª—¿‹³ˆ°‹³ŽŽ²Ž²¬Š„¢€€™{wŽrdx]MaHQQ5QQ5RR6,03,03,03,03./1./1./1./1/////////0/-/.,/.,.-+.-+/-..,-.,--+,,*++)*+)**()+)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)**()*()*())'()'(+)*+)*,*+-+,.,-.,-/-./-./+*/+*/+*/+*/+*.*)-)(,('0,+0,+0,+0,+1-,2.-40/40/:12;23;23<34=32<21<21;10<1/<1/<1/=/,>0->0-?1.@2/;60;62;83<94=:5=:5?82A60F5.O4-W5+b6+n8,x:-<,„<.’:6‘<5=5Ž@4A4‘B3•B2™@0Ÿ?1¦@4ªB7ªB9¥@6?5—=2•?2‘@-’?-‘>,’<+‘;*‘;,“;-“;-‘;,<.;-‹<-‰;.‡;-„;,„;,…9)…9)…9)‚9*‚9*9+~8,}9,=1€=4€@7B9„E>…HCˆKFŠMHŒIAŽGA˜JF¢SOª\X«h`©{n£Žy—Ž©ˆ…¯‹«ˆ~£„€˜€‹w{nixacr[ZhQP]IIUACL;>D60-?1.?1.96/:729839839:4:94;83>71A2+I2*S2)^4(j6)s8*|:*~;+84:5=4Œ@3‹B3A1@/”>-˜<-Ÿ=0¥@4¦A7¢@7œ>4—=4•=3‘@-?,=+<*‘;*‘;,‘;,’<-‘;.<.;-Š;,ˆ:-‡;-„;,„;,…9)…9)‚9(‚9*9*€8*~8,}9,€>2?5€@7‚C<ƒG?†IDˆMGŠOIŒICHD˜MJ¥UT¬a^­ng«s¤•€–¡ƒŠ¬‰‚°‹|«‡|£„™y‚ql{dgv__nWXeQP\HIRAAG9=@579.66.41,1,)1)'2()3)*4*+2)*2)*2)*2)*2)*2)*2)*0**1++1++1++0,+0,+0,+0,+0,+:&27(+4."47=HRb1l~J€’b‰™rŽ|Ÿ‚ŠŸ~Ч{·€˜Æ…œÎ…œÉ¢šÉŸ™Èž”׉¸Š®€‚°‹¶ˆ‚¬~ˆ¯ƒ‡ª€~œvuml„dZnRG[?IL/GJ-DG*/0*/0*/0*01+01+01+21,21,32-63.63.63.52-50,4/+4/+8.,7/,6.+5-+4,*2-*1++0,-0,-.,/--/-,1,+0*+/)*.()./(0/(//(//(//(//)-.)-.*+/+,-,*-,(.-).-)-.(./)./)--/--/---.../-.0/-2.+3.+2-)4,)5.(7.)8/(;0*;1(<2)<5+=4+>5.>5.>5.=4-<3.<1-=2.<1-<1/;0.=/.>0/>0/?11H-&C1';5)2:++=-(=.-;.45-?-+H()R%(X((Z.+Z8.[A2\G6wC-{B.„C1A3’?1•;0–:/”8+“;-‘>.‘B1‘D0‘D0B.?,<*Ÿ63›83”:2Œ<1…@1B0|A/|A/‚C2„A1ˆ>1‰=0‰;/ˆ:.‡9-‡9-v:/|@5u=0n9)s@/s@/t<+{@0{<-ƒ?4ˆD9‹H?ˆLA„NBQC€RC—HK•TRd]…ue{…lw’sz|€£ƒ‰¦ˆŽ¥‰’¤Œ‘¥Œ‡¤ˆy¢‚kŸ{awhŽea†]\zV[sS]mR[cLVTEPH=J;6G53B,/=&,:#+:#-9#/8".#/-#-,$-,&*+))+-(.1'/2'/4'06&14'14'13'32(32(30(3.)-0,-0,)//'=>0WZErx\‹gœs‹žpŒ¢qŒ§r‹¨r‰ªs³{›¾†£¿Ž ¾Œ›¹‡’²€‹­{†ªz„ª{…ª~„§}…¥€€ž|z“vr‰oi{e[jWLZIKO@CG8>B3/0*01+01+01+12,12,21,32-43.63.74/74/63.61-50,50,7/,7/,6.+6.,5-+2-*1++0,+0,-/-./-0--/-,1+*/)*.()-/(//(//(//(//)-/)-.*+.*+/+*-,*.-).-)/.*./)./)./)..0....../-./.,/.,1-*3.+3.*5.(6/)8/(90);0*<2)=3*>5,>5,>5.>5.>5.=4-<3,=2.=2.<1-;0.;0.;0.=/.>0/?10F/'D0)A3*=4+96-85.83-<1-?-+D*)K)(P*'U.)[4-_:1c?3s@+xA-€A0‰?2‘?4”;3”:1“;19.‹<-Š>.ŠA0‹B1B/ŽA/@/š93—:3’;2‹=1„?0‚@0@/?/„A1†>0‰=0‰;/‡;.„:-‚:,‚:,w9.x<1s9-n9)r?.s>.q9*u:,}=1„@5‰E:‹H?‰K@†MB„PCQC›DJ›QR–d]vfƒ‡p}”w~ ƒ¦…ˆ§ˆŽ§Š’¦‹“¥Œ£‰‚Ÿƒwœ}o˜xa•g\`VƒZU}XWyXWpSPbJKVECI;@A998340-0,+/+,.)--(,*,+)+***,+),-(,/)-2(03(03(02(02(10)1/*1-*1,+3,+32-12./0,)--%9:,TWBox[€‹i‡–o†™l†žnˆ£p†¤p„¥pŠ­w“¶€›¹‡˜¶„“³Œ®{†«xƒ§w‚¨yƒ¨|ƒ¦|„¤{x’uqˆnh{eYjWL[HGK<@D5:>/12,12,12,12,23-23-43.43.54/74/85085085083/72.61-80-80-7/,6.,6.,3.+2,,1-,1-./-.0.1..0--/,+0+*/*).1'//(//(//)-/)-/)-.*+.*+0,+0,+/.*/.*/.*0/*/0*/0*/////////0./0/-1-,1-*2-)4/+70*90+:1*<1+=3*>4+?5,?6-?6-@7.@70?6/>5.=4->3/=2.<1-;0.;0.;0.;0.<1/=20C2*E0+H/+L,-N+/M*.J*/E+.A-,@.*@/(C/(M/'Y0*d1-j30i;+o;-w;0=4‰<4Ž;5Ž94:4‹;2‡=2†>2…@1†A2‰A3ŒB5C6‘=2=1Œ>1Š>0†>/…=.…=.†=.ˆ<.‰;.ˆ:-‡9,„;,€;+~=+z=*}=3z<1v:/u;-x@1x@1v<.v;-?3„B6ŠF=‹H?ŠJA‡KA‡NC†PDDHQQšc^’ug‰„n‘t~}€¥ƒ„©‡ˆª‰©Œ“§Œ‘£‰‹ƒ„˜€”{a›k[•eXaV‰`W…`W]QtVMiPC[E=RA6F9/<2*5-&1+%.)$-(1&*1&*1&*1&*1&*1(-2).1+//*0-+0,+0+,0),1(-1&.1&.14.24.0.*'**"66*PUAmv[~‰i€k~“h™jƒŸn€ n~ m€¥q‡¬xŽ®|‹­zˆªw„©v§t€¦u¦w€¥y¤y€¢}}›yw’sp‡mh{eYkUL[HEG:=?28:-23-23-34.34.34.45/54/54/650961961:72:72:51940940:2/91.91.80-7/-4/,4/,3/.3/.3/01/01/00.1..0--/,,.2).2).2).0*.0*,0*,0*,/+*1-,1-*0/+0/+10+10+10+10+11111100010.10.2.+2.+3.*91.92,;2+<3,>4+@6-@6-A7.A8/A8/B90A8/A81@70>5.?4.=2.=2.<1-;0.;0.<1/=20=20?5,E2.O-.W(0]#/\"0W#/L'.C/.:3-55);5)E1(U.'c+*l*+e;/j;1s=3}<6…;8‰;9Š;7ˆ:6‰>9†?9…B9ƒC9…B9†B9‡A9‰@7†B/†B/‡@.‡@.‡>-ˆ<,‰:+‹9+‹8*‹8*ˆ9*…9)€<)z=(w?(t@(ƒ=3{7,x8,z3/>3/=2.=2.=20=20>31>31>7/C41O/2Y*2_%3`#2Y%1N+1B3077-39+68*?5)N1)]-)e+)c;3h<3r=7z=:‚<<†<=‡;;…;:‚;9>8€A:C;‚C<ƒB<…@9„?8E/D/C.ƒ@-†=,‰<,‹9+Œ9+Œ6)Š7)†9)‚;)~=)w?(sA(qB(…6/|/'8/ƒ?4w5)s5*}A6}C7E9G<ƒI>„J?…K@‡LDŠOGŒSJycL~hSoYu]}bˆi„•u‚ |¥~|©€~¬…­†€ª„¥€|ž}{˜yn}ŽlyŒlwŒkwŒmt‰joƒgl~dbqZ[hTSZHIK=B@4=6,8/&5+":&(8%'6&'2&&0(&-)(++)).*'+*&,*&,*'+*'+,)*,**,**,-#$2*(50,85,BC5UZFfpWn}^tˆcqŠbt‘ex˜iw›ks™hs›iwŸmz¢mx lwŸkv¡ly£q{¥u{¥w|£wxžuzœww–tqŽom†hd{_WkPJ^CFB9>:195,560560671671782782872872983<94=:5>;6>;6?:6>95>95?74?74>63=52;62:5294194184184195484373243132021/6-.6-.6-.6-.6-.4..4/,4/,40-40-40-52-32-32-43.43.431431542540841850940:5/=60?6/@7.B8/C9/F90G:1H;2F<3F<3F<3F<3E;2C90B71A60@5/@51>50=4/=4/>42?53?53=82A64I35Q16V.6U-5R/5J22A62::08<.9;-?9)H6*P4)U3)]2+c4.k62t76}77‚89ƒ7978}75{:6|=8{?7@9ƒ@:…@;†?;|E0}D0€C0‚A/…=.‡;-‰:-ˆ9,‡8+…9+‚:+<+{>+x?+uA+tB+‹2,‹2,¡LE§XQŠA8|90‚F;€J>yH:zJ<{M@|NA~NB‚PE‡UJYN_uNgwRtzX€{^Š|b“i›s›—|™zˆ |ƒ¨¬ƒ|¬‚x¨~t£yq vŠpˆo†nƒŽp€p}px‹ms‡kk~bgu\_iQWZGPM0%:,+7,*5+)1,(-,'+.').((/().(+-*,,*/+*3)*6',7&,9&,2)$<3,E>4JF:QR@]bLgqVizXmƒ]j…\j‰]p‘bq•eo•do—eršhu krhq›itžlx¢rz¤vy¢vyŸvvštw™tu”rokj…fc|^UlOJ^BHA9@91;4,671782782782893893983:94:94=:5>;6?<7?<7@;7@;7@;7B:7B:7A96@85=84=84<73<73<74<74<74;74:6395284173080.80.80.80.80.80.61.61.61-52-52-52-63.63.54/54/540540651952:72=84=82@93?80A8/C90D:0E;1H;2I=1I=1H>4H>4H>4G=4F<3D:1B8/A60B71@70@72?61?61@72@72A83=84@85B86D97E:8G96G96E:4C90B90B:/B:-D;,F:*H;*H;*].&b0)n3/x73ƒ98‰;;Š<<‰>;‹A>†A<?6}=4~;3‚;5ˆ=8Œ>:~C3€B3€A2ƒ?2ƒ=1„<0ƒ;/;/;.|=.{=.|>/|>/|>/}>/}>/—.*£;8ÎkfÙ~y­ZTŒC<ˆLAN@tJ:qM=pQ?qR@tSB{VD‚[J‰_OUOe€Uz~[‘y_¥ra³of»rk»xo¶…vªz ›~•£€Œ¦ƒ¦~}¢yyŸvŒr‹rˆ‘r„“r€•t|–sv”ps’pl‹ig„eby\\lQU_GMP;ED0A<)>3-<3,92*41(01).1(+1'+0)/0*2/*6,*:*+@'+D%+G$+H#+A7+LC4WP@[XE`bLgmQiwVj{Wl‚[g‚Wf†WjŽ^n”an”an–bršfržko›hnšiqœnw¡sy¢vxžuu›ts—su—ts’pn‹li„cb{[TmMH`@MD=E<5@707827828938938939:4:94:94;:5>;6?<7@=8@=8A<8A<8A<8A<8A<8A<8@;7?:6>95>95=84>95>95>95>95=84<73:51940:0.:0.:0.91.91.91.91.72.61-61-63.63.63.74/74/74/540651961;83<94?:4@;5B;3A8/B90C9/E;1H<0I=1J>2K=2K>5K>5J=4J=4F<3E;2C90B8/B92B92A81@72@72@93A:4A:4?74>95=<7>?7?@8@@6D@5J=4J70N5.Q6-Q6+O8*M:+I<)H=)l3(r6,~;3‰@:•DA›HDŸJGŸLH QJ—MDD;„;2‚8-…7-Œ91;4…?7…?7†=6…<5ƒ=5€=4|>3y?3vA3uA3uA3y?3}=3ƒ:3‡83Š73Ÿ%$´<;í{zþ•’Åhc–G@‰K@wI:mNfW@jX@r\E}aL„eQj{O{{U™w\´l`Ì^_ÚR\áM[àO^êmuÜxxÎ…~¿€²–€§—}ž•x˜“u•Žr”r‘‘u”u‡–u—s{–sx–rq‘lp‹hiadtW]gLVX@LJ3GB.L40H3.D3,?2*:1(70&40'40'81):/+?-+C++H(+M%-O$-Q#-PE1[P:d^FgfJilOnuTm{Wl~Vk„Zg„Vg‡Vm]p•ap—br™dvhrœlo™km—ip™mwtyŸxw›wt–us•tu”tsqoŠki„cb{[TmMGa>SJCKB;F=69:49:49:49:49:4:;5=<7=<7=<7?<7@=8@=8A>9C>:D?;D?;E@8C>8D=7B;5B;5B;5B;5B;5B;5A:4A:4A83A83A83@72@72>71>71>71<71<71;60:5/85085074/74/761961961:72<71=82A:2B;1C:1E;1F<2J>2K?3L@2N@3N@3M@7M@7L?6K>5I<3F<2E;2E;2B90A81A81?80?80?82@93@93<5/LE?IB:E<5OB:K:2J3+\>6Z5-`5.`4+^/'\0%b8,g@1gB2‹I;G;–I?žLAŸF>›>7š=6žD;¥ND£QE¨VH«YK£PBš@5˜:0ž=4’9;9:Œ67†54„96ƒ@:{@8o?3oC6lB4m?2u:274Œ35’-3–(1ÏEEèbaÅEDÍWUáyv«VO†F<‚WGlS=f\CedFgfHgbEm_DyeL†nVŽdK­p]ÍphÞW]å8Kð(Dü&Hþ+Lþd02b22\31L)'D'#I2,J70F5.E2,E0+H0.I-,I)*O+-V24VK/`W:f_BgdEkoLu}Xu„]oWj„WlˆXnŽ]q“`s•bu˜bušdv›eq–ks˜ms˜oq•os•rw™xz™zy–zx•yqŽrm‡jj„ghƒdazZTnKIc@TKBSJAPG>9:49:49:49:4:;5;<6>=8?>9>=8@=8A>9A>9B?:D?;D?;D?;FA;E@:E@:E@:D?9D?9E>8E>8E>8E>6E>6D=5C<4D;4D;4C:3B92B92B92B92A81A81@91@93>71<71;60;60:5/85.74-74-96196/96/;60<8/>:1A:0C:1C;0E;1G=1J>0L@2M?2NA1NA1N@5N@5M?6J=4I<3H;2E;1E;2C:1B90A81@91@91@91?;2?;2C:3G81I0,V..j68u99{;;†ECƒD?„H@…I?†G>ŽJA›NH£PL¥MK’E3”C2šB4 B6 >36-7+¡<0£C5›@.™@. E3¦F6©E5¯H9¸N@´KR¯GN¥@F™9=‘8:Š?<€A:r@5k?2uK=€NC@:‚,-“(0µ8FÒK\àJIáMMÌ>=Ã>?Ò_\µXQ„@5€UDvbJa]@Z_?ekIonOshJ{fK†kPÌ]VÚ][êSZó7SD=]P.dY9ga?ifCnrMz‚[z‰bt†^r‰]oŠ]oŒ^qŽ^u’bw•cw•cw•cr’mw—rz˜vy–w~˜}ƒ„…‡ƒ›…™ƒz’|q‰ql„jhc`yYTnKJdAWQEVPDUOC8938938939:4;<6<=7?>9@?:@?:B?:C@;C@;C@;D?;D?;D?;FA;FA;FA;E@:E@:G@:G@8F?7IB:HA9H?8G>5F=4E<3E<3D;2D:1D:1D:1C:1D;2D;4D;4C<4?80?80<71;60:5/:5/94.94.96/96/96/;7.<8/@9/A:0C;0E;1F<0I=/K?1M@0M@0NA1M@0N@5M?4L>3K=2I<3H;2E;1D:0C:1C:1A:0A:2?;2@<3@<3A=4SE–I?•MA›OB¬RJÃSRÏNSÒENœE2B0 @0¥?1¦:-¥7*¦8+§=/¬E4¡>+˜7$:%¥>+®@/³B2¹C5§/8±9B¹DL¾KR¸NRªLL“B>}:1u;/q9,s5*2-›47º8@?:A@;BA4G=3F<2E;1D:0D:0E;1E;1D;2E<3E<3E<3@91?80?80<71;60:5/:5/:5/96/96-;7.;7.=9.@9/C;0D<1F<0F=.J>0L?/M@0M@0O?/O?/O>4O>4N=3K=2J<1G:1G:1D:0D;2D;2B;1B;1@<3A=4A>5A>5Q9/X+&‰:?ÅP`ãOeñOfíPcÐGO¢20”:/Ž?.–C3®F=ËFGÞ>Hã2B§H6§F5©B3®@3°?1²>1³B4´D6²G5«B/£<)¤;&©<(­:(¯5&®3$¸7<»8>½7>½6=¿9@?:BA4G=1H<0G;/E;/E;/E;/E;1E;1D<1D;2D;2@9/@91@91?82<71;60;60:5/;7.;7.;7.<8-?8.A;/C;0D4N=3N=3J<1I;0G;/F90D:0D<1D;2B;1@<1A=2A>5B?6C@7_4-t42¯KSâYiðH_ð:Qá2C½#+¬/)š9(;&•=)¬@3ÈA=Ý:?ä0;¨D4¨B3«?2®>2´?5¹C7½G;»J<¬>/ª?-¨=+¨:)ª9'²:*¹;-¼ÃLDËTLÑTNÙKJÝ>Cã3>è.<Ù5+Û7.Ò0+Ò94Á82µ@9µ[P”UDxO9~dI„lPbF]F®eTÍqdÛsjübÿ?eÿAiÿBkÿBmÿAmÿ@oÿ@oÿ@qÿAqÿBnÿ=hÿEmÿJpöGhíMièZrÛbs½YcŒ@D]($M-"PC2PR=CO76H.WH1eYCujT€{gŽy˜œ‹”Œ‡”ƒ~‰—ˆŽœŒ™ˆ‡’‚Š“‚—žŽ¤¨—²¶§¸¼®¿Á¶ÀÁ¹ÂþÅÅÃÃÃþ¾¾²´³¢©¢—Žy‡vh{e\sWTmONiHTYBUZCW\E560560671782893:;5=<7>=8@?:B?:C@;DAGB>GD=GD=HC=ID>IE0I=/G>/G>/F<0F<0E;/E;1D<1C:1B90A:2@91@91?82<71;60;60;7.;7.;7,<8-?8.A;/D0K?/M@0NA0P@0O?/O@-P>2N>1M<2L;1I;0H:/F90C9/C;0B<0B;1@<1A=2A?3B@4C@7t50–FEÆY_ßUbã@Qä5FÚ0;À*+¯1%Ÿ9#•;!”: ¡=&·=.Æ90Ê2- :,¢:-¥9-¨6,°91¸A9»E;·E:­?2«@0§<,¤6'ª6)·=0ÄD9ÊG=¾9*Î@4áD=ïA@öDâ<@×?>ÎC>ÍJB×RMåZWéPRìELï;Gõ6F÷2Dø/Bû1Gÿ6Lø:Tø:Tø:Tû:Wþ=\ÿ?aÿBeÿDiûhú?júAm÷@nõ?oò>mï=mÿFnÿ:aÿ>dÿInÿJløMmòSoæXnëp‚Å_j˜ILt:6\6-O9+OD2SN:`PArdWˆ|p”Ž‚Ÿœ“¦§¡¡¦ ”˜”Ÿ›¨¤¦¯¬¦¬ª¤¦¥§§¥µ´°ÄÀ½ÍÉÀÒÍÇÕÐÌ×ÏÍÖÍÐ×ÎÓÑÊÑËÆÌ¿½À°²±˜Ÿ˜€Œ€m~k^u[VoQSlNU_DV`EWaF560560560560671893:94;:5=<7@=8A>9C@;DAHC?HC?GD=HE>ID>ID>JF=LE=MF2G=1F<0D<1D<1C:1B;1A:2@91?82?82<71<71<8/<8-<8->7-@:.B:/D2B@4@@4+)¨JKÁSV¾=BÀ/6Ç.3Ä./»0)ª1 £9!›=!–=˜= ¡=#¥;#¦6"6- 8/¢5.¦3,®71·@:¹B<²@6±B7­A5¨7È`UÑq¤eSŽWC‡N:¡XGÊe[ãa_ëPTëBIùDKí@DÞ@?ÑB<ÅB8ÁB9ÌIAßPLìKPô@Kù9Hý7Hþ5Hø3Eö7G÷=K÷9R÷9Rø7Rú7Uý7Xÿ9]ÿHC?ID@HE>HE>ID>JE?JF=MF>MF2G=1E=2D<1C:1C:1A:2A:2@93?82<71<71<8-<8-<8-?8.@:.B:/D2??3@@4”67Á]_ÈZ[¯78®,,µ/,±,#°0#¯8$®B(©G* G'šF$šF$–C!”? Ÿ81£;2¦92¨50°:6¹B>¹D=±>7«<3¨<2¦»72»:Ê<$á:*ñ.(ÿ$&ÿ'ÿ'ÿ%ÿ%(ù,)ñ2*ë5*è3(è2'ê/&ì-%Ü=(Ñ2Þ>0Ñ5)Ê7/Â?7¯C9Çqd²m]–YF™VE¿i\ÝlfãSSë@Hù?Lï4¹6,½4.Î44ïBHø8Gÿ2Fÿ3Hÿ5Iú7GöYÿ=Xÿ:Wÿ6Wÿ5Yÿ5\ÿ6_ÿ7eÿ;kÿ:mÿ;oÿtû>vôEbýNkÿTqúIfð?\ÿRqÿfƒÿf€ô^wêbváky×s{Ärvªfe”ZV‰TN’€~¨™–¾°°Ä»¼ÆÁÅÈÇÍÅÈÑÀÄÏÆÌØÈËÚËÍÜÓÐáÚÖåäÜëêßïîáòòäãõççöçêóâèñàêïßêìÜéå×äÓÉÒþά©—y‡vi|f`w[\uWbqRapQ`oP201312423653875984984983;:5<<4==5??5AA7CC9EE9EE9HH@HH>HH3B90E<5C:5@85?74@86?67>56:44F85E76B87@78>:;<:=<<>==????A@,§B0©D2©D0©B/¨?,«>*­<*µ=-¾C4ÅF7À>0·3&Í6+Ì8,Ì:-Ì=/Ï=.Ô(Þ9%Ô4Ï4 Î9%Å8&¾6&Æ@4ÕQEÒIAÜMIïUUüVXýJPø9Aü4?ÿ9DäCHßCFÓAAÆ?;¹=3®=/ª?/ª@0¿Q@ÉQCÑLCØC=å??÷@Eÿ>Gÿ8CúGMúENûEQþESüARú=Sü>XÿCbÿGiÿBhùHH7H?8F=6C:5C<6A:4?74?74@85>95=84;63>3/=4/>42<74=98<;9=<:>=;@?;C@9G@6J@4L@0O@-P?+P>(=B,?A,E=0H92K63J46F35A57>=;8=69?5?A4C=-J9)^B4sRC¼K=¬;- 2#¡6&£:'8$ž9%£?(¡;%¦=(­@,³@-¶=,·9*¸6(¹5(¦;+¤:*£9)¥;+¦?.©B/«B/«@.­?.«:(±<+¿E6ÆH9Á?1¼8+½7+Ï5+Ï7,Î:.Ï;/Ó=/×;/ß8/ç4/ð0-õ--÷-+ò/+ê4)ß8(Ö;'Ï=&á:'Ù7"×8%Ô=*Ì;*Á5&Ã;/ÍG<ÐG?ÙJFèPOóPQôGKò;@÷:Aÿ?GàDGÜDCÓB?Å>8·;1¬;-ª<-©>.µF5ÅM?ÓNEÜGCã?@ñ>Bý>Fÿ>H÷DJ÷CLúDPÿFTýBSú=Sü>XÿBaÿFhÿCiü?iù@lùBpûGvüJzþL|ÿIxÿHtõKpðRsò]zö`{ùXwýMqÿCkÿAlóCjÝJgÉ^p®pugNI†‚v´”‡Ì²¥äÔÇëäÜèéäéêîéçòíáõöâûýàüÿâýÿçþÿìÿÿòþÿ÷üþúûþûöýúõü÷ôúôôøïðôëîñèëïæëäÞâÜÖØÊÆÅ²²°ž ›Ž“Œˆ…ˆ…–†‰€†}/.,0/-10.21/43/540762761:94::2<<4>>4@@6BB8CC9DD8IF=IG;JH;KJ8MJ7NL7NL7OL9KI:NKBTSQ_^dihxmm…lkŠihˆcYd[QZQGPJ@IH>FG>CC=A@::1>:1=90:3-94.;60=82=:3>;4?<5?<3C?4F@4I?3L@2O?0P?-Q>-P>*3@&7?'<=+A;-B8/A62>42;31=85B:7H94O2.[+)o-.Š:= EJª9+¢2$Ÿ1"¤9'¥<)ž7$8$¢<&¤;&¨=)±A-¶A/¹>.»<-¾:-À:.®>0¬<.©9+¨:+ª<+¬>-­>-¬=,²?-®9(¸>/ÊL=ÊH:¼6*º2&Å;0Ó5*Ô6+Ò8,Ô:.×;/Û9.â7/é2,ñ/-õ.+õ.+ñ0)ç2'Ý6&Ó8$Ì:#à7$Ü5#Û8'Û>-Ó=.Æ7)Å8.ËA7Ç<5Ì?8ÙEAåKIìIJëCCí?Að@CÜDC×C?ÏB;Â=4¶:.­9*ª;*«<+ª9)¿E8ÔNEÝIEâ?@ëXÿ@_ÿDfÿCiþDmÿFpÿIwÿK{ÿL|ýK{ÿCvÿGwÿJtúNtþZ|ÿa€ýUvòCdüHkÿRvÞ=\ÎH`Úz†µ}~\F;„r³‹Õ³§óÛÑúíåøóðøøú÷ôýôëüüêÿÿéÿÿëÿÿíÿÿòÿÿ÷ÿÿûÿÿýþÿþúÿýùÿûøÿøöþõöýòöûðôúïóðçêåßáÓÏξ½¹­®¨¢¥œ£™£—¤ªœŸ¥—œ¢”/.,/.,0/-10,21-32.54/650872991;;3==3??5AA7BB8CC9IE<0?=1@<0?<-A;+F?/H?.K?/M@/O?/P?/Q>/P=.<@)=?*?>,?<-?;0=:3;:5:94<94D95N43[*-o&--8¨3C¶7H§7)¥7&§9(ª?-¨?, 9&Ÿ9#¤;&¥:&«<)³>,¹@/½>/Â<0Å=/Ç=0¹@5¶=2²:,®8*¯9+°:,²:,²:*¶;,¹;-ÄB4ËE9Ç?3¾1'À2(Ê:1Ú3+Ø4*Ù7,Ú8-Ü8.ß7,æ3,ì1,ó0,õ.+õ.)ï0(æ1&Ú4$Ñ6 Ê8Ü/Ú0Ú4$Ý;,ØVßetû §Í‘]=2aP@©wlÑ¥œöÔËþêãÿôòÿþÿÿüÿùóÿüïÿÿïÿÿðÿÿòÿÿôÿÿ÷þÿûýÿüûÿýùÿüøÿúøÿù÷ÿö÷ÿôøÿôøþó÷öëïìãäÚÔÔÉź¹´³´¬±´©²µª¶¾³°¸­¬´©10,10,0/+0/+10,21,43.54/77/880991;;1==3??5AA7BB8KD:LF:OG:QJ:RK9SL9RM:QK=OKBVTUfdowx††¨»“ÃŽ‘ÆŠÀ‡‚¸{w©rlœid_[~UPnNJaJGXEBM?=B;7696196-86*86)581692891;;/><-?<+C<)D<'I>*J?+L?,M@/M@0M?2M?4L>3M?4K?3F<2B90=909:25<44>57<5>:1H3.\0/{48œ;D¯9E²2Aª<+ª<+«@.¬A/©@-¥<'¥<'©>*§8%­:'µ<+¼=.Á;/Å;.Ê<0Ì<1ÁA6¾>3º:/·7,·7,¸8+¸8+º8+»7+ÇA5ÍC8Å8.Á1&Æ3)Ë7-Í6-à2+ß3)á5+â6,ã5,ç4-ê2*ð/*ö/,ø.*ô/)ì0'ã1#Ù4!Î6É7Ú/Ù/Ù2"Ù5)Ù9-Ô:0Ö?6ØE=ÕF>Í@9Ç<5Ë@9ÖKDÙNGÐF<Å;1Å=1Ä<0ÀCí>EóBJûJTÿJYýFXúCYýB]ù@_ûBdþFjÿJsÿOxÿOzÿLyýIxÿGwÿRÿQ}ÿIqûImÿStÿVtøNiëD^äF]èYkÿ—¢ÿ¶¼î žˆKFd2)©jcÍ–ôÇÁÿãÞÿòðÿüýÿýÿú÷ÿý÷ÿÿöÿÿöÿÿøÿÿùÿÿüÿÿýýÿýúÿüøÿûøÿúøÿø÷ÿ÷øÿõ÷ÿôøÿôøýñóóéêäÜÚÖÑÍÍÊÃÉÉ¿É˾ËÍÀÇÑȾȿ·Á¸84163.52-30+30+41,52-63,85.96/:70<90>;2@=4B?6B?6KC8ME:PF:SJ9TK:UL;SL<=;:6;8396/267465672880<:-A<)D>(G?(I?&J?)IA,JA0IA4IA6HA9G@:R9?ž46§<*¨=+ª?-ª?-©>,©>*¬?+¯@-«8%²9(¹:+¿:+Ã9,É9.Î:0Ò;2É>7Æ;4Ã81Â8.Â8.Ã9/Â8.Ã6,Ä7-ÑC9Ò?5Ä0&Ã,#Ð7/Ö<4Î4,æ1*æ1*ç2)è3*ê3+í2+ð/*ó.(ø.*÷-)ò/)ì2&ã3$Ø5"Ï7 Ì7Ü5#Ù3#Ø2$Ö2&Õ5)Õ7,Õ;3Ö?8ìYRáRJÓHAÊD;ÉF<ÊJ?ÅG;½?3¼;(¼;(º;*¹:)·:(¸:+¼>0¿A3ÁA6Á<5Å<6ÏA?×EEÝGIãJMèMQëADì?EðCIúJTþN[üJZüF\üF]øA]ùBaýEiÿJpÿNwÿOzÿMxÿKxÿR{ÿR{þOvýOtÿVwÿ]{ÿSoîD^øUjîQd÷dtÿ’žÿ‹“òƒ‰Ç`c­KL²keÏŽˆñ¼¶ÿÞÙÿðìÿúúÿüþýûÿüûÿþûÿÿûÿÿûÿÿüÿÿûýÿûûÿûøÿûøÿüùÿûùÿûúÿøúÿöøÿòõÿðóûìïòææçÝÛߨÒÛ×ÎÝÛÏàÞÑàáÓÚãÞÏØÓÅÎÉ<94;8385052-41*41*52+63,74-85.96/;8/=:1?<3A>5B?6KA7MC7RF8UI9WK;WK;UL=SJASJK[Xcnl‚‚‚¨‘”Çš Þž§ì¡©ò¡¤óž í™›æ•˜ß”•Ö̈‰¿‚ƒ±zz rq‘fd|XWiPN\IGRFCJDBG=?K==G;:?;:8<92A;-D=*F@*F@(GA)GB.ED2CC7BC=AC@>BAG9HH,©>,ª?+­@,¯@-°?-°=*±8'¶8)½9*Ã9,È8-Ì8.Ò91Õ;3Î;4Í:3Ë81Ë81Ì92Í:2Ì70Ë6/Ó<3Õ>5Ò91Ì2*Ð3*Ù;2Ú<3Ó5,è0(é1)ì1*î1+ñ0+ò/)ô-(ö,(÷-)õ.)ñ0)ê2(â5%Ù6#Ò7!Í8 Õ8%Õ8%Õ5%Ñ4%Ò4(Ô6+Ô7.Ð7/ãNGèXPçZQØRIËH>ÃE9¼B5·?1¹<&¹<&¹<(¸;'¸9(º;*À>0Ä@4ÉD;Æ?9É@:ÑFCÕIHÖHG×IHÛJMìCFêADíDIöKSüQZýN]ûL]üJ`öD^÷DaùFfýIlÿNuÿOxÿOxÿNyðYzðWvóVuüYxÿ]{ÿZuûQkòI`ýWköUgêN\ö^kâKZçSaçSaåQ_¸jfÉ‚~窧ÿÓÑÿëèÿôòÿøùÿÿÿùýÿùüÿûüÿüüþüúûýùøüøõü÷ôÿú÷ÿûøÿüúÿûúÿøøÿòõýîñúëîðââëÝÝäÙÕâÙÒæßÕëçÛñîßóñâêóðÜåâÏØÕ@=6=:3:7074-52+52+52+63,74-74-96/;8/=:1?<3@=4A>5M@7OC7RF8WJ:XK:YL-C@-CB.BC3AE7>E=€UE’YFL7A+“A+«@,®A-®A-®A-°A.²A/²=+°7&µ7(¼8)Â8+È8-Í6-Ñ7/Õ8/Ù;2Ò73Ñ61Ñ61Ò72Ô94Ô94Õ81Ó6/ÞA:Ö8/Ñ3*Ø7/Þ=5Þ=5Û8/Ù6-ë0'ì0'ï0(ò/)õ.)ø-)ø+(ø+(ø-)ô/)ð1)é4)á5'Ù8&Ó8$Ï8#Í8$Î9%Î7$Ï6&Ð7)Ô8,Ó7+Î4*Ì3+ãNGôd\ë`YÔOFÂB9¸<2´:/·?&¸>&·=&¸;%º9&½9*Á;/Ä>3ÌC9ÊA9ÎE?ÕKHÓLIÎGDÌFEÐJIéFGæCDéDHòMSùRZùR\ùN^úOaõG^õGbøGdûIiÿNrÿRvÿRyÿRyå[uë\xõ`}ü_|øUpõMgùPgÿYnÿ[mÿbsóL]úSdøM_ÿRgüI_ýE]³d`¾tqÚš˜ûÈÅÿåãÿîëÿõôÿÿÿûÿÿùÿÿùÿÿúÿÿüþýýüúýùöýøõÿøõÿùöÿúøÿúùÿööþððøêêõåæìÜÝèÚÙæØÕèÞÕðèÝùóåþûêÿþíòûúâëêÔÝÜA>5@=4?<3=:1;8/96-74+63*52)52)63*74-:70=:3@=6B?8J@6OC7RF8VI9WJ9XK;ZL?[NHTIMXR`gd|}©’Ì—Ÿçž©ù¤°ÿª³ÿª³ÿ¬³ÿ«³þª±ùª®õ¨«î§«êŸ¡Ü™šÒÁ±ur¡he’]Z…XR~YP{YQxVOpOG_E?M?:@?;8@@6>>2@B5@F:>E=:C>9CB*®?,±@.³@.´?-¶=,¹;,º6'¿5(Ä6*Ë7-Ñ7-Ö8/Ú91Û81×84Ø95Ù:6Ú85Ø61Ø61Û83Ý:3æC<à=6Ú70ã@7þ[Rÿlcÿ]Tã@7é1'î2)ò1*ô/)õ*&÷'%ø(&ú*(ø-)ó0*í2)ã1%Ú0#Ó1"Ò5$Õ:(É=&É=&Ë=)Ï<*Ñ;,Ò9+Ô8,Ó6-Ú@8Ð71ÜGAôc^ãXQÉB<Å@9·3.´<#¶<$¹<&º<&½:(¿:)Ä<.Ç=2È>4ÌC;ÙPJßXTÓOJÁ@;¿@:ÊKEäFEäFEèJKïPTòQWïNVïKVñL\ùRdøOf÷Ke÷JfüMnÿRsÿRvÿPtê[wêZuðZuú[wÿ]xÿZsÿWnÿViÿctþVgÿ\mÿYlõDXùBXÿMeÿIb·nh­hcËŽ‹èµ²ùÑÏÿêéýïîúù÷øþüøÿÿøÿÿøÿþúþýþþüÿûøþöôþùõÿû÷ÿùöÿöôÿööÿõõöèèçרäÔÔÞÐÍãÖÐñçÝüôçÿøèÿüéÿÿí÷ÿÿèñðØáàC?4B>3A=2?;0=90;7.:6-95,73*73*73*83-:5/=82@;5B=7I?5LB6QE7UH8VI8YI9YK>ZMEUKLXP_ebyz¦‰É”œäš§ö ¯ÿ«´ÿ¬µÿ­·ÿ¯·ÿ¯·ÿ¯¶ü¯³ú¯²÷§ªí¢£ä˜˜ØŒŠÉ€~½uq®ie¢b^›cVŽbU‹]TƒWOtNHdFCTBAIAAA;=8@C9ß<7ß<7â=9æA=èC=éB<èA;ç@:èA9ä@7Ü8/Õ1'Ø6+ëI>þ\Qô?4î6,ê+#î)#ù,)ÿ./þ,-ø((ú0.õ4/ï7/ç6,Ü4)Ö2&Ó3%Ò5&Å='Ç<'É<(Ì;(Í:(Ï7)Ï6(Ð4(Õ8/Ï5-Õ<6åPJçSOÛLHÏA?º/,¹=%º>&»='½<'¾9(À8(Ã9,Ä:/È>4ËB:ÕOFÜWPÒQKÃD=¿B<ÆKDáIFáIFåMLëSRíTVëPVéNVìOZ÷VføUhùSiúRküRmÿSqÿStÿRsïNoøTvÿ\|ÿ^{ÿ[vÿUoýQgûReüUføQbÿZhÿZjôM^úRcÿWiôI\§ha™\W·€{Ù©¥ïÇÅýáÞùêçýøõøýùøÿÿ÷ÿÿöÿýùÿýÿÿýÿûûÿö÷üùòþùõþùõþöóÿ÷õÿõõøêéêÜÛäÖÓÝÐÊáÔÌïåÙüõåÿùçÿýéÿÿì÷ÿýèñîÙâßEA5EA6C?4A=2?;0=9.<8-;7.84+84+73*83-:5/=82?:4A<6G>5JB7ND8RF6TG6WG7YI:YKBWKKXP[b^wsuž…ŠÂ™Þ—¤ó¬ÿª´û¬¶ý®¸ÿ±¹ÿ²ºÿ´»ÿ³ºÿµ¹ÿ¯²ùª­ô££ë™—àŽŒÕ‚€Éxt¾qm·l`¢i]dY“^V‡VQyNKhEDV@@J76;?=>HBBKABN?BYFJmX_}fnt¤}¬§‚®¬}§´w ¾p—Âc…ÃRpÅE^ÔI\×EPÊ9<¾3,»7(¸;%³; ¯<*¯<*°;)³;*·<,»<-À<-Ä<.Ä6*Ë8.Ô<1Û>5á@8á>7à<3á:2Ü73Ù40Ø3/à93èA;ìE?êA<å<5ã<4Û4,Ø4*Û7-Ô2'Ì, Ö6*èH<÷I>ò@6ï4-ð-)÷+*ý+,ý+,ø*,ñ))ì/+è3,â5.Ü4+Ö2(Ô2'Ô2'Ç:&È;'Ê<(Î;)Ñ;*Ò:,Ô8+Ô8,Ñ4+Ø;4Õ:5Õ<7çONîXYÙEEÅ02¾=(¿<(¿<(¿:'Á9)À8*Á7*Á7,Æ>2ÇA6ÏJAØUKÑRIÄH>¿E:ÃH@ÚIDÙHCÝLGäSPåSSâPQâMQåNWòXdöZhý[pþZrýUoûQlýPnÿRpÿFmÿOvÿZ}ÿ[{ÿVqÿSkÿVkÿ[mûYhúYhü`mö`kî\fñenífmÚT[’cY}ND™lfØ’ß¹¶ñÓÑôàßþöôøú÷÷ÿý÷ÿÿöÿýùÿýÿþÿÿýÿÿ÷ûúúòüùôüùôýøôÿùöÿøöùîìñãâçÙÖÝÐÈÜÒÈîäØýöäÿûèÿýçÿÿè÷ýùêðìÝãßIE9HD8FB6D@4B>2@<1?;0>:/:6-95,95,94.:5/<71>93@;5E>6HA7LD7QE5RE4UF3WG7WIC_@EmDJ€OU•]f¦jrÇe˜ÍkœÏl›Ïf‘Í]…ÎTyÌFgË8UÌ0Hß>PäBMÔ:<Æ7/Ã@.ºB*®/Û?0Ü@3Ü@3Ò6*èKBåJEÎ50àFFóZ\áHKØ?BÆ=-Ä;+Ã:*Ã:*Ã:*Ã9,Á9+À8,Â<0Â>2ÈF9ÏOBÎPDÄH<¿C7¾D7ÑF?ÑF?ÕJCÛPKÝROÙMLÚKMÜKPëX`ó[hüaqÿauûWoõOgõMgúPkÿJuÿOyÿSwÿRqÿSmþ[pÿcuÿixÿguüaoôbmìelàglÔjjÉjh¼c_dVeH:_Tª‡Í«©åÇÇïÚÙÿóóùøöøþü÷ÿÿ÷ÿÿûÿÿÿþÿÿüÿÿ÷þûüôúûóûúõþûöÿýùÿûøþôòøíéêßÙÞÔËÝÓÇíæÖÿøåÿþèÿÿæÿÿçõúóêïèáæßLI:KH9JG8HD8FB6D@4B>3A=2=9.<8/;7.;60;60<71>93?:4B?8EA8JD8NE4PE1TE0VG4XH9ZMEVMR[Whkl‹~‚²‰“Ð’Ÿå™§ò§­÷©¯ù«±û­³ý°´þ°´þ°´þ¯³ý«®û¨«ø¥§ô ¢ïšœé“•⊌ل†Ó…É{u½mk­dd _a”X[†QQsNHbUFY_CRlBLEO˜LV¬U]¼[dÅ]fçJuéNxæPuàLn×FcÒ?YÍ5JÊ+?Ú5EçAMéFKÙ><Í>6ÊH8¿J6°B)·>-¸=-º<-½>/Ã?2ÊB4ÐD7ÕE:ÙE9ÚB7Û>5Û:2Ù6-Ù5,Ú3+Ù2*Ô1*×4-Û60Ý90ß80Þ7/Ý6.Ü5,Ö/&Ù5+Ø6)Ï2#Í1"Ò9)Õ>-Ó<+Ö=-æD7÷KAÿD?û56÷)-÷)-ù.2ø67í55â30Ú1,×/,×/,Ù0-Û/-ã80â:1â:1â<0à<0ß=0Ü?0Ú>1Ñ7+ïWLù`XÓ;6Ó;:èOQÞEHèOTÍ=2Ê:/Æ8,Æ8,Æ:-Å;.Ã;-À:.¾:-¾<.ÁB3ÇH9ÇI:ÂD6¾@2¼>0ÊE<ÊE<ÎI@ÕPI×RMÔNKÓKK×LOçZ`ð^hüfrÿhxü]qóOgóMeùQjÿPzÿQxÿQpûSmø\qûhxûjw÷epüfró_kí_kêkrÝsu¿lh¦f\¡l^ujXVI8kXJ–{t¾ŸœßÁÁïÕØþîïûõõúüûúÿÿùÿÿýþÿÿýÿÿûÿÿ÷ÿýÿ÷ûþõûüöÿþùÿÿúÿþúÿûõÿ÷òñèáäÜÑáÙÌðé×ÿúæÿÿæÿÿãÿÿäöùðíðççêáQK=PJ3Õ;1Ö8/Õ4*Ö3*Ø4+Û4,Ü5-Ú9/Ý<2à=4ß<3Ý90Ü5-Ü5,Ý6-Ò.$Ý;.Ü<.Í1"Å.Í8$Ð=)Ì;&Ë:'Ò9+á:1ó=9ÿ@@ÿ;?ÿ27ô+1ê,.ß+,×+)Ó+(×/.Þ44ä88è:;ó55ò64î73é6/ã7-Ý5*×5(Ñ5&Í5'çPEÿmcÛHAÈ42×CCÓ>BêUYÙB;Ô=6Ì70Æ6-Ç9/Æ<1Ã=1Á=.»9)»<+½@.¿B0¿B0¾?.¼=,»<+ÃC8ÄD9ÈH=ÏPGÒSLÐOIÐOJÔOPç_cîaiûitÿm|ÿdu÷UjõRgýWoÿSxÿUtûWpð_pñoyôy~êmsÞXaïamò`mïaoðs{숊ɂ|¥wjšyhhpYMO:^WGƒqg±•’Ý¿¿ñÔØýéëþôõýûþûÿÿúþÿýþÿÿýÿÿûÿÿöÿüÿøùÿõúýôÿÿúÿÿúÿÿúÿý÷ÿþöùðçíåÚéâÒôïÜÿûåÿþåÿÿãÿÿâøúíòôçîðãSM=RL4D=5B;3A:4@93A:4A96B:7@A;CC;IE:NG7QF2RF.UF/WH5XJ=RHFXR\jh€}§‹’Æ’žÚ–¤å¥¦ù¦§ú©ªý«¬þ¬­ÿ­®þ¬­ý«®û¨¬ö¦ªó¤¨ñ£§î¡¨î §ë¤è›¢æ™žâ’šÛŠ”Ò…Ê‚ŽÂ‚‰·‚©‡yšŽmˆšczªWi¾P]ÓKWäGPí?Hñ9Aî;6é<5âB6ÙH7ÎJ5ÅG1ÂD.Å@/ãUGàG?Ú;7Ø64Ø88Ö:;Ï98Ê66¼=.¾<.¿;.À;,Â8+Ä6*Æ3)È1&Í5*Ð3*Ñ3(Õ2)×3*Ù5,Ý6.Þ7/Ü>3Ý<2Ü;1Û8/Û7.Ú6,Ø4*×3)Õ3&Ó3%Ñ4%Ï6&Ò=)Ñ>*Ê9$À2Æ;(È5%Ó3'ç60ü;<ÿ=@ÿ7=ù27ê-1à..×--Õ0.Ü44ã9:é;=ë;>ý.4ú/3ö01î1/æ1*Þ2(Õ1%Ï3$È2#Ð>/új_ãTLÈ95Ð@@Ë:=ãRUçJEÝB=Ò93Ê5.Æ8.Å;0Â<0¿=-¹<*¼?-½@.¼?-º;(º;(½<)¾=*º>2º>2ÀD8ÈLBÌPFÊNFÌMGÐNLçbcêbføhqÿo{ÿhxøYm÷Ujþ[pÿXsü\tìbqãktç€í‰‡ãyyØ_dñhrÿl|öcsíkwø‘•餟À–Š¥‹z\pWFRRLÿ4:èB*âD)ÙH)ÎN+ÃO(¹L%¶H%»D&ÛWBÚF8Ú;5æ>>íBHé>Fß5>×08ÈF8ÇE7ÈD7ÉA3Ç=0Æ8,Æ3)Ç0%Ê0&Î1(Ó2(Ö3*Ù5,Ù5,Û4,Û4,áC8Û=2Ø7-Ø7-Ü:/Ý9/Ù5+Õ1'Ù7*Ð0"Ì0!Ð9&Ì9%Æ5 Ç9#ÑE.Á:&É:)Õ7+â3.í//÷05þ5;ÿ;BÿIMúGJîDDæ@@ä>>ã9:ã28á.4þ'/û(/ø*.ó-.ë0+ã2*Û5)Ô7(Æ0!¾/óeYê]TÌA<ÓEDÊ;=ÝNRïPMäFCÕ:6Ê5/Æ8.Ä:/À,¼A/½B0º=)·8%º9&¾;)Á>,²8+²8+¸>1ÁG<ÅK@ÄIAÆICÊJGå`aæ^bñdlÿlxÿix÷ZköTiýZoú^tòcuãgqØqrÝ…é”ꋇåruùq{ÿxˆõ`sßXgóŠ‘ý¶´Ö«¢¬•…TnSAS;PTCkaWž†‚Ý¿ÁõÖÛøßåÿóùÿûÿÿþÿüýÿýüÿÿüÿÿúÿÿôÿùÿø÷ÿôöüòüÿøýþøüüôÿýöÿÿöÿþôûõç÷ñáüúåÿþåþýáýþßÿÿãÿÿñýþîüýíXO@XO@WN?VM>TKñ8>æ=@ÙD@ÑHBå;Dà;BÞCGÉ99ÌB@ËD@½/-ÞHIëHKîAGï;Dì8Aé:?â<>Ú<;Ô<9ÏA=É>9ÊC=ÑLCËK@¼>2³7+¹;-¹9,¾8-Å7-Ê3,Ï0,Ô/-Ý11á34çA1à9)Ü1 á1"é8(ê;*ã6%×2Ñ2Ì4Ê5Ç4 É3"Ì3%Ñ3(Ô3)Í.(Ï2+Î6+Ì8*Ë8(Í7&Ð7%Ø6'ß3'é2,ð31ò01ð+2í*2í+4ï-6ú+1÷*/ñ+,î.-ë4.ä8,Ú7(Ð5#Ã.Ä3 çXHèZLÊ<2ÞOGÄ5/ÚIFÝQRÚLKÒDBË<8È80Ç7,È9+Ê;+È;)Å:'À9%½:&»<)º=+¸=+¶=,³9.µ;.¹=1½?1½?1¿@1Â@2ÅA4ïk_õqeêd[ômiùroécbðjiútuÿk|ûivñdmï_hòaføgjõnkîqk÷|wÿ}ƒþYjÿ[wîZpû¬±«°œaŸz]sMIZ6LR6snX£–†Ë·®íÕÓÿîðÿõ÷ÿ÷ûþøüüüþþÿÿþÿÿþÿÿýþÿæÿòàÿëâýêìÿð÷ÿôûÿôþÿóÿþñÿýïÿûîÿùèÿùæÿøãÿùãÿùáþúáýÿþþÿÿþÿÿYPAXO@XO@VM>UL=TKDë:Bè7?ä7;Ü89Õ:8Ð;7ÓF?Ç<5Å<4ÌG>ÌLAÁC7¶;,·9+¹7*½7+Å7-Ë4-Ñ2.Ø3/á53æ66á?0ß<-Þ6)à4&á6%á6%Û4"Ó4Ð:"Ê:"Æ:#Æ;&É<*Í;,Ì8,Ì5*Ö3.Ö5-Ñ7-Î8*É6&Ç4"Ë4!Ð3"Ø2$ß1(å/+ç.,è,-æ,1æ-3ç.4î*,î,-í0.é2.á3*Û5'×7'Ò9'Ó@,»*ÔE5Î?1ÙF>êWPØC?ØBAåWVâRRÛKJÔC>Í=5É9.È9+Ç8(È;)Ä;(Á:'¾;'½>+º?-¹@/¶>-²9.µ;0·=0¹=1º?0½?1ÁB3ÅC6ëi\òmdçb[ðkfõolèbañklûuvÿp€ÿo|öirë^fêY^òadøqnù|vöyuÿx~ùRdÿUríXnö¥«¥¨“X”n[tLN_;QZ;us\ª×úøàÜÿôóÿúûÿúûÿûüüüþúþÿûÿÿúþÿûüþçÿñáÿêáýçéÿìóÿòøÿóýÿòÿÿóÿýïÿýíÿúëÿöåûóàúòÝûõßý÷ßúúøüüúÿÿýZQBYPAYPAWN?VM>UL=TKCß>Câ;CØ7=Õ?AÏA@ÉD?Â=8Ã96ëWWàBCæ=Bé:Aæ7<Þ58Ö66Ñ96Ì;6ÕHAÅ:3¾5+ÅA5ËK>ÆH:»=/¶8)¹7)¿7+Æ8,Î7.Õ60Þ63æ87ë;;Ó5)Ö6*Ú6*Ü6*Ý5(Ý7)Ú:*Ö?,Ã5¼5¸6 ¸7"»9)¼8+¼4(º0&é=;å>8Þ=5Ô*ÓB/Â1 æTEÐ<0ÚA;ÞC?èJIòTSèVVçSSãOMÝIEÖC;Ï<2Ê8+Å6&Ä7&À7%¼7$»:'¹<*·>-µ=,²=,°:.±;/²<.µ=/·=.º?0ÀB4ÃE7Ü\Oêg]äaYñlgöpoçabìfgòkoäP`ï^kôhqòemñ`eödgûqqúzwövsÿnuõJ]ÿMjïUmñœ¡ŸžŠPˆcVoEOd=Va?ww]¯¤’âÐÄÿíæÿ÷óÿûøÿýûÿþüûÿüûÿýûÿýùÿû÷ýùãÿëÜþãÚøÞàúáèûåïüèöýëýþîýúëÿúêÿ÷èúñàòê×ðèÕôìÙùñÜýùöÿûøÿþû\PB\PB[OAZN@YM?YM?XL>XL>UI;TH:SG9RF8RF8RF8RF8RF8JF=KGÓ>@ÐFCÅA<¸71Å>:ê[WÝABä?Cç=@ã:=Û89Ó97Î=8ÌA:ÏE;Ã9/»2(À/¸9(¼8)Â8+É:,Ò:/Ù80á83è;7ì=:Ô3+Ö3,Ù5,Ý4-Þ6-Þ7.Ú:.Ô>/Æ9(Á<)½>-¹>.»=/½=2Á>6Ã>7ó?>î?<æ?7Ù=1Í:*Æ9%Æ;$È<%Ï<(Ï8'Ï2#Ñ1%Ó2(Õ4,Ñ2,Ï0*Ñ3*Ó5*Ñ7+Ï7)Ê7'É8%Ê<(Ì>*Ê<(Î=,ô^PàF<Ò3/Ò.-è?BþUXÿvuÿroÿjgö^YçPIÕA7Ç5(½.Ä8'À9&»8&¹:)¶=,µ=-±>,°<-­<.­<.®=/°<-±;-¶>0¼B3ÁE9ÉMAß`Wâa[ôpløtrå`aä]aå^dÙFVçYeógpôgo÷dlýjpÿstúxvõssûenóCXÿEbðRkë’˜œ—ƒN‚\Ql?Ri?ZhDy|_°ª”èÛËÿôêÿùðÿúóÿýöýÿùûÿúùÿúöÿøòüóîøïÔüÚÎóÒÊëÌÏìÎ×îÒàïØéòÝóöãöõãûõåüõãõìÛíáÑéÝÍíáÑóç×úõïü÷ñþùó\PB\PB[OA[OAZN@YM?YM?YM?WK=VJcî7Uí8IçAEßFAØIAØIAÞFCæAGð;Jõ8JãDI×>AÐ@?ÏJE¾?8²3,ÇD<âTPÜDCáACä>@â>?Ü>=Ô@<ÏE;ÌH<Ç=2Á7,½5'½9*¿=-¿=-»<+½<)À;*Ç;,Î<-Õ;/Û8/à70ç83ë95ã:7â64â22å31æ42ä50Û2+Ò1)É2'Ç9-Ä<0¿90¼5/¿52È<;ÒDCó57î66å61Ø5,Ë5&Ã6"Á9#Ã;#É>'Ê9&Ë5$Í5'Ñ9,Ó;0Ò:/Ï8-Í?1É;-Ä8'Ã7&Ã:'Å<)Å='Æ;&Í>-Í:*Ø>2ãB:Ö.+æ::á14å26Ò73Ö;7ÞC>åJEêQIêSHèTHäUGË?0Æ>.¾<,º<-¶>.³@.°?/®?.«=0«=.¬<.¬<.­<,±=.·A3¼D6ÆLAÞbZâc]ðnlôrrå`cå`eæ`gúixûozõltí`hñ^fÿkqÿw{ÿ{|öpqø^hö@Wý>]óOh懠•ƒX†aXuE\vIgwP‚ˆfµ±–éáÌÿùéÿüíÿýñþÿóûÿôøÿöôÿóíûìäòãÝëÜÁëŻ㾺޺¿Þ¼ÆáÀÍâÃØæÌãëÓìîÙôñÞøñßóêÛìàÒèÚÍìÜÏñáÔòçáòçáóèâ[OA[OA[OAZN@ZN@YM?YM?YM?XL>XL>WK=VJPI?QI>SK>UL;XM9YM7YM7XM;WK=ULGYSWc_nmkƒtt–|~§ƒ†³†‰²‡Š·ŠŒ¿‹ÈŽÏŽŽÔÕÓ”Ó‹Ê‚‰¿{‚¶u|²ov­gp«ck©€n~ey­ZvÏMoê?cú2Vÿ0Lû6Gð@CâGBÙLB×MCÝIGèCJõÍID¸<4¯5*ÉI@ÕLF×CAÜ>=Ý:;Û;;Ù?=ÔE=ÌH<ÇI;Á7*Á7*À8(¾9(¼9'º9&½:(À;(Ä;)Ê=,Ò<-×;.Ü8.á6.ä6/è5.ê24è.1ê+0ð/2ö37÷69î45æ21Ø/,×31Ô63Ï42Î/3Ð/5Û5?ä=Gõ,2ñ.2è2/Ü3,Ñ5(É8'Æ;&Æ>(Ä9$Æ8$Ë8&Ò:,Ø?1ÛA5ÚB5ÙA6ÎI8ÇB1¿<*½:&Á<)Ã?*Å<)Ä9&Ì;*Î6)Î0'çB<Ý1/ñ>Aå.2à'-Ò3-Ó4.Ö71Ö92Ò8.Í5*Æ2&À1#ÎE5ÆA2¼=.µ:+±9)®:+ª:,ª:,ª/«=.«<+¬=,°?/µA4ÉSGàg^ßd_èkiînoæchðjqõoxüp}ýt~õmwîcj÷dlÿqzÿw|ûsuökpöXfûAYÿ:[õKfâ}…©˜†l”ojŠXo‰ZxŠ`—r¶·˜âÜÂúôÞüúåÿÿïûÿïõÿïîÿëçúäÜïÙÐãÍÉÛū٫¨Ó¦¨Ñ¥¯Ô©¶Ô®¼Ö±ÇÚºÒßÁàæÌêéÔòíÚòéÚïáÖìÛÑëØÑíÚÓèÛÒæÙÐåØÏZN>ZN>ZN>ZN>YM=YM=YM=YM=XL@çE@ÝJBÚKCÞHGéBLó8ÏE;ÆF9¿E6Á8(Ã:*Â:*¿:'½8%½:&¿:'Á:&Ä9&Ë:)Ò;*Ù9+Ý7+á5+ä3+ç4-í)-ò)/ù,3ÿ.4ÿ07ÿ18ÿ28ý58ú7;õ8<ò9?ò9Aô9D÷6Gû6Hü5Jø)1õ,2î02ã4/Ø7-Ï9*Í<+Ì=,È7&Ï9*Ø2á?4â>4â?6â?6ÑN<ÍH7ÇB1Â=,¿:'Á:'Å9(È9)Ç3%Ó9/á@8ëD>Þ0/á-.ì38í38×4-×6.Ù80Ø:1Õ;1Ó;0Î:.Ê:/ÖL?ÌF:¿?2´9*¯7)«7*©8*¨8*ª<-¬>/­?0­=/«<+«<+­<,¯>0ÀKAÚc[Ýc^èkiðosëhnõrzüvïer÷oyør{öjsÿlvÿvÿu}öioõfl÷RbÿA[ÿ6YôFaÝt{²›‰€¤~z›f{—f€–h‘u­±ŽÌË­áàÄéëÓî÷ÜåóÙÙíÑÎçÉÅÞÀ¼Õ·´Ë®®Å¨•Ã’”‘˜Ä“¡È™§Ë¬Ë¡µÎ§ÁÒ®ÎÙ»ÙÝÄåãÎìåÕïáÖëÚÒçÒÍäÏÊÞÐÇÚÌÃÕǾ[N>ZM=ZM=ZM=ZM=ZM=YLXL>YNø<=íA=äE?àGBãDHèAKï=Mô:OÒBAÑGDÅA<ÂH=¯;.°5É83È.,Ç)&É.*Í:3ÌC9ÂD6¸@0Ã:(Ã<)Ã<)Á:'À;(Á=(Â;'Ã8%Ä6"Ê7%Ô8)Ù7*Ý5(á3(å3)è3*û03ÿ58ÿ7<ÿ38ÿ,2ÿ&-ÿ'-ÿ)1ÿ,3ù'0ô%/ú'6ÿ+=ÿ(Aÿ:ú2ö".ô&0î+1æ0/Ú1,Ò4+Ï5)Ð6*Ô6+Ü90æ>5ì>7ë:4é61è50é61ØL?×K<ÒF7Ê>/Ä6(Â3%È6)Í9-Í5*Ô6-æC<à74à21Ò ì89ê35Ó2(Ô3)Ò4)Ñ5)Ï5+Ì5*È5+Å7+ãYNØRFÊH;¾@4¶=ê@AéBIêCMëANê>NÌA<Å@9¾?6µ?3®=/±=0¿E8ÒMDÇ61Ô;6Ï1.Í2.ÖC<Ç?3´6'·?.½6#Á:'Ã<)Â;'À9%Á:&Ã:'Ç:&Ë:'Ð9(Ô7(Ö3$Ú."à/%ì7.ô=5ø72ù30ú.-û)(ý%&ÿ#%ÿ"'ÿ"'ÿ$*ù )ú!,ÿ%7ÿ'<ÿ;ÿ4ÿ3ý)7ð".ç"+ä*-Ý--Ó+(Ò-)Ü41â62é54ï64ó55ó12ñ-.ï+,í++Õ<4Ò91Ñ:1ëTK»"Ä+#ßF>È.&Ì/(Þ<7èE@â:7Ø/,Û.*ã41é:7Ý?3×;.Ï5)Ë3&Ì5*Î:.Ë;0Æ8.ìbWàZOÈD8¹6,º:/·9-¯3)²6,¯1%°2&®2&®4'¯7'²:,²<.³=/°:.ºC;Ö\Wìppñsvøv~ûyƒõq|ÿ{„ûx€øu}üs{ÿr~ÿq}ÿlxûisøbmôI\ÿ=\ÿ8[ñ:VÖek²–‡¦}~¡i|šd}•c‡—j”ŸuŸ¥ ¨ƒœ¨„’£Š£|€Ÿvx›qw›o|r t„£w¯uƒ³y‰¹½„“¾†—¾‡œ¾‹¢½§¼“¯½š¾Â§Ï̹ßÓÇãÒËÜÇÄÖ¾¾Ê»´Á²«¹ª£ZM1ÐB6Ü?6è?8ôA=ö=;ø:<÷:@ô7½=4¶<1°õ6;ú3:û06ú-2û.3ý14þ36×4/Ü:5Ù72æDAæDAÎ/+Ñ2.Á"Ö41á?<èE@à=8Ø3-Ù2,Ý60à91Ò<-Ï9*É5'È4&Ê8+Ë;0Ê<2Æ9/ícYáXNÉ@8¼3+À:1Á;2½7.À:1Á4+¾4*½4*»5*¸6(´6(²7(°6)´;0»B9ÓYTèllïqtöw~þ|†øv€ÿ|„ûyøv~þuÿsÿo}ÿiwùeqùanöI]ÿ<\ÿ9\ô=YÕdh«y€œsu˜`t’\w]cŠ•k—p‹•p…”mp†_lˆ_fŠ\g^j_q•ey›i}l€­r„²tЏz»}½‘½‚–½„›»‰›µ†¡³­¶—¾½¨ÏÆ·ØÇ¿ÖÁ¾ÒººÅ·¶º¬«²¤£\L<\L<\L<\L<\L<\L<\L<\L/ÇE5ÐG7ÚC8ä?9ó=<ú9>ü9Aú:Eò>GæAH×@EÏ@B¿<4¸90±8-«:*¨9(«:*»?3ÏF<ÙD>Ø96Ú65Ü:7ÜC=ÝOEÍI<²4%À9&Á:'Ã<)Æ=+Ç>,È=*É:)Ì9)Ï8'Ï2#Ó/#ß4*î=3ô?6ñ91í2+Ú7&Ý6&à3#å/"é-"î+%ñ,&ò+(ó++ð(+ò'-ú(5þ%8ÿ5þ2ÿ3ð(5ô.;ô4?ò8Cï;Dðå+6ñ1<ô/9ù-8ù+5ù,3ø-1ö.1ö01Ù1.ä<9Û64à;9ÿljæBAÒ.-Ð.,Û97á?<àA=Û<6Õ7.Ô6+Ô6+Ó5*Å8&Ã6%Ã6%Ä8)Ç;.Æ<1Æ<2Å;1ëaWáTMÉ<3¿0(Ë;3Ï?6Î;3Ñ>6Ú=8×<7Ô=4Ï<2É;/Â:.»7*¶6)·;/»@8ÏTMãgeíorøz~ÿˆý{…ý{ƒùzúx€ÿwÿsÿl}ÿftøbnø]kõG^ÿ:Zÿ9\÷AZÐ_c›gkŠ^e†Oh…Ol„Rt…X{ˆ\}ˆ^x„\q‚X`yO_P`†UeYm•`uœg{ j€£m­p…±tˆ¶v‹¹y‹¹yŒºz‘º~”º‘±•¬€›©†©­’ºµ¢Ç¹°Ë¸²Ì´²¶­®ª¡¢ —˜[K;[K;[K;[K;[K;[K;[K;[K;ZJ:ZJ:ZJ:[K;[K;\L<\L<\L<]K=]K=]L<^M=^M;^O<^O<^O<`P@^Q@]P@\NC\NE[NF\OI]PJ`NdcSmfX{g^‰ohœzu¯„|¸†{µ™…º¥…´¯€ªºy¡ÈxŸÓušÍc‹¾OyêAFà@@ÕA=ÌF;ÈJ;ÉJ;ÐF9ÜB:î@?ø;Aþ:Dü7õ>8ð50è-&×:)Ú8)Ý5(à2'æ/'é.'é,(é,*ç+*å(,è)1ï+7õ';ö";ú=ÿ"A÷8Gä(6ç/;ÿP\ÿ`lÿP\ò^N>^N?^N?_OB`PC`OEbM\cPdcUodZle‘vr¤~w«‚v¦“~©¬†«Â‰©ÐžÛw“âk‡ÝXuÓFfÿ=MüDPðJNÞJHÌG>ÇG<ÍG<ÙD>èBBó>Cù>Gø@HðCIÞDDÍB=À?9½A5µ=/®:+ª;*©:)­9*º<.Ì?6áFBä<;ïABíAAÞ:8ãJBæXLÔL>È@0À8(»3#Á8(È<-É:*Ë7)Ð8+Î0%×3)à8/é;4ï:3î50ë0+è+'Û4,ß4-ä2.ë31ð43õ45ö58õ6;é/4ç.6ê0=î1Cò.Fõ*Gý,Lÿ1TðPî3Dî2Aî3>ê5<æ89Ü73Ð3*Ç/$Ì2*È-(Ñ61óXT÷\ZóXVÜ@AâHHÜB@Õ<7Î70Í6-Ï8-Í9+Ê7'Æ3!³:%²9$´;(¸=-¹;-¶6)»8.Ä>5ÛNGÙEAÎ50Ð1-á>9è?:ã81ä71ð/0ï11ì42é73â92Ø:/Ð9.È:.¾6*º7-ÈIBÜ_Yënlû}€ÿ…‰ýƒõv}õx~ùzÿx‚ÿsÿj{ÿdtö_nðUeôF]ÿ6Vÿ7ZúF_ÀTRvaBJoRÿ-Hÿ:QþCTéDKÒ@AËA>ÎDAÖEBãEFêAFï@EïBFçDEÚEAÉC:¿?4º@3±;-©8(¨9(©:)®9(º:-Ë;3èIEë??î;>æ68Û2/ÞA:îZPõg[ÙQCÉA3¾4'À6)Ç9+Ê8+Í6+Ò8,Ñ0&Ü5-æ;4ë:4ê40è/,ê-+í-,ó4;õ3;ø3<þ2=ÿ1>þ0=ý0?ù0@ô1Añ2Dò5Kó5Oó0Põ-Qþ1Xÿ:dá7B÷O\ÿanÿ`nþXfùQbòEXé8Jó@Sê:GÝ2;Ò/2È3-Á9-º=+µ>(Æ9/¿2(ÙJBúkcÝLGáPMÍ<9Ï;9àLJÔ@<Ê7/Ê7-Î(«;%­=)²?-±9)®4'º:1ÊC=ÕHAØC?Ô72×2.ç;7ì:6è2.ë2-÷)+÷+,ô.-ð3/é61â:1Ú<1Ò>2Â6)º4)ÅB:×XRçjhú|}ÿ†‰þ€„õv}öyú{‚ÿx„ÿqÿh{ýbtõ^oîSe÷I`ÿ9Xÿ9[ûI_ºQNmZ:Em8ZvCa|InSv†Y|‡]Šbg‚—lœl{ m|¤o}¨p~ªo‚ªnƒ©l…©lˆ«qˆ®qˆ°r†³r„³oƒµn„¸p‡¹t‹µv‰¬tŒ¦wš¨„°´™ÈïØÌ¾àÏŽÃÓ«±Á›¡±ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\M:\M:\M:`J<`J<^K<_L=^M;_N<_N<^O<^O<_P;_P;aPHÿ$Hÿ0Qÿ;UñÇA6¾>1·?1¯9+¨7'¨:)¬=*²=,À>1Ñ>7ß=:ç79æ/3ã/0á32Û94åNEülaïj[ÙQCÆÍD>Á61É;7ãUQÕF@É91È8-É:,È9(È:&É;%ªB)¦<&¦<&¬=*©8(¬3(¼=4ÒMFÕGCÝEBÛ96Ü30é73í41ì/+ó2-ÿ)/ÿ*/ý--ö0/ï4/è7/ß;1Ø>2É:,¼4(À;2ÏNHßb^÷yzÿˆŠÿ„†ùzú}ƒü}„ÿx„ÿn~ÿdwù^pò[léN`öHaÿ8Wÿ7YøH]²JGcS1Al6ZtDf~NuˆZŽc…f‡’jˆ—n‰žs‡¤t‚§t§r}¨p}©n©mƒ©l…©k†§n‡ªp†¬o…¯o°l³k‚¶n…·p‡´s‡­rŒ¨wœ¬…²¹šÈƱ×οÞÐÅ·¿Ò¤¬¿’š­ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\M:\M:\M:`J<`J<^K<_L=^M=_N<_N<^O<`Q>aR=bQ=bQ=bR;bP:aO9`N8jNMgNRbQ[cWkjfuv’}}™y‘’{¯ŒËƒ‡ã{|ùqsÿgjÿTXÿAGÿ#Mÿ.Tÿ7Wù9Pé>NàEM×EHÑ?B×BDÚACÜ@AÛA?ØC?ÏB9Å?4¿=0·?1¯9+©8(«=,°A.·B1ÇC7×D=Ú64å57ã,0ç02è88Ó0+Ï5-éUKÿznæ^RÎD7É=0Ê<0É6,Í6+Ö90Ú70ß82ä71ç40é1/í10ò53ø87ÿ=ÿ>ÿ>ÿ>ÿ=ÿ=ÿ<ü=ò:ï@ð$Ið&Nï$Qó%Uÿ0eÿ=sÿgrþalôXeîR_ïQ`îM]â?RÖ1Bß:JÑ4?¿-0±-(¦5'ž>&–C%E"¯7&²9(ÒWHº<0ÁA8º7/º3/ÍC@ãXSÕHAÈ91Ä6*Å6&Ä5$Ä6"Ç9#¦B*¢<%£:%§<*¦7&©3'½A7ØSLØIEáGEÞ:8ß2.ê41î1-ï.)ù4.ÿ'-ÿ',ÿ)+ö*)í-(ä1*Ü5,Õ9-Ð>1½3(¼7.ÉHBÙ\Xôwuÿ‰‰ÿ‡‰ý~…ý€†þ†ÿx„ÿl|ý`sõZlïXiãHZóE^û4Sÿ3RóCX«E@\L*?j4Uo?d|LwŠ\†“h‹–l˜pŽtŽ£xŽ«{†«x©t|¨mz¦i}¥g¥h‚¦h…¤k…¦m„ªm‚¬l®j}±i€´lƒ·oˆ·sˆ°tެxœ®„²¹šÄ«ÐǶÖÈ»²½Óž©¿‹–¬]K7]K7]K7]K7]K7]K7]K7]K7^L8^L8^L8^L8^L8^L8^L8^L8\J>]K?]M@\L=ZM=ZO=\Q?^SA_T@_R?^Q@aQAcRBdQCdNAcM@pKEjKIfOUgZknl„v|ž}†¯ƒŠ´Š…®Ÿ‰­¸Š¦Ìƒ”Þ{~îumøl]ûfRðN[æDQä>LéANïCQí>Ké:Gê4Á;/¼8+ :$¬C0¬=,®6(Â?5ÑD=Ð;5Ó61Û83Ü71Ý6-Ý7)Ü9(Ý='Ù;"Õ7à74õPLõXOÛD9Ç8(Ì?.ÒC3Ñ;-Ò4+ðGDâ.1ï4;ö4?ï+9ÿ@Qí(9þ&+ÿ*-ÿ*-÷"û#$ÿ()þ((òð"ú+1ì )î&1ò.<ç$5ÿYnë+@ÿ`jÿ^iÿYcûT[öPTìHIÛ@;Ê:1ÅA2½F2®D.Ÿ;$”5–7#˜;)œ=+§81«83ÁEC¿;9¾23Æ45È44×CAÜKFÚKEÑD;È:0Ä4+È4*Ì3+Ì2*·?1³9,®.#­'¶,"Æ7/ÓC:ÚG=äPFßE;Ù80Ü1*ç/-ô01ý/3ÿ.4ò14ó12ô01ó/0ó0.î1+é4+à8-Ö=/¾2#¾?0·>3Õ`Wçtqÿù…†ôŠŒþ…Œÿwˆÿe}ÿ[wÿXuÿSoûJgûDcö7Y÷9]ç>[Ú]k„C=PI/F`;Xw^N?^N?[N>ZO=\Q?^SA_TB]QA]P@_OB`NBbPFcOFcOFkLGjMOgS\h_rnoŽw~ª~ˆ»…ŠÁ›–Ì¢Œ»«£»wŽÕx‚í|x÷uhöjYüZgóN\ìFRòHUöJVõERï?Jë;Eä9Aà:>Ú::Õ=:Î?7Ç>4À+ª?-¨9(²:,ÁA6Å<4Ç7/Õ<7Ó40×4-Ø4*Ø4(Ú7&Û:&Û;%Ù;"Þ52æA;ëMDàI>Ð>/Ç8(Ê8)Ó;.Ý<2öJFæ/1ò5<ø6Aò.<ÿ?Pì'8ö$'÷%(û),ý+,ü*+ù'(ø((ø*,ð$'í%(ê%,þ:DÚ'ð4CüATÞ#6ÿluÿblþZcüW]õOSæBCÙ;8Ñ>6¾8,¾E4¹H6¨?,–1)Ž()ž-'°:6ÑTRÎHGÃ54Æ45Ò<=ëWUØGBÖGAÏB9Ç9/Ä4+Ê6,Ð7/Ò5.Â?5À:1À5.Â3+É4.Ð83Ø?9ÞE=ãJBÞA8Ù6/Ü1*æ0-ó11ü03ÿ.3ò14ó12ô01õ/0ó0.î1+é4+à8-×>0¿3$¼=.¶=2Ó^Uévsÿù…†õ‡Šþ‚Šÿu…ÿe|ÿ[vÿWtÿQoþIhúAaö8Zö=_æF`ÅQ\{?7NH.Ga>Yx=e‡Ks•Yx›awbz¢f|¥i}¦j|¥i|¥i|¤h{£e{¡d}¡c}¡c¡d{¤l}¦n}©l}ªi}ªe}­c¯c‚±cƒ±f‡²k‡¯pˆ«u‹«|¬„©‰‹¤†z…‡doqR]_]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8^K<_N>aP@`P@]P?[O?[O?[RC[QE[QE\OF\OG_PKcQOfTRhTUiTQiVXi]kmi„sv¡zƒ¼ŠÍ‰Ö—‘ÙŸ‹Êª‚¶º}ŸÒ‘烅ð~tïveÿ`k÷S\íGQðFQöHR÷EQô@Kî=Gå6=à7:Ù99Ô<7Í@7ÅA4½?0¸=-©@-¨=+ª;*¸B4ÅI?À;2»0)Ì92Í6/Ò5.Õ7,Ù7*Ù7(Ú7$Ü:%Þ<'ß3/Û4.âA9éOCÜH:Ç6%Æ3#Ù@2á>5õHDé13ó4;ú6@ø4@ÿES÷3Añ),í"&î#&û03÷--ï''í%%÷12ì(*ø7:è+1â)1ë3?ÿR^ï=KÿYiúafñV\îOTðMRêEIÞ:;Õ74Ô?9À6,¿?2»C5²>1ª8-¥3)Ÿ,%œ' ˜% §0*ÆFCÂ::¼,,È44×ABô^]Ò>:ÒC;ÐA9Ë=3Ì9/Ô=4Ú@8Ý@9ÙA>×=;Ü>=ãA?ã?>à;9ã?=ëIDàA;Û=4Ø5,Û2+å2-ð31÷12ú/2ó04ô02ö01õ/0õ/.ð0+é4+à8-Ø?1À4%¸9*´;0Ð[Rízwÿ’’û‡ˆøƒ‹ü~‰ÿr‚ÿcyÿZtÿTqÿMmÿFgü=_ø:^ôBbåQg§?Fn<1OK2KcA[z?h‡Lr“Zu˜^tš_wŸc{£gz£gy¢fy¢fy¡cx byŸb{Ÿa| b}Ÿby¢j{¤j{§h{¨e{©azª^|­^®`…³hеnвs‰¬t†¦w‚žvy“pn‡gVb`COM4@>^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^L6`N:aP<`Q>]P?ZN>YPAXPEXOH[RM_UTcWYeX_iYcl\fm]hlbclemolrtšx¶~†Ï„ŒßŠŽç‹‡ÞŠÙ¬‰É³­½y’Í{ßyê†vÿnrÿbgùU\öLUöFPöBMó>Gð;Dæ5;á7:Û97Ò=7ËA6ÄB4»B1·?.©;,­=/¯>0»G:ËRGÇH?¹6.º1)È91Í81Ó;0Ú<0Û;-Ù6%Ü6&à9'á40Û2-à=4ëOCãK=Ñ;,Ð8*àB6Þ7.ð>:é/0ò16÷4<ü8BÿNZÿKWý>Cò38â$&í/1ê,,ð22ç+*é0.ò::Ñæ37Ü-2ç9BïENÿYcôLYÔ?AÚADßCFá>CÞ9=Ü89Ø88Ó:5É83Â91½:2ÀA:ÍNHÖVSÐNNÆAB¯82µ:5ÏKGØNLãQRïYZêRQñYXÉ51Î>6ÑC9Ð@7Ó?5ÚA9àC<àA;íCñ:?é58í=?øLJà93Ú70Ø4+Ü3,ã5.ì30ò21ô01ô04ô02ö01ö.0õ/.ñ0+ê3+à8-Ù@2Â6'µ6'²9.ÉWMî}yÿ“’û‰‰þ€‹ý{‡üoücwÿXqÿNmÿFhÿ?cþ8\ù=`íIdÙYhˆ25d<0SQ8TgG`}Ej‰Ps’Yt•\u˜^wby¡ey¢fw dv awŸavž`xŸ`zž`{Ÿa| by¢hz£g|¦fz§bz¨_z¨]|«]~­_†²eеmŒ³rŠ­s†¦u€œstŽii_RaZDSL8G@^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;_K2_M5aO9_P;\O>ZN@XPEXQKYQO^X\g`hnfsshysg{sg}tfnnzor…rw•v|¬y‚Ã~†×ƒŠåˆ‹ì’뛌ߞƒÆžt¢¡kƒ®mq¾vjÈ{iþllÿklÿfiÿ]`üQWöEMð;Bí5=è59ã68Ý98Õ>7ÎA7ÅC5¼C0¶A-¬8+´@3¯;.°;1ÇRHÓ]SÈNCº;2¾90Á7,Ì9/Ö>1Ý=1Ú6*Ü4'á7(á2-ã60ä=5åE9âF9ÜC3ÝA2á?2Û0&ì62ì0/ð-1ò-4ú7?ÿOYÿZdÿ[_ÿOSá.1ã03ß--÷EEè66Ü,,Û-.ë>@Û25Ù37ÿchÞ=CÊ*2Ê-4¾()Ô;=àAEÚ7:Ù37á8;Ü89Î..Ì43Í<9ÓHEÝSSì`c÷hnõdkî[e¿B<ÆE@å^[÷igÿopÿjjåKK×=;É4.Ñ>7ÕE<ÖC;Ó?5Ö<4Ø93Ø7/ö0=ò,9ó+6õ-8ò*5î+3õ8<þJKà3/Û4.Ø4+Ü4+â5.ê40ï4/ð3/ö/4ö/2÷/1ø-0ö..ñ0+ê3+â7-Û?2Å9*²3$±8-ÃNEî}yÿ’‘üŠŠÿ}‹ÿw…ùl|öatùUmÿHgÿ>bÿ8_þ4\õ@aâMcÂWap/+\A0XX>]lMbIl‰St’\u–_v™_xžcy¡ex buŸ`uŸ`u_vž_wž_zž`{Ÿa| by£d{¥f|¦dz¨`y§^y¨Z{ªZ}¬\€¬_…¯g‡®m‡ªp…¥sƒ t{•nrŠffvi[k^RbU_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<`L1aM2`N6^O:[N>YOE[RMZTT_ZahbprmzuŒ{t“yr“zp“yo”ov’pyšt}¨w€·zƒÈ~…Õƒ‰á‹‹å”ã—ŠÒ™„¼¡ƒ§ª„“«~yŸl[ŽX>ÈH?ÕPIäVRìVUòRRôJMî=Cè38ì7<ç9;à;9Ø=8ÑA8ÈC4¿B0¹@-³9.ºA6«5+£.$¼J?Øh\×eZÊVI·=2¸6)¾4)Î:0Ù;0Ü5,ß3)ä6+á/+å61ã;2Ü:/Ü?0ãF7ãC3ß9+ß1&ê3-ð31ï-.î*.ô17ÿEJÿS[ÿ_dÿ\aâ9<â9<Õ+.ôJKâ89×//Û55Ì()Ë(+÷YZÛ?BÔ9=Ð7:· %Ã))Û=>åBEÝ49Ù,2Þ17Ú/5Í(,Ò37äKNöaeûhnùcl÷_kû_mý_nÒNIÔOJè]ZêVTçMMãGHÑ32Î31ÙA<àKDãPHßKAØA8×:3×50Õ2+ÿ,;þ+:ü(7ø%4÷'4û/:ÿ=CÿILà1.Ü3,Û4,Ü5,á4-ç4-ì5/ï4/ö/4÷/2ù.1ù-0ø..ò/+ë3+â7-Ù=0É;-³1#°7,¹D;ìyvÿþŠ‹ÿyŠþqõhxó`söTlüCcÿ7^ÿ3_ÿ3\óDcÒM^ JMb6+TE0W[@^kMc~Kk‡Tt‘[w•_x™`{ždz cvž`s›]s›\s›\tœ]v^wž_{Ÿa| by¡bz¤b|§b{¦_x¦[x§Yz©Y{ªZ~ª]ƒ­e…¬i†ªm‰§s‰¥u„s|•mv‡unmfwe_P=_P=_P=_P=_P=_P=_P=_P=^O<^O<^O<^O<^O<^O<^O<^OÏcWÔh[ÔfYÁPB¹?2¹5)Ç7,Ô:0Ù5,ß2+ç6.ã0,ã4/â7/Ü8.à>1åC4â?0Þ4'æ4*é1)ò2/ð..ï-.ò14ô68ü?CðOTúY^éFKõRW×47ëFJÝ8<åBEÚ7:Î.0Ð15ãIKÑ8;Î8:¸#%Ñ<>Ü89ä;>ê=Aç6<â-4Þ)2â19çÿ/>ý)7ÿ-:ÿ9CÿAHûABã1/ß4-Ü5,Ý5,á4-æ3,ì5/ð50÷.4ù.2ú.1ù-0ø..ò/+ë3+ã7-Ø:.Ì>0´2$±7,±<3çtqþŠŠþŠ‹ÿr†ýj}ñbtð]pôRjûBbÿ6`ÿ5aÿ8_ïKfÁN[z;6Y?.LH/TZ@]cIbzJj„TrŽ[v”^yšc{ždxžas›\p˜Yp˜Yq™Zq™Zt›\uœ]y_zž`x¡_y¢^z¥^y¤\x¤Wv¥Uw¦V{§X~ª]‚¬d„«h†¨l‡¥o†¢r€šmx‘gr„lk}ecu]_O?_O?_O?_O?_O?_O?_O?_O?^N>^N>^N>^N>^N>^N>^N>^N>eQ6cR8aP<]P@ZPG\TR_Zab^otrŠyx˜€¨ƒ°~~²yx±wv°xw³t}Âw€Ã}…Æ‚ˆÆ…ŠÂÀ—–¾ ¼¬§»¶¬´¾³¯È¸©Ð¿¥Õ¡ϼ”Dz‡·kS®\F¤G5©=0ÂH=áVQðVTòNOì?Aë=?è<<ä<;ß=:×=5Ï;1Ë8.¿82Á<5¹:3·>5ÀPDÅYMÅ]PÎgXÐdWÁM@º:-Å8.Ò91Ø3-ß2,è50æ40á2-à5-ã<3çC7æC4â:-à3%ê5*è-&ð0+ð.,ò21ò44ç.,è00áEIõY]öW\ÿpuåDJéHNÞ=Cü[aÿouÝ>Cÿ~‚ÿmqêQTÔ>@Å02Ñ<>øEIî9>ð7=ø=Fô6@è-8ö>Jÿ\hÿmwÿitÿdl÷]gú^kÿapÿ]nüWhî_YãOKâJGÕ74Ò0.Ù54Ó/.Ø95ßD?ãJDáJAÙ@8Ó6/Ö5-Ü71â94ð$0ý/<ÿ1=ø*6û/:ÿ>Eÿ>Cì44â3.Þ5.Ý6-Ý5,á3*è3,ï4/ò5/÷.4ù.2ú.1ù-0ø..ô.+í2+ä6-×9-Ï@2µ1$²6,°7/èpoþˆˆÿŠŒÿkƒücxð]pïZnôPiýAdÿ7aÿ8dý=bæPi°QW^2'RG3DH/PV`P@`P@_O?_O?_O?aQAbRB_O?]M=]M=aQAcSCbRB`P@eS;aP<_O?^QH[QOZSZeapsq‰xxšz|¥~€±€¹}¼xy¹rs¶no²qwÏv{̓̋Ȗ—䤾²±¹½¸²ÌŲÓÍ­ÙЩÛУÛÑ ÝÑ¡ØÌšÒÆ”Õ¦Š·gŸ_FËzgØte¾G?ØQMøbaìILç>Aä79æ9;ã99Ü75Ù61Û94È95À50ÇB;¹=5¾I?ÄXK·PAËeVÎdVÊYKÃG;Ä:/Í6-Ù6/â5/å3/á/-ß2,â70ä=4à<0Û8)Ý5(å8*å/$ê/(î.)ð0-ï20ë40è51æ40Ó8<åJNõY]ëOS×7?×6>ùX`ÿ~†ÿ~†ÿowÿgoÿipÿfjõ\_ïY[ô^`ÿRYÿCKü8Bü7A÷1>ï+9î/>ñ=IÿS_ÿ`kÿgpÿepþboÿbpÿ`oÿ[lìTOßFA×85×31Ù10×/.Ú21Ü86áD=ÜB:Ø?7Ö<4×90Û81á83ä84ô5=ó4;õ3;÷4<ø5;ó49ë33ã1/Þ3,Ý6-Þ7.à5+ä3+é2,ñ1,õ2.ø/5ø03ú/2ú.1ù//õ/,î3,å7.à@4Ë9,½7+®/&·<5ÒXWÿ˜šù~ÿhÿe|ö]rîRhòHeÿAeÿ9bÿ5`üJlÕRd‰==K. >>&?I.IO5]]EWlAcxMqˆZx’by–`t•\r–Xq˜Wl•Sm–Rn—So˜Vr™Xt›\uœ]uœ]tœVtWv Xw¡Wv¢Uv¢Uu¡Tt S{¥[{£\zŸ\u—Zn‹Uc}MXrCSj>AW1?U/`P@`P@`P@_O?`P@aQAbRB`P@_O?`P@bRBcSCbRB`P@fVF_QD\OF_TRcZ_f`nmkƒwv˜wy¢{}°}¸x|»qt·lo¶ln¸oq»suÙ|}Ù‰ˆÔ˜—Ш§Æ¹¶½ÉƵÓÏ©Ý×£âÜžçßžæÞäÜžâÙ ÙÒœÑʖѼ¸€¦~dÄ‹wÉ}m¶VJÓ`Y÷qnîZZêJLä>@é<>ì>@è:;ã56á34Õ=:Ë73Ê?8¹6.·>3¼L@³I;Å^OÛp`ÒaSÄH<½5)Ä0&Ö5-Ý4-Ü/)â43å95å<7à<3Ü8.Ù5)Ý5(ã5*í6.ï4-î1+ë0+ç0,ã2,á4.Þ5.Ò9;×>AäIMóW[ü\dü\dþ]eÿ`kôR]ïMXñQ[ÿ_gÿjqÿflô[`ëRU÷07ó+5ô+5ù-9ó&5è/ç'6í7DüP\ÿ[dÿclÿemÿepÿdoý[hõP^åFBÞ<9Û64ß63á53Þ20Û2/Û62à>9Û>7Ö<2×:1Ú91ß82å95è96é9;ê7:ë7:î79î79ì57å31Þ3,Û4,Û7-Þ7.á6,å2+ì1*ó0,ø1.÷05÷03ú/2ù.1ù//õ/,î3,ç6.ß=2Ò>2Â8-µ2*·82ØZ[ÿ“õw{ÿa{ÿ^v÷WqöOkøFfý=bÿ:cú=cëLhºJVw<8F5#7=#9C(DH/UP`rJnƒXw_v“]t“Zp”Vn•Tk’Ok”Pl•Qm–Ro˜Vr™Zsš[sš[tœVuWuŸWuŸUtžTržQqPq›Qn˜Pl”NhŒLbFXu?Nh8F]/@W+@W-@W-AX.YL<[N>^QA^QA^QA^QA_RB`SCaTD`SC_RB`SCaTDaTD`SC^QAbUM^QK[QPcYakesqm„vu•y{¤y{®y~¶w}»ns·ei°bf°jn¸rvÀ}zᇃᖔߩ§Ù¼¸ÏÍÊÃÝØ¸çá­êå¡ïéŸðêžíæžéá¢âÛ¤×Ï ËĘ´°“¦œ˜„k§„p¥p`œRG»]UÞmi÷usð^_çHLæ@Dí@Dí=@ë7:ç36Ü>;Ô;6ÔA:Â70·7.µ?3­=/µG8Új\Þj[×\MÊB6Å2(Ñ4+Ú6-Ú1*Þ44éA>ìGCà=6Õ2)Õ1'Ú2'Þ0%è3*é1)ç.)æ/)ã2,â7/á=4âA7Ã-,Ê43ÜCEðVXú^bùYaóS]òP[èFQêHSðNYü\fÿmvÿmtôY_ÜAGó*2õ,4ý1<ÿ1>÷*9ï&6ö6EÿJX÷ISõOY÷W_ü_fÿdkÿai÷Q[éBJÞ95Þ63ã75é<8ë<9ç85â51Ý60Ý:3Ù;2Ö90×90Û81á83ç:6ì:8à;9â:9ã99ç98è88å84à40Ú3+Ú6,Ú8-Ü8,á6,å3)ì/)õ/,ú0.ô15õ13ø02ù.1÷//ó0,î3,ç6.Ý9/ÛD9Æ9/»4.´0,â`bÿƒˆônuÿ_zþWsúPmþLlýDfø8_ö9_ðGf×ReDJi=4K@,7@%8@(ED/LE2N^9YkEg|Qr‰[tZqUmRkMi‘Kh‘Ki’Lk”Pm–To–Up—Xq—ZuWuWtœUrœTpšRm—Mk•Kj”LdGaˆE\~AUt;Li3E_/AX*>U'B\/E_2Ic6WJ:ZM=\O?^QA]P@^QA_RBaTD`SC`SC`SCaTDaTD`SC_RB]P@YNR[PVbXcjcsqm†vu•xz£z|­w|´sy·mr¶bi±]c­ag±lr¾v|È‹‡æ”‘褡淴áÇÄ×ÕÒËáÞ¿èå²ëç¨ïê¦îé¥éã¥ãܨÛÒ§Ëß¾µ–Ÿ§˜š…‰v—‚q—se™cW³i`Ïrmû‹‰õutë[[çKNéCGî?Dî;?í8=ß:8Ý;8ßD?ÓC;Ã:0¹;/¯7)¦2#¾J;ÚbRék]ÛSGÉ9.Í3)Ö5+Ø4+Ù33ñMLý[XíKFÙ80Ö3*Û4+Þ2(à-&á,%á,%ß,'Ý0)Ú6-Ø<0×?2À0(Ä4,Î:6ÙCBßFHàEKäGPìLVñQ]öVbøXdû[gÿgpÿmuôY_Ø=Cñ.2ò-4ô-4ò*4í%2ì(6ûô@?ð<;ç85à72Ü92Ø:1×90Ù80Ü71ã73ê86ì87Þ<9ß;9â:7ä;8æ:8ä84Þ5.Ø4+Ù7,Ú8-Ü8,á7*å3)ì/)ô/)ù/+ó25ô23õ12÷/1÷//ó0,î3,ç6.Ü8.ßG<É90¾3.´-*îfjÿy€ójrÿ`{ýTqþKkÿFjÿ=cö3[î<^äPhÄXe…DBbE7WP=DH1@D-JH3JB/IW4Sc?btLmƒUp‹XoŒRkŽNiŽKgIg‘Ih‘Kj“Mk”Pm–To–Wp–YtœVs›Uq™Sn—Qj”Lg‘IeŽHdG`‡D]AWy=Rq8Mi6Lf6Ne7Pe:Lf6Oi9Sm=UH8WJ:[N>\O?]P@]P@_RBaTD_RB`SCaTDaTD`SC_RB_RB_RBTLY`Xgnf{tp‰xt•xw¡xz«y{´sy·jqµ`g¯\b¬`f°kq»v|Æ~„Ε”äžžè­­é½¼æËÉßÕÓÔÝÜÊãàÁåâ¹çã¶æß³àØ³ÚÑ´ÐůÀ´¤¯¥™”œ‰ˆ†y‰}qwk›sk§ngºoi扄î~ósróedòVYòLNðCEî>Aå95â:7äB=ÞE?Ì<3Æ=3ÂB5­1%¬1"ÇI;ÛYKÖN@Ì=/Î8*Ò6*Ñ3'Ö34õUUÿkhú]XâE>Ü;3ß;2ã80â4-ä1,â1+Ý0)Ö/'Ì0$Æ/$Â0#Ã9,À4'Á3)Ë:5×CAÛEGÛBGÛ@HàDOìOZóVaòVaú^iÿgoóYaÝDIð88í55ï26ð18ò3;÷9CÿHSÿVaä6?Ý4;Ý7;êAFøKOüIMô;@ê05å61ë95ñ;8ó;9ó;9ð:7é73â70ß;2Ü;1Ù;2Û:2ß82ä73è64ì65á<8ã;8ä;8è:9è;7æ95á6/Û4,Ú8-Û9,Ý9-á7*å3)ë0'ò/)÷0+ð45ñ33ô22ô01ö0/ò1,î3,ç6.Þ7.ÞD:Ê7/¿1-¾21÷jpÿrzøhrû]vúPmÿCfÿ_L;_ZFQP;KI4PI6MB0DR1M[8[kFf|Nm…SmŠPlŒMhHfŽGgHg‘Ii’Lj“Ol•Sn•Vo•Xt™Vq˜Un–Pj’LfIcŒFaŠF_ˆDZ@X|?St;Pn8Pj:Tk=XmB[pEUp=Vq>Wr?RE5UH8XK;ZM=[N>\O?^QA`SC`SCaTDaTDaTD`SC`SCbUEdWG]Ulje|yu}yœzy£wyªvx±sw¶lqµcj²[c¬]e®hp¹w}LjІՙܡ¦à¯²å»¿åÆÇãÍÏÞÔÓØ×ÖÑÙ×ËÙÕÉ×ÑÅÒÉÂÌÂÀŹ»´§®¥˜¡‡Œ†xzuwvqulg~mfŒoib[œa[¾sm×zuï{ü|yÿrpýccöSTîHHñB=ê>:ã<6àA;Ñ:1ÒD:ÝTJÂ>2¸6)¼:,Â=.È?/ÏA3×C5×?1Ñ8*Ð23èLMú_]ñXSßD?Ø;4Û81à70æ92ç92ç92â92Ú9/Ñ9.È9+Ä8)®)¸3"È@2ÓI>ÒE>Ë;:Ì7;Ð9@Ï8AâHTïUaðYbõ^g÷`iêU[ØCIè?:ë?;ñAAúGJÿMRÿQYÿT]ÿV^á4:Ú/5Ú03ç7:ô=Aù:?ø48÷/2é61ï95ð95í41í1/ê20ç40á4.ã<4à=4Þ=3Þ;2à93ä73è43ë33æ:8ç98ê88ì89ì87é75ã4/Ü4+Û7-Û9,Ý9-ß7*ã2(è0&ï0(õ0*î45ð43ó32ó11ô1/ò1,î3,è5.à90Ù<3Ì70Á0-ÑAAÿnuýku÷coïSkóIfÿ;cÿ1`ÿ3bÿRJ7QF4MB0AL.GU4Sc>`rHgMj‡MjŠKh‹GeFfŽGfHgJi’Nk”Rl”Um“Vq–So”Qj‘NgŽKcŒH`‰E_ˆF_†G\‚E[~DWxAVr?Uo?YpB]rG_tKYtAYtAXs@NB2QE5UI9WK;XL\P@^RBaUEbVFbVFaUE_SCaUEfZJj^Nkg‚up|x›{y¡wx¨vw­pt±jo±ah®^f¯_g°em¶pxÁ~…͉ؖܙ¡Ï ¨Öª±Û´¹ßº¿ß¾ÂßÂÄÝÅÆÛÆÃÖÅÁÒÁºÌ¼³Æ»¯Å´¨¾¦˜±—‰¢†‡‰qqstpqogevhe†nj`Y”e_š[T·g`×tnî{vÿ{wÿwsÿhfù[ZÿQKöGBè=6èC=Ø;4ÛG=ê\RÅ;0Ä<0½7+¾6(Ç>.ÑD3ÔC2ÔA1×A0Ò8:Ø>@ÜDCÛC@Ö=8Ó91Ø7/Þ7/å:3æ93å:3â;3Û>5ÕA5ÑE6ÌG8¬.¼;%ÌK8ÑL=Æ=3»0+¿10Ë8>ÕBJáKVëU`ðZeð]eìYaßLRÐ?DÑ4+Ö8/ß<7ê@@ñDFôEJñBIî?Fâ5;ß26ã36ï8<õ79ù14þ-2ÿ.4ë40ð95ò64ì0.è,*è/,è2.á2-ä=5à=4ß>4ß<3ã:5ç85ì65í55ì57ì57í57ï56ï56ì42å2.Þ1*Þ7.Ü:-Ý:+Þ8*á3(ç1&í1(ò1*í55î53ñ42ó11ó1/ò1,î3,è5.ã;2Ò4+Ò;4Æ20çUVÿpxùcnñ[gãKbóEfÿ7bÿ+]ÿ1bÿ@hÞKe­RYd8/ZI7SN:UN;[P>VI8M@0MA1=H*CN.K[6Xj@ayGf‚HhˆIgŠFeŠDc‹BcEeŽHgLh‘Oi‘Rj’Tn“Pl‘NhLd‹Jb‰H_ˆF_‡H`‡H_…H_‚H]~I]yH]wH`wKcxOdyP[vA[vAZu@MA1PD4SG7VJ:WK;YM=[O?]QAcWGdXHdXHbVFaUEcWGj^NpdTvq‘yu˜xvtsŸrr¤su®lp¯bg«Za©^f¯em¸lt½u}ƈДڕœâš¤ÈŸ©Í¦°Ô¬´Ù°µÛ±µÚ²´ÚµµÛ³±Ö²®Ñ®¦Ë«¡ÄªžÂ¦˜»™‹®‹{Ÿ|y€dbgidhbY\g[[xeauXRe]ˆOHŸVO»aY×jcóvpÿ}zÿwuÿljÿZUÿPJñD>ôMGàB9ßF>êWOº,"¼2'½5'Ç=0ÑE6Ë>-Á2!É8%ÙF4ÞDFÒ9;Ë32Ë62Ó;6×<7Û<6á<6æ;4å82à5.Ø4+Ï5+Ê8+Ä<.Â>/ÑU;ÅI/»='½;+Ã=2Ä;5Â65Â37ÜKRÞLVâOYåS]éWaæU\ÝLSÒCGÉ5)Ð8-Õ81Ú64Ý55ß58á4:ß28å8<å6;ì9=ö8É53øceÿpyô\hêR_ÞHaõGhÿ:eÿ*]ÿ/aÿ@hÓE]–AFQ-!UJ8PN9OH5\O>YH8L<-NB2:D)?J*GU2Rd:]sBcEf†GeˆDcˆBa‰@a‹CcŒFeŽJfMgPhRlPkOfLcŠIaˆG_‡H_‡H`†I\‚G]€H]~I`|Ka{Ld{Of{Rg|S]xC^yD_zEAC8CE:IF=OH@RGAWI@]M>`O=aQ:aS9`T>_VGaZTfaeljwro€wožzt¢~wªzu«ro¨hf¥a`¢^^¦ba­hg·qoÃ|xÏ…€Ú‰ã—í–ó¢žÙ£ŸÚ¥¡Ü¦¢Ý§¡Ý¦¡Û¥ Ú¦žÙ¥Ö£œÒ¢™Ð¡˜Íž–É—ÁŒ‚´ƒy«mrvghlc_`e[ZlYUtUP€ULVK–RG¨ZN²ZP½\SÔmdç|tò…~üˆðxyõyyæabÜPQ×EEñYVÎ61È1(Ç5(Ä7&Â6%Ã8%Æ9'Ì:+Ð<.Õ?1Ô8+Ö=/Ø?1Ó;-Í5'Í4&Ø:.ã?5à90á90Þ7.×7+Ï7)È;)Ä@+ÁC,Ä;3È?7ÍD<ÏF>ÌC;Å<4»2*µ,$Ä>5ÍG>×QHÞXOá[RßYPÖPGËE<Ìÿ)<ö*6í.6ç48å;;Ü94Ü:5Ý<4à;5ã:5æ93é73é62ì25ì44ë54è64ä71ß7.Ú6,Ø6)Û9*Û:(Û:&Ü9&ß8%á8%â7#â7#í41ï4/ñ4.ó3.ó4,ï5)ê6(å8*à:.Ø7/×96Ý>BÿlyÿasþRlöGdÿIjû5Yÿ5]ÿ;eú=cãPj©LVT)":1 9<)EF4RL>PH;BC39E15K4FGHJ#MQ,U\:\jGcuOf}QeNc…Hb‡BaŠ>cŒ@eDjIl‘Nm‘Qj’IiFgŒFf‹Ff‹Hf‰Ic…Ic‚GdƒJdIc~Gc~Gd€FfFe~Dc|BX}8[€;^ƒ>[K>^M;`O;`Q:^S?^WGa\Vhcinlyrqƒtnšvpžtp¢pm¢gfŸaaŸ]^Ÿ\\¤ed°kjºtrÅ}{φ‚ÙŽˆà”Žè˜’ì›—Òœ˜Ó™Öžš×™Ö—Õœ–Ò•Ñž–Ñœ”Íœ“Ê›’Ç™‘Ä“‰»ˆ®€w¦tmtkdkf]`e[YiZSoWMzVJŠVI›UK°\RºYRÁXRÓf_Þqjãvoêwý‡…ÿˆ‡÷uuðfdäTSíYUÇ2+Â/%Æ7)Ã7&À7%Á8%Ä9&É:*Ï;-Ó=/Ö8,Õ9,Ó:,Ò:,Ñ9+Ñ9+Ô8+Ø8,ß;1à90Ü8.Ø8,Ð8*Ç:(¿;&¼;%¿4-Á80Æ=5É@8ÊA9È?7Å<4Â91¾5-Ç>6ÑH@ØOGÚQI×NFÌC;À7/Ê8Ñ9"Û8)å4,ï./ö*3û(7ÿ(:ÿ+Bÿ*Bÿ)Aÿ&Aÿ$@ÿ >ÿ=ÿ<ÿ8ÿ9ÿ$;ÿ);÷-9ï29ê7;å;;Ü94Ü:5Ý;6à;5ã:5æ93é73é62ì25í36ë54è64ä71ß7.Ü5,Ø6)Û9*Û:(Û:&Ü9&Þ9%á8%â7#â7#é4-ê3-ì4,ì4*ì4*ë5(æ6)á7*ÞcŒ@eDiŽHkMlPl’IjGhGf‹Ff‹Hf‰Id†JdƒHe„KdIc€HdHeGeGfEd}C\<_„?b‡B69.:<1??7E@:KB=OE/Ô>/Î6(Ë/"Ú:.Û7-Ù7,Ö8,Ñ9+É:)Â9&¼8#¾4*À6,Â8.Ä:0Ç=3Ê@6ËA7ÌB8Å;1Ê@6ÏE;ÐF<ÒH>ÑG=Ê@6Â8.Í6!Ô7&ß7,é3/ñ03ø,5ý*9ÿ*<ü'=ü'=û%=ù#;û!:ü8ü7þ7ÿ6ÿ6ÿ#8ý*;ù1<ñ6=é9;ã;:Ü86Ü:5Þ;6à;5ã:5ç85é73é62ï26î47í55ê65å61ß6/Ü5,×5(Ù9)Ù9)Ú9'Û8%Ý8%Þ7$à7$à7$â4+â4)å4*å5(ã6(â7&Þ7'Û8)Ý=1Ï2+×98ÿltÿ]nþPið=[ÿJlÿ5\ÿ=eü4[ô<`êTq«?Oa#(H1+79+-8'18&:;)B=*A<(@>)@B*?GY`4s~T€Œfw‡bi~Ub|MaI`ƒC`…?aŠ>cŒ@hŽEjJkMlPn”Kk‘HhGgŒGgŒIh‹KfˆKf…Je„Ke‚Jc€HeGf‚Hf‚GeFcDb‡BeŠEhH06*58-;<4A>9G@:KB;RE.Ð?.Ë8(Ç/!Ò6)Ó5)Ô4(Ò6)Ñ9+Í<+È=*Ä;(Æ9/Æ9/Æ9/Æ9/Ç:0È;1É<2Ê=3ÒE;ÒE;ÐB8Ë=3Ë=3ÏA7ÏA7Ë=3Ñ4#Ø6)â5.ë31ò/5÷+6û(7ü)<ù&9÷&;÷&;ø'<û&<ý%<ÿ$:ÿ#:ÿ!7ÿ"7ü%7ù-9÷5>ñ:?ç9:à87Ü86Ü:5Þ;6à;5å95ç85ê65ë54ñ27ð37î66ê65æ72á6/Ü5,×5(Ø8*Ø8(Ø9&Ù8&Ú7$Ü7$Ý6#Ý6#Ù6'Ú7(Û8'Ü9(Ü9(Û:(×:'Ö:+Õ;/Î3.éIKÿo{ÿVjøDaö=_ÿCiÿ/[ÿ7`û=cëLlÆOe€0=G >3--3'+8'2=,=B.B@+C;$G="MA'R_*q}MŸp—¨|ƒ˜mj„W_{J]~E_ƒCa†@b‹?fCk‘Hl‘Lm‘Qm‘So•Ll’IiŽHhHhJiŒLhŠMiˆMf…LdƒJdGe‚Hf„Hh„If‚EeDf‹FiŽIl‘L-3'17-7:3<;6B=9G?UOCZUQa_dhgukkƒllˆjg’baXV‡PP†QQXYš`cªfj´orÁuxÉ|Ѓ„Ö†‡×‰ˆØŠ‰×Œ‰ØŒŒÌ‹‹ËŠ‰Í‰‡Ð‰…ш„ÑŠƒÓ‰‚ÐŒ„Ï‹„È…Á†º†²‡¥}x–vpŠ“ScƒQ\qUT`^RVcOTbH_]DvUB’LB¼RRÖPWàPYé\dèejâljâwqâvláphõ~vÿ‚{ÿ‡~ôkaÉ?2À8(À;(¿='¾='¿='Â;'Å:'Ç8(Ê8)Ü8/Ú7.Ô8,Ï9+Ê;+È;*Ç:)É7(Ï9+Ñ7+Ô8,Ó7+Ï7*Ì8*Ë<,Ë>-É=0Ê<0Ê<0É;/È:.Æ8,Å7+Å5*Ð@5Ð@5Í=2Ë8.Ë8.Î;1Í:0É6,Ò.$Ù0)ä2.î23ô/8ù-9û+;ü+>ü-?û.?ú0@ü/@þ/Aÿ.?ÿ-?ÿ->ÿ)9ý)8ø*7õ0:ó6=ì9=ã77Ú53Ü86Ü:5Þ;6â:7å95ç85ê65ë54ò38ñ48ï56í76æ74á6/Ú6,×5*Ö9*Ö9*Ö9(Ø9&Ø9&Ù8&Ú7$Ú7$Ô9%Õ:&Ô<'Õ=(Ô=(Ô=(Ó>*Ó=.Ð8-Ù;8ÿ^eÿaqÿPi÷;\ÿAiû6aÿ/]ÿ.WøIjÛYq•>NX'-?+,730*1)-9-5@/:B+<<"B;VG(iV6v‡P£lª¾‹¨¾Ž¥wo‹[aK^F`…BcˆBeŽBj“Go•Lp•Po“So“Uo•Ll‘KiŽHgŒGiŒJiŒLi‹NhŠNf…Je„IdƒHfƒIg…Ih†Hg…Gf„FgIi‘Kl”N*2%.4*470894<;7B=:HA;KD(À>(Á=(Ä;(È;)Ì9)Î8*Ú3+Ù6-Ö:.Î:,Ç:)Â9'Ä;)É=,Í>.Ö@2ÙA4×=1Ï7*Ê4&Ê8)Ë<,È:,È:,É;-Ê;-Ê;-È9+È6)Ç5(Ê6*Ï;/Ò>2Õ>3Ö?4Õ>3Î7,Å.#Õ)%Ü-*ç02ñ29ø0;ü/>þ/?ý0Aú0@÷1@ö2@ö0=÷/:ù-9ú,8ü*7ý/<ù/;õ0:ñ2:í6;æ68ß55Ù42Ü86Ý:5ß:6â:7æ87é77ê67ë54õ49ó49ð69í76æ74ß6/Ú6-Ö6*Õ7+Ô8)Ô8)Ô9'Õ8'Õ8%×8%×8%Ï:$Î<%Î>&Í?'ÍA(ÍA*Î@,Ï=.Ð71éIKÿgrÿOdÿHfû7]ÿAmý/_ÿ1^ø1XåOj¹Wfh39@*,?994443524925>-2<#29ECl`8Ž}R™±u©Á‡µÎ—­È•’®}v”be†Q_ƒF`…Bc‰@gDo•Jr˜Or—Rq•Up”Vo•Ll‘KhGf‹Fh‹IiŒLi‹Ni‹Og†Kf…Je„If…IhˆIjˆJi‡Gg…EhJk“Mn–P(0#*2'/4-350664<87@<9C>8IEû3>ú0>ú0@ø/?ò.<ï/<í/9í07í.5ï,2ò+2ò)/õ1;õ3<ò5;ì59ç47á55Þ65Û75Ü86Ý97ß:6ã:7æ87é77ê67ë46ö5:ô5:ñ7:î87æ74à72Ù6-Ô6+Ñ8*Ð8*Ð9(Ð9(Ð9(Ñ8&Ñ8&Ó8&È:"Ç;"È>$Ç?%ÇA(Ç@*Ê>-Î;1Õ:6üU\ÿ_oÿGcÿ>bÿ8cÿ6gÿ0cÿ4\òCbÈMa…BIL44:97<<>948>58<7379+3="8DS[,ƒPª£o«Èˆ¯ËŽ¯Ì’¦Ã‘¯}{™ggˆQ^‚E^ƒ@c‰@iDo•Js™Ps˜Sq•Uo“Un“MkJgŒGeŠEgŠHh‹Ki‹Ni‹NfˆLd†Id†Ig‡Hi‰JjŠIi‰FhˆEi“Kl–No™Q&.!(0%-2+130333756:97>;6GD=DD*½<'»8$¾5#ÑB2ãOAäN@ØB4Í7)Ë7)Ð>/Ê;+É:*Ç8(È6'È6'Ê6(Î8*Ð8+Ó;.Õ;/Õ9-Ó5*Õ7,Ü;1Ý<2Ú9/ë7:ñ8=÷:Aü8Bü4A÷.>ò,;ï,:í/;é19è38é58í57ñ48ô36ö45î49ï6;í9<é69â45Ý33Ý86ß;9Ü86Þ97á98å99æ89é69ê67ë46ö5:ô5:ñ7:î79ç85ß82Ø7/Ó7+Ð8+Í9+Í:*Ì;*Í:*Í:*Í:(Ï9(Ä: Â: Ã=$Á?%Â@(Ä@+É=.Í81ßhŽCo•Jr˜Or—Rp”Tn’To“MkIgŠFeˆFf‰Gh‹Ki‹Ni‹NfˆKe‡Jd‡GeˆHgŠHh‹Gh‹GfŠDj”Lm—OpšR(0!'/"(-&+-*.0/333775:94==5?@8DE?JLKQQYVWiZ\s]^|YW†[Y‹^]–ee¥nn¸wxÊ€Ú„„䊌ðŠŒðŠŠì†‡ä‚‚Ü€Ô‚€Óƒ‚Ò€„ĄǃƒÉ„„ΆƒÒˆƒÕ‹ƒÖŒƒÒŠ€ÇŠ€½‰±…~ €xwpxkeec^XpZMm[Mi\Kf^Kd_IcaHfbGl`FlR;„UA£^O¿aYÑYXßPTñQ[ÿXbôkcæYRÔD<Î70Ñ7/×;/Ø/Å@/Á@-¾=*¼9'Â9)¾0"êVJáJ?Å.#Ñ=1Î2Ü<0Ù7,Û7-â>4éE;øAFó8?ð3:ö4?ö2>ñ-;ï,:í2=ì7@æ5;ã68å78é99ð:9ñ86ò65ï==î<<ê:<æ89á77ß76Ü75Ü75Þ97á98ã99æ::é9;ì9<í9<ï8<÷6;ô5:ñ7:í9:è:9à;5×90Ï7,Ë7+È9)Ç:)Ç:)Ç:)Ç:)È;*È;)Á9!Ä>%½;#µ5»:$ÈE3Í@6Ê0.ÿ^eÿVgÿHcÿ;\ú0Xø/[ý5cÿc‡?iDn”Im•Ll”Nk’Qj‘RjŽHfŠDc†Bc†Df‰Gh‹Kg‰LdˆJg‹MhŒNg‹Kf‹HeŠEf‹EjIm“Jp›SrUtŸW*0")/#).'+-(-/.222553782;<4>@5BC;HJGOPTSUaXYm[[s\Z‚^]‰da–kj¦us¼}Ї‡á‹‹íŒòŒ‹ñ‰‰í…„ ڀ~Ò€σ€Ï…†Æ†‡È‡ˆË‰ˆÎ‹‡ÑŒ†Ð…ÎŽ„ÉŠ€½‰³†{£‚x‘{s€tknkd^e\SbaLb`Ke^Kh]Ii\Ij^Hk_Gm_EraG{]CŽ[Fª[LÆWPàQS÷PXÿS`ìWQãKFÛ>9×50Ú5/Ý90Ü8,Ø8*Ó8&Ñ8&Ñ8&Ô8)×7)Ü5,à3,ã2,Ë1'Ë4)È9+Æ=-ÄA/Á@-¾=*¾9(Â9)Ë<.åQEÜH<È4(Ì:-È:,Á5&Ê=+Ê=+Ê;*Ì;*Ë:)Î8)Ï7)Ï6(Ó7*Ö8,Ù7,×3)Õ1'Ø1(ß7.å=4ûBHò7>í07ï/:ò0;î.;ì1<ê6?ã6<Ü36×32ß:8îEB÷JFøEAõ?<è:9æ:8å97â96á85à85á98á98à87â88å99ç9:é9;ì9<í8=ì7<ô5:ò59î68ê88æ:8Ý:5Ó91Ë7-Æ8*Ã:*Â:*À;*À;*Á<+Á<+Á<+½9"Á?)¹;$²5¸;'À>];2@>/3A05?4E=:X;?T-0X51ZI7bjEu[бpšÄ|žÈ|š¹}š¹€™·ƒ©yr`YuESq?\{B_>b†>iCm“Fl”Kk“Mh‘MhQhŒFeˆDc†Bc†DgŠHiŒLhŒNg‹MiOiMiŽKgŒGgŒGfŽGj’Im•LnœQoRr U-1"-1#,/&,.).0-11/34/45-9;0<>1@B5EH?KMLQRWUTbXWi\Yx^]fcŽpm¢zx¹…‚ÏŠáíŽñŽŒïŠˆé‡ƒá~Õ|Í}È}Ç…‡ÄˆˆÆŠŠÊŒŠËŒŠËŒ‡ÇŒ„À‹‚¹‰€¯†|¡€v‘{p€ujpod`i_Ue\MXeK]bKa_Jh[HmZIp[Hq\Go]EtcItZ?‚V= WDÅYMäTSûNTÿIUß@<Þ<9Ý84ß61á6/á6.Þ6+Ú7(Ö6&Ó8&Ó8&Õ8'Ø6)Ý5,á3,ä1,Ç5(Å6(Â9)Á<+Á@-Á@-À=+À8(Ã5'ÜJ=ÜE:ÕA5Îë7@ê=CÜ7;áAAìNK÷ZUüZUùRLïB>è62à72à74à74ß74à85á96ã;8ä::á77ä88æ89è8;é9<ë8<ì7<ì7<ò38î47ì57ç77â:7Ù:4Ï8/Ç7,Â8+¿:+½;+»<+»<+»<+»<+»<+º9$¾@*³9$°7$¶;+´2%Ã40îOTÿZiÿH`ù8Uó6Vó>]ñFfçHfÞEat?9e?6QA2@C04?.29)>5,O61K*#W:,j\Bˆ_«t”½{“ÃyÃv•²|œ¸…™µ…€šm\uKHa7Nh9[xB_}?c„?hŒBl’Ej“Gh’JgLeMe‰Cd‡Cc†BeˆFh‹IjŽNkOjŽNkOkOiMhJgHi‘Hl•Ip™Ms¡Vt¢Wv¤Y25$13&02'01+12-23.34.46+9;-;>-?B1DF9IJBNNNRQWTR]XVd\Zoda~nl”zw®„‚ÄŒ‰Ø‘Žå”‘ì“펋扅ڂÎ{Å}¿‚}¿ƒƒ¿……Á‰ˆÂŠÃ‹ˆ¿‹„¸‡®…}¦…{€vŽzm~sfmoa`k^Vi[NgZJVdJZbJa_JjZJpYIsYJtZIs]FqY?tU9†T;§ZFÌ\PæRNóEGù:AØ3/Ü41á51ä50ã5.â4+à6)Û8)Ö7$Ó8$Ñ8&Ô9'Ø6)Ý5*à3,ã2,Â8+¿7)»7(¼:*¿=-Â>/Ã;-Ä8+Æ3)ëTKÔ;3Ì8.ÑA6¾4'À<-½>-Ã7&Ä8'Æ9(Ç:)Ê8)Ë7)Ì6(Í3'Ó5*Ô3)Ö2)Û4,ã:3é>7ì?9ë>8è47ì59ï6;î5;ê2:æ39ä7=á<@óUVûc`ÿnjÿidóVQäA<ß61à3/Þ71Þ71Þ71ß82á85â96å97æ::å78æ89è8;é9<ë8<ë8<ë8<ë8<ñ48î68ê67æ87à;7Ö<4Ì9/Å8.½9,º;,¶;+µ<+´<+´<+³;*³;*³:'·@,­8&¬9'±;-«+"Ã54ÿ_gÿSdýE]ó;Uí1B2SE*okHŠ“f•¬t´t‹¹q‹½t¡¹‰¡¸Š§}l‚\K_:BV1Lc7Yq?_{@dƒ@i‹Ak‘Di’Fg‘IdJbLc†Bc†Bd‡CgŠHjMkOm‘Qn’Rj‘Pj‘Nj’Li‘Jg‘Gi“Gm—KqœMu¥Yv¦Zx¨\78(78*66,56056156167/68+;>-=@+@C.DG4IK=NNFQPNSQTVUSYY[a_lkius›€}´ˆ†ÈŒ‰Ö•’ã”äÞ‹‡Ó„Æ}º|µ€{±~¸‚º‡„»‰…¸Š„²†¨z›€xs‡znzrfjm_\j[Tk[NjZKjYI^bK_aKe^Kk[KpZLtZKw\Kz[G{WAƒS=—U?³XFÍSFÝF?å76ê01Û2-ß3/â5/å4.ã2*à2'ß5(Ü9(Ô7$Ð9$Ï:$Ñ:'Ô8)Ù7*Ý5,à3,½>-¹:)µ6%·8'½;+Â=.Ç;.É6,Ñ80ö\T×=5Ë4+ÏA5¸3$·:(¹@-Â9)Ã:*Æ:+È:,Ê;-Ì:-Ï8-Ñ7-Ñ3*Ò1)Ö1+Þ71ç;7ë>:è;7æ74é77ï;<ðê7=ê7=ð69î79ê7:ä::ß=:Ö=7Ë;2Ã;/¸9*´;*±<*¯<)­=)¬<(¬<(¬<(«:(¬=*¤9'¥:*©9-«0)ËAAÿgr÷L^÷E[ðBYèF[ÛN^ÈT]´VW§SQSU@LN9JG4JE1FD-AA'>C#@G%MU.^g,?=.==1==5=<7;<6;=2;=/?B-@D+CG,GI1KM8NOASPITQLYXDZ[M_^Zgepqo‡{y¡ƒ€·‡…ƌӋՊъ…ǃ€¹~z­zw¤{u¡zw°|y°€|®~©‚~£y•|t‰zrvkqrffm`Zl[QlZNl[KmZKmZIg^Mi]Mi]Mj]Mn]Ms^My^M€[I“`OšWG§N@¹I=Æ@5Ð6.Ù0)á0*á51â5/ã4/â4-à2)ß3'Ü6&Ú;(Ð9$Í;$Ì<$Í<'Ñ:)Õ9*Ù7,Ü5,ºA.´;(¯6#°5#¹:)Â=.É;/Í6-Û>7ùZTåHAÐ90Ì@3¸6&«4 ±>)¿7'¿7'À7'Ã7(Å7)É7*Î7,Ð8-Ù<3Û:2Þ93å<7ê>:ê=9ç85ã41è96ë<9ê::è8:ì>@øORÿccÿqpùheàUPÈ=8¿2+È5.Ö;7à<:â:9à<3á:2á:4á83ã73ä65å55æ68é69é69ê7;ë8<ë8>è7=è7=ç6<ð8:ì8;è8:ã;:Ý>:Ó>7É<2À+>467>O#Jh4gTt•\„›c‹™dŽ›f‘¢l•¬t•²x„”pn}\Q`C=J09F,BO3O_;Xi=czDgBkŠDk‘Dh’Fe‘F`G`Gf†Ci‰FjKlMlOkOm‘Ql“Rm”Qm”Qm–Pl–Lk—Jm™JržOu¢Qy¬]y¬]x«\CB0DB3DB6EB9CC;CC;BB8AD3CG0EH-GJ-JM0OO7RQ?TREURI[\:\\@\]Kaa_ihvrq{z¦~µ†‚¿ˆƒÃˆ„Á„¸{­ysŸtp•qmŽol£rn¡tq wršwrtoƒskxrilmb^l_Vj\OlZLn[Lo\Kq\Kq\KrZNq[Nn\Nl_Ol`PqaQy_N†[KŸ_S¦OE°A8½:2È5-Ï1(Ø1(Ý5*â70á6/á4-á3*à4(ß5(Ù6%Ô9#Í;"Ê<$È>$Ê>'Í<'Ò;*Õ9,Ø8,·D/±<(¬5!­4!¸9(Ä<.Ì9/Ï5-Ú83ñNIòSMÙB9ÌB5½@.¥2¬?(À;,Á9+À8*À6)Å7+É9.Ï;1Ô;3áD=ãA<ä?;ç>;é=;é;:è88ç77æ93æ95å84é;:ôJJÿ\[ÿdc÷caË=9¿82»4.Ã81ÓB=ÞE@ß=;Ù42â;3â;3â92ä84å84æ66é77é77ê69ë6;ë6;ë8<ë8>è7=è7=ç6<í68ê69æ89à;9Û>9Ñ>6Æ<1¾<.²8)®;)ª;(¦;'¤;&¡;%¡:' 9&ž?-”7%š=,—:)˜3'ÂQKíkmï\fïN^ìI\àHWÎJU·SS¡]RŒfQ‚jP=Sg{Fh‚Cl‹Ek‘Di“Gc‘Fa‘G^Gi‰FlŒImNn‘OlOjŽNkOk’Qp—Tp™SpšRo›Po›NqNv£Rw¦Uz­^z­^y¬]GD3HE6HF9HE±61Á3/Î5/Ö5+Ù7*Û8)ß6/ß4-à3,à4*â6*Þ7'Ø7%Ï7 Ì<"È>"Æ>$Ç?'Ê>'Ï<*Ó:,Õ9,µE/­='¨3¬3 ·8'Å;.Ì9/Ò5.Ò/*ä?;ûYTàI@ÎD7ÆI7¥5®D,ËF7ÉD5ÉA3É?2Í?3ÒB7ÚF<àG?ßB;à>9à;7à74â64ä65ç77é99é>7ç:4ä73è<:ñIHñMLØ=;¹(%¸-(¼5/Å@9ÌC=ÐA;Ö=8Ý>;ã?>á:2á:2â92ä84æ95è96ë99í9:ë7:ë6;ì7<ë8<ë8>è7=ç6<æ7<ì59è58å78ß:8Ù<7Ï<4Ä<0º:-°8(«:(¨;'¤;&¡:'Ÿ:&Ÿ:&ž9%š?,4"—>,“:*“1&Ì\X÷y|æT_ðTbèI[ØDRÃGO®SPšbS†lS{rSC[C?H3B7%O6"_K0prJ€£iˆÇ€yÃt{¾qu¢]oƒHy}J‡†Xy|O\d5:D)3=$4>&WN?XO@YPAZQB\SD]TE]TEcZKbYJbXNcXRg\Zmacsfmwjs|n{~p}s€s€~p}wjtobli\fcb]a`[a^W_\U_[R^ZOa[ObZMe\Kg\Ji\Ii]Gk\El]Fm]Dm]D_gOkiTqZH{M@•RI©WL®TI³WH¦N:¢G2¢?*ª;(¾:.Ò72à23å,1Þ7.Þ7.Þ7.Ü8.Ü8.Û7-Ø6+Ø6+×7+Õ7+Õ7+Õ7+Ô8+Ô8+Ô8+Ô8+¸=.·=.°8(§2!ª2!´;*½>/Â:,Æ6+Í6-Ô:2ÜB8àI>ÖG9Ç;,¹1!ßOGÙIAÔE=ÓE;ØH?ÜG@àC>á<:ã54ê67ï8:í9:ç77à72Ý:3Ü>5ÎKAÈE;½=0µ7)°5&³8)¹>.ÀA2Á;/Ê<2Õ>5ß=8ç;9î79ò67ô68æ7>æ7>æ7<å8:å99å97ã:5ã:3Þ5.ß6/ã81ä84å97ç98ç9:ç9:ë;>ç9;á99Ü<<ÖA=ÌC;ÀB6´@3¦;+¢=+>,™<*–;(•:'”9&“8%‡F2‡>/†/%”-(ÀIKèkoçlqÊWZ¶OP©TQŸVO˜YP•[P–]R™^Vœ`XMb!:O3JOf x’I˜²h¡½r »t™²pƒ›akN\lEWdHS\GHN@=C9;<,AB4=?2:=2,¯:)½9,Ì70Ø42Þ22Ý6-Þ7.Ü8.Ü8.Û7-Ú8-Ù7,×7+×7+Õ7+Õ7+Ô8+Ô8+Ô8+Ô8+Ò9+¸>/·=.®9(¥2 ¦3 ²:)»=.¿;,Æ:-È4*Ì3+Ó;0ÜE:ßPBÞRCÚQAÝE@Ø@;Ñ<6Ð;5Õ>7Ø=8Û96Ý33é69í68ï79í68é77å97â=9á?:ÆC9¿?2¸:,±6'¯5&²8)¸=-¿@1ÅA4ÍA4×@7ß=8å97ê67ï56ô68ç6<ç6<ç7:æ89æ87å97å95ã:3â92ã:3ã:3ä;6æ:8æ:8å99å99æ9;ä:=à<=Ú?=Ñ@;Å?6¸<2¬;-¥;+ <,œ=+—<)–;(’:&‘8&7%z;)€8)‰5*ž;5ÁQPÚceÔ]a¹MM­NL¤SOYP˜\R—^S—^U˜_V™^VSg*Sg(^r3zO—°l¥¾z™²nˆ¡`j‚Fau@Sf9IY5FP7?H59?358/;<,AB4=?2:=2;A5:C2@M3Rc?]uCgƒHqLp”Jm“Hk“Jk“Lh‘Km‘Tn’To“Sm”Qk“Lj”Hl—Hm˜HpJnžJp Ls£Ou¦Tx©Xx©Xx©Zm–\b‹QY‚H]TE]TE]TE]TE]TE]TE]TE]TE[RC\SD]TE^UF_VG`WHaXIaXIe]He]Jd[Jd[Le[Qf[Uh]Yh\\i]]j^`k_ak__i]]f[YbWU`USYVMWTKTQHRNCQMBSOCWQCXRB^WG^WEaYFc[Fg\Hi^Hk`Jk`J^cOmhUy_PˆXN¤[T³VQ´HE¸E>¹@7¸>3·<-·9*¼8+Ã9.Ê:/Ï;1Û7-Û7-Û7-Ü8.Ú8-Ù7,Ø8,×7+Õ7+Õ7+Õ7+Ô8+Ô8+Ô8+Ò9+Ò9+º@1¶>.®9(£2 ¢3ª:&µ=,»=.Ä?0Å7+Æ2(Ê3(Ð<0ØF9ÛM?ÝQBÜ87Ø43Ô20Ô52Ù:7à>;å=<é;<ï8<ï5:ì27ê24é56å97á<8à=8¹;-·9+±6'®4%­5%°8(µ<+»=.ÈD7ÏC6ÖB8Ü=7â96è64í55ò67ê5:é6:é69ç79ç77æ95å:3å:3ã:3ä;4ã<6ã<6ã;8â:9á99à88Ý9:Þ;<Û@>ÕA=É>7º:1­7+¥7(¡;,œ=+˜=*”<(’;(9&8%Ž7$u8%y6%ˆ9,¢E=ºROÂVT¹OO¬HH¤LHœSL˜ZO—^S–bU—aW˜_V˜]UgxB{ŒU“¦n¥¸€«À‡ž³zz‘YYp:?R$AS)AQ-?L0:C.6<.690581:;+@A3=?29<1;A59B1@M3Qb>_wEi…Js’Nr–Lo•Jm•Lm•Nk”Np”Vq•Uo–Sn–Pl”Kk•Il—HmšIpJpJp Lu¤Sx©Xyª[u¦Wq¡U_ˆNVEOx>aXIaXIaXIaXIaXIaXIaXIaXI_VG`WH`WHaXIbYJcZKd[Ld[Le]Ff^Gf^Ig_Lg^Of\Pf\Rf\Sh]Wh]Wh^Uh^Ug]Se[QdZNdZN]YNZVKVRFRNBPL@PM>RO@UO?WQAYTA[VC^WDaZGd]Jf`JgaKadSleUt]O‹[Q«b\»YXºDD¾9:Æ;8É:6Ç80Â8-½8)¼:*½@.¾C1Ù7*Ù7*Ú8+Ú8+Ú8+Ø8*Ø8*Õ8)Õ8)Õ8)Ô8)Ô8)Ô8)Ò9)Ò9)Ò9)»A2¶>.¬9'¡4 2¢8"¬=)µ@.¼>/Á9+Ä6*Ç4*Ë7+Í;.Î0å26á14Ý02Ý34à88å;<ë=?î;?ï6<í38ì/5é05ç47ã77Û64Õ30±7(°6'®6&¬7&¬7&®9'²:)µ:*ÃA3ËA4ÔA7Ü?8â:7ç85í76ð67í6:í6:í68ë76ê86è94ç:4æ;4â92á:2ß:4à;7Þ:8Ý98Û97Û89Ö<:Õ@<ÓB?ÊA;»;2¯6+¥5'ž7(œ;*—<)“<)‘<(:&8$Œ7#Œ6%z@,v5#6'™E;¬OH¬MI©LG¨PLPH–VL“ZO“_R“bT•aV—aW™`W~‹]™©z­½Ž¦·Š¡ts†YN`8/A->3B%:F.=F3;A3:=2;<4<=79:*?@2<>19<1:@49B1?L2Pa=`xFj†Kt“Os—Mq—Lo—No—Pm–Pp—Tq˜Up˜Ro—Pm•Ll–Jn™JoœKqžMrŸNt£Sy¨X|«]w§[mSd”J[„LS|DNw?cZKcZKcZKcZKcZKcZKcZKcZKcZKcZKd[Ld[Le\Mf]Nf]Nf]Nf_Eg`Fh`IiaLiaNi`Oh_Ng^OjaRi`Qi`Qh_Nh`Mh`Mh`KiaLb_P^[LYVGTQBPM>NKTQ>VS@YVC\YF^[H^]I`aSf^QmWJ†[R­hcÁb`ÄLMÌ@CÔ:<×79Ö74Î70Á9+·>)²D+°H-×7)×7)Ø8*Ù9+Ù9+Ö9*Ö9*Õ8)Ô8)Ô8)Ô8)Ò9)Ò9)Ò9)Ò9)Ò9)¼A2¶>.«:( 7"™5š7 ¢>&¯B-±<*º;*Â:,È8-Ë8.Î:.Ð<0Ò>2ò5<î3:é27ã36â46â46â46ä15ì5:ì39ê38ê5:æ8:Ü66Ñ2/Ç,(®9(­:(­:(«:(«:(«:(¬9&¯7&¸:+Á<-Í?3Ø?7à=8æ:6ê86ì87ï56î66î66í74ë84ê93ç:3æ;3á:2ß;2Þ=5Ü=9Û=:Ù><Ø=;×==ÌA<ËB<ÆA:»<3­7-£5(ž7(š;)–;)“<)=(Œ;(Š9&‰8%ˆ7$‡6#}C/s4"y4$“G:¤RG¡NFžNE¡WN˜UL’XL[NŒ\NŽ^R”`U—aW›bYƒŽd˜¤|©ƒ€Žj]kJDS42@&$2-:&0;*5=.9?36:;3::29:*>?1;=08;09?38A0>K1Pa=ayGk‡Lu”Pt˜Nr˜Mq™Pq™Ro˜RršSršSršQp˜Om—Km˜Ip›LržOt Qv¢Sx§Y{©^z¨_qŸVd’JY‡?]†NVGQzBe\Me\Me\Me\Me\Me\Me\Me\Me\Mf]Nf]Nf]Ng^Og^Oh_Ph_Pg`Fh`IiaJjbMjbMjbOjbOjbOjbOiaNh`Kh`Ih`IhaGibHjcGe`Mb]J^XHXRBSM=MJ9KH7IH6KJ8LK9LM;NO=PQ?QTASVESVEYYM]WKcQEzXN¡ha¸eaÇUUÛORÞ=Cã8>à67Õ62È:.¹@+­E*¦I*Ô7(Ô7(Õ8)Ö9*Ö9*Õ9*Õ9*Ô8)Ô8)Ò9)Ò9)Ò9)Ò9)Ò9)Ò9)Ñ:)¼@4µ=/«<+ :$—7’6š<#¦B*°C.¹@/¿;,Ã7*Å2(Ë4+Ó:2Ù@8ó1<ð2<î5=ë8>ç:>å;>ä:=ã9<á48ä5:å8<ä;>Þ;<Ò86Å1-¼-'«<+«=,«>*©>*¨=)©<(©:'«8%¯6%¹7)Å;.Ñ=3Ù<5à;7ä;8è;7ð75ï75ï75î84ì94é;4è;4å=4â>5à?7ÞA:ÚA;ÙA>ÕA?Ñ??Ñ??¾B:»@8µ<3ª8-¡5(›5'˜8(•<*‘;*<)Š<(‡:&†9'„7%ƒ6$‚5#y<)r3!}:*—OA£YLœRG•OE–VJ”ZN[MŒ[M‹[OŽ\Q”^T™`Yœa[s}Xyƒ`r|ZU`B9F,/;'0;+1;03=44;35<4:?8?B9?A6<<277+89)>?1:27@/=J0O`HO?HO?PPDVRGYOChREYM˜UL³RLØXWàGJçï:Aì?CæBCáACÞ@AÚ>?Ï12Ñ56Ô::Ò<;Ê;7¾73µ4.¯3+¥>+¥>+¥>+¦?,¥>+¤>(¥<'¨;'ª7$²7'¼8+Å8.Ì8.Ö92Þ<7ä?;î85î85î84ì94ë:4è;4å=4â>4âA7ÝC9ÚC<ÕB;ÐA=Ê?<Ç=;Ã<9®>3©:/¢8+œ6(˜7'”8)‘:)Œ;(‹=)ˆ=*…<)ƒ:'‚9&€7&6%~5$v4$x5%…B2˜UEœXK“QCPD•ZL’ZM[NŽ]OŽ\Q’\R•\U˜[V™\W`hCX_=JS4>G,6?*2=-4>35?74=88>:=B/;9*78(=>0:26?.=J0N_;`xFk‡Lu”Pu™Os™NršQršSp™SqœMrNqœMp›LošKrNu¡Ry¥X«`~©az¥]qœUf‘L_‰G[ˆE\‰Hb‰RY€ISzCh_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Pg^Oh_Ph_Ph_Ph_Ph_Pi`Qi`QmcWlbVjaRi`Qh_Pg^Og^Mh_NiaNiaLiaLiaJh`IhaGhaGhaGh`Kg_Je_Ib[H\WCUR?PM:ML:EF4DG6DH7BI9BI9BJ;BJ;BJ;JJ@QQERPAUNÄYSÛQOãCEå8:ß55×:3Ê>/¸>)¬<$Ï8'Ï8'Ð9(Ò;*Ò;*Ò;*Ò;*Ò;*Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)Ñ:)½=2¶:.­<,¥>+˜9#Œ59ž@' :$¯<)¾?0È;1Ì8.Ñ7/Ù<5àA;ð;Bï>FëBGãCEÖ@?Ê;7À50»1.·0,¼51¾:5»<6³:2©9.£9,¡9,Ÿ>+Ÿ>+ ?,¡@-¡@-¡A+£>*¤=*©<(­:(²7(¹5)Á4*Ë80Ö?8ÝD>é:5é:5è;4è;4ç<4ä=4á?4Þ@5ÝC9ØD:ÒC;ÊA9Ä?:¼;6¸85´73ž9-™7*•5'’6'‘:)<*‰:)„9&†=*„=+=*€<)~:'|7'{6&{6&y1#€8*ŒG8–RE’PB‹K?ŽSE™_SXKZN’\R–]T—\V˜[V˜YT—XSV^7EM(6@8A&>G27@E>GJ?GI;BC1?>);;#78(=>09;.69.8>26?.E5>F7?G8=H8AE4HK6YS;_F0€K9Àj]Ýf`åSSçDEè@@ã?=Ö=5É=0Â>/É3$Ë5&Ì6'Í7(Í7(Î8)Ñ;,Ó=.Ò<-Ò<-Ò<-Ò<-Ñ;,Ñ;,Ñ;,Ñ;,¸3,·7.±;-¦;)˜8"‘7’8š:"«B-±<+¹7)Á4*Í6/×<7âC?êHCëBGéDHÝCCÉ:6»61´80®8.§5+ª:/¨9.¤8. 8-›9,–:+’<+>-˜=*˜=*™>+š?,›@-œA.žB-¡@-¡<*¥:(«7(°6)¶6+¾8-Å;1Ê=4ß:4á<6â?6ã@7âA7ßA6Ú@4×@5ÚG=ÒE;ÇA6»;2±6.ª3-¤1,¢1+”;-’:,:+:*‰:)ˆ;)…<+„=+~:'|9(|9({:({:(z9'x6&w4$z, A4˜NC“MAŽL>RE‘VHŽRG˜\R˜\R‘UMTL™ZU—XS–WR `^R[0IQ(AK&BK,>H/7@-2=-4>34;3HPEX^RW[LLO?1;=0:=29?34=,;H.Pa=bzHlˆMu”Ps—Mq—Lp˜OršSqšTpJqžKrŸLrŸNsŸPv¢U{§\ªb‚­fx£^i”O_‰G]‡G`ŠJfŽOhRd‰U[€LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj^^j_]j_]j_[j_Yj`Wj`Vj`Vj`TjaRjaRjaRjaRjaRjaRjaRj_Kh`Kg_Jg_Jd]J^YEUR?ONE5?E7>F7>F7=E6BF8>E5=F1DN5HK0PB'yS<¹ubÉdXà_YíUTêFGä>>â@=Û>9Ñ82Ì:+Î<-Ï=.Ð<.Ï;-Î:,Í9+Í9+Î:,Î:,Î:,Ð:,Ð:,Ð:,Ð:,Ð:,È?9ÆA:½A7®=/6#•2•2™3¦5#²7(Á;0ÑA8ÞE?æIDéJFìJGÞBCÛEDÎC@¼;5®9/¨>1¢A1œ?.œ@1™@0–>0’?/Œ?-ˆ?.„A.ƒB.‘;*‘;*’<+“=,”?+”?+–?,™>+Ÿ@.¡=-¤:,§9*¬8+±8-¶:0¹:1Ð90Ò;2Õ>5ÕA7×C7ÖD7ÔD9ÑE8ÊB6ÃA4¹=1°:0¨8-¢5.5,œ5.Ž=,Œ=,Š;,ˆ;+†:*„;*<,€=,~;*|;)y:)y:)x9(w8'u6't5&„1)‘C9˜NC‘K?ŒJ>PD’TIRG“SJšWQ˜UO™UR\X”WTŽSO—\XT]0Zc8_j@[eBIT66C)4@*0:-;H.Pa=c{IlˆMu”Pt˜Nq—Lq™PršSqšTq¡Kp LpJqžMt Qx¤W|§_ªc{¦aošUcŒJ]…Fa‰JeNeNc‹Ld‰U[€LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj^`j^`j^^j_]j_[j_Yj`Wj`Vj`Vj`Tj`Tj`Tj`Tj`Vj`Vj`VlaMk`LiaLiaNf_La\I[VCTQ@ML:HI9DG6AE6AE6?E7>D6=C5=F57@-?H3EM5AA%QA']E³u`³WHÙbZðebîRSéEFìFHèBDÝ79È9+É:,É:,É:,É:,Ê8+È6)È6)Ê8+Ë7+Ë7+Ë7+Ë7+Ì8,Ì8,Î7,Â3/¾5/¸5-¬3( 0"›0Ÿ1 ¥4$»A2ÇC7ÖG?ãKFçLGéJFåFBâC?ÕCCÏDAÁ@:°;1£=/žC1™F4•G3’E3E2ŒC2‰B0ƒB0B/{B.xD.Š8*‹9+‰:)Š;*‹<+<+Ž=,<*–?.–=-›;+9* 8+¥9-©:/«;/¼7.¾90Á;0Ä>3Å?3Æ@4Ä@3ÁA4¸:,²:,ª9+£7+7+™7,–8.–91‰=-ˆ<,…<+„;,‚:+€;+<+<,};+z;*z;,w9*v8)u7(t6's5&Œ91”F<—MBŽJ?ˆHMKB3;I27C-EJ3IG0K<%mN9—dO§`NŸA5ÆSLçc_ð^^îRUíJMêDHç>CÉ;/Ç9-Å7+Å7+Ç9-Ê:/Ë;0Ë;0Ñ>4Ñ>4Ñ>4Ò>4Ó?5Ó?5Ó?5Ó?5Ó?=ÑB>ÍD>ÆF=ÁG<ÂI>ÆN@ÎPDÙSJÞOGäLGäIEåFCâC?àA=ß@<ÔFDÊC?º?7«<1ž>.—D2“H3‘J6‹G4ŠF3‡D3„C1B0zA.wC.uB/†8+…9+…9+†:,†:,‡;-‡;+ˆ;+‰:+‹:)Ž8)8*•9,™<-=/ž>0«9/­8.®9/°:.°:.²:,¯9+®8*¨7)¥7*ž7(›6*•7+’8-9/;0†=.…<-ƒ;,9*:+~9*}:*};-|:,z;,y;,w9,s8*q6(q7)q7)B8”G=‘K?ŠH<‡I<‹OD“UJ—TL—PLSP˜QO–RO—\X_Xh^žzn™k…’fu‚VYh=CR)?O(P`B'=A&;>#78(:;-79,9<1;A57@/MKH/JH1Q?+e>-”ZL¬`S›>6œ4+µ@9ØXUóigödeëRUèINìKQ×J@ÓF<Í@6Ë>4Í@6ÒD:ÕG=×G>ÚJAÚJAÝJBÝJBÞKCßJCàKDàKDëRTéSTãTPÜSMØSLØSLÛTNàUNàLHâHFäEBäB@äB@äB@ãEBãEBØJHËD@¹>7ª>2žA2–C1F3I6‰F3‡D3†C3ƒ@0@1}?0y@/x@1ƒ9.ƒ9.‚:.‚:.ƒ;/ƒ;-ƒ;-ƒ;-9*‚9*…9+‡9,‰:+;-<.=/›;/œ:/ž9- :.¡9,¢8*¢8*¢8*Ÿ8)œ8)˜8(”8)9*Œ:,ˆ:-‡;-ƒ;-‚:,9+~9*}8)}7+|8+{9+z8*y9-x:-t9+q5*o5)q7+r:-G;ŽH<‰I=„I;…K=ŒRF“WMšWO˜QMžTQ™RP•VQ’`YˆbW‚h[ŠwhivKZi>JY.AR&IZ0Wi?dvLj|TXjDL\8?M,:D)C-=@-:=*89):;-68+8;0H-NC-b=-„D:¯VP¶MJ¡++´:9º=;ÑTPòpnýwvñehêY^ò]cáVOÚOHÒG@ÎC<ÑD=ÔG@ÖGAÖGAÙHCÚIDÚIDÝIEÞJFÞJFàKGàKGãGJáGIÝGHÙGG×HD×HDØGDÝEBàBAåABé@CêBBèBBäB@ßA>ÜA=ÚJIÌB@»<6®>3¢@3—A2B0D3‰A2ˆ@2ˆ>1…=1‚<2€<1=1}=1ƒ:3;3;1;1€<1€<1=/=/=/€.™9)•9*“:*Ž;+Š;,‡;+ƒ;,€;+‚:,9+7)~6*{5){5)z6)z6+x6*x8,w9.s7,o5)o5)r:-u=0ŽL>‰K>„J<‚M=…QC‹VH’XM—WN”MIœRQšTR•[We\y_PcXFb]IBP,?M)?O(K\2_qGk~QcyKVk@M_7@R,6E&7D*=F1=D4:=27:19:*:;-68+8;0G*SA+{E9¦NL¸EH»5<¾19Ë@EÄ?@ÊJIÞb`îrpïopçbeáZ^ÛRJÕLDÏD=ÍB;ÏD=ÒE>ÐC<Î?9ÒC=ÓB=ÔC>×C?×C?ØD@ÙEAÚEAà?Dß@DÞDFßFHßIHàJIãIIæFHçACëADîAEîACéAAâ@>Ù>:Ö=8ÛEGË=<»73°;4¦@4˜?1>0ŽA1‰=/Š<0‰;1‰92‡81†93…:4„;4:4:4€<3€<3<3}=3}=3|<0{=0{=0{=.{<-z;,y:+z8*z8*€:0‚:.„:-ˆ:.Œ:.‘;.”<.–=-’9)‘:):*Š;*‡;+ƒ;,<+}<*€8,€8,~6*}5)|4(z4(z4*y5*u3'v6,v8-r6+n4(n5*s:/v@4‹PB†N?N=R@…VF‰XIŽUJ‘RI“NI™RP”SO‘\VŠfZl\LML7BL3@O.KZ9WgC`rJezOdzLVl=G]/AV+7I#0A!5C*=F5QJ:MG7IC3GA13M*>G*[B.PGºVVº7?»'3ÜBNÐ:CÄ9>»;:ÂHGÓ][ßgf×[]ÇILÓJDÏF@ÌC=ÎC>ÒGBÒGBÐB>Ë=9ÒC?ÓB?ÔC@ÕDAØDBÙECÙECÚFDá>Cà?DÞBEßEGáGGàFFàBCâ=AëADí>Cì;Aê<>æ>>ãA?ßD@ßFAÙ@CÉ78¹30±:4§?4š>1=/Ž?2Š;.‹9.‹80‹61Š71Š73‰84‰:5:3:3:3~;3|<3|<2{=2{=2u9.v;-w<.w<.x=-x=-y;,y;,{;1};/~8,7*„6)‡5'‰6(‹5&7(‹8(‹:)ˆ;)…<+<,~=+{<*€8,7+~6*|4(|4({2)y3)y5*t1(u5+v8-r6+n4)n5*t;0xB6ŒTE„Q@P>‚UB„YHˆYI‰SGNG˜SN˜RPPKˆVO‚bUeZHFK4;K0IX;[jKgxVewQYnCSi;Me5I`28M"-B*;2@):E7;B;8<;7;<<=-<=/79,9<1=C77@/6C)DU1Rj8_{@mŒHp”Jq—LršQtœUr›Uq¢Qt¥Vu¥Ys£Ym›Sd‘N\‰HZ„DdŒNa‰J`‡HcŠIfJiŽIeŠDa‡>`‚PWyGPr@i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTo\Nq_QtdUrdWnbTj`Th`ShbTgaSebQa^K[VBVQ;TN6NH.GA'RD)N=#cI2iV²zm·ng³[W¸PQ¶BEÁ@EÉ@GÑBFÖDGÚEIÜGIÝGIÔBEÔBE×BDÙEEØDBÒC;ÎD:ÌH;ÄF7ÃH9ÆH:ÊG?ÐEB×BDÜ?FÞ=EâBDâBDâBDâDEâDEãEDãEDãEDâDAâC@áB?â@>ã?=ã?=ã?=å@>ÎE?Ä?8¶:2©80Ÿ:0•>4Œ@3ƒ?2A4|@5}?4<3ƒ:3‡83Š73Œ72…<-…<-…<-„;,ƒ;-‚:,‚:,‚:,9-9-9-~:/~:/~:/~:/~:/~80~80}90}90}90}90|90|90|90|90z:0y9/y9/x8.w9.w9.w8/w8/v7.t8.s7-r6,q5+p6+l2'q7,m4)l3(o6+m4)q8-H=ULƒTL†QK‹PJNJ•NL˜NM—PL”SM‹UK†\NdOkaFTW8JX5N_;gT`zMWpFTkARg@O`0CA4B@4@<12:/2:/4:.5;-9=.A,>D*T^4ÉE9ÈF9ÊG=ÍG>ÒGDØCEÜAEß?GáCDáCDáCDâDEâDEáFDáFDáFDàEAáC@àB?ßA>àA=àA=â@=ãA>ÑFAÉB<¼=6¬:0 90“;/‰=0=0A4|@5}?4<3ƒ:3†91Š71Œ72…<-…<-„;,„;,ƒ;-‚:,‚:,‚:,9-9-9-~:/~:/~:/~:/~:/}90}90}90}90}90}90|90|90|90z:0z:0y9/y9/x:/w9.w9.w8/w8/t8.s7-r6,r6,p6+p6+k1&q7,m4)l3(o6+l3(p7,~H<‚SK„TJˆQJ‹PJ‘PL•OM–PN–RO‹OG…SH€[K{ePsiPhkLdrOgxT\uKXoEPf?Ka:K_:K\:GV7CP42><03;03;05;/6<09=/A,>D*Q[9^mDmPpŒRr’Sq™RsSsŸRxža|¢exžak‘T`†I]ƒF]ƒF\‚E`†Ia‡Jc‰Le‹NdŠMbˆK`†I^„G]MRtBIk9i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtbTo_Pm]Pm_ToeYog\keYhbVfbVpl`{xi~{jzgzuapiVf`JPVÔG@ÖGCÚFFÛEFÝDGáCDßCDßCDßCDàDEßECßECßECÞDBÞE@ÝD?ÜC>ÜC=ÜC=ÝB=ÝB=ÕF@ÎE=ÃC:³>5¢:/’8-ˆ9,<-€A2~@3}?2=1ƒ:1†91ˆ81‹80…<-„;,„;,„;,‚:,‚:,‚:,€:.9-9-9-~:/~:/~:/~:/~:/}90}90}90}90|90{8/{8/{8/{;1{;1z:0y;0x:/x:/x:/x:/t8.t8.s7-s7-r6,q5+o5*o5*k1&o6+m4)k2'n5*i3'm7+}G;†QI‡PIŠQJŽQL‘RM“RN•TP’UPVO‡[P^OtbNoiQnrWjwYfwWPf@K_:EY6BV3EV6GV7FU8ER8?I1*7;*:<.<>0<=/:;-5<45<46<26<09=/<>0=@-=C)MV7Zi@h|KlˆNpOq™RuŸSt Sz cw`n”Wc‰L\‚E\‚E\‚EZ€C_…Ha‡JbˆKdŠMc‰La‡J_…H]ƒF[}KPr@Gi7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtdWqaTm_Rk_SkaWlcZle[jf]jf]wuiˆ„y‘•’Œ|‰‚r€ygZfNLV>AI2CF1ED0D?,I=-TD5M:+O8*R6*T7)X8+];/a?3eA5‹KAœSL­UQ¶NK½EDÇABÓCCÛEF×?>Ø@=×B>ØD@ÙEAÚFDÛEDÛEDßCDßCDÞDDÞDDÞDDÝEDÝEBÜGCÛFBÚE?ØE>ØE>×D=×D=ØE=ØE=ÖC<ÔE?ÊE>»@8§;/–8,‹9+…;.‚@2@1~?0=/;/„:/‡9/‰90„;,„;,ƒ;-‚:,‚:,‚:,9+9-9-9-~:/~:/~:/~:/~:/~:/}90|90|90{8/{8/{8/y9/x8.{;1y;0y;0y;0x:/x:/v:/v:/s7-s7-s7-r6,p6+o5*o5*n4)j1&o6+l3(h2&k5)h2&l6*|F:ŠOGŒPHQIRMSN’UPWPŽYQ‰]R…aUy_PiZGd_IciOZgKN]@EU8AQ4=M0G2:A/7>,9=,9=.8<-7;,6=66=66;46<29<1;=/dxGj†LpOs›Tw¡Uw£T{¡dr˜[e‹N\‚EZ€C\‚E\‚EZ€C_…H`†Ia‡JbˆKa‡J`†I^„G]ƒFY{INp>Ef7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTseXugZsg[mcYjaXle]snhzwp~w† –©¥œ«§œª£™£‘œ”‰v~i`hSLSADK9AJ7>G4>G4BI7GNBÛ?@ÛAAÛC@ÚEAÚEAÚEAÚEAÞDFÞDFÞDFÞDDÝEDÝEDÛEDÙEAÚFB×FAÕF>ÔE=ÓF=ÓF=ÓF=ÔG>×@9ÕB;ÏD=ÁB9®>3œ:-‘;.‰=/„?0?/~?0=/<-„:-†:-ˆ:.ƒ;-ƒ;-‚:,‚:,‚:,9+9-9-9-~:/~:/~:/~:/}:1}:1}:1|90|90|90{8/y9/x8.x8.v8-y;0y;0x:/v:/v:/u9.u9.u9.s7/r6.q6.p5-o4,n3+m4+m4+j1(o6-j4*h2(j4*g1'k5+zF;MGNH‘PJ’SLUOŽWPŠZP…ZQ{YMv\OkZJ]UBYXDY^HOYA>L3;G18D.5A+5A+8D.=I3AM7EN;BK8?H5.5<,4;+5;75<56;56;48;2:-;@)GP1Ra:buGi…Kq‘PuVy£Wx¤Uzcn‘W`ƒIZ}C[~D^G^G]€F`ƒIa„Jb…Kb…Ka„J`ƒI_‚H^GW{KLp@Bf6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTmaUndXpf\lcZkd\rmg„|‘‹¥¤ ³²®ÄÁ¼ÉÆÁÉľÅÀºÀ¹±¹²ª¤œˆ‚tfcTPQAEI8=F38E18G45F35F44E36D58D6;E:?G<@H=<6(L0–=/Œ=.†>/‚?/€>.=-<-ƒ;,„;,‡;-‚:,‚:,‚:,‚:,9+9-9-~8,~:/~:/~:/~:/}:1}:1}:1}:1z:1z:1y90y90x8/v7.v7.v7.u9/u9/u9/s9.s9.s9.r8-r8-q6.q6.p5-o4,n3+m4+l3*l3*h2(l6,i3)f2'h4)e1&i5*xD9’KE’MF“PJTLVO‡XNYO|\Os\Nk[L_XFUTBPS@JQ?@I64@,3<+2;*09(09(2;*5>-9B1-;@*CL/O^7_rDi„Mr’SwŸXy£Wv¢Us–\f‰OZ}CX{A\E]€F]€F^G`ƒI`ƒI`ƒI`ƒI`ƒI_‚H^G]€FVzLJn@Ae7haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTiaVjbWkdZmf^upjˆ…€Ÿžš°°®ÂÂÀÓÒÐâáßéåäçãàãÞÚÞÖÓ×ÏÌÒº°º¤™˜†zym__YIKL:>F19E1>2J91`94ˆHH²\_È_dÍVZÐOSÕMOÚLKÜJJàHEáFBãDAåA?ÞDFÞDFÞDFÝCEÝCEÜBBÛCBÛCBÚDCØD@ÔE?ÓF?ÐF<ÏF<ÐG=ÎH=Ý>8Ú?:ÒB9ÉC:¼C8«A4™<-Œ9)‡>-ƒ>.>-€=,€=,<,ƒ;,…<-‚:,‚:,‚:,9+9-9-~8,}9.~:/~:/~:/}:1}:1}:1}:1}:1y:1y:1x90x90w8/t8.s7-s7-s9.s9.r8-r8-q8-p7,p7,p7,p5-o6-n5,n5,m4+l3*i3)i3)g1'k7,h4)e1&h4)d0%f4)uC8•JE“LH“PJTL‰WNYOx[Mp]Nj^N]WGPQAKN=CJ:9B12:+08)36-17-06,/5+/5)17+2:-4<-9D4;F6=H7*0640641622716929;0:<.:?)?H+KY5]pChƒLs“TwŸYw¡WržQiŒT^IUx@WzB[~F[~F[~F]€H_‚J_‚J_‚J_‚J^I^I]€H]€HUvKJk@@a6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcToh^ng_lh_tqj…„¡ ž¼¼ºÏÏÏÎÏÑààâòòòúøùû÷öøòòñìéêåâïÍÃàÀµÅ©¥€sbaZGML7CH2AI4AH6BF7BD7C@9D<9C98C772?5;@9@93H/+c76QR³giÇmmÂ[\ÉYWÑUS×QNÝKKåGFèBBê@AÞCGÞDFÞDFÞBEÞBEÝADÜBBÜBBÜDCÙCB×C?ÔC>ÒE>ÐE>ÏF<ÐG=â@;Ý@9Õ@9ÌC9ÀD:°B5›;-‹5&Š=-…=.>-€=,€=,<,ƒ<*„=+‚:,‚:,€:.9-9-~8,}9.}9.~:/~:/}:1}:1}:1}:1}:1{;2w;1w;1v:0u9/t8.s9.r8-q7,r8-q8-p7,p7,n8,m7+m7+m7+o6-o6-n5,m4+j4*j4*i3)h4)f2'k7,h4)c1&e3(b0%e3(uC8”JG“NIQJ‹TM„XOzZMq[Mh\LXUDHK:=D4=E69A208+/7*5=056157257247005.06,08-19,6A3:E5=J9>K9;J77F12A,0?*.42.420511605818:/:<.:?+WzB[~FY|DY|D\G_‚J_‚J^I^I^I]€H]€H]€HSsJHh?>^5icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUfc\gd]vsn“’ޝ¯­ÄÆÅÚÛÝìíïóôöö÷ùüüþÿÿÿÿþÿÿûúüööùôñÿÞÏöÖÇãÈ·É´Ÿ­ž‡ŠƒicbFGG-EG/DF0GD3IC5H;3F42G34M797@;;@:@;8G85cGF‘kjŔ譩ҋ‡ÇtnÀ]XÆSNÖNNâIKëEIðCGÜFHáHKÜCFÕ:>Ø>@âFIàDGÖ:;Ú@@Ú@@ÙA@ÖB>ÔC>ÑB<ÏB;ÏB;ãA<Ý@9Ô?8ËA7¾B8°@4;.8*‹>.†>/‚?.>-€=,<+=*=*9-9-9-~8,~8,|8-|8-|8-}9.|90|90|90z:1z:1z:1z:1x=5w<4v;3u:2t91r7/p7.p7.o6-m7-m7-m7-m7-l8-l8-l8-i2+m6/p92o81k4-g2*g2*h3+e0(i7.d2)^,#`0&_/%b2(p@6’LJOKŠQJ‚QJ}YMv_QfYIRO>CF5=F58C35@02=/3;04:04:077577566446135016/05..6+.9+2=/6C29H5:I68G42D./A+,20,2.-2..3-36/780:&DR1YkCh‚Ru”[wž_r›Wj•N\}HXyDTu@Tu@WxCZ{F[|GZ{F^JbƒNbƒN^J\}H_€K`L^JTrNFd@:X4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUed_onj…†¤¤¢ÁÃÂÖÚÛêîï÷ûþ÷ûþøüÿüýÿþþþÿþÿÿýüÿüùÿûøÿïÚüêÒîÞÅØÍ±À»¤£„‚ƒcgkJMP1II/EC,HA/J>2L93M85Q99;;9BA?MHE\RQyjg¢‹Ì³®åÇ¿ÿÙÏ괪̃|Àc\ÌVTÛPSãFMâ=DÕEEÕEEÙGHÞIKÛEGÖ<>Ö<>Ü@CÚ>?Ù??Ú@@ÙA@ÖB>ÓB=ÒA<ÐA;ß@:Û@;Ô?8ÌA:¿C9±A6 ;/‘9+Œ=.‡>/ƒ>.>-€=,<+€=,<,9-9-9-~8,}9.|8-|8-|8-|90|90|90z:1z:1{;2{;2{;2v=4u<3t;2s:1r90p7.m7-m7-m7-l8-l8-l8-l8-j8-j8-j8-l5.n70n91n91l7/i4,g2*e3*c1(e3*_/%^.$b2(^.$`0&n?5„IEˆQLˆWRWOrVKdRDQJ:>?/:A16A14A02>02<14<15;17:388677577557446116005./7,.8-1<.4A07E49H58G44E22D.062.40.3--2,14-45-8:-9=,7?'DQ3YkEh‚Sv”`wbp˜YfNZzHWwETtBTtBVvDYyGYyGYyG[{I_M_M\|J[{I^~L^~L\|JTmOF_A9R4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUneVneVneVddby{x—™˜²¶µÍÑÒäéìôùüúÿÿûÿÿûÿÿûÿÿýÿþþþüÿÿûÿÿúÿÿúÿüßúùÛïðÐáåÄÒØ´¼Äž©‡’j`hCRW7DG,EC.KD4MC9N?8L=8C:;SJKi`a€xv›“¼µ¯×ÐÈçÝÓúêÝÿôéÿåÛ画Äec¸ACËBIáNVÚVRÒLIËDAÎBAÔFE×EFÙCDÛBD×=?Ø>>Ù??Ø@?×A@ÕA=ÓB=ÒA<Ü?:Ù@:ÔA:ÍD<ÀD<²B7¡<2“9.Œ=0‡=0ƒ>/>.€=-<+€=,€=,9-9-9-}9.}9.|8-|8-{8/}:1}:1{;2{;2{;2{;2{;2{;2t;2s:1p:0o9/n8.m7-k7,k7,l8-l8-j8-j8-j8-j8-i9-i9-n91m80m80m80m80i7.f4+c1(c3)a1']-#_0&c4*\-#_0&sD:OK‚UPXQqSK^J?OC7?<-37(2:+/<+0<.2=/4<15;17:37:388688668557257227016/08-.8-0;-2?.6C27E48G48G48G46=53:2/4-,1*.1(13(57*6:)6>'DQ5[lHk„Zy–fwœfl”X^‡KWwEUuCRr@Rr@TtBVvDWwEWwEXxF[{I]}K[{I[{I]}K\|JXxFPfOAW@3I2icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUneVneVneVneVofWgklƒ‡ˆ£§¨¹¾ÁÐÕØåíðóûþõýÿùÿÿûÿÿüÿÿüþûýþùþýøÿþ÷ÿÿöóÿâñÿÞëùÖäòÎÛêÃÌÛ²³Â™ ¬„}‰cdnKLS4EI0HJ5KI:GE9D@7QEEk__‹€¤š™µ°­ÊÇÂÜÜÔççÝ÷óèÿýñÿøíÿÝÕú·±èŽŽÌbd±>CÃPIÉTMÉOJÃF@ÊFBÔMJØJIÑ??Ò>>Ô>?Õ?>Ö@?ÕA?ÓB?ÓB?ÒC?×>8×?:ÒC=ÌE?ÀE>±B9¢=5•;2Œ<1‡=0ƒ=1=0=-~<,€=-€=-~:/~:/~:/}9.}9.|8-{8/{8/~;2|<3|<3{;2{;2z;4z;4z;4p:0o9/o9/m9.l8-k7,j6+h6+i7,i7,h8,h8,h8,h8,h8,h8,o:4j81h6/i70j81j81e4-a0)e4-b1*].&a2*b3+Y*"_3*zNE~]XvWRiNGWC:J<3@:.:;-8<.08)/:,1<.2=/5=25;169078079468368349338138119.19..9+/:,1<.2?.5B18E4:I6;J7;C87?428.-3)-0%/1&24'48)4<'ER8_pPr‹d}šnwœifXT}EUrBTqASp@Sp@TqAUrBVsCVsCWtD[xH]zJ\yI^{K_|L\yIVsCK\JD8f\Z†|z«¡ŸÁ·µËÃÁÕÐÍãâÞîïé÷øðùöíüòèÿóéÿóíÿäß즤´if«K=³QDÁYNÇ[QÆQH¿D=ÂA<ËD@Ë@=Ï?>Ð@?ÑB>ÒC?ÒC?ÑC?ÑC?Ö>9Ô@<ÒD@ÉE@½D<¯@9 >5•<4Œ<3‡=2ƒ=1=0=/~<.=/€Qn>Qn>Qn>Qn>Qn>Sp@Sp@WtD[xH]zJ]zJ_|L_|LZwGQn>ESF6D7(6)gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXpgXpgXinrz‚…“š «´¹ÄÍÒÜåêì÷ùôþÿôþýöÿüúÿúûÿ÷ûþóøúìõöæòóãòþêôýèôüåóøáòöÛëëÏØ×¹ÅÄ¥±°’ŽregOMP;EL:EM>EODGSG~zqŸ›’ƽ¸ÙÎÌáÓÒçÛÛôêéü÷ôðïëûüöÿÿöÿþôÿúñÿôêÿçÞÿÚÒß‘}·fS¢K:²UF½WKµF;·@8ÈKEÇC>ÊC?ÌB?ÎC@ÎC>ÍD>ÍD>ÌC=Ô@<ÒC=ÎE?ÅD?¸A;ª=8ž;5•<4Œ<3‡=4ƒ=3=2=1~<0=1=/~:/~:/~:/}9.|90{8/{8/{8/|<3{;2{;2y:3y:3x92w81w81m80l7/j8/j8/i7.i7.g7-g7-g7-g7-f7-f7-f7-f7-f7-d8-i70h6/g5.f5.g6/h70g6/e6.a2*e6.^2)\0'`4+a5,i=4|PGQJBE>6:6-85,99/8:/47,36+4:.5;/5;/69.69.68-57,46+19,19,19,19,19,19,19,19,08+.9+.9+/:*0;+3>.6A17B2gw]umv‘nf‰_RwKAh;Mj:Nk;Pm=Pm=Nk;Nk;OlVsCZwG]zJ^{K_|L_|LVsCLi9=H@/:2#.&gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXqhYqhYcjpmtz„’£¬±¾ÉÍÓÞâåðòðüüòüûõþùøÿ÷úÿôüÿòúýìøùçöøãööìù÷ëúöêýöæÿôâøëØçØÁÖÆ¯À±šŸ“}vn[ZWFOQCQWKYcZbme–˜‹²²¦ÕÎÆêÜÙõããüéëÿñôÿ÷ùÿýýýþùøûôõûñúýòÿÿóÿÿóÿÿñÿãÊ¹q[¨WD¬SCµQB¹MA¿JAÂG@ÆE?ÉE@ÊE@ÊE>ÉD=ÈC<ÈC<ÒC?ÒD@ÌEAÂC=³=9¦;5œ;5•<6Œ<5‡<6ƒ=5=4<3~<0=1€<1~:/~:/~:/}9.|90{8/{8/y90{;2{;2z:1x92w81v70v70u6/k90j8/j8/j8/j8/h8.h8.h8.g7-f7-f7-f7-d8-d8-d8-d8-h6/h70i81i81h70i81j;3l=5g80k<4b6-a5,oC:xLCtI@uJA:=647036/7:18;247.14+25,58-58-57,46+46+46+46+46)/7(08)08)08)08)08)08+08+19,08+08+/7*08+19,3;.4e9Jg9Li;Nk=Nk=Li;Li;Mj
        UrDYvH[xJ]zL^{M\yKQn@Eb47@;+4/!*%gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVofWpgXpgXqhYriZhowmt|‚‹’¥®µÂÍÑÔßãäïñòþþóýüôÿùöÿ÷úÿôüÿñýÿíýÿêýÿêÿöñÿøóÿ÷ïÿ÷íÿöëÿïáöÜÍäʹƯ§”ƒ€sce]P[YM_bYovo|…€¦­¾À³ÚÖÍñãàÿìíÿñôÿñ÷ÿñ÷ÿ÷ûûúøøÿøøÿúôÿõîÿïòÿï÷ÿóÿñÖÿðÖÿȰÅ}g¢O=®Q@¸RD³C8ÀIAÄH@ÇF@ÇF@ÈE=ÇD<ÆC;ÆC;ÓD@ÐE@ÊE@¾A=±;7£74š93•<6Œ<5‡<6ƒ=5=4<3~;2<3=1~:/~:/~:/}9.|90{8/{8/y90z:1z:1y90w81v70u6/u6/t5.k90k90j8/j8/j8/i9/i9/h8.f7-f7-f7-d8-d8-d8-d8-d8-f5.i81l;4k:3j92j92m>6qB:n?7pD;g;2g;2SJŒaXTKpE<6=52913:27<5492/5+25,9<345-35*24)13(13(35(46)57*,7',7'-8(-8(-8(-8(-8(/7(19*08)08+/7*/7*/7*08+08+7@+9B-=D2=D2=A29;-35'/3$3:*JVBcr[f}a\wVLnICgA=c:He7Kh:Nk=Nk=Kh:Jg9Li;Nk=TqCWtFZwI[xJ]zLZwINk=A^05;9*0.!'%heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVg`MjeOnlWnl]ff^eeeqqy‡‘“–ž¡«³¶ÃÈËÙÝàìíï÷÷÷ûùúþýûÿþúÿÿûýþøûüöùüóúýôùÿõùúõùúôøúïúûëûýèöùÞäçÈÒÖµ¶¼š”›ymvW\fK`lTq~lƒ‘€žŽ··µËËÉââàïïíôôòøøöúúøùù÷þþüþþüþþüþþüþþüþþüþþüþþüæÿÿðÿÿûÿÿýïîЪ§ a\™D=¸MEÄKBÈC:ÊA7ÎD:ÑH>ÏJAÉI>ÆG>ÁJ2¿K4¹L5¯K4 H2”F2ŒE3‡E5‚D5C6€@4‚>3…;2‡9/Š7/6-~:1~:1}90|8/{7.z7.y6-x5,w7-w7-x8.x8.v8-u7,s5*q3(h91h91h91g80h70g6/g6/g6/f5.h6/i70j81i70h6/f4-g2,k1-k4/n70m80k9.j:.i>.iB1dC2gJ8aJ8raOyn\ƒ|j…‚qOL;4:04:04:039/39/39/28.28.17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4.05//4./4..3-.3-/4./4.05/0;32=55A77C98D86B64@22?.3@.DQ=WeN\jSSaHHV=DR8FT:Ic>Ke@Ke@Ke>JeOjAUpGYtK\vO]wR]wTWpPHaC8Q3).2&+/$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVjcPlgQmkVlj[gg_lll~~†’ž§±³¹ÁÄÏ×Úâçêðô÷ûüþÿÿÿÿþÿþýûÿþúÿÿûþÿùûüôøûòøûò÷ýóøùóøùñøúíøùéùûåòõÚáâÃÌЯ´¸—‘–vkrSYaI_kUtoŒ˜Š›©œÀÀ¾ÓÓÑççåóóñ÷÷õûûùüüúûûùþþüþþüþþüþþüþþüþþüþþüþþüîÿÿôÿÿüÿÿÿüúÿíêñ¿¸Ã}u¢J@³K@»J<ÅK>ÈJ>ÄD9½=2¿?6ÃD;ÂH3ÃJ7½M9³J7¦G5™C4D6‹F7ƒC7C8A7>5‚<4„:1†91‡81}:2}:2|91z:1y90x8/w7.v7.u6-v7.t8.t8.t8.r6,p4*o3)i81i81i81h70h70h70g6/g6/e3,e3,g5.h6/j81j81j81k92k60l71m80l:1k;/l>1j@0iD2hG6kP=gR?ufSvd‹†s†ƒrML:4:039/39/39/28.28.28.17-17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4.05//4..3-.3-.3-.3-/4.05/-80/:21=34@66B66B66B45B16C1CPAO6BP7FT:Ic@Jd?Ke@Ke>Ic3L/).2',0$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVmhTmhRmkVjk[jkcvxw‘‘™¨ª¶¾ÈÊÓÛÞêòõ÷üÿüÿÿþÿÿÿÿÿÿþÿþýûÿþúÿÿúýþøúûóõøïóöëñ÷ëô÷îöøíöøêö÷åõ÷áîîÔÛÛ¿ÉÊ«°±’“–yuy^kpZt{iˆ§œ¬¶­ÎÎÌÞÞÜïïíøøöûûùþþüþþüýýûþþüþþüþþüþþüþþüþþüþþüþþü÷ÿÿùÿÿþÿÿÿüúÿúôÿöíÿÑÄÙž•L=§Q@¬K;ª>1¸G9ÑXMÐTJ¾?6ÆD6ÇH9ÄJ=¹I=ªB7?5•A7’E=‡A9„A9@:>8~>5<4<4€;4x<2x<2w;1w;1v:0u9/t:/t:/s9.r9.r9.r9.q8-n8,l6*k5)j81j81j81j81i70i70i70h6/g5.g5.g5.g6/h70i81k:3k:3l;4k:3i:0j;1k?2lB4iD2fE2fI7lVAjYEviV†l‘Ž{€mEF439/28.28.28.17-17-17-06,17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4./4./4..3--2,-2,.3-/4./4.*5-+6.-9//;12>24@46B47D38E3?L:ER>CQ:;I28F->L3ES:H`>Jb@LdBKc?Ia=G`9F_8G`9RkDXpL]uS^vVZqTPgK=T8,C)).2',0%*.heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\kd\md]meZmfVniUljSlkVlm]pqi€‚ž¡¨º¼ÈÃÍÏÜäçóûþûÿÿúþÿüýÿýýýüûùÿþüÿÿûÿþùûüôõöîîñæëîãçíáíñãðôåñôãòôßðòÜêêÐÙØ¼ÈÇ«²±•¡¡‡‘“}‘’€œžª­¢¶»´ÀÅ¿ÜÜÚééçööôûûùýýûÿÿýÿÿýýýûþþüþþüþþüþþüþþüþþüþþüþþüüúÿÿþÿÿþÿöòïûôîÿýóÿûíÿõäêı·ƒn”Q>¡P=¸XH¸L?¸D7ÀG<Ç>4ÉD;ÈH?¿F>°?9¢;6š=8–A>?;‡@<@<}@;z?9y@9x?8v?8v=4v=4v=4u<3s=3r<2r<2q;1o;0o;0o;0l:/k9.j8-j8-i7,n72n72m61l71l71k60i70i70l:3j92h70g6/f7/f7/h91h91j?6f>4e=1f>2hC3iE5gF3cG2cJ6hV@k\GskV‡‚nŽzor_9>*28.28.17-17-17-06,06,06,17-17-17-06,06,/5+/5+/5+.3-.3-.3-.3-.3-.3-.3-.3-.3-.3--2,-2,-2,-2,.3-.3-)4,)4,*6,+7-.:01=14@25A36C2:G5Æ=7ÈA;ÈD?ÀC?´<;©98 9:›==‘==Š>>„@?|A=xA6s>6s>6r=5p>5p>5p>5n>4n>4m=3l<2j;1j;1i:0i:0i:0p62p62p62o51m61m61k60i70l;4k:3h91e90e90e90e:1f;2dB6cA5cC4dD5fG5eH6cH3_I2^L6eV?jbKrmW„ƒn„‡r[`L3;&28.28.17-17-17-06,06,06,17-17-17-06,06,/5+/5+/5+.3-.3-.3-.3-.3-.3-.3-.3--2,-2,,1+,1+,1+,1+-2,-2,,6.+5-*4,*4++5,.8-0:/2=/2=-5@06A05A-1=)1=)5A+9E/=O5AS9FY=I\@J]?J]=K^>L_?TgG\oQcvZbtZYkSK]G6G4$5"&+.$),"'*heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\lc\md]meZlfVlgSljSlnXorasvm…„Ÿ¤ª¸¿ÉÖßäîöùùÿÿûÿÿùýÿþÿÿÿÿÿþýûÿÿûÿÿúüüôóõêëíâãçÙßãÕÜãÓäéÒçìÕéíÖêìÔëëÓèæÏßÚÄÔθÔÍºÍÆ¶ËøÐÉÁÙÒÌàÛØëååòîïòòðùù÷ýýûýýûýýûÿÿýþþüüüúþþüþþüþþüþþüþþüþþüþþüþþüÿøüÿöùÿýýþÿý÷ÿýïÿøëÿõòÿøëúçÿÿíÿïÛ̧”£lX£ZG­VCªM;ÁA8ÃB<ÃD>¿D?·?>­;;£99œ:;–<<Ž>?…?=}@=wB7o>7n?7o@8n?7m>6i=4h<3h<3h<3i=4r73q62q62p62o51m61l71j81h70g80e90e:1d<2f>4f@5gA6]C4aG8cL:dM;cM8`K6]K3]M4]Q9`Y?miPss[€„mt|eFO:2>(39/28.28.28.17-17-17-06,17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,-2,,1++0*+0*+0*+0*,1+-2,,6.,6.*4,*4+*4++5*-7,.9+-8*0;+4?/5@/4?.3>-3?+4@,7F/;J3@P6DT:GWºH=ºH>ºG@·F@°C@¦=:97—<;‘=;ˆ>;€A5i=4j>5j>5k?6s63r73q62p62n72l71j81i81d8/d90c;1d>3d@4cA5cA5bB5VG4^OmmSsw^z‚jcmU2>(5C,4:039/39/39/28.28.28.17-17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1+,1++0**/)*/)+0*,1+,1++5-+5-*4,*4,+5,+5,,6+-7,,7)/:,2=/6A17B27B25@/4?.2?+5B.:G3>L5AO6ES:JX?M[BTbI]kTcqZ_lXUbPERA2>0#/#(..&,,$**heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVjdTjdVjcYkd\lc\md]lfZlfVomXmmUimVgkZembr{xŽ—œ¨±ºÊÓØäëñöþÿ÷üÿøüÿþÿÿÿÿÿúù÷ÿÿúýýõøøîðòåéëÝåéÚåéØåìÚæíÎèïÐéîÐæéÎèæÏèãÏáÚÈÙÏÃÚÍÄßÒÌìÞÛúììÿôöÿõùÿõûÿøþýýûÿÿýÿÿýþþüþþüÿÿýÿÿýýýûþþüþþüþþüþþüþþüþþüþþüþþüÿüúÿýúÿûøùýüøÿÿôÿÿðÿÿêþüðÿûùÿûÿÿôÿöæÿôßÿãÍ×­”¢sY°SA®Q?®N>°O?±OB¯J@¥C:š<4—<7‘>8‰?6ƒ@7{B7tD6qE8nG8s>:s>:s>:q>:q>:q>:q>:p?:sB=rA8l=7l=7m>8n?9r73r73q73n72m82j81i81f:1f;2d>3d@4bB5`C5]A3\@2[?1QI4[S>f^Gg_H`Y?ZS9ZS7\W:ZV;WW;knSrx^u}eUaI%37E.4:04:04:039/39/39/28.28.17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1++0*+0**/)*/)+0*+0*,1+)3+)3+*4,+5-+5,,6--7.-7,,6+.8-2=/6A39D69D67B46A1/<*2?-5B09F2:u@:s@9o>9o>9n72n72n93m;4l;4j;3g<3d<2c?3^>1dG9cG9T=-O8(M8'D/TR;PN7KI0MK2]Y>ieJeaDVU7XX<]`CosXz€fcmT=I1,:#1?(5;15;14:04:04:039/39/39/39/39/39/28.17-17-17-06,16016005/05//4./4./4./4.,1+,1+,1+,1+,1+,1++0*+0*.5.-4--4-,3,-4--4-.5-.5-+2*-4,08-5=29A6=E:?G7B25@03>-1<+2>*9E/BN8IU?O[EVbN]hWYdTLWIF5F4‰D4…D2}B0yB.s@-o?+v?:t=8u>9v?:t?9q<6r=7sA:q?8q?8q?8o>7o>7n=6n=6n=6l;4m<5m>6k?6j?6h@6eA5cA5dG9[A2^G7\I8N=+F7$G8%A4!IM4GK2DG,BE*MM1[[?abC`aBYY=dgJsw\sy_X`H8D,/;%6D-7=36<26<26<25;15;15;15;15;15;15;14:04:039/39/39/27127127116016016005/05/.3-.3--2,-2,,1+,1++0*+0**1**1*)0))0))0)*1*+2+,3,.5--4,.5-07/4;39@8?F>BIA:G69F56C13@.2?+5B.;I2?M6KXDR_KXeSVcRKWI8p;5q<6vA;sA:p>7r@9xG@n=6n=6n=6m>6l=5l=5l=5l=5g?5h@6gA6gC7eC7cC6`C5^D5aL;UB1ZI7`S@RG3C;&E=(GA+>G,BH.@F*<@%?B%LO2_`AijKaaEnqTvz_gmSHP84<%4=(=F18>48>48>48>47=37=37=36<28>48>47=37=37=36<26<26<25:449349349338238238227105/05//4..3--2,,1++0*+0*(/((/((/((/((/()0)*1*+2+070.5.+2++2+.5.5<5K:4-9/-3/-3/,2.gdUgdUheVheVheVheVifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWmlWimThpXht`hthm|wˆ—𥴻ÀÉÐÔÛáéðööûÿúþÿýþÿÿÿýÿþúþþöýýñúûí÷úéô÷âîóÝçìÕàèÐÜà¿×Ú»ÖÖ¼Ù×ÂÝ×ÉßÖÍåÛÙìàâøìðüïöÿõûÿùþÿúýÿûûÿûûÿýúþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüöÿþ÷ÿþúÿþþþÿÿüÿÿùÿÿøÿÿ÷þÿøÿÿøüÿùùÿýúÿÿøþÿøúÿõöÿóÿþìÿýéÿòßÿñÛÿðÚñÒ½³zyS3i?3i?3i?3f>2f>2f>2f>2aA4`C5`C5_C5^D5[D4ZE4VE3XI6OB/\T?oiSc^HMK4IG0LJ3;E*?H->G*48>47=37=37=39?58>48>48>48>48>48>48>47<67<67<66;56;56;55:45:438238216005//4.-2,,1+,1++0,+0,*/+*/++0,,1--2.-2.051.3/+0,+0,-2.2738=9'4.:0.5..5.-4-gdUgdUgdUheVheVifWifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWjnUiqYgs_drejyt…”—¡²¹¾ÇÎÓÚâèïõôùýùýÿýþÿÿÿýÿÿúÿÿøÿÿóþÿñûþë÷úåðõÞèîÔàéÎÛܽÕÕ¹ÑÑ·ÔѾÚÔÈáØÓêàßôéíþóùÿöþÿûÿÿýÿÿþÿÿþúÿþúþÿùþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüøÿÿøÿÿûÿÿþþþÿýþÿûüÿûúÿúúÿùùÿù÷ÿù÷ÿüùÿÿûþÿûûÿüùÿûùôîÿÿöÿþôÿýóÿüîÿ÷çùçÓéӾϴŸ¶š„•u`yVBlI5mH6rM;uP>mF7iB3gB2jE5nI9oJ:pK;oK;eA1eA1cB1cB1cB1cB1cB1bC1\G6\G6\G6ZG6YH6WH5TG4RG3PH3MH2fdM~~fprZVX@IM4HL3;E*A.;>+9?59?59?58>48>47=37=37=38>48>48>48>48>48>48>48>49>89>89>88=78=78=77<67<66;55:449338227105//4./4.-2.-2.,1-+0,+0,,1--2.-2.,1-,1-,1-,1-.21043376598:H7=L9@O<@O:8F91?2,9/.5.-4-,3,fcTfcTgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWioUiqYgs_bpcgxr‚”– ³¹ÁÊÑÕÜäéðöõúþùýÿýÿþÿÿýÿÿúÿÿöÿÿôÿÿñÿÿïúýèò÷àéïÕàéÎÙÚ»ÑѵÍË´Î˺ÖÏÅßÕÓìâãøíóÿöþÿùÿÿüÿÿýÿÿÿýþÿúýÿ÷þÿøþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüþþüýýÿýþÿýþÿýÿþþþüþÿùþÿ÷ÿÿõýýóýýõþýøþýùÿþüÿýÿÿýÿÿþÿþùÿÿüÿÿúþúöõýøôÿþöÿþñÿþïÿûéÿóàöåÓåÓ¿Ò»©¹ŸŸƒuŽrd|]I}^JrVAaE0W;&Y=(Z?*X=(`E0`E0_F0_F0`G1`G1^H1^H1[L9ZM:ZM:XM9XM9UM8RL6QL6NL5QQ9ikS|€glrXSY?DM2>G,:G+48>48>48>47=37=38>48>48>48>49?59?5:?9:?9:?9:?99>89>89>88=78=78=77<66;55:4493382382/40.3/-2.,1-+0,+0,+0,+0,+/.,0/-10.21/32/32/32.210A.5F3;M7>P:=O7:L47I/6H.3E-6H0:L6MJ9EB1;A7;A7;A7;A7:@6:@6:@69?58>48>48>49?59?5:@6:@6:@6;@:;@:;@::?9:?99>89>89>8:?9:?99>89>88=78=77<67<6495273162/40-2.,1-+0,+/.,0/,0/-10.21.21.23-12,01):'/@-6H2;M5=O7?I.9F*?L0=J.AN2DN3HQ4LR6IN0JM0ZY;miLhdIc]C_YA_ZD`[GZUBQN=LI8=C9=C9=C989>89>8;@:;@:;@:;@::?9:?9:?9:?99>:8=95:6384162/40.3/.21.21.21-10-12,01,01-12-12$5"*<&3E/9K3XW9UT6SR3KE/JD.FA-D?,A>/@>1??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B79A6:B7;C8F;7B:7C97A66A16?.4<-39-270.5./51-7/-9+-<%.B3J7O7Z 8Y$8W+:U2:R8;P==O?>O=:L6@R8EX:EZ;DY:>U93J0(>'.5-,3++2*ZgM[hN\hP_iQakSckTglXhkXghVihVifWifWkeWmeXmeZnf[khWkhYkg[kg^jf]jf]hfZgeVgjWglVfoZerajwnzЉ𫲷ÉÓÑØÞáéìò÷úøþþùþúúÿøûþóúüï÷úé÷øæõôâíìØéæÓåâÏÜ×ÄÑ̹˾­Á´¤º¬Ÿ¼¯§Á¶²ÌÀÀÛÐÖèÞæûóþý÷ÿþûÿÿþÿþýÿüýÿüýÿüýÿþþþþþþþþþþþþþþþþþþÿþüÿþüÿþüÿýúÿýúÿüùÿüùÿýùÿýùÿþúÿþýÿýüÿüûÿýþÿþÿÿþÿÿýþýûüÿþÿÿýýÿüùÿøóøíçòåÝöèßÿïçÿûÿÿýÿÿýþÿÿýÿÿûýÿüýÿþüýÿýþÿþýÿÿýÿÿýþÿý÷ÿþîÿÿæÿÿâ÷÷ßýûââàÇ‹‡lRM0TM0QK+SJ+WN/UO/UN1TO1SO2QP4QP4PP6QM2PO3PN5PP6MO7KO6HM6EM5HQ6EN3BK.AH)BI(GM+JP,KQ-NR/PT1VZ9^aBaaE[[?VVVV>XV=YW>XW;XW9WV8VU7QK5OI3LG3ID1DA2B@3??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B7:B7:B7;C8F;76<83=51=/3B+9M*BY-Ia1Nq7Mn9Ji=Fa>AY?:L<:K9=O9DV5:@69A67B47B47C57D3:B7:B79A69A69A69A6:B7:B7:B7:B7:B7:B7;C8F;>F;>IA>J@?I>>I9?H7>F7>D8=B;>E>;A=6@85A39H1BV3Pg;ZrB]€F\}HVuIMhEBZ@9N;5G74E3XR6F;?G<>H=>I9?H7>F7>D8=B;=D=;A=6@85A39H1DX5Ri=]uEY|BXyDRqEIdA,6H2@R8L_AQfGShIMdH@W=4J329107/-4,YgMZhN\hP^jRblTemVgoZjo[lo\lm[mk\mj[nhZnhZoi]ph]liXkhYjfZie\ie\ie\ig[igXfiVchRajUerao|s{‹ŠŽŸ¦Ÿ±»ÂËÒÕÜäéðöòúüôúøñöðíðçéëÞáãÕÚÛËÒÑ¿ÌɶÉıþ«¾¹¦»´¢Ë¾®ÓŸÝÏÄæÙÑíâà÷ëíÿôúÿøÿÿ÷ÿÿúÿÿüÿþýÿýüÿûüþüþýþÿÿþþþþþþþþþþþþþþþþþþÿþüÿþüþýûÿüùÿýúÿýúÿýúÿû÷ÿúöþùõÿýüÿûúýùøüúûþüýÿýþÿþÿÿýþÿüýÿüüÿüùÿøó÷ìæòåÝøêáÿóëÿûÿÿýÿÿýþÿÿûÿÿûýÿúýÿüüýÿüýÿþýÿÿþÿÿþýÿþõÿüìÿüãÿúÝþýèÿÿëåãÌŒˆoRL2UN2TM0WN1VM.UO/WP3VQ3UQ4QP2ON2MM1PL1NM1NL3MM3LN6LP7KP9JR:LU:IR7JS6QX9SZ9U[9]c?gmI€”a’¦sŸ±š«’¡xˆ”pr|Z\bFLP7KM7LK6KI4NI5PK7TM:VP:WQ;VP:SN:QL9LI:IG:EE9CE:=>6F;?G<=G<=H8>G6=E6=C7=B;:A:9?;5?75A39H1BV3Ne9Wo?Svoutput_width / + (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size); + MCU_rows = srcinfo->output_height / + (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size); + + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + comp_width = MCU_cols * compptr->h_samp_factor; + comp_height = MCU_rows * compptr->v_samp_factor; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + y_crop_blocks = y_crop_offset * compptr->v_samp_factor; + for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks; + dst_blk_y += compptr->v_samp_factor) { + dst_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + if (dstinfo->jpeg_height > srcinfo->output_height) { + if (dst_blk_y < y_crop_blocks || + dst_blk_y >= comp_height + y_crop_blocks) { + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + FMEMZERO(dst_buffer[offset_y], + compptr->width_in_blocks * SIZEOF(JBLOCK)); + } + continue; + } + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_y - y_crop_blocks, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } else { + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_y + y_crop_blocks, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + if (dstinfo->jpeg_width > srcinfo->output_width) { + if (x_crop_blocks > 0) { + FMEMZERO(dst_buffer[offset_y], + x_crop_blocks * SIZEOF(JBLOCK)); + } + jcopy_block_row(src_buffer[offset_y], + dst_buffer[offset_y] + x_crop_blocks, + comp_width); + if (compptr->width_in_blocks > comp_width + x_crop_blocks) { + FMEMZERO(dst_buffer[offset_y] + + comp_width + x_crop_blocks, + (compptr->width_in_blocks - + comp_width - x_crop_blocks) * SIZEOF(JBLOCK)); + } + } else { + jcopy_block_row(src_buffer[offset_y] + x_crop_blocks, + dst_buffer[offset_y], + compptr->width_in_blocks); + } + } + } + } +} + + +LOCAL(void) +do_wipe (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, + jvirt_barray_ptr *src_coef_arrays, + JDIMENSION drop_width, JDIMENSION drop_height) +/* Wipe - drop content of specified area, fill with zero (neutral gray) */ +{ + JDIMENSION comp_width, comp_height; + JDIMENSION blk_y, x_wipe_blocks, y_wipe_blocks; + int ci, offset_y; + JBLOCKARRAY buffer; + jpeg_component_info *compptr; + + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + comp_width = drop_width * compptr->h_samp_factor; + comp_height = drop_height * compptr->v_samp_factor; + x_wipe_blocks = x_crop_offset * compptr->h_samp_factor; + y_wipe_blocks = y_crop_offset * compptr->v_samp_factor; + for (blk_y = 0; blk_y < comp_height; blk_y += compptr->v_samp_factor) { + buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y + y_wipe_blocks, + (JDIMENSION) compptr->v_samp_factor, TRUE); + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + FMEMZERO(buffer[offset_y] + x_wipe_blocks, + comp_width * SIZEOF(JBLOCK)); + } + } + } +} + + LOCAL(void) do_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, JDIMENSION x_crop_offset, @@ -888,7 +998,8 @@ jtransform_request_workspace (j_decompress_ptr srcinfo, /* Determine number of components in output image */ if (info->force_grayscale && - srcinfo->jpeg_color_space == JCS_YCbCr && + (srcinfo->jpeg_color_space == JCS_YCbCr || + srcinfo->jpeg_color_space == JCS_BG_YCC) && srcinfo->num_components == 3) /* We'll only process the first component */ info->num_components = 1; @@ -965,39 +1076,81 @@ jtransform_request_workspace (j_decompress_ptr srcinfo, info->crop_xoffset = 0; /* default to +0 */ if (info->crop_yoffset_set == JCROP_UNSET) info->crop_yoffset = 0; /* default to +0 */ - if (info->crop_xoffset >= info->output_width || - info->crop_yoffset >= info->output_height) - ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); - if (info->crop_width_set == JCROP_UNSET) + if (info->crop_width_set == JCROP_UNSET) { + if (info->crop_xoffset >= info->output_width) + ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); info->crop_width = info->output_width - info->crop_xoffset; - if (info->crop_height_set == JCROP_UNSET) + } else { + /* Check for crop extension */ + if (info->crop_width > info->output_width) { + /* Crop extension does not work when transforming! */ + if (info->transform != JXFORM_NONE || + info->crop_xoffset >= info->crop_width || + info->crop_xoffset > info->crop_width - info->output_width) + ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); + } else { + if (info->crop_xoffset >= info->output_width || + info->crop_width <= 0 || + info->crop_xoffset > info->output_width - info->crop_width) + ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); + } + } + if (info->crop_height_set == JCROP_UNSET) { + if (info->crop_yoffset >= info->output_height) + ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); info->crop_height = info->output_height - info->crop_yoffset; - /* Ensure parameters are valid */ - if (info->crop_width <= 0 || info->crop_width > info->output_width || - info->crop_height <= 0 || info->crop_height > info->output_height || - info->crop_xoffset > info->output_width - info->crop_width || - info->crop_yoffset > info->output_height - info->crop_height) - ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); + } else { + /* Check for crop extension */ + if (info->crop_height > info->output_height) { + /* Crop extension does not work when transforming! */ + if (info->transform != JXFORM_NONE || + info->crop_yoffset >= info->crop_height || + info->crop_yoffset > info->crop_height - info->output_height) + ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); + } else { + if (info->crop_yoffset >= info->output_height || + info->crop_height <= 0 || + info->crop_yoffset > info->output_height - info->crop_height) + ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); + } + } /* Convert negative crop offsets into regular offsets */ - if (info->crop_xoffset_set == JCROP_NEG) - xoffset = info->output_width - info->crop_width - info->crop_xoffset; - else + if (info->crop_xoffset_set != JCROP_NEG) xoffset = info->crop_xoffset; - if (info->crop_yoffset_set == JCROP_NEG) - yoffset = info->output_height - info->crop_height - info->crop_yoffset; + else if (info->crop_width > info->output_width) /* crop extension */ + xoffset = info->crop_width - info->output_width - info->crop_xoffset; else + xoffset = info->output_width - info->crop_width - info->crop_xoffset; + if (info->crop_yoffset_set != JCROP_NEG) yoffset = info->crop_yoffset; + else if (info->crop_height > info->output_height) /* crop extension */ + yoffset = info->crop_height - info->output_height - info->crop_yoffset; + else + yoffset = info->output_height - info->crop_height - info->crop_yoffset; /* Now adjust so that upper left corner falls at an iMCU boundary */ - if (info->crop_width_set == JCROP_FORCE) - info->output_width = info->crop_width; - else - info->output_width = - info->crop_width + (xoffset % info->iMCU_sample_width); - if (info->crop_height_set == JCROP_FORCE) - info->output_height = info->crop_height; - else - info->output_height = - info->crop_height + (yoffset % info->iMCU_sample_height); + if (info->transform == JXFORM_WIPE) { + /* Ensure the effective wipe region will cover the requested */ + info->drop_width = (JDIMENSION) jdiv_round_up + ((long) (info->crop_width + (xoffset % info->iMCU_sample_width)), + (long) info->iMCU_sample_width); + info->drop_height = (JDIMENSION) jdiv_round_up + ((long) (info->crop_height + (yoffset % info->iMCU_sample_height)), + (long) info->iMCU_sample_height); + } else { + /* Ensure the effective crop region will cover the requested */ + if (info->crop_width_set == JCROP_FORCE || + info->crop_width > info->output_width) + info->output_width = info->crop_width; + else + info->output_width = + info->crop_width + (xoffset % info->iMCU_sample_width); + if (info->crop_height_set == JCROP_FORCE || + info->crop_height > info->output_height) + info->output_height = info->crop_height; + else + info->output_height = + info->crop_height + (yoffset % info->iMCU_sample_height); + } /* Save x/y offsets measured in iMCUs */ info->x_crop_offset = xoffset / info->iMCU_sample_width; info->y_crop_offset = yoffset / info->iMCU_sample_height; @@ -1013,7 +1166,9 @@ jtransform_request_workspace (j_decompress_ptr srcinfo, transpose_it = FALSE; switch (info->transform) { case JXFORM_NONE: - if (info->x_crop_offset != 0 || info->y_crop_offset != 0) + if (info->x_crop_offset != 0 || info->y_crop_offset != 0 || + info->output_width > srcinfo->output_width || + info->output_height > srcinfo->output_height) need_workspace = TRUE; /* No workspace needed if neither cropping nor transforming */ break; @@ -1067,6 +1222,8 @@ jtransform_request_workspace (j_decompress_ptr srcinfo, need_workspace = TRUE; transpose_it = TRUE; break; + case JXFORM_WIPE: + break; } /* Allocate workspace if needed. @@ -1327,12 +1484,13 @@ jtransform_adjust_parameters (j_decompress_ptr srcinfo, { /* If force-to-grayscale is requested, adjust destination parameters */ if (info->force_grayscale) { - /* First, ensure we have YCbCr or grayscale data, and that the source's + /* First, ensure we have YCC or grayscale data, and that the source's * Y channel is full resolution. (No reasonable person would make Y * be less than full resolution, so actually coping with that case * isn't worth extra code space. But we check it to avoid crashing.) */ - if (((dstinfo->jpeg_color_space == JCS_YCbCr && + if ((((dstinfo->jpeg_color_space == JCS_YCbCr || + dstinfo->jpeg_color_space == JCS_BG_YCC) && dstinfo->num_components == 3) || (dstinfo->jpeg_color_space == JCS_GRAYSCALE && dstinfo->num_components == 1)) && @@ -1427,7 +1585,11 @@ jtransform_execute_transform (j_decompress_ptr srcinfo, */ switch (info->transform) { case JXFORM_NONE: - if (info->x_crop_offset != 0 || info->y_crop_offset != 0) + if (info->output_width > srcinfo->output_width || + info->output_height > srcinfo->output_height) + do_crop_ext(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, dst_coef_arrays); + else if (info->x_crop_offset != 0 || info->y_crop_offset != 0) do_crop(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, src_coef_arrays, dst_coef_arrays); break; @@ -1463,6 +1625,10 @@ jtransform_execute_transform (j_decompress_ptr srcinfo, do_rot_270(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, src_coef_arrays, dst_coef_arrays); break; + case JXFORM_WIPE: + do_wipe(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, info->drop_width, info->drop_height); + break; } } diff --git a/transupp.h b/transupp.h index 9aa0af38..eee69314 100644 --- a/transupp.h +++ b/transupp.h @@ -1,7 +1,7 @@ /* * transupp.h * - * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding. + * Copyright (C) 1997-2013, Thomas G. Lane, Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -51,14 +51,17 @@ * * We also offer a lossless-crop option, which discards data outside a given * image region but losslessly preserves what is inside. Like the rotate and - * flip transforms, lossless crop is restricted by the JPEG format: the upper - * left corner of the selected region must fall on an iMCU boundary. If this - * does not hold for the given crop parameters, we silently move the upper left - * corner up and/or left to make it so, simultaneously increasing the region - * dimensions to keep the lower right crop corner unchanged. (Thus, the + * flip transforms, lossless crop is restricted by the current JPEG format: the + * upper left corner of the selected region must fall on an iMCU boundary. If + * this does not hold for the given crop parameters, we silently move the upper + * left corner up and/or left to make it so, simultaneously increasing the + * region dimensions to keep the lower right crop corner unchanged. (Thus, the * output image covers at least the requested region, but may cover more.) * The adjustment of the region dimensions may be optionally disabled. * + * A complementary lossless-wipe option is provided to discard (gray out) data + * inside a given image region while losslessly preserving what is outside. + * * We also provide a lossless-resize option, which is kind of a lossless-crop * operation in the DCT coefficient block domain - it discards higher-order * coefficients and losslessly preserves lower-order coefficients of a @@ -102,7 +105,8 @@ typedef enum { JXFORM_TRANSVERSE, /* transpose across UR-to-LL axis */ JXFORM_ROT_90, /* 90-degree clockwise rotation */ JXFORM_ROT_180, /* 180-degree rotation */ - JXFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */ + JXFORM_ROT_270, /* 270-degree clockwise (or 90 ccw) */ + JXFORM_WIPE /* wipe */ } JXFORM_CODE; /* @@ -130,7 +134,7 @@ typedef struct { boolean perfect; /* if TRUE, fail if partial MCUs are requested */ boolean trim; /* if TRUE, trim partial MCUs as needed */ boolean force_grayscale; /* if TRUE, convert color image to grayscale */ - boolean crop; /* if TRUE, crop source image */ + boolean crop; /* if TRUE, crop or wipe source image */ /* Crop parameters: application need not set these unless crop is TRUE. * These can be filled in by jtransform_parse_crop_spec(). @@ -151,6 +155,8 @@ typedef struct { JDIMENSION output_height; JDIMENSION x_crop_offset; /* destination crop offsets measured in iMCUs */ JDIMENSION y_crop_offset; + JDIMENSION drop_width; /* drop/wipe dimensions measured in iMCUs */ + JDIMENSION drop_height; int iMCU_sample_width; /* destination iMCU size */ int iMCU_sample_height; } jpeg_transform_info; diff --git a/usage.txt b/usage.txt index 88158d63..75140e59 100644 --- a/usage.txt +++ b/usage.txt @@ -158,10 +158,10 @@ file size is about the same --- often a little smaller. Switches for advanced users: - -arithmetic Use arithmetic coding. CAUTION: arithmetic coded JPEG - is not yet widely implemented, so many decoders will - be unable to view an arithmetic coded JPEG file at - all. + -arithmetic Use arithmetic coding. + CAUTION: arithmetic coded JPEG is not yet widely + implemented, so many decoders will be unable to + view an arithmetic coded JPEG file at all. -block N Set DCT block size. All N from 1 to 16 are possible. Default is 8 (baseline format). @@ -188,6 +188,25 @@ Switches for advanced users: so many decoders will be unable to view a reversible color transformed JPEG file at all. + -bgycc Create big gamut YCC JPEG file. + In this type of encoding the color difference + components are quantized further by a factor of 2 + compared to the normal Cb/Cr values, thus creating + space to allow larger color values with higher + saturation than the normal gamut limits to be encoded. + In order to compensate for the loss of color fidelity + compared to a normal YCC encoded file, the color + quantization tables can be adjusted accordingly. + For example, cjpeg -bgycc -quality 80,90 will give + similar results as cjpeg -quality 80. + CAUTION: For correct decompression a decoder with big + gamut YCC support (JFIF version 2) is required. + An old decoder may or may not display a big gamut YCC + encoded JPEG file, depending on JFIF version check + and corresponding warning/error configuration. + In case of a granted decompression the old decoder + will display the image with half saturated colors. + -dct int Use integer DCT method (default). -dct fast Use fast integer DCT (less accurate). -dct float Use floating-point DCT method. @@ -387,7 +406,8 @@ quality settings to make very small JPEG files; the percentage improvement is often a lot more than it is on larger files. (At present, -optimize mode is always selected when generating progressive JPEG files.) -GIF input files are no longer supported, to avoid the Unisys LZW patent. +GIF input files are no longer supported, to avoid the Unisys LZW patent +(now expired). (Conversion of GIF files to JPEG is usually a bad idea anyway.) @@ -415,8 +435,9 @@ it may run out of memory even with -maxmemory 0. In that case you can still decompress, with some loss of image quality, by specifying -onepass for one-pass quantization. -To avoid the Unisys LZW patent, djpeg produces uncompressed GIF files. These -are larger than they should be, but are readable by standard GIF decoders. +To avoid the Unisys LZW patent (now expired), djpeg produces uncompressed GIF +files. These are larger than they should be, but are readable by standard GIF +decoders. HINTS FOR BOTH PROGRAMS @@ -533,14 +554,20 @@ image region but losslessly preserves what is inside. Like the rotate and flip transforms, lossless crop is restricted by the current JPEG format: the upper left corner of the selected region must fall on an iMCU boundary. If this does not hold for the given crop parameters, we silently move the upper -left corner up and/or left to make it so, simultaneously increasing the region -dimensions to keep the lower right crop corner unchanged. (Thus, the output -image covers at least the requested region, but may cover more.) +left corner up and/or left to make it so, simultaneously increasing the +region dimensions to keep the lower right crop corner unchanged. (Thus, the +output image covers at least the requested region, but may cover more.) +The adjustment of the region dimensions may be optionally disabled. The image can be losslessly cropped by giving the switch: -crop WxH+X+Y Crop to a rectangular subarea of width W, height H starting at point X,Y. +A complementary lossless-wipe option is provided to discard (gray out) data +inside a given image region while losslessly preserving what is outside: + -wipe WxH+X+Y Wipe (gray out) a rectangular subarea of + width W, height H starting at point X,Y. + Other not-strictly-lossless transformation switches are: -grayscale Force grayscale output. From a560e4b4239b585e0f9dfc4d7e5d7b2273f43c11 Mon Sep 17 00:00:00 2001 From: Guido Vollbeding Date: Sun, 17 Jan 2016 00:00:00 +0000 Subject: [PATCH 114/140] The Independent JPEG Group's JPEG software v9b --- Makefile.am | 22 +- Makefile.in | 48 +- README | 34 +- aclocal.m4 | 2783 +++++++++++++----------- ar-lib | 2 +- change.log | 23 + cjpeg.1 | 4 +- compile | 2 +- config.guess | 173 +- config.sub | 36 +- configure | 2121 +++++++++++-------- configure.ac | 2 +- depcomp | 2 +- djpeg.1 | 23 +- djpeg.c | 7 +- install-sh | 354 ++-- install.txt | 9 +- jconfig.vc | 3 +- jdarith.c | 4 +- jdatasrc.c | 6 +- jdcolor.c | 27 +- jdct.h | 32 +- jdmaster.c | 62 +- jdmerge.c | 106 +- jdsample.c | 29 +- jerror.c | 10 +- jfdctflt.c | 6 +- jfdctfst.c | 6 +- jfdctint.c | 95 +- jidctflt.c | 51 +- jidctfst.c | 89 +- jidctint.c | 278 ++- jpeglib.h | 6 +- jpegtran.1 | 24 +- jversion.h | 6 +- ltmain.sh | 5580 +++++++++++++++++++++++++++++++------------------ makefile.ansi | 22 +- makefile.b32 | 243 +++ makefile.bcc | 22 +- makefile.dj | 22 +- makefile.manx | 22 +- makefile.mc6 | 22 +- makefile.mms | 22 +- makefile.sas | 22 +- makefile.unix | 22 +- makefile.vc | 22 +- makefile.wat | 22 +- missing | 2 +- rdswitch.c | 6 +- usage.txt | 58 +- wrgif.c | 7 +- wrjpgcom.c | 16 + wrtarga.c | 5 +- 53 files changed, 7614 insertions(+), 5008 deletions(-) create mode 100644 makefile.b32 diff --git a/Makefile.am b/Makefile.am index 86895a1e..d7e0bd22 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,17 +33,17 @@ DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \ structure.txt coderules.txt filelist.txt change.log # Makefiles for various systems -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt # Configuration files CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ diff --git a/Makefile.in b/Makefile.in index 5654c785..76286768 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -23,7 +23,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -91,14 +101,12 @@ target_triplet = @target@ bin_PROGRAMS = cjpeg$(EXEEXT) djpeg$(EXEEXT) jpegtran$(EXEEXT) \ rdjpgcom$(EXEEXT) wrjpgcom$(EXEEXT) subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/jconfig.cfg depcomp $(include_HEADERS) \ - $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(include_HEADERS) $(noinst_HEADERS) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -284,6 +292,7 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -397,17 +406,17 @@ DOCS = README install.txt usage.txt wizard.txt example.c libjpeg.txt \ # Makefiles for various systems -MKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt # Configuration files @@ -491,7 +500,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -997,6 +1005,8 @@ uninstall-man: uninstall-man1 uninstall-libLTLIBRARIES uninstall-local uninstall-man \ uninstall-man1 +.PRECIOUS: Makefile + # Install jconfig.h install-data-local: diff --git a/README b/README index 014ad301..4c8e82e9 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ The Independent JPEG Group's JPEG software ========================================== -README for release 9a of 19-Jan-2014 +README for release 9b of 17-Jan-2016 ==================================== This distribution contains the ninth public release of the Independent JPEG @@ -60,7 +60,7 @@ OVERVIEW This package contains C software to implement JPEG image encoding, decoding, and transcoding. JPEG (pronounced "jay-peg") is a standardized compression -method for full-color and gray-scale images. +method for full-color and grayscale images. This software implements JPEG baseline, extended-sequential, and progressive compression processes. Provision is made for supporting all variants of these @@ -115,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or fitness for a particular purpose. This software is provided "AS IS", and you, its user, assume the entire risk as to its quality and accuracy. -This software is copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding. +This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. All Rights Reserved except as specified below. Permission is hereby granted to use, copy, modify, and distribute this @@ -159,11 +159,6 @@ to produce "uncompressed GIFs". This technique does not use the LZW algorithm; the resulting GIF files are larger than usual, but are readable by all standard GIF decoders. -We are required to state that - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." - REFERENCES ========== @@ -176,8 +171,8 @@ The best short technical introduction to the JPEG compression algorithm is Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. (Adjacent articles in that issue discuss MPEG motion picture compression, applications of JPEG, and related topics.) If you don't have the CACM issue -handy, a PostScript file containing a revised version of Wallace's article is -available at http://www.ijg.org/files/wallace.ps.gz. The file (actually +handy, a PDF file containing a revised version of Wallace's article is +available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually a preprint for an article that appeared in IEEE Trans. Consumer Electronics) omits the sample images that appeared in CACM, but it includes corrections and some added material. Note: the Wallace article is copyright ACM and IEEE, @@ -225,14 +220,13 @@ WG1 N 6080 with title "JPEG 9 Lossless Coding", June/July 2012, Paris, France. The JPEG standard does not specify all details of an interchangeable file -format. For the omitted details we follow the "JFIF" conventions, revision -1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report -and thus received a formal publication status. It is available as a free -download in PDF format from -http://www.ecma-international.org/publications/techreports/E-TR-098.htm. -A PostScript version of the JFIF document is available at -http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at -http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures. +format. For the omitted details we follow the "JFIF" conventions, version 2. +JFIF version 1 has been adopted as Recommendation ITU-T T.871 (05/2011) : +Information technology - Digital compression and coding of continuous-tone +still images: JPEG File Interchange Format (JFIF). It is available as a +free download in PDF file format from http://www.itu.int/rec/T-REC-T.871. +A PDF file of the older JFIF document is available at +http://www.w3.org/Graphics/JPEG/jfif3.pdf. The TIFF 6.0 file format specification can be obtained by FTP from ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme @@ -252,8 +246,8 @@ ARCHIVE LOCATIONS The "official" archive site for this software is www.ijg.org. The most recent released version can always be found there in directory "files". This particular version will be archived as -http://www.ijg.org/files/jpegsrc.v9a.tar.gz, and in Windows-compatible -"zip" archive format as http://www.ijg.org/files/jpegsr9a.zip. +http://www.ijg.org/files/jpegsrc.v9b.tar.gz, and in Windows-compatible +"zip" archive format as http://www.ijg.org/files/jpegsr9b.zip. The JPEG FAQ (Frequently Asked Questions) article is a source of some general information about JPEG. diff --git a/aclocal.m4 b/aclocal.m4 index 9e947ab4..2329dd17 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -22,9 +22,7 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -32,36 +30,30 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# This file is part of GNU Libtool. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . ]) -# serial 57 LT_INIT +# serial 58 LT_INIT # LT_PREREQ(VERSION) @@ -89,7 +81,7 @@ esac # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -113,7 +105,7 @@ dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -133,26 +125,43 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -199,15 +208,16 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -220,7 +230,7 @@ aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -231,14 +241,14 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -291,21 +301,21 @@ no_glob_subst='s/\*/\\\*/g' # _LT_PROG_LTMAIN # --------------- -# Note that this code is called both from `configure', and `config.status' +# Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' +# in macros and then make a single call at the end using the 'libtool' # label. @@ -437,8 +447,8 @@ m4_define([_lt_decl_all_varnames], # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) @@ -462,7 +472,7 @@ m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl +available_tags='_LT_TAGS'dnl ]) @@ -490,7 +500,7 @@ m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], @@ -516,8 +526,8 @@ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], @@ -563,7 +573,7 @@ for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -576,7 +586,7 @@ for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -592,7 +602,7 @@ _LT_OUTPUT_LIBTOOL_INIT # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this +# '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). @@ -614,7 +624,7 @@ AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl +test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT @@ -637,7 +647,7 @@ exec AS_MESSAGE_LOG_FD>>config.log } >&AS_MESSAGE_LOG_FD lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, +'$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. @@ -659,7 +669,7 @@ Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." -while test $[#] != 0 +while test 0 != $[#] do case $[1] in --version | --v* | -V ) @@ -672,10 +682,10 @@ do lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; +Try '$[0] --help' for more information.]) ;; esac shift done @@ -701,7 +711,7 @@ chmod +x "$CONFIG_LT" # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: -test "$silent" = yes && +test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false @@ -721,32 +731,47 @@ m4_defun([_LT_CONFIG], _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. -# + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + _LT_COPYING _LT_LIBTOOL_TAGS +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in @@ -755,7 +780,7 @@ _LT_EOF # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -772,8 +797,6 @@ _LT_EOF sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) - _LT_PROG_REPLACE_SHELLFNS - mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -791,7 +814,6 @@ _LT_EOF [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS @@ -988,7 +1010,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then + if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -1006,7 +1028,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1024,7 +1046,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], @@ -1046,7 +1068,7 @@ _LT_EOF _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1056,32 +1078,32 @@ _LT_EOF ]) case $host_os in rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]][[,.]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1101,29 +1123,29 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1143,7 +1165,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then +if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], @@ -1161,7 +1183,7 @@ else _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) @@ -1181,8 +1203,8 @@ m4_define([_LT_SHELL_INIT], # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO @@ -1210,10 +1232,10 @@ fi # Invoke $ECHO with all args, space-separated. func_echo_all () { - $ECHO "$*" + $ECHO "$*" } -case "$ECHO" in +case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; @@ -1239,16 +1261,17 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -1258,14 +1281,14 @@ case ${with_sysroot} in #( no|'') ;; #( *) - AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) +[dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- @@ -1273,31 +1296,33 @@ m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -1326,9 +1351,46 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1338,9 +1400,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1359,7 +1431,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1377,19 +1452,20 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in @@ -1397,7 +1473,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -1406,7 +1482,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" + LD=${LD-ld}_sol2 fi ;; *) @@ -1422,7 +1498,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ;; esac -need_locks="$enable_libtool_lock" +need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK @@ -1441,11 +1517,11 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then + if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi @@ -1453,7 +1529,7 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], ]) ]) -if test "x$lt_cv_ar_at_file" = xno; then +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -1484,7 +1560,7 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -1520,7 +1596,7 @@ AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -1547,7 +1623,7 @@ AC_CACHE_CHECK([$1], [$2], $RM conftest* ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) @@ -1569,7 +1645,7 @@ AC_DEFUN([_LT_LINKER_OPTION], m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -1588,10 +1664,10 @@ AC_CACHE_CHECK([$1], [$2], fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS ]) -if test x"[$]$2" = xyes; then +if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) @@ -1612,7 +1688,7 @@ AC_DEFUN([LT_CMD_MAX_LEN], AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -1652,7 +1728,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1702,22 +1778,23 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -1733,7 +1810,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ;; esac ]) -if test -n $lt_cv_sys_max_cmd_len ; then +if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) @@ -1761,7 +1838,7 @@ m4_defun([_LT_HEADER_DLFCN], # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : +if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -1808,9 +1885,9 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -1836,7 +1913,7 @@ int main () return status; }] _LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in @@ -1857,7 +1934,7 @@ rm -fr conftest* # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then +if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -1867,44 +1944,52 @@ else case $host_os in beos*) - lt_cv_dlopen="load_add_on" + lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], + [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], + [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) @@ -1913,21 +1998,21 @@ else ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], @@ -1937,7 +2022,7 @@ else lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) - if test "x$lt_cv_dlopen_self" = xyes; then + if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl @@ -1947,9 +2032,9 @@ else ]) fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -2041,8 +2126,8 @@ m4_defun([_LT_COMPILER_FILE_LOCKS], m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes @@ -2052,8 +2137,8 @@ if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else @@ -2080,8 +2165,8 @@ objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR @@ -2093,15 +2178,15 @@ m4_defun([_LT_LINKER_HARDCODE_LIBPATH], _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else @@ -2115,12 +2200,12 @@ else fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -2144,7 +2229,7 @@ else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) @@ -2162,6 +2247,47 @@ _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics @@ -2172,17 +2298,18 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -2198,28 +2325,35 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -2233,7 +2367,7 @@ BEGIN {RS=" "; FS="/|\n";} { # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -2242,7 +2376,7 @@ fi]) library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -2259,14 +2393,17 @@ hardcode_into_libs=no # flags to be left without arguments need_version=unknown +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) @@ -2274,41 +2411,91 @@ aix[[4-9]]*) need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -2318,18 +2505,18 @@ amigaos*) powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -2337,8 +2524,8 @@ beos*) bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -2350,7 +2537,7 @@ bsdi[[45]]*) cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -2359,8 +2546,8 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -2376,17 +2563,17 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' @@ -2395,8 +2582,8 @@ m4_if([$1], [],[ *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -2423,7 +2610,7 @@ m4_if([$1], [],[ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -2436,8 +2623,8 @@ m4_if([$1], [],[ esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -2450,7 +2637,7 @@ m4_if([$1], [],[ *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -2463,8 +2650,8 @@ darwin* | rhapsody*) version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -2477,8 +2664,8 @@ dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2496,12 +2683,13 @@ freebsd* | dragonfly*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -2526,26 +2714,15 @@ freebsd* | dragonfly*) esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2563,14 +2740,15 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -2578,8 +2756,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -2588,8 +2766,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -2602,8 +2780,8 @@ interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2614,7 +2792,7 @@ irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -2622,8 +2800,8 @@ irix5* | irix6* | nonstopux*) esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -2642,8 +2820,8 @@ irix5* | irix6* | nonstopux*) esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; @@ -2652,13 +2830,33 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2683,7 +2881,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) # before this can be enabled. hardcode_into_libs=yes - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" @@ -2703,12 +2906,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -2718,7 +2921,7 @@ netbsd*) newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -2727,58 +2930,68 @@ newsos6) version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -2789,8 +3002,8 @@ solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -2800,11 +3013,11 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -2812,8 +3025,8 @@ sunos4*) sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -2834,24 +3047,24 @@ sysv4 | sysv4.3*) ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -2869,7 +3082,7 @@ tpf*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -2877,8 +3090,8 @@ tpf*) uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -2887,20 +3100,30 @@ uts4*) ;; esac AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) @@ -2933,39 +3156,41 @@ _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- -# find a file program which can recognize shared library +# find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -2988,11 +3213,11 @@ _LT_EOF break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else @@ -3010,7 +3235,7 @@ dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- -# find a file program which can recognize a shared library +# find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -3037,16 +3262,16 @@ m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], + [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -3060,7 +3285,7 @@ if test "$GCC" = yes; then while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD="$ac_prog" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -3071,37 +3296,37 @@ if test "$GCC" = yes; then with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies @@ -3187,13 +3449,13 @@ lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. +# 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) @@ -3220,8 +3482,7 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -3257,10 +3518,6 @@ freebsd* | dragonfly*) fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3299,7 +3556,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -3321,8 +3578,8 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' @@ -3375,6 +3632,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) @@ -3415,33 +3675,38 @@ AC_DEFUN([LT_PATH_NM], AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -3452,21 +3717,21 @@ else esac fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -3474,8 +3739,8 @@ else esac fi AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -3521,8 +3786,8 @@ lt_cv_sharedlib_from_linklib_cmd, case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -3534,7 +3799,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) @@ -3561,13 +3826,28 @@ AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + # LT_LIB_M # -------- # check for math library @@ -3579,11 +3859,11 @@ case $host in # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) - AC_CHECK_LIB(m, cos, LIBM="-lm") + AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) @@ -3602,7 +3882,7 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; @@ -3654,7 +3934,7 @@ cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; @@ -3687,14 +3967,44 @@ case `$NM -V 2>&1` in symcode='[[ABCDGIRSTW]]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3712,21 +4022,24 @@ for ac_symprfx in "" "_"; do # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -3766,11 +4079,11 @@ _LT_EOF if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else @@ -3796,7 +4109,7 @@ lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -3816,9 +4129,9 @@ _LT_EOF mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -3839,7 +4152,7 @@ _LT_EOF rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -3866,12 +4179,16 @@ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3887,17 +4204,18 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -3908,8 +4226,8 @@ m4_if([$1], [CXX], [ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -3925,6 +4243,11 @@ m4_if([$1], [CXX], [ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -3974,7 +4297,7 @@ m4_if([$1], [CXX], [ case $host_os in aix[[4-9]]*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4015,14 +4338,14 @@ m4_if([$1], [CXX], [ case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default @@ -4051,7 +4374,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4059,7 +4382,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. + # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' @@ -4204,17 +4527,18 @@ m4_if([$1], [CXX], [ fi ], [ - if test "$GCC" = yes; then + if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) @@ -4225,8 +4549,8 @@ m4_if([$1], [CXX], [ ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -4243,6 +4567,11 @@ m4_if([$1], [CXX], [ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -4313,7 +4642,7 @@ m4_if([$1], [CXX], [ case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else @@ -4321,11 +4650,30 @@ m4_if([$1], [CXX], [ fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -4341,7 +4689,7 @@ m4_if([$1], [CXX], [ ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -4350,9 +4698,9 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4377,6 +4725,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4474,7 +4828,7 @@ m4_if([$1], [CXX], [ ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi @@ -4503,7 +4857,7 @@ m4_if([$1], [CXX], [ fi ]) case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; @@ -4569,17 +4923,21 @@ m4_if([$1], [CXX], [ case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in @@ -4625,9 +4983,9 @@ m4_if([$1], [CXX], [ # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -4643,7 +5001,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test "$GCC" != yes; then + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -4651,7 +5009,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; esac @@ -4661,7 +5019,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -4683,24 +5041,24 @@ dnl Note also adjust exclude_expsyms for C++ above. esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -4713,7 +5071,7 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -4732,7 +5090,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -4748,7 +5106,7 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4758,7 +5116,7 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -4766,61 +5124,89 @@ _LT_EOF _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test "$host_os" = linux-dietlibc; then + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4831,42 +5217,47 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4880,8 +5271,8 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4899,8 +5290,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4912,7 +5303,7 @@ _LT_EOF _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -4927,9 +5318,9 @@ _LT_EOF # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4946,15 +5337,15 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= @@ -4970,7 +5361,7 @@ _LT_EOF # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported @@ -4978,34 +5369,57 @@ _LT_EOF ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -5024,13 +5438,21 @@ _LT_EOF _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -5049,61 +5471,80 @@ _LT_EOF ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -5112,7 +5553,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) @@ -5142,16 +5583,17 @@ _LT_EOF # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -5160,18 +5602,18 @@ _LT_EOF # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -5180,7 +5622,7 @@ _LT_EOF # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -5230,33 +5672,33 @@ _LT_EOF ;; hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5264,25 +5706,25 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ @@ -5290,14 +5732,14 @@ _LT_EOF # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in @@ -5308,7 +5750,7 @@ _LT_EOF *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -5319,16 +5761,16 @@ _LT_EOF ;; irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], @@ -5341,21 +5783,31 @@ _LT_EOF end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -5370,7 +5822,7 @@ _LT_EOF newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; @@ -5378,27 +5830,19 @@ _LT_EOF *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no @@ -5409,33 +5853,53 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5446,24 +5910,24 @@ _LT_EOF solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -5473,11 +5937,11 @@ _LT_EOF solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', + # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi @@ -5487,10 +5951,10 @@ _LT_EOF ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -5539,43 +6003,43 @@ _LT_EOF ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -5590,17 +6054,17 @@ _LT_EOF ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld @@ -5617,7 +6081,7 @@ x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -5697,12 +6161,12 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the + "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR @@ -5743,10 +6207,10 @@ dnl [Compiler flag to generate thread safe objects]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. +# the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" +lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. @@ -5782,18 +6246,18 @@ if test -n "$compiler"; then LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB - # Report which library types will actually be built + # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -5801,8 +6265,12 @@ if test -n "$compiler"; then ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -5810,13 +6278,13 @@ if test -n "$compiler"; then AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP -CC="$lt_save_CC" +CC=$lt_save_CC ])# _LT_LANG_C_CONFIG @@ -5824,14 +6292,14 @@ CC="$lt_save_CC" # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. +# the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes @@ -5873,7 +6341,7 @@ _LT_TAGVAR(objext, $1)=$objext # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then +if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" @@ -5915,35 +6383,35 @@ if test "$_lt_caught_CXX_error" != yes; then if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately - if test "$GXX" = yes; then + if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi - if test "$GXX" = yes; then + if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) - wlarc='${wl}' + wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi @@ -5979,18 +6447,30 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in @@ -6000,6 +6480,13 @@ if test "$_lt_caught_CXX_error" != yes; then ;; esac done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -6018,13 +6505,21 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac - if test "$GXX" = yes; then + if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -6042,64 +6537,84 @@ if test "$_lt_caught_CXX_error" != yes; then fi esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -6109,7 +6624,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6137,57 +6652,58 @@ if test "$_lt_caught_CXX_error" != yes; then # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6198,6 +6714,34 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_DARWIN_LINKER_FEATURES($1) ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + dgux*) case $cc_basename in ec++*) @@ -6232,18 +6776,15 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default @@ -6255,7 +6796,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6264,11 +6805,11 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6278,15 +6819,15 @@ if test "$_lt_caught_CXX_error" != yes; then ;; hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi @@ -6312,13 +6853,13 @@ if test "$_lt_caught_CXX_error" != yes; then aCC*) case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -6329,20 +6870,20 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -6357,22 +6898,22 @@ if test "$_lt_caught_CXX_error" != yes; then interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -6381,22 +6922,22 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -6404,8 +6945,8 @@ if test "$_lt_caught_CXX_error" != yes; then # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6414,10 +6955,10 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. @@ -6431,59 +6972,59 @@ if test "$_lt_caught_CXX_error" != yes; then # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -6497,18 +7038,18 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) @@ -6516,10 +7057,10 @@ if test "$_lt_caught_CXX_error" != yes; then *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on @@ -6577,22 +7118,17 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else @@ -6608,9 +7144,9 @@ if test "$_lt_caught_CXX_error" != yes; then # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using @@ -6628,17 +7164,17 @@ if test "$_lt_caught_CXX_error" != yes; then cxx*) case $host in osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac @@ -6653,21 +7189,21 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists @@ -6713,9 +7249,9 @@ if test "$_lt_caught_CXX_error" != yes; then # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -6723,7 +7259,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; @@ -6740,30 +7276,30 @@ if test "$_lt_caught_CXX_error" != yes; then ;; gcx*) # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else - # g++ 2.7 appears to require `-G' NOT `-shared' on this + # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -6771,11 +7307,11 @@ if test "$_lt_caught_CXX_error" != yes; then output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi @@ -6784,52 +7320,52 @@ if test "$_lt_caught_CXX_error" != yes; then ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" + '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; @@ -6860,10 +7396,10 @@ if test "$_lt_caught_CXX_error" != yes; then esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -6890,7 +7426,7 @@ if test "$_lt_caught_CXX_error" != yes; then lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes +fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG @@ -6912,13 +7448,14 @@ AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -7002,13 +7539,13 @@ if AC_TRY_EVAL(ac_compile); then pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. - if test $p = "-L" || - test $p = "-R"; then + if test x-L = "$p" || + test x-R = "$p"; then prev=$p continue fi @@ -7024,16 +7561,16 @@ if AC_TRY_EVAL(ac_compile); then case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in + if test no = "$pre_test_object_deps_done"; then + case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being @@ -7041,9 +7578,9 @@ if AC_TRY_EVAL(ac_compile); then esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" + _LT_TAGVAR(postdeps, $1)=$prev$p else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= @@ -7058,15 +7595,15 @@ if AC_TRY_EVAL(ac_compile); then continue fi - if test "$pre_test_object_deps_done" = no; then + if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" + _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" + _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi @@ -7097,51 +7634,6 @@ interix[[3-9]]*) _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; esac ]) @@ -7150,7 +7642,7 @@ case " $_LT_TAGVAR(postdeps, $1) " in esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) @@ -7170,10 +7662,10 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then +if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi @@ -7210,7 +7702,7 @@ _LT_TAGVAR(objext, $1)=$objext # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then +if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7232,7 +7724,7 @@ if test "$_lt_disable_F77" != yes; then _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} @@ -7246,21 +7738,25 @@ if test "$_lt_disable_F77" != yes; then AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7268,11 +7764,11 @@ if test "$_lt_disable_F77" != yes; then AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7289,9 +7785,9 @@ if test "$_lt_disable_F77" != yes; then fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG @@ -7301,11 +7797,11 @@ AC_LANG_POP # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) -if test -z "$FC" || test "X$FC" = "Xno"; then +if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi @@ -7342,7 +7838,7 @@ _LT_TAGVAR(objext, $1)=$objext # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then +if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t @@ -7364,7 +7860,7 @@ if test "$_lt_disable_FC" != yes; then _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. - lt_save_CC="$CC" + lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} @@ -7380,21 +7876,25 @@ if test "$_lt_disable_FC" != yes; then AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7402,11 +7902,11 @@ if test "$_lt_disable_FC" != yes; then AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7426,7 +7926,7 @@ if test "$_lt_disable_FC" != yes; then GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes +fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG @@ -7436,7 +7936,7 @@ AC_LANG_POP # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE @@ -7470,7 +7970,7 @@ CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. @@ -7503,7 +8003,7 @@ CFLAGS=$lt_save_CFLAGS # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE @@ -7537,7 +8037,7 @@ CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" +_LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. @@ -7570,7 +8070,7 @@ CFLAGS=$lt_save_CFLAGS # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. +# to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE @@ -7586,7 +8086,7 @@ _LT_TAGVAR(objext, $1)=$objext lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" +lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER @@ -7596,7 +8096,7 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= @@ -7625,7 +8125,7 @@ AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) @@ -7734,7 +8234,7 @@ lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue + test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in @@ -7751,9 +8251,9 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break + test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then + if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi @@ -7777,27 +8277,7 @@ dnl AC_DEFUN([LT_AC_PROG_SED], []) # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false @@ -7821,102 +8301,9 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) - - -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) - - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) - - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) - - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi - -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) - - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) - # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- -# Determine which file name conversion functions should be used by +# Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], @@ -7983,15 +8370,15 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 7 ltoptions.m4 +# serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -8012,7 +8399,7 @@ m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl + [m4_warning([Unknown $1 option '$2'])])[]dnl ]) @@ -8058,13 +8445,15 @@ m4_if([$1],[LT_INIT],[ dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS @@ -8092,7 +8481,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) +put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -8128,7 +8517,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL], _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) +put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -8137,9 +8526,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], @@ -8152,14 +8541,14 @@ AC_ARG_ENABLE([shared], *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) @@ -8191,9 +8580,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], @@ -8206,14 +8595,14 @@ AC_ARG_ENABLE([static], *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) @@ -8245,9 +8634,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], @@ -8260,14 +8649,14 @@ AC_ARG_ENABLE([fast-install], *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) @@ -8284,14 +8673,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) +the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) +the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -8299,11 +8688,64 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + # _LT_WITH_PIC([MODE]) # -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], @@ -8314,19 +8756,17 @@ m4_define([_LT_WITH_PIC], *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC @@ -8339,7 +8779,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) +put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -8362,7 +8802,8 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience], # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -8395,7 +8836,7 @@ m4_define([_lt_join], # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -8406,7 +8847,7 @@ m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different @@ -8486,7 +8927,7 @@ m4_define([lt_dict_filter], # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -8495,22 +8936,23 @@ m4_define([lt_dict_filter], # @configure_input@ -# serial 3337 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2]) -m4_define([LT_PACKAGE_REVISION], [1.3337]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2' -macro_revision='1.3337' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -8521,7 +8963,7 @@ _LT_DECL(, macro_revision, 0) # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -8535,7 +8977,7 @@ _LT_DECL(, macro_revision, 0) # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until @@ -8607,7 +9049,7 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -8619,10 +9061,10 @@ m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -8638,12 +9080,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -8705,7 +9147,7 @@ AC_SUBST([AR])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -8750,15 +9192,14 @@ AC_SUBST([AR])dnl # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -8789,7 +9230,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -8980,7 +9421,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9056,7 +9497,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9146,8 +9587,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -9220,7 +9661,11 @@ to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -9249,7 +9694,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9260,7 +9705,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -9270,7 +9715,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9292,7 +9737,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9327,7 +9772,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9377,7 +9822,7 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9416,7 +9861,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9445,7 +9890,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9492,7 +9937,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9511,7 +9956,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9592,7 +10037,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9652,7 +10097,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9680,7 +10125,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9699,7 +10144,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/ar-lib b/ar-lib index fe2301e7..463b9ec0 100755 --- a/ar-lib +++ b/ar-lib @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff --git a/change.log b/change.log index 97cde1d4..b8439f41 100644 --- a/change.log +++ b/change.log @@ -1,6 +1,29 @@ CHANGE LOG for Independent JPEG Group's JPEG software +Version 9b 17-Jan-2016 +----------------------- + +Improvements and optimizations in DCT and color calculations. +Normalize range limit array composition and access pattern. +Thank to Sia Furler and Maddie Ziegler for inspiration. + +Use merged upsample with scaled DCT sizes larger than 8. +Thank to Taylor Hatala for inspiration. + +Check for excessive comment lengths in argument parsing in wrjpgcom.c. +Thank to Julian Cohen for hint. + +Add makefile.b32 for use with Borland C++ 32-bit (bcc32). +Thank to Joe Slater for contribution. + +Document 'f' specifier for jpegtran -crop specification. +Thank to Michele Martone for suggestion. + +Use defined value from header instead of hardwired number in rdswitch.c. +Thank to Robert Sprowson for hint. + + Version 9a 19-Jan-2014 ----------------------- diff --git a/cjpeg.1 b/cjpeg.1 index 8684331e..7d685be5 100644 --- a/cjpeg.1 +++ b/cjpeg.1 @@ -1,4 +1,4 @@ -.TH CJPEG 1 "23 November 2013" +.TH CJPEG 1 "26 July 2015" .SH NAME cjpeg \- compress an image file to a JPEG file .SH SYNOPSIS @@ -16,7 +16,7 @@ cjpeg \- compress an image file to a JPEG file compresses the named image file, or the standard input if no file is named, and produces a JPEG/JFIF file on the standard output. The currently supported input file formats are: PPM (PBMPLUS color -format), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster +format), PGM (PBMPLUS grayscale format), BMP, Targa, and RLE (Utah Raster Toolkit format). (RLE is supported only if the URT library is available.) .SH OPTIONS All switch names may be abbreviated; for example, diff --git a/compile b/compile index 531136b0..a85b723c 100755 --- a/compile +++ b/compile @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff --git a/config.guess b/config.guess index 9afd6762..6c32c864 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2013-11-29' +timestamp='2014-11-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ timestamp='2013-11-29' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -579,8 +579,9 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -826,7 +827,7 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +970,10 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1371,154 +1372,6 @@ EOF exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -283,8 +283,10 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -296,11 +298,11 @@ case $basic_machine in | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -311,6 +313,7 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -325,6 +328,9 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -402,8 +408,10 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -415,6 +423,7 @@ case $basic_machine in | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -432,6 +441,7 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -769,6 +779,9 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -824,6 +837,10 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1369,14 +1386,14 @@ case $os in | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1594,9 +1611,6 @@ case $basic_machine in mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff --git a/configure b/configure index 77a5df32..d4a1131a 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libjpeg 9.1.0. +# Generated by GNU Autoconf 2.69 for libjpeg 9.2.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libjpeg' PACKAGE_TARNAME='libjpeg' -PACKAGE_VERSION='9.1.0' -PACKAGE_STRING='libjpeg 9.1.0' +PACKAGE_VERSION='9.2.0' +PACKAGE_STRING='libjpeg 9.2.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -634,6 +634,7 @@ LTLIBOBJS LIBOBJS JPEG_LIB_VERSION MEMORYMGR +LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO @@ -767,6 +768,7 @@ enable_shared enable_static with_pic enable_fast_install +with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock @@ -780,7 +782,8 @@ CFLAGS LDFLAGS LIBS CPPFLAGS -CPP' +CPP +LT_SYS_LIBRARY_PATH' # Initialize some variables set by options. @@ -1321,7 +1324,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libjpeg 9.1.0 to adapt to many kinds of systems. +\`configure' configures libjpeg 9.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1392,7 +1395,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libjpeg 9.1.0:";; + short | recursive ) echo "Configuration of libjpeg 9.2.0:";; esac cat <<\_ACEOF @@ -1424,9 +1427,12 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). Some influential environment variables: CC C compiler command @@ -1437,6 +1443,8 @@ Some influential environment variables: CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1504,7 +1512,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libjpeg configure 9.1.0 +libjpeg configure 9.2.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1869,7 +1877,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libjpeg $as_me 9.1.0, which was +It was created by libjpeg $as_me 9.2.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2370,7 +2378,7 @@ test -n "$target_alias" && # Initialize Automake # Don't require all the GNU mandated files -am__api_version='1.14' +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2542,8 +2550,8 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2562,7 +2570,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2856,7 +2864,7 @@ fi # Define the identity of the package. PACKAGE='libjpeg' - VERSION='9.1.0' + VERSION='9.2.0' cat >>confdefs.h <<_ACEOF @@ -2890,8 +2898,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -2949,6 +2957,7 @@ END fi fi + # Make --enable-silent-rules the default. # To get verbose build output you may configure # with --disable-silent-rules or use "make V=1". @@ -5910,8 +5919,8 @@ esac -macro_version='2.4.2' -macro_revision='1.3337' +macro_version='2.4.6' +macro_revision='2.4.6' @@ -5925,7 +5934,7 @@ macro_revision='1.3337' -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. @@ -5974,7 +5983,7 @@ func_echo_all () $ECHO "" } -case "$ECHO" in +case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 @@ -6167,19 +6176,19 @@ test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld -if test "$GCC" = yes; then +if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw + # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; @@ -6193,7 +6202,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; } while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done - test -z "$LD" && LD="$ac_prog" + test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. @@ -6204,7 +6213,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; } with_gnu_ld=unknown ;; esac -elif test "$with_gnu_ld" = yes; then +elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else @@ -6215,32 +6224,32 @@ if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } @@ -6283,33 +6292,38 @@ if ${lt_cv_path_NM+:} false; then : else if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + lt_cv_path_NM=$NM else - lt_nm_to_check="${ac_tool_prefix}nm" + lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" - break + break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" - break + break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but @@ -6320,15 +6334,15 @@ else esac fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : @@ -6434,9 +6448,9 @@ esac fi fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -6444,8 +6458,8 @@ fi esac fi - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" + if test : != "$DUMPBIN"; then + NM=$DUMPBIN fi fi test -z "$NM" && NM=nm @@ -6485,7 +6499,7 @@ if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 - teststring="ABCD" + teststring=ABCD case $build_os in msdosdjgpp*) @@ -6525,7 +6539,7 @@ else lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -6575,22 +6589,23 @@ else ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do + for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough + test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring @@ -6608,7 +6623,7 @@ else fi -if test -n $lt_cv_sys_max_cmd_len ; then +if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else @@ -6626,30 +6641,6 @@ max_cmd_len=$lt_cv_sys_max_cmd_len : ${MV="mv -f"} : ${RM="rm -f"} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else @@ -6772,13 +6763,13 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then + if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi @@ -6903,13 +6894,13 @@ lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. +# 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) @@ -6936,8 +6927,7 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -6973,10 +6963,6 @@ freebsd* | dragonfly*) fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -7015,7 +7001,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -7037,8 +7023,8 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' @@ -7091,6 +7077,9 @@ sysv4 | sysv4.3*) tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac fi @@ -7245,8 +7234,8 @@ else case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib @@ -7258,7 +7247,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" + lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac @@ -7412,7 +7401,7 @@ if ac_fn_c_try_compile "$LINENO"; then : ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -eq 0; then + if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 @@ -7420,7 +7409,7 @@ if ac_fn_c_try_compile "$LINENO"; then : ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - if test "$ac_status" -ne 0; then + if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi @@ -7433,7 +7422,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } -if test "x$lt_cv_ar_at_file" = xno; then +if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file @@ -7650,7 +7639,7 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in - openbsd*) + bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) @@ -7740,7 +7729,7 @@ cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; @@ -7773,14 +7762,44 @@ case `$NM -V 2>&1` in symcode='[ABCDGIRSTW]' ;; esac +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -7798,21 +7817,24 @@ for ac_symprfx in "" "_"; do # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" @@ -7860,11 +7882,11 @@ _LT_EOF if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else @@ -7890,7 +7912,7 @@ lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; @@ -7910,13 +7932,13 @@ _LT_EOF mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" + LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then + test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS @@ -7937,7 +7959,7 @@ _LT_EOF rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then + if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= @@ -7979,6 +8001,16 @@ fi + + + + + + + + + + @@ -8002,9 +8034,9 @@ fi lt_sysroot= -case ${with_sysroot} in #( +case $with_sysroot in #( yes) - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( @@ -8014,8 +8046,8 @@ case ${with_sysroot} in #( no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac @@ -8027,18 +8059,99 @@ $as_echo "${lt_sysroot:-no}" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -8047,24 +8160,25 @@ ia64-*-hpux*) test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) - HPUX_IA64_MODE="32" + HPUX_IA64_MODE=32 ;; *ELF-64*) - HPUX_IA64_MODE="64" + HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -8093,9 +8207,50 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -8109,9 +8264,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -8130,7 +8295,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -8148,7 +8316,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" + SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } @@ -8188,13 +8356,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then + if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" + CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) - # Find out which ABI we are using. + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 @@ -8206,7 +8375,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -8215,7 +8384,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" + LD=${LD-ld}_sol2 fi ;; *) @@ -8231,7 +8400,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } ;; esac -need_locks="$enable_libtool_lock" +need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. @@ -8342,7 +8511,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then +if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -8845,7 +9014,7 @@ if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then + if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the @@ -8863,7 +9032,7 @@ else cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -8902,7 +9071,7 @@ else fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 @@ -8931,7 +9100,7 @@ _LT_EOF _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 @@ -8944,32 +9113,32 @@ fi $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then + if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -8977,6 +9146,41 @@ $as_echo "$lt_cv_ld_force_load" >&6; } ;; esac +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default @@ -9011,14 +9215,14 @@ if test "${enable_shared+set}" = set; then : *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9042,14 +9246,14 @@ if test "${enable_static+set}" = set; then : *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9073,14 +9277,14 @@ if test "${with_pic+set}" = set; then : *) pic_mode=default # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9088,8 +9292,6 @@ else fi -test -z "$pic_mode" && pic_mode=default - @@ -9105,14 +9307,14 @@ if test "${enable_fast_install+set}" = set; then : *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac else @@ -9126,11 +9328,63 @@ fi + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -9179,7 +9433,7 @@ test -z "$LN_S" && LN_S="ln -s" -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -9218,7 +9472,7 @@ aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -9229,14 +9483,14 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -9245,15 +9499,8 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +func_cc_basename $compiler +cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it @@ -9268,22 +9515,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then : else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -9306,13 +9553,13 @@ _LT_EOF break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -9334,22 +9581,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then : else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : @@ -9372,13 +9619,13 @@ _LT_EOF break fi done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } @@ -9399,7 +9646,7 @@ esac # Use C for the default configuration in the libtool script -lt_save_CC="$CC" +lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9457,7 +9704,7 @@ if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; @@ -9473,7 +9720,7 @@ else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -9503,7 +9750,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : @@ -9521,17 +9768,18 @@ lt_prog_compiler_pic= lt_prog_compiler_static= - if test "$GCC" = yes; then + if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi + lt_prog_compiler_pic='-fPIC' ;; amigaos*) @@ -9542,8 +9790,8 @@ lt_prog_compiler_static= ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac @@ -9559,6 +9807,11 @@ lt_prog_compiler_static= # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -9629,7 +9882,7 @@ lt_prog_compiler_static= case $host_os in aix*) lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else @@ -9637,10 +9890,29 @@ lt_prog_compiler_static= fi ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -9656,7 +9928,7 @@ lt_prog_compiler_static= ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' + lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) @@ -9665,9 +9937,9 @@ lt_prog_compiler_static= lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. + # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' @@ -9692,6 +9964,12 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -9789,7 +10067,7 @@ lt_prog_compiler_static= ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi @@ -9818,7 +10096,7 @@ lt_prog_compiler_static= fi case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: + # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; @@ -9850,7 +10128,7 @@ else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins @@ -9880,7 +10158,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then +if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -9912,7 +10190,7 @@ if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -9931,13 +10209,13 @@ else fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } -if test x"$lt_cv_prog_compiler_static_works" = xyes; then +if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= @@ -10057,8 +10335,8 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } @@ -10070,9 +10348,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; } ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -10115,9 +10393,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if @@ -10132,7 +10410,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. - if test "$GCC" != yes; then + if test yes != "$GCC"; then with_gnu_ld=no fi ;; @@ -10140,7 +10418,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; - openbsd*) + openbsd* | bitrig*) with_gnu_ld=no ;; esac @@ -10150,7 +10428,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility @@ -10172,24 +10450,24 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie esac fi - if test "$lt_use_gnu_ld_interface" = yes; then + if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v 2>&1` in + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -10202,7 +10480,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then + if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 @@ -10221,7 +10499,7 @@ _LT_EOF case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -10237,7 +10515,7 @@ _LT_EOF allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi @@ -10247,7 +10525,7 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' + export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes @@ -10255,61 +10533,89 @@ _LT_EOF exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no - if test "$host_os" = linux-dietlibc; then + if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no + && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -10320,42 +10626,47 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then + if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -10369,8 +10680,8 @@ _LT_EOF archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -10388,8 +10699,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10401,7 +10712,7 @@ _LT_EOF ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify @@ -10416,9 +10727,9 @@ _LT_EOF # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -10435,15 +10746,15 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac - if test "$ld_shlibs" = no; then + if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= @@ -10459,7 +10770,7 @@ _LT_EOF # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported @@ -10467,34 +10778,57 @@ _LT_EOF ;; aix[4-9]*) - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' - no_entry_flag="" + no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -10513,13 +10847,21 @@ _LT_EOF hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes - file_list_spec='${wl}-f,' + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac - if test "$GCC" = yes; then + if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` + collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then @@ -10538,35 +10880,42 @@ _LT_EOF ;; esac shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' else - shared_flag='${wl}-bM:SRE' + shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi - export_dynamic_flag_spec='${wl}-bexpall' + export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -10601,7 +10950,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -10609,17 +10958,17 @@ fi aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then + if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : @@ -10654,7 +11003,7 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" + lt_cv_aix_libpath_=/usr/lib:/lib fi fi @@ -10662,21 +11011,33 @@ fi aix_libpath=$lt_cv_aix_libpath_ fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -10685,7 +11046,7 @@ fi case $host_cpu in powerpc) # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) @@ -10715,16 +11076,17 @@ fi # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes @@ -10733,18 +11095,18 @@ fi # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' ;; *) # Assume MSVC wrapper @@ -10753,7 +11115,7 @@ fi # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" + shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. @@ -10772,24 +11134,24 @@ fi hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" + allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; + ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac - if test "$_lt_dar_can_shared" = "yes"; then + if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10831,33 +11193,33 @@ fi ;; hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes @@ -10865,25 +11227,25 @@ fi ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) @@ -10895,7 +11257,7 @@ if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then @@ -10914,14 +11276,14 @@ else fi fi $RM -r conftest* - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -10929,8 +11291,8 @@ fi ;; esac fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in @@ -10941,7 +11303,7 @@ fi *) hardcode_direct=yes hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' + export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -10952,8 +11314,8 @@ fi ;; irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. @@ -10963,8 +11325,8 @@ $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " > if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } @@ -10976,24 +11338,34 @@ else fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" + LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -11008,7 +11380,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; @@ -11016,27 +11388,19 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } *nto* | *qnx*) ;; - openbsd*) + openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no @@ -11047,33 +11411,53 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes ;; osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -11084,24 +11468,24 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } solaris*) no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi @@ -11111,11 +11495,11 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', + # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi @@ -11125,10 +11509,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } ;; sunos4*) - if test "x$host_vendor" = xsequent; then + if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi @@ -11177,43 +11561,43 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' + no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not + # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' + export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; @@ -11228,10 +11612,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } ;; esac - if test x$host_vendor = xsni; then + if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' + export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi @@ -11239,7 +11623,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no +test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -11265,7 +11649,7 @@ x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then + if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. @@ -11480,14 +11864,14 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } -if test "$GCC" = yes; then +if test yes = "$GCC"; then case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in @@ -11503,28 +11887,35 @@ if test "$GCC" = yes; then ;; esac # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. + # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; + lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } @@ -11538,7 +11929,7 @@ BEGIN {RS=" "; FS="/|\n";} { # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else @@ -11547,7 +11938,7 @@ fi library_names_spec= libname_spec='lib$name' soname_spec= -shrext_cmds=".so" +shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -11564,14 +11955,16 @@ hardcode_into_libs=no # flags to be left without arguments need_version=unknown + + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' + soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) @@ -11579,41 +11972,91 @@ aix[4-9]*) need_lib_prefix=no need_version=no hardcode_into_libs=yes - if test "$host_cpu" = ia64; then + if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -11623,18 +12066,18 @@ amigaos*) powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) - library_names_spec='${libname}${shared_ext}' + library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; @@ -11642,8 +12085,8 @@ beos*) bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" @@ -11655,7 +12098,7 @@ bsdi[45]*) cygwin* | mingw* | pw32* | cegcc*) version_type=windows - shrext_cmds=".dll" + shrext_cmds=.dll need_version=no need_lib_prefix=no @@ -11664,8 +12107,8 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ @@ -11681,17 +12124,17 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' @@ -11700,8 +12143,8 @@ cygwin* | mingw* | pw32* | cegcc*) *,cl*) # Native MSVC libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' case $build_os in mingw*) @@ -11728,7 +12171,7 @@ cygwin* | mingw* | pw32* | cegcc*) sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` @@ -11741,8 +12184,8 @@ cygwin* | mingw* | pw32* | cegcc*) esac # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' @@ -11755,7 +12198,7 @@ cygwin* | mingw* | pw32* | cegcc*) *) # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac @@ -11768,8 +12211,8 @@ darwin* | rhapsody*) version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' @@ -11782,8 +12225,8 @@ dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -11801,12 +12244,13 @@ freebsd* | dragonfly*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac @@ -11831,26 +12275,15 @@ freebsd* | dragonfly*) esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -11868,14 +12301,15 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -11883,8 +12317,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; @@ -11893,8 +12327,8 @@ hpux9* | hpux10* | hpux11*) dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... @@ -11907,8 +12341,8 @@ interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -11919,7 +12353,7 @@ irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) - if test "$lt_cv_prog_gnu_ld" = yes; then + if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix @@ -11927,8 +12361,8 @@ irix5* | irix6* | nonstopux*) esac need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= @@ -11947,8 +12381,8 @@ irix5* | irix6* | nonstopux*) esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; @@ -11957,13 +12391,33 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -12007,7 +12461,12 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" @@ -12027,12 +12486,12 @@ netbsd*) need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -12042,7 +12501,7 @@ netbsd*) newsos6) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; @@ -12051,58 +12510,68 @@ newsos6) version_type=qnx need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; -openbsd*) +openbsd* | bitrig*) version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" + sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi + shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' - shrext_cmds=".dll" + version_type=windows + shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) @@ -12113,8 +12582,8 @@ solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -12124,11 +12593,11 @@ solaris*) sunos4*) version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes @@ -12136,8 +12605,8 @@ sunos4*) sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) @@ -12158,24 +12627,24 @@ sysv4 | sysv4.3*) ;; sysv4*MP*) - if test -d /usr/nec ;then + if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then + if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' @@ -12193,7 +12662,7 @@ tpf*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -12201,8 +12670,8 @@ tpf*) uts4*) version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; @@ -12212,20 +12681,35 @@ uts4*) esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no +test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then +if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + @@ -12322,15 +12806,15 @@ $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then + test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && + if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else @@ -12345,12 +12829,12 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi @@ -12360,7 +12844,7 @@ fi - if test "x$enable_dlopen" != xyes; then + if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -12370,23 +12854,23 @@ else case $host_os in beos*) - lt_cv_dlopen="load_add_on" + lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) - # if libdl is installed we need to link against it + # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : @@ -12424,10 +12908,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else - lt_cv_dlopen="dyld" + lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -12435,10 +12919,18 @@ fi ;; + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" + lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } @@ -12477,11 +12969,11 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" + lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } @@ -12520,7 +13012,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } @@ -12559,7 +13051,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } @@ -12598,7 +13090,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -12619,21 +13111,21 @@ fi ;; esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else + if test no = "$lt_cv_dlopen"; then enable_dlopen=no + else + enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" + save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" + save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 @@ -12641,7 +13133,7 @@ $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -12688,9 +13180,9 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -12720,7 +13212,7 @@ _LT_EOF (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -12740,14 +13232,14 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } - if test "x$lt_cv_dlopen_self" = xyes; then + if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : + if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -12794,9 +13286,9 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif @@ -12826,7 +13318,7 @@ _LT_EOF (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in @@ -12847,9 +13339,9 @@ fi $as_echo "$lt_cv_dlopen_self_static" >&6; } fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; esac @@ -12893,7 +13385,7 @@ else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) - if test -n "$STRIP" ; then + if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -12921,7 +13413,7 @@ fi - # Report which library types will actually be built + # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 @@ -12929,13 +13421,13 @@ $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no + test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) - test "$enable_shared" = yes && enable_static=no + test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' @@ -12943,8 +13435,12 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } ;; aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -12954,7 +13450,7 @@ $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes + test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } @@ -12968,7 +13464,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -CC="$lt_save_CC" +CC=$lt_save_CC @@ -13623,7 +14119,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libjpeg $as_me 9.1.0, which was +This file was extended by libjpeg $as_me 9.2.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13689,7 +14185,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libjpeg config.status 9.1.0 +libjpeg config.status 9.2.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -13827,6 +14323,7 @@ enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' @@ -13874,10 +14371,13 @@ compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' @@ -13942,7 +14442,8 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' @@ -13994,9 +14495,12 @@ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ nm_file_list_spec \ +lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ @@ -14031,7 +14535,7 @@ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -14058,10 +14562,11 @@ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -14070,19 +14575,16 @@ sys_lib_dlsearch_path_spec; do done ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' @@ -14791,55 +15293,53 @@ $as_echo X"$file" | ;; "libtool":C) - # See if we are running on zsh, and set the options which allow our + # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then + if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi - cfgfile="${ofile}T" + cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # The names of the tagged configurations supported by this script. -available_tags="" +available_tags='' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG @@ -14868,6 +15368,9 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + # Shell to use when invoking shell scripts. SHELL=$lt_SHELL @@ -14979,18 +15482,27 @@ global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec -# The root where to search for dependent libraries,and in which our libraries should be installed. +# The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + # The name of the directory that contains temporary libtool files. objdir=$objdir @@ -15081,8 +15593,11 @@ hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -15175,13 +15690,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -15231,6 +15746,65 @@ hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + _LT_EOF case $host_os in @@ -15239,7 +15813,7 @@ _LT_EOF # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then +if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -15248,7 +15822,7 @@ _LT_EOF esac -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if @@ -15258,165 +15832,6 @@ ltmain="$ac_aux_dir/ltmain.sh" sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" diff --git a/configure.ac b/configure.ac index 934d07e9..e06ff34f 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ # Configure script for IJG libjpeg # -AC_INIT([libjpeg], [9.1.0]) +AC_INIT([libjpeg], [9.2.0]) # Directory where autotools helper scripts lives. AC_CONFIG_AUX_DIR([.]) diff --git a/depcomp b/depcomp index 4ebd5b3a..fc98710e 100755 --- a/depcomp +++ b/depcomp @@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/djpeg.1 b/djpeg.1 index 67ee5cba..dfbe4f12 100644 --- a/djpeg.1 +++ b/djpeg.1 @@ -1,4 +1,4 @@ -.TH DJPEG 1 "23 November 2013" +.TH DJPEG 1 "26 July 2015" .SH NAME djpeg \- decompress a JPEG file to an image file .SH SYNOPSIS @@ -55,11 +55,16 @@ default options are chosen for highest quality output.) Currently, this is equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR. .TP .B \-grayscale -Force gray-scale output even if JPEG file is color. Useful for viewing on -monochrome displays; also, +Force grayscale output even if JPEG file is color. +Useful for viewing on monochrome displays; also, .B djpeg runs noticeably faster in this mode. .TP +.B \-rgb +Force RGB output even if JPEG file is grayscale. +This is provided to support applications that don't +want to cope with grayscale as a separate case. +.TP .BI \-scale " M/N" Scale the output image by a factor M/N. Currently supported scale factors are M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for @@ -76,7 +81,7 @@ emitted if .B \-colors or .B \-grayscale -is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color +is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color format is emitted. .TP .B \-gif @@ -90,12 +95,12 @@ emitted if .B \-colors or .B \-grayscale -is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color +is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color format is emitted. .TP .B \-pnm Select PBMPLUS (PPM/PGM) output format (this is the default format). -PGM is emitted if the JPEG file is gray-scale or if +PGM is emitted if the JPEG file is grayscale or if .B \-grayscale is specified; otherwise PPM is emitted. .TP @@ -103,8 +108,8 @@ is specified; otherwise PPM is emitted. Select RLE output format. (Requires URT library.) .TP .B \-targa -Select Targa output format. Gray-scale format is emitted if the JPEG file is -gray-scale or if +Select Targa output format. Grayscale format is emitted if the JPEG file is +grayscale or if .B \-grayscale is specified; otherwise, colormapped format is emitted if .B \-colors @@ -162,7 +167,7 @@ faster and needs less memory, but it produces a lower-quality image. is ignored unless you also say .B \-colors .IR N . -Also, the one-pass method is always used for gray-scale output (the two-pass +Also, the one-pass method is always used for grayscale output (the two-pass method is no improvement then). .TP .BI \-maxmemory " N" diff --git a/djpeg.c b/djpeg.c index be7f2690..0c9b89bd 100644 --- a/djpeg.c +++ b/djpeg.c @@ -2,7 +2,7 @@ * djpeg.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2009-2013 by Guido Vollbeding. + * Modified 2009-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -102,6 +102,7 @@ usage (void) fprintf(stderr, " -colors N Reduce image to no more than N colors\n"); fprintf(stderr, " -fast Fast, low-quality processing\n"); fprintf(stderr, " -grayscale Force grayscale output\n"); + fprintf(stderr, " -rgb Force RGB output\n"); #ifdef IDCT_SCALING_SUPPORTED fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n"); #endif @@ -264,6 +265,10 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, /* Force monochrome output. */ cinfo->out_color_space = JCS_GRAYSCALE; + } else if (keymatch(arg, "rgb", 3)) { + /* Force RGB output. */ + cinfo->out_color_space = JCS_RGB; + } else if (keymatch(arg, "map", 3)) { /* Quantize to a color map taken from an input file. */ if (++argn >= argc) /* advance to next argument */ diff --git a/install-sh b/install-sh index 377bb868..0b0fdcbb 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -207,6 +203,15 @@ if test $# -eq 0; then exit 0 fi +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 @@ -223,16 +228,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ do # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -314,74 +293,74 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +370,51 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue + test X"$d" = X && continue - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -472,15 +449,12 @@ do # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +467,24 @@ do # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 diff --git a/install.txt b/install.txt index 04053068..0cec9b87 100644 --- a/install.txt +++ b/install.txt @@ -1,6 +1,6 @@ INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software -Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. +Copyright (C) 1991-2015, Thomas G. Lane, Guido Vollbeding. This file is part of the Independent JPEG Group's software. For conditions of distribution and use, see the accompanying README file. @@ -147,9 +147,10 @@ makefile.bcc jconfig.bcc MS-DOS or OS/2, Borland C makefile.dj jconfig.dj MS-DOS, DJGPP (Delorie's port of GNU C) makefile.mc6 jconfig.mc6 MS-DOS, Microsoft C (16-bit only) makefile.wat jconfig.wat MS-DOS, OS/2, or Windows NT, Watcom C -makefile.vc jconfig.vc Windows NT/95, MS Visual C++ -make*.vc6 jconfig.vc Windows NT/95, MS Visual C++ 6 -make*.v10 jconfig.vc Windows NT/95, MS Visual C++ 2010 (v10) +makefile.vc jconfig.vc Windows NT/9x, MS Visual C++ +make*.vc6 jconfig.vc Windows NT/9x, MS Visual C++ 6 +make*.v10 jconfig.vc Windows NT/9x, MS Visual C++ 2010 (v10) +makefile.b32 jconfig.vc Windows NT/9x, Borland C++ 32-bit (bcc32) makefile.mms jconfig.vms Digital VMS, with MMS software makefile.vms jconfig.vms Digital VMS, without MMS software diff --git a/jconfig.vc b/jconfig.vc index 7d88482f..e9d33e58 100644 --- a/jconfig.vc +++ b/jconfig.vc @@ -1,4 +1,5 @@ -/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ +/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 9x or NT. */ +/* This file also works for Borland C++ 32-bit (bcc32) on Windows 9x or NT. */ /* see jconfig.txt for explanations */ #define HAVE_PROTOTYPES diff --git a/jdarith.c b/jdarith.c index efdb26d3..5533c073 100644 --- a/jdarith.c +++ b/jdarith.c @@ -1,7 +1,7 @@ /* * jdarith.c * - * Developed 1997-2013 by Guido Vollbeding. + * Developed 1997-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -94,7 +94,7 @@ get_byte (j_decompress_ptr cinfo) * (instead of fixed) with the bit shift counter CT. * Thus, we also need only one (variable instead of * fixed size) shift for the LPS/MPS decision, and - * we can get away with any renormalization update + * we can do away with any renormalization update * of C (except for new data insertion, of course). * * I've also introduced a new scheme for accessing diff --git a/jdatasrc.c b/jdatasrc.c index 7be59a88..2a27cfed 100644 --- a/jdatasrc.c +++ b/jdatasrc.c @@ -2,7 +2,7 @@ * jdatasrc.c * * Copyright (C) 1994-1996, Thomas G. Lane. - * Modified 2009-2011 by Guido Vollbeding. + * Modified 2009-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -247,7 +247,7 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile) GLOBAL(void) jpeg_mem_src (j_decompress_ptr cinfo, - unsigned char * inbuffer, unsigned long insize) + const unsigned char * inbuffer, unsigned long insize) { struct jpeg_source_mgr * src; @@ -271,5 +271,5 @@ jpeg_mem_src (j_decompress_ptr cinfo, src->resync_to_restart = jpeg_resync_to_restart; /* use default method */ src->term_source = term_source; src->bytes_in_buffer = (size_t) insize; - src->next_input_byte = (JOCTET *) inbuffer; + src->next_input_byte = (const JOCTET *) inbuffer; } diff --git a/jdcolor.c b/jdcolor.c index a31c2861..29c30fae 100644 --- a/jdcolor.c +++ b/jdcolor.c @@ -2,7 +2,7 @@ * jdcolor.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2011-2013 by Guido Vollbeding. + * Modified 2011-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -25,9 +25,6 @@ typedef struct { INT32 * Cr_g_tab; /* => table for Cr to G conversion */ INT32 * Cb_g_tab; /* => table for Cb to G conversion */ - JSAMPLE * range_limit; /* pointer to normal sample range limit table, */ - /* or extended sample range limit table for BG_YCC */ - /* Private state for RGB->Y conversion */ INT32 * rgb_y_tab; /* => table for RGB to Y conversion */ } my_color_deconverter; @@ -134,8 +131,6 @@ build_ycc_rgb_table (j_decompress_ptr cinfo) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32)); - cconvert->range_limit = cinfo->sample_range_limit; - for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ @@ -176,10 +171,6 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE+1) * SIZEOF(INT32)); - cconvert->range_limit = (JSAMPLE *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - 5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); - for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ @@ -195,20 +186,6 @@ build_bg_ycc_rgb_table (j_decompress_ptr cinfo) /* We also add in ONE_HALF so that need not do it in inner loop */ cconvert->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF; } - - /* Cb and Cr portions can extend to double range in wide gamut case, - * so we prepare an appropriate extended range limit table. - */ - - /* First segment of range limit table: limit[x] = 0 for x < 0 */ - MEMZERO(cconvert->range_limit, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); - cconvert->range_limit += 2 * (MAXJSAMPLE+1); - /* Main part of range limit table: limit[x] = x */ - for (i = 0; i <= MAXJSAMPLE; i++) - cconvert->range_limit[i] = (JSAMPLE) i; - /* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */ - for (; i < 3 * (MAXJSAMPLE+1); i++) - cconvert->range_limit[i] = MAXJSAMPLE; } @@ -235,7 +212,7 @@ ycc_rgb_convert (j_decompress_ptr cinfo, register JDIMENSION col; JDIMENSION num_cols = cinfo->output_width; /* copy these pointers into registers if possible */ - register JSAMPLE * range_limit = cconvert->range_limit; + register JSAMPLE * range_limit = cinfo->sample_range_limit; register int * Crrtab = cconvert->Cr_r_tab; register int * Cbbtab = cconvert->Cb_b_tab; register INT32 * Crgtab = cconvert->Cr_g_tab; diff --git a/jdct.h b/jdct.h index 360dec80..5d0fe83f 100644 --- a/jdct.h +++ b/jdct.h @@ -2,6 +2,7 @@ * jdct.h * * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2002-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -78,13 +79,16 @@ typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could * be quite far out of range if the input data is corrupt, so a bulletproof * range-limiting step is required. We use a mask-and-table-lookup method - * to do the combined operations quickly. See the comments with - * prepare_range_limit_table (in jdmaster.c) for more info. + * to do the combined operations quickly, assuming that MAXJSAMPLE+1 + * is a power of 2. See the comments with prepare_range_limit_table + * (in jdmaster.c) for more info. */ -#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE) - #define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ +#define RANGE_CENTER (MAXJSAMPLE * 2 + 2) +#define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE) + +#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET) /* Short forms of external names for systems with brain-damaged linkers. */ @@ -391,3 +395,23 @@ EXTERN(void) jpeg_idct_1x2 #ifndef MULTIPLY16V16 /* default definition */ #define MULTIPLY16V16(var1,var2) ((var1) * (var2)) #endif + +/* Like RIGHT_SHIFT, but applies to a DCTELEM. + * We assume that int right shift is unsigned if INT32 right shift is. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS DCTELEM ishift_temp; +#if BITS_IN_JSAMPLE == 8 +#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */ +#else +#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */ +#endif +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif diff --git a/jdmaster.c b/jdmaster.c index 6f42d3c5..ab95090f 100644 --- a/jdmaster.c +++ b/jdmaster.c @@ -2,7 +2,7 @@ * jdmaster.c * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 2002-2013 by Guido Vollbeding. + * Modified 2002-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -45,11 +45,23 @@ LOCAL(boolean) use_merged_upsample (j_decompress_ptr cinfo) { #ifdef UPSAMPLE_MERGING_SUPPORTED - /* Merging is the equivalent of plain box-filter upsampling */ - if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) + /* Merging is the equivalent of plain box-filter upsampling. */ + /* The following condition is only needed if fancy shall select + * a different upsampling method. In our current implementation + * fancy only affects the DCT scaling, thus we can use fancy + * upsampling and merged upsample simultaneously, in particular + * with scaled DCT sizes larger than the default DCTSIZE. + */ +#if 0 + if (cinfo->do_fancy_upsampling) + return FALSE; +#endif + if (cinfo->CCIR601_sampling) return FALSE; /* jdmerge.c only supports YCC=>RGB color conversion */ - if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || + if ((cinfo->jpeg_color_space != JCS_YCbCr && + cinfo->jpeg_color_space != JCS_BG_YCC) || + cinfo->num_components != 3 || cinfo->out_color_space != JCS_RGB || cinfo->out_color_components != RGB_PIXELSIZE || cinfo->color_transform) @@ -199,30 +211,20 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo) * These processes all use a common table prepared by the routine below. * * For most steps we can mathematically guarantee that the initial value - * of x is within MAXJSAMPLE+1 of the legal range, so a table running from - * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial - * limiting step (just after the IDCT), a wildly out-of-range value is - * possible if the input data is corrupt. To avoid any chance of indexing + * of x is within 2*(MAXJSAMPLE+1) of the legal range, so a table running + * from -2*(MAXJSAMPLE+1) to 3*MAXJSAMPLE+2 is sufficient. But for the + * initial limiting step (just after the IDCT), a wildly out-of-range value + * is possible if the input data is corrupt. To avoid any chance of indexing * off the end of memory and getting a bad-pointer trap, we perform the * post-IDCT limiting thus: - * x = range_limit[x & MASK]; + * x = (sample_range_limit - SUBSET)[(x + CENTER) & MASK]; * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit * samples. Under normal circumstances this is more than enough range and * a correct output will be generated; with bogus input data the mask will * cause wraparound, and we will safely generate a bogus-but-in-range output. * For the post-IDCT step, we want to convert the data from signed to unsigned * representation by adding CENTERJSAMPLE at the same time that we limit it. - * So the post-IDCT limiting table ends up looking like this: - * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE, - * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), - * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), - * 0,1,...,CENTERJSAMPLE-1 - * Negative inputs select values from the upper half of the table after - * masking. - * - * We can save some space by overlapping the start of the post-IDCT table - * with the simpler range limiting table. The post-IDCT table begins at - * sample_range_limit + CENTERJSAMPLE. + * This is accomplished with SUBSET = CENTER - CENTERJSAMPLE. * * Note that the table is allocated in near data space on PCs; it's small * enough and used often enough to justify this. @@ -237,23 +239,17 @@ prepare_range_limit_table (j_decompress_ptr cinfo) table = (JSAMPLE *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE)); - table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */ + 5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); + /* First segment of range limit table: limit[x] = 0 for x < 0 */ + MEMZERO(table, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); + table += 2 * (MAXJSAMPLE+1); /* allow negative subscripts of table */ cinfo->sample_range_limit = table; - /* First segment of "simple" table: limit[x] = 0 for x < 0 */ - MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); - /* Main part of "simple" table: limit[x] = x */ + /* Main part of range limit table: limit[x] = x */ for (i = 0; i <= MAXJSAMPLE; i++) table[i] = (JSAMPLE) i; - table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */ - /* End of simple table, rest of first half of post-IDCT table */ - for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++) + /* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */ + for (; i < 3 * (MAXJSAMPLE+1); i++) table[i] = MAXJSAMPLE; - /* Second half of post-IDCT table */ - MEMZERO(table + (2 * (MAXJSAMPLE+1)), - (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE)); - MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), - cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE)); } diff --git a/jdmerge.c b/jdmerge.c index a6bde33c..192da582 100644 --- a/jdmerge.c +++ b/jdmerge.c @@ -2,7 +2,7 @@ * jdmerge.c * * Copyright (C) 1994-1996, Thomas G. Lane. - * Modified 2013 by Guido Vollbeding. + * Modified 2013-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -24,7 +24,7 @@ * multiplications needed for color conversion. * * This file currently provides implementations for the following cases: - * YCbCr => RGB color conversion only. + * YCC => RGB color conversion only (YCbCr or BG_YCC). * Sampling ratios of 2h1v or 2h2v. * No scaling needed at upsample time. * Corner-aligned (non-CCIR601) sampling alignment. @@ -76,12 +76,13 @@ typedef my_upsampler * my_upsample_ptr; /* - * Initialize tables for YCC->RGB colorspace conversion. + * Initialize tables for YCbCr->RGB and BG_YCC->RGB colorspace conversion. * This is taken directly from jdcolor.c; see that file for more info. */ LOCAL(void) build_ycc_rgb_table (j_decompress_ptr cinfo) +/* Normal case, sYCC */ { my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; int i; @@ -119,6 +120,46 @@ build_ycc_rgb_table (j_decompress_ptr cinfo) } +LOCAL(void) +build_bg_ycc_rgb_table (j_decompress_ptr cinfo) +/* Wide gamut case, bg-sYCC */ +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int i; + INT32 x; + SHIFT_TEMPS + + upsample->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cr_g_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(INT32)); + upsample->Cb_g_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(INT32)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ + /* Cr=>R value is nearest int to 2.804 * x */ + upsample->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 3.544 * x */ + upsample->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS); + /* Cr=>G value is scaled-up -1.428272572 * x */ + upsample->Cr_g_tab[i] = (- FIX(1.428272572)) * x; + /* Cb=>G value is scaled-up -0.688272572 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + upsample->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF; + } +} + + /* * Initialize for an upsampling pass. */ @@ -251,32 +292,32 @@ h2v1_merged_upsample (j_decompress_ptr cinfo, /* Do the chroma part of the calculation */ cb = GETJSAMPLE(*inptr1++); cr = GETJSAMPLE(*inptr2++); - cred = Crrtab[cr]; + cred = Crrtab[cr]; cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); - cblue = Cbbtab[cb]; + cblue = Cbbtab[cb]; /* Fetch 2 Y values and emit 2 pixels */ y = GETJSAMPLE(*inptr0++); - outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_RED] = range_limit[y + cred]; outptr[RGB_GREEN] = range_limit[y + cgreen]; - outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr[RGB_BLUE] = range_limit[y + cblue]; outptr += RGB_PIXELSIZE; y = GETJSAMPLE(*inptr0++); - outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_RED] = range_limit[y + cred]; outptr[RGB_GREEN] = range_limit[y + cgreen]; - outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr[RGB_BLUE] = range_limit[y + cblue]; outptr += RGB_PIXELSIZE; } /* If image width is odd, do the last output column separately */ if (cinfo->output_width & 1) { cb = GETJSAMPLE(*inptr1); cr = GETJSAMPLE(*inptr2); - cred = Crrtab[cr]; + cred = Crrtab[cr]; cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); - cblue = Cbbtab[cb]; + cblue = Cbbtab[cb]; y = GETJSAMPLE(*inptr0); - outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_RED] = range_limit[y + cred]; outptr[RGB_GREEN] = range_limit[y + cgreen]; - outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr[RGB_BLUE] = range_limit[y + cblue]; } } @@ -315,46 +356,46 @@ h2v2_merged_upsample (j_decompress_ptr cinfo, /* Do the chroma part of the calculation */ cb = GETJSAMPLE(*inptr1++); cr = GETJSAMPLE(*inptr2++); - cred = Crrtab[cr]; + cred = Crrtab[cr]; cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); - cblue = Cbbtab[cb]; + cblue = Cbbtab[cb]; /* Fetch 4 Y values and emit 4 pixels */ y = GETJSAMPLE(*inptr00++); - outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_RED] = range_limit[y + cred]; outptr0[RGB_GREEN] = range_limit[y + cgreen]; - outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; outptr0 += RGB_PIXELSIZE; y = GETJSAMPLE(*inptr00++); - outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_RED] = range_limit[y + cred]; outptr0[RGB_GREEN] = range_limit[y + cgreen]; - outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; outptr0 += RGB_PIXELSIZE; y = GETJSAMPLE(*inptr01++); - outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_RED] = range_limit[y + cred]; outptr1[RGB_GREEN] = range_limit[y + cgreen]; - outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; outptr1 += RGB_PIXELSIZE; y = GETJSAMPLE(*inptr01++); - outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_RED] = range_limit[y + cred]; outptr1[RGB_GREEN] = range_limit[y + cgreen]; - outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; outptr1 += RGB_PIXELSIZE; } /* If image width is odd, do the last output column separately */ if (cinfo->output_width & 1) { cb = GETJSAMPLE(*inptr1); cr = GETJSAMPLE(*inptr2); - cred = Crrtab[cr]; + cred = Crrtab[cr]; cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); - cblue = Cbbtab[cb]; + cblue = Cbbtab[cb]; y = GETJSAMPLE(*inptr00); - outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_RED] = range_limit[y + cred]; outptr0[RGB_GREEN] = range_limit[y + cgreen]; - outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; y = GETJSAMPLE(*inptr01); - outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_RED] = range_limit[y + cred]; outptr1[RGB_GREEN] = range_limit[y + cgreen]; - outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; } } @@ -375,7 +416,7 @@ jinit_merged_upsampler (j_decompress_ptr cinfo) upsample = (my_upsample_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_upsampler)); - cinfo->upsample = (struct jpeg_upsampler *) upsample; + cinfo->upsample = &upsample->pub; upsample->pub.start_pass = start_pass_merged_upsample; upsample->pub.need_context_rows = FALSE; @@ -395,7 +436,10 @@ jinit_merged_upsampler (j_decompress_ptr cinfo) upsample->spare_row = NULL; } - build_ycc_rgb_table(cinfo); + if (cinfo->jpeg_color_space == JCS_BG_YCC) + build_bg_ycc_rgb_table(cinfo); + else + build_ycc_rgb_table(cinfo); } #endif /* UPSAMPLE_MERGING_SUPPORTED */ diff --git a/jdsample.c b/jdsample.c index 7bc8885b..fd9907e2 100644 --- a/jdsample.c +++ b/jdsample.c @@ -2,7 +2,7 @@ * jdsample.c * * Copyright (C) 1991-1996, Thomas G. Lane. - * Modified 2002-2008 by Guido Vollbeding. + * Modified 2002-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -296,13 +296,12 @@ jinit_upsampler (j_decompress_ptr cinfo) my_upsample_ptr upsample; int ci; jpeg_component_info * compptr; - boolean need_buffer; int h_in_group, v_in_group, h_out_group, v_out_group; upsample = (my_upsample_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_upsampler)); - cinfo->upsample = (struct jpeg_upsampler *) upsample; + cinfo->upsample = &upsample->pub; upsample->pub.start_pass = start_pass_upsample; upsample->pub.upsample = sep_upsample; upsample->pub.need_context_rows = FALSE; /* until we find out differently */ @@ -325,17 +324,17 @@ jinit_upsampler (j_decompress_ptr cinfo) h_out_group = cinfo->max_h_samp_factor; v_out_group = cinfo->max_v_samp_factor; upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ - need_buffer = TRUE; if (! compptr->component_needed) { /* Don't bother to upsample an uninteresting component. */ upsample->methods[ci] = noop_upsample; - need_buffer = FALSE; - } else if (h_in_group == h_out_group && v_in_group == v_out_group) { + continue; /* don't need to allocate buffer */ + } + if (h_in_group == h_out_group && v_in_group == v_out_group) { /* Fullsize components can be processed without any work. */ upsample->methods[ci] = fullsize_upsample; - need_buffer = FALSE; - } else if (h_in_group * 2 == h_out_group && - v_in_group == v_out_group) { + continue; /* don't need to allocate buffer */ + } + if (h_in_group * 2 == h_out_group && v_in_group == v_out_group) { /* Special case for 2h1v upsampling */ upsample->methods[ci] = h2v1_upsample; } else if (h_in_group * 2 == h_out_group && @@ -350,12 +349,10 @@ jinit_upsampler (j_decompress_ptr cinfo) upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); } else ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); - if (need_buffer) { - upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - (JDIMENSION) jround_up((long) cinfo->output_width, - (long) cinfo->max_h_samp_factor), - (JDIMENSION) cinfo->max_v_samp_factor); - } + upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) cinfo->output_width, + (long) cinfo->max_h_samp_factor), + (JDIMENSION) cinfo->max_v_samp_factor); } } diff --git a/jerror.c b/jerror.c index 8c0b9e07..7163af69 100644 --- a/jerror.c +++ b/jerror.c @@ -2,7 +2,7 @@ * jerror.c * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2012 by Guido Vollbeding. + * Modified 2012-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -19,16 +19,16 @@ * These routines are used by both the compression and decompression code. */ +#ifdef USE_WINDOWS_MESSAGEBOX +#include +#endif + /* this is not a core library module, so it doesn't define JPEG_INTERNALS */ #include "jinclude.h" #include "jpeglib.h" #include "jversion.h" #include "jerror.h" -#ifdef USE_WINDOWS_MESSAGEBOX -#include -#endif - #ifndef EXIT_FAILURE /* define exit() codes if not provided */ #define EXIT_FAILURE 1 #endif diff --git a/jfdctflt.c b/jfdctflt.c index 74d0d862..0ebc186d 100644 --- a/jfdctflt.c +++ b/jfdctflt.c @@ -2,7 +2,7 @@ * jfdctflt.c * * Copyright (C) 1994-1996, Thomas G. Lane. - * Modified 2003-2009 by Guido Vollbeding. + * Modified 2003-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -54,6 +54,8 @@ /* * Perform the forward DCT on one block of samples. + * + * cK represents cos(K*pi/16). */ GLOBAL(void) @@ -89,7 +91,7 @@ jpeg_fdct_float (FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */ dataptr[4] = tmp10 - tmp11; diff --git a/jfdctfst.c b/jfdctfst.c index 8cad5f22..d779f78b 100644 --- a/jfdctfst.c +++ b/jfdctfst.c @@ -2,7 +2,7 @@ * jfdctfst.c * * Copyright (C) 1994-1996, Thomas G. Lane. - * Modified 2003-2009 by Guido Vollbeding. + * Modified 2003-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -109,6 +109,8 @@ /* * Perform the forward DCT on one block of samples. + * + * cK represents cos(K*pi/16). */ GLOBAL(void) @@ -145,7 +147,7 @@ jpeg_fdct_ifast (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */ dataptr[4] = tmp10 - tmp11; diff --git a/jfdctint.c b/jfdctint.c index a2ef2031..7ed42e5d 100644 --- a/jfdctint.c +++ b/jfdctint.c @@ -2,7 +2,7 @@ * jfdctint.c * * Copyright (C) 1991-1996, Thomas G. Lane. - * Modification developed 2003-2013 by Guido Vollbeding. + * Modification developed 2003-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -194,7 +194,7 @@ jpeg_fdct_islow (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS); dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); @@ -367,7 +367,7 @@ jpeg_fdct_7x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]); z1 = tmp0 + tmp2; - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS); tmp3 += tmp3; @@ -503,7 +503,7 @@ jpeg_fdct_6x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]); tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS); dataptr[2] = (DCTELEM) @@ -618,7 +618,7 @@ jpeg_fdct_5x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]); tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << (PASS1_BITS+1)); tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */ @@ -724,7 +724,7 @@ jpeg_fdct_4x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]); tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+2)); dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+2)); @@ -818,7 +818,7 @@ jpeg_fdct_3x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+2)); dataptr[2] = (DCTELEM) @@ -876,7 +876,7 @@ jpeg_fdct_3x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) GLOBAL(void) jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) { - INT32 tmp0, tmp1, tmp2, tmp3; + DCTELEM tmp0, tmp1, tmp2, tmp3; JSAMPROW elemptr; /* Pre-zero output coefficient block. */ @@ -904,13 +904,13 @@ jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) */ /* Column 0 */ - /* Apply unsigned->signed conversion */ - data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp2 - 4 * CENTERJSAMPLE) << 4); - data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp2) << 4); + /* Apply unsigned->signed conversion. */ + data[DCTSIZE*0] = (tmp0 + tmp2 - 4 * CENTERJSAMPLE) << 4; + data[DCTSIZE*1] = (tmp0 - tmp2) << 4; /* Column 1 */ - data[DCTSIZE*0+1] = (DCTELEM) ((tmp1 + tmp3) << 4); - data[DCTSIZE*1+1] = (DCTELEM) ((tmp1 - tmp3) << 4); + data[DCTSIZE*0+1] = (tmp1 + tmp3) << 4; + data[DCTSIZE*1+1] = (tmp1 - tmp3) << 4; } @@ -921,14 +921,17 @@ jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) GLOBAL(void) jpeg_fdct_1x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) { + DCTELEM dcval; + /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + dcval = GETJSAMPLE(sample_data[0][start_col]); + /* We leave the result scaled up by an overall factor of 8. */ /* We must also scale the output by (8/1)**2 = 2**6. */ - /* Apply unsigned->signed conversion */ - data[0] = (DCTELEM) - ((GETJSAMPLE(sample_data[0][start_col]) - CENTERJSAMPLE) << 6); + /* Apply unsigned->signed conversion. */ + data[0] = (dcval - CENTERJSAMPLE) << 6; } @@ -976,7 +979,7 @@ jpeg_fdct_9x9 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) z1 = tmp0 + tmp2 + tmp3; z2 = tmp1 + tmp4; - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((z1 + z2 - 9 * CENTERJSAMPLE) << 1); dataptr[6] = (DCTELEM) DESCALE(MULTIPLY(z1 - z2 - z2, FIX(0.707106781)), /* c6 */ @@ -1130,7 +1133,7 @@ jpeg_fdct_10x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]); tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << 1); tmp12 += tmp12; @@ -1291,7 +1294,7 @@ jpeg_fdct_11x11 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[7]); tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[6]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 - 11 * CENTERJSAMPLE) << 1); tmp5 += tmp5; @@ -1480,7 +1483,7 @@ jpeg_fdct_12x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]); tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) (tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE); dataptr[6] = (DCTELEM) (tmp13 - tmp14 - tmp15); dataptr[4] = (DCTELEM) @@ -1641,7 +1644,7 @@ jpeg_fdct_13x13 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[8]); tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[7]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) (tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 - 13 * CENTERJSAMPLE); tmp6 += tmp6; @@ -1848,7 +1851,7 @@ jpeg_fdct_14x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]); tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) (tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE); tmp13 += tmp13; @@ -2047,7 +2050,7 @@ jpeg_fdct_15x15 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) z1 = tmp0 + tmp4 + tmp5; z2 = tmp1 + tmp3 + tmp6; z3 = tmp2 + tmp7; - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) (z1 + z2 + z3 - 15 * CENTERJSAMPLE); z3 += z3; dataptr[6] = (DCTELEM) @@ -2234,7 +2237,7 @@ jpeg_fdct_16x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]); tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS); dataptr[4] = (DCTELEM) @@ -2443,7 +2446,7 @@ jpeg_fdct_16x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]); tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS); dataptr[4] = (DCTELEM) @@ -2624,7 +2627,7 @@ jpeg_fdct_14x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]); tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE) << PASS1_BITS); tmp13 += tmp13; @@ -2786,7 +2789,7 @@ jpeg_fdct_12x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]); tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE) << PASS1_BITS); dataptr[6] = (DCTELEM) ((tmp13 - tmp14 - tmp15) << PASS1_BITS); @@ -2922,7 +2925,7 @@ jpeg_fdct_10x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]); tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << PASS1_BITS); tmp12 += tmp12; @@ -3057,7 +3060,7 @@ jpeg_fdct_8x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << (PASS1_BITS+1)); dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << (PASS1_BITS+1)); @@ -3192,7 +3195,7 @@ jpeg_fdct_6x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]); tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << (PASS1_BITS+1)); dataptr[2] = (DCTELEM) @@ -3288,7 +3291,7 @@ jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]); tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+3)); dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+3)); @@ -3342,7 +3345,7 @@ jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) GLOBAL(void) jpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) { - INT32 tmp0, tmp1; + DCTELEM tmp0, tmp1; JSAMPROW elemptr; /* Pre-zero output coefficient block. */ @@ -3359,12 +3362,12 @@ jpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) /* Even part */ - /* Apply unsigned->signed conversion */ - data[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5); + /* Apply unsigned->signed conversion. */ + data[0] = (tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5; /* Odd part */ - data[1] = (DCTELEM) ((tmp0 - tmp1) << 5); + data[1] = (tmp0 - tmp1) << 5; } @@ -3417,7 +3420,7 @@ jpeg_fdct_8x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS); dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); @@ -3607,7 +3610,7 @@ jpeg_fdct_7x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]); z1 = tmp0 + tmp2; - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS); tmp3 += tmp3; @@ -3789,7 +3792,7 @@ jpeg_fdct_6x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]); tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS); dataptr[2] = (DCTELEM) @@ -3938,7 +3941,7 @@ jpeg_fdct_5x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]); tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << PASS1_BITS); tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */ @@ -4081,7 +4084,7 @@ jpeg_fdct_4x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]); tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+1)); dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+1)); @@ -4220,7 +4223,7 @@ jpeg_fdct_3x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+1)); dataptr[2] = (DCTELEM) @@ -4321,7 +4324,7 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp0 = GETJSAMPLE(elemptr[0]); tmp1 = GETJSAMPLE(elemptr[1]); - /* Apply unsigned->signed conversion */ + /* Apply unsigned->signed conversion. */ dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 3); /* Odd part */ @@ -4377,7 +4380,7 @@ jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) GLOBAL(void) jpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) { - INT32 tmp0, tmp1; + DCTELEM tmp0, tmp1; /* Pre-zero output coefficient block. */ MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); @@ -4394,12 +4397,12 @@ jpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) tmp0 = GETJSAMPLE(sample_data[0][start_col]); tmp1 = GETJSAMPLE(sample_data[1][start_col]); - /* Apply unsigned->signed conversion */ - data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5); + /* Apply unsigned->signed conversion. */ + data[DCTSIZE*0] = (tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5; /* Odd part */ - data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp1) << 5); + data[DCTSIZE*1] = (tmp0 - tmp1) << 5; } #endif /* DCT_SCALING_SUPPORTED */ diff --git a/jidctflt.c b/jidctflt.c index 23ae9d33..c7e832a3 100644 --- a/jidctflt.c +++ b/jidctflt.c @@ -2,7 +2,7 @@ * jidctflt.c * * Copyright (C) 1994-1998, Thomas G. Lane. - * Modified 2010 by Guido Vollbeding. + * Modified 2010-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -63,6 +63,8 @@ /* * Perform dequantization and inverse DCT on one block of coefficients. + * + * cK represents cos(K*pi/16). */ GLOBAL(void) @@ -77,7 +79,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, FLOAT_MULT_TYPE * quantptr; FAST_FLOAT * wsptr; JSAMPROW outptr; - JSAMPLE *range_limit = cinfo->sample_range_limit; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */ @@ -95,14 +97,14 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, * With typical images and quantization tables, half or more of the * column DCT calculations can be simplified this way. */ - + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) { /* AC terms all zero */ FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - + wsptr[DCTSIZE*0] = dcval; wsptr[DCTSIZE*1] = dcval; wsptr[DCTSIZE*2] = dcval; @@ -111,13 +113,13 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*5] = dcval; wsptr[DCTSIZE*6] = dcval; wsptr[DCTSIZE*7] = dcval; - + inptr++; /* advance pointers to next column */ quantptr++; wsptr++; continue; } - + /* Even part */ tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); @@ -135,7 +137,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp3 = tmp10 - tmp13; tmp1 = tmp11 + tmp12; tmp2 = tmp11 - tmp12; - + /* Odd part */ tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); @@ -172,7 +174,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, quantptr++; wsptr++; } - + /* Pass 2: process rows from work array, store into output array. */ wsptr = workspace; @@ -183,16 +185,17 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, * the simplification applies less often (typically 5% to 10% of the time). * And testing floats for zero is relatively expensive, so we don't bother. */ - + /* Even part */ - /* Apply signed->unsigned and prepare float->int conversion */ - z5 = wsptr[0] + ((FAST_FLOAT) CENTERJSAMPLE + (FAST_FLOAT) 0.5); + /* Prepare range-limit and float->int conversion */ + z5 = wsptr[0] + (((FAST_FLOAT) RANGE_CENTER) + ((FAST_FLOAT) 0.5)); tmp10 = z5 + wsptr[4]; tmp11 = z5 - wsptr[4]; tmp13 = wsptr[2] + wsptr[6]; - tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13; + tmp12 = (wsptr[2] - wsptr[6]) * + ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */ tmp0 = tmp10 + tmp13; tmp3 = tmp10 - tmp13; @@ -206,28 +209,28 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, z11 = wsptr[1] + wsptr[7]; z12 = wsptr[1] - wsptr[7]; - tmp7 = z11 + z13; - tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */ z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */ tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */ - tmp6 = tmp12 - tmp7; + tmp6 = tmp12 - tmp7; /* phase 2 */ tmp5 = tmp11 - tmp6; tmp4 = tmp10 - tmp5; /* Final output stage: float->int conversion and range-limit */ - outptr[0] = range_limit[((int) (tmp0 + tmp7)) & RANGE_MASK]; - outptr[7] = range_limit[((int) (tmp0 - tmp7)) & RANGE_MASK]; - outptr[1] = range_limit[((int) (tmp1 + tmp6)) & RANGE_MASK]; - outptr[6] = range_limit[((int) (tmp1 - tmp6)) & RANGE_MASK]; - outptr[2] = range_limit[((int) (tmp2 + tmp5)) & RANGE_MASK]; - outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK]; - outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK]; - outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK]; - + outptr[0] = range_limit[(int) (tmp0 + tmp7) & RANGE_MASK]; + outptr[7] = range_limit[(int) (tmp0 - tmp7) & RANGE_MASK]; + outptr[1] = range_limit[(int) (tmp1 + tmp6) & RANGE_MASK]; + outptr[6] = range_limit[(int) (tmp1 - tmp6) & RANGE_MASK]; + outptr[2] = range_limit[(int) (tmp2 + tmp5) & RANGE_MASK]; + outptr[5] = range_limit[(int) (tmp2 - tmp5) & RANGE_MASK]; + outptr[3] = range_limit[(int) (tmp3 + tmp4) & RANGE_MASK]; + outptr[4] = range_limit[(int) (tmp3 - tmp4) & RANGE_MASK]; + wsptr += DCTSIZE; /* advance pointer to next row */ } } diff --git a/jidctfst.c b/jidctfst.c index dba4216f..474cc45f 100644 --- a/jidctfst.c +++ b/jidctfst.c @@ -2,6 +2,7 @@ * jidctfst.c * * Copyright (C) 1994-1998, Thomas G. Lane. + * Modified 2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -133,35 +134,10 @@ #endif -/* Like DESCALE, but applies to a DCTELEM and produces an int. - * We assume that int right shift is unsigned if INT32 right shift is. - */ - -#ifdef RIGHT_SHIFT_IS_UNSIGNED -#define ISHIFT_TEMPS DCTELEM ishift_temp; -#if BITS_IN_JSAMPLE == 8 -#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */ -#else -#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */ -#endif -#define IRIGHT_SHIFT(x,shft) \ - ((ishift_temp = (x)) < 0 ? \ - (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \ - (ishift_temp >> (shft))) -#else -#define ISHIFT_TEMPS -#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) -#endif - -#ifdef USE_ACCURATE_ROUNDING -#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n)) -#else -#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n)) -#endif - - /* * Perform dequantization and inverse DCT on one block of coefficients. + * + * cK represents cos(K*pi/16). */ GLOBAL(void) @@ -180,7 +156,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, int ctr; int workspace[DCTSIZE2]; /* buffers data between passes */ SHIFT_TEMPS /* for DESCALE */ - ISHIFT_TEMPS /* for IDESCALE */ + ISHIFT_TEMPS /* for IRIGHT_SHIFT */ /* Pass 1: process columns from input, store into work array. */ @@ -253,12 +229,12 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ - tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ - tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + tmp10 = z5 - MULTIPLY(z12, FIX_1_082392200); /* 2*(c2-c6) */ + tmp12 = z5 - MULTIPLY(z10, FIX_2_613125930); /* 2*(c2+c6) */ tmp6 = tmp12 - tmp7; /* phase 2 */ tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; + tmp4 = tmp10 - tmp5; wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); @@ -266,21 +242,28 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5); wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); - wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); - wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); + wsptr[DCTSIZE*3] = (int) (tmp3 + tmp4); + wsptr[DCTSIZE*4] = (int) (tmp3 - tmp4); inptr++; /* advance pointers to next column */ quantptr++; wsptr++; } - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ + /* Pass 2: process rows from work array, store into output array. + * Note that we must descale the results by a factor of 8 == 2**3, + * and also undo the PASS1_BITS scaling. + */ wsptr = workspace; for (ctr = 0; ctr < DCTSIZE; ctr++) { outptr = output_buf[ctr] + output_col; + + /* Add range center and fudge factor for final descale and range-limit. */ + z5 = (DCTELEM) wsptr[0] + + ((((DCTELEM) RANGE_CENTER) << (PASS1_BITS+3)) + + (1 << (PASS1_BITS+2))); + /* Rows of zeroes can be exploited in the same way as we did with columns. * However, the column calculation has created many nonzero AC terms, so * the simplification applies less often (typically 5% to 10% of the time). @@ -293,7 +276,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { /* AC terms all zero */ - JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3) + JSAMPLE dcval = range_limit[(int) IRIGHT_SHIFT(z5, PASS1_BITS+3) & RANGE_MASK]; outptr[0] = dcval; @@ -312,12 +295,12 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); - tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); + tmp10 = z5 + (DCTELEM) wsptr[4]; + tmp11 = z5 - (DCTELEM) wsptr[4]; - tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); - tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562) - - tmp13; + tmp13 = (DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]; + tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], + FIX_1_414213562) - tmp13; /* 2*c4 */ tmp0 = tmp10 + tmp13; tmp3 = tmp10 - tmp13; @@ -335,30 +318,30 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ - tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ - tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + tmp10 = z5 - MULTIPLY(z12, FIX_1_082392200); /* 2*(c2-c6) */ + tmp12 = z5 - MULTIPLY(z10, FIX_2_613125930); /* 2*(c2+c6) */ tmp6 = tmp12 - tmp7; /* phase 2 */ tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; + tmp4 = tmp10 - tmp5; /* Final output stage: scale down by a factor of 8 and range-limit */ - outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3) + outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp7, PASS1_BITS+3) & RANGE_MASK]; - outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3) + outptr[7] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp7, PASS1_BITS+3) & RANGE_MASK]; - outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3) + outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp1 + tmp6, PASS1_BITS+3) & RANGE_MASK]; - outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) + outptr[6] = range_limit[(int) IRIGHT_SHIFT(tmp1 - tmp6, PASS1_BITS+3) & RANGE_MASK]; - outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) + outptr[2] = range_limit[(int) IRIGHT_SHIFT(tmp2 + tmp5, PASS1_BITS+3) & RANGE_MASK]; - outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) + outptr[5] = range_limit[(int) IRIGHT_SHIFT(tmp2 - tmp5, PASS1_BITS+3) & RANGE_MASK]; - outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3) + outptr[3] = range_limit[(int) IRIGHT_SHIFT(tmp3 + tmp4, PASS1_BITS+3) & RANGE_MASK]; - outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) + outptr[4] = range_limit[(int) IRIGHT_SHIFT(tmp3 - tmp4, PASS1_BITS+3) & RANGE_MASK]; wsptr += DCTSIZE; /* advance pointer to next row */ diff --git a/jidctint.c b/jidctint.c index 76fe5d9c..de233ec9 100644 --- a/jidctint.c +++ b/jidctint.c @@ -2,7 +2,7 @@ * jidctint.c * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modification developed 2002-2013 by Guido Vollbeding. + * Modification developed 2002-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -230,13 +230,6 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, * The rotator is c(-6). */ - z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); - z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ - tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ - tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ - z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); z2 <<= CONST_BITS; @@ -247,6 +240,13 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp0 = z2 + z3; tmp1 = z2 - z3; + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ + tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -306,6 +306,12 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, wsptr = workspace; for (ctr = 0; ctr < DCTSIZE; ctr++) { outptr = output_buf[ctr] + output_col; + + /* Add range center and fudge factor for final descale and range-limit. */ + z2 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); + /* Rows of zeroes can be exploited in the same way as we did with columns. * However, the column calculation has created many nonzero AC terms, so * the simplification applies less often (typically 5% to 10% of the time). @@ -318,7 +324,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { /* AC terms all zero */ - JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3) + JSAMPLE dcval = range_limit[(int) RIGHT_SHIFT(z2, PASS1_BITS+3) & RANGE_MASK]; outptr[0] = dcval; @@ -339,6 +345,11 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, * The rotator is c(-6). */ + z3 = (INT32) wsptr[4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + z2 = (INT32) wsptr[2]; z3 = (INT32) wsptr[6]; @@ -346,13 +357,6 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ - /* Add fudge factor here for final descale. */ - z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); - z3 = (INT32) wsptr[4]; - - tmp0 = (z2 + z3) << CONST_BITS; - tmp1 = (z2 - z3) << CONST_BITS; - tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -508,8 +512,10 @@ jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp13 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp13 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp13 <<= CONST_BITS; z1 = (INT32) wsptr[2]; @@ -644,8 +650,10 @@ jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp0 <<= CONST_BITS; tmp2 = (INT32) wsptr[4]; tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */ @@ -763,8 +771,10 @@ jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp12 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp12 <<= CONST_BITS; tmp0 = (INT32) wsptr[2]; tmp1 = (INT32) wsptr[4]; @@ -875,8 +885,10 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp2 = (INT32) wsptr[2]; tmp10 = (tmp0 + tmp2) << CONST_BITS; @@ -972,8 +984,10 @@ jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp0 <<= CONST_BITS; tmp2 = (INT32) wsptr[2]; tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */ @@ -1014,11 +1028,11 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; ISLOW_MULT_TYPE * quantptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); - SHIFT_TEMPS + ISHIFT_TEMPS /* Pass 1: process columns from input. */ @@ -1027,8 +1041,8 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Column 0 */ tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]); tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]); - /* Add fudge factor here for final descale. */ - tmp4 += ONE << 2; + /* Add range center and fudge factor for final descale and range-limit. */ + tmp4 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2); tmp0 = tmp4 + tmp5; tmp2 = tmp4 - tmp5; @@ -1045,14 +1059,14 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Row 0 */ outptr = output_buf[0] + output_col; - outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; - outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; + outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; + outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; /* Row 1 */ outptr = output_buf[1] + output_col; - outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp2 + tmp3, 3) & RANGE_MASK]; - outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2 - tmp3, 3) & RANGE_MASK]; + outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp2 + tmp3, 3) & RANGE_MASK]; + outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp2 - tmp3, 3) & RANGE_MASK]; } @@ -1069,17 +1083,21 @@ jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - int dcval; + DCTELEM dcval; ISLOW_MULT_TYPE * quantptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); - SHIFT_TEMPS + ISHIFT_TEMPS /* 1x1 is trivial: just take the DC coefficient divided by 8. */ - quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; - dcval = DEQUANTIZE(coef_block[0], quantptr[0]); - dcval = (int) DESCALE((INT32) dcval, 3); - output_buf[0][output_col] = range_limit[dcval & RANGE_MASK]; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + + dcval = DEQUANTIZE(coef_block[0], quantptr[0]); + /* Add range center and fudge factor for descale and range-limit. */ + dcval += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2); + + output_buf[0][output_col] = + range_limit[(int) IRIGHT_SHIFT(dcval, 3) & RANGE_MASK]; } @@ -1178,8 +1196,10 @@ jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp0 <<= CONST_BITS; z1 = (INT32) wsptr[2]; @@ -1361,8 +1381,10 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + z3 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); z3 <<= CONST_BITS; z4 = (INT32) wsptr[4]; z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */ @@ -1554,8 +1576,10 @@ jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp10 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp10 <<= CONST_BITS; z1 = (INT32) wsptr[2]; @@ -1758,8 +1782,10 @@ jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + z3 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); z3 <<= CONST_BITS; z4 = (INT32) wsptr[4]; @@ -1979,8 +2005,10 @@ jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + z1 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); z1 <<= CONST_BITS; z2 = (INT32) wsptr[2]; @@ -2206,8 +2234,10 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + z1 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); z1 <<= CONST_BITS; z4 = (INT32) wsptr[4]; z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */ @@ -2438,8 +2468,10 @@ jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + z1 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); z1 <<= CONST_BITS; z2 = (INT32) wsptr[2]; @@ -2689,8 +2721,10 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp0 <<= CONST_BITS; z1 = (INT32) wsptr[4]; @@ -2964,8 +2998,10 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp0 <<= CONST_BITS; z1 = (INT32) wsptr[4]; @@ -3182,8 +3218,10 @@ jpeg_idct_14x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + z1 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); z1 <<= CONST_BITS; z4 = (INT32) wsptr[4]; z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */ @@ -3366,8 +3404,10 @@ jpeg_idct_12x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + z3 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); z3 <<= CONST_BITS; z4 = (INT32) wsptr[4]; @@ -3542,8 +3582,10 @@ jpeg_idct_10x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + z3 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); z3 <<= CONST_BITS; z4 = (INT32) wsptr[4]; z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */ @@ -3707,6 +3749,15 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, * The rotator is c(-6). */ + /* Add range center and fudge factor for final descale and range-limit. */ + z2 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); + z3 = (INT32) wsptr[4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + z2 = (INT32) wsptr[2]; z3 = (INT32) wsptr[6]; @@ -3714,13 +3765,6 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ - /* Add fudge factor here for final descale. */ - z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); - z3 = (INT32) wsptr[4]; - - tmp0 = (z2 + z3) << CONST_BITS; - tmp1 = (z2 - z3) << CONST_BITS; - tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -3852,8 +3896,10 @@ jpeg_idct_6x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp0 <<= CONST_BITS; tmp2 = (INT32) wsptr[4]; tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */ @@ -3954,8 +4000,8 @@ jpeg_idct_4x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = wsptr[0] + (ONE << 2); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = wsptr[0] + ((((INT32) RANGE_CENTER) << 3) + (ONE << 2)); tmp2 = wsptr[2]; tmp10 = (tmp0 + tmp2) << CONST_BITS; @@ -4003,11 +4049,11 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp1; + DCTELEM tmp0, tmp1; ISLOW_MULT_TYPE * quantptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); - SHIFT_TEMPS + ISHIFT_TEMPS /* Pass 1: empty. */ @@ -4019,8 +4065,8 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ tmp0 = DEQUANTIZE(coef_block[0], quantptr[0]); - /* Add fudge factor here for final descale. */ - tmp0 += ONE << 2; + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2); /* Odd part */ @@ -4028,8 +4074,8 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Final output stage */ - outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; - outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; + outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; + outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; } @@ -4174,6 +4220,15 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, * The rotator is c(-6). */ + /* Add range center and fudge factor for final descale and range-limit. */ + z2 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); + z3 = (INT32) wsptr[4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + z2 = (INT32) wsptr[2]; z3 = (INT32) wsptr[6]; @@ -4181,13 +4236,6 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ - /* Add fudge factor here for final descale. */ - z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); - z3 = (INT32) wsptr[4]; - - tmp0 = (z2 + z3) << CONST_BITS; - tmp1 = (z2 - z3) << CONST_BITS; - tmp10 = tmp0 + tmp2; tmp13 = tmp0 - tmp2; tmp11 = tmp1 + tmp3; @@ -4377,8 +4425,10 @@ jpeg_idct_7x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp23 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp23 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp23 <<= CONST_BITS; z1 = (INT32) wsptr[2]; @@ -4558,8 +4608,10 @@ jpeg_idct_6x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp10 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp10 <<= CONST_BITS; tmp12 = (INT32) wsptr[4]; tmp20 = MULTIPLY(tmp12, FIX(0.707106781)); /* c4 */ @@ -4716,8 +4768,10 @@ jpeg_idct_5x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp12 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp12 <<= CONST_BITS; tmp13 = (INT32) wsptr[2]; tmp14 = (INT32) wsptr[4]; @@ -4908,8 +4962,10 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp2 = (INT32) wsptr[2]; tmp10 = (tmp0 + tmp2) << CONST_BITS; @@ -5021,8 +5077,10 @@ jpeg_idct_3x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 = (INT32) wsptr[0] + + ((((INT32) RANGE_CENTER) << (PASS1_BITS+3)) + + (ONE << (PASS1_BITS+2))); tmp0 <<= CONST_BITS; tmp2 = (INT32) wsptr[2]; tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */ @@ -5117,8 +5175,10 @@ jpeg_idct_2x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Even part */ - /* Add fudge factor here for final descale. */ - tmp10 = wsptr[0] + (ONE << (CONST_BITS+2)); + /* Add range center and fudge factor for final descale and range-limit. */ + tmp10 = wsptr[0] + + ((((INT32) RANGE_CENTER) << (CONST_BITS+3)) + + (ONE << (CONST_BITS+2))); /* Odd part */ @@ -5148,20 +5208,20 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { - INT32 tmp0, tmp1; + DCTELEM tmp0, tmp1; ISLOW_MULT_TYPE * quantptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); - SHIFT_TEMPS + ISHIFT_TEMPS /* Process 1 column from input, store into output array. */ quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; /* Even part */ - + tmp0 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]); - /* Add fudge factor here for final descale. */ - tmp0 += ONE << 2; + /* Add range center and fudge factor for final descale and range-limit. */ + tmp0 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2); /* Odd part */ @@ -5169,10 +5229,10 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, /* Final output stage */ - output_buf[0][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) - & RANGE_MASK]; - output_buf[1][output_col] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) - & RANGE_MASK]; + output_buf[0][output_col] = + range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; + output_buf[1][output_col] = + range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; } #endif /* IDCT_SCALING_SUPPORTED */ diff --git a/jpeglib.h b/jpeglib.h index f4fbf23e..939b50be 100644 --- a/jpeglib.h +++ b/jpeglib.h @@ -2,7 +2,7 @@ * jpeglib.h * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2002-2013 by Guido Vollbeding. + * Modified 2002-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -39,7 +39,7 @@ extern "C" { #define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */ #define JPEG_LIB_VERSION_MAJOR 9 -#define JPEG_LIB_VERSION_MINOR 1 +#define JPEG_LIB_VERSION_MINOR 2 /* Various constants determining the sizes of things. @@ -979,7 +979,7 @@ EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, unsigned char ** outbuffer, unsigned long * outsize)); EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, - unsigned char * inbuffer, + const unsigned char * inbuffer, unsigned long insize)); /* Default parameter setup for compression */ diff --git a/jpegtran.1 b/jpegtran.1 index 2220f7a5..caefcd14 100644 --- a/jpegtran.1 +++ b/jpegtran.1 @@ -1,4 +1,4 @@ -.TH JPEGTRAN 1 "13 September 2013" +.TH JPEGTRAN 1 "20 September 2015" .SH NAME jpegtran \- lossless transformation of JPEG files .SH SYNOPSIS @@ -19,6 +19,10 @@ for example from baseline JPEG to progressive JPEG or vice versa. It can also perform some rearrangements of the image data, for example turning an image from landscape to portrait format by rotation. .PP +For EXIF files and JPEG files containing Exif data, you may prefer to use +.B exiftran +instead. +.PP .B jpegtran works by rearranging the compressed data (DCT coefficients), without ever fully decoding the image. Therefore, its transformations are lossless: @@ -28,7 +32,11 @@ followed by .B cjpeg to accomplish the same conversion. But by the same token, .B jpegtran -cannot perform lossy operations such as changing the image quality. +cannot perform lossy operations such as changing the image quality. However, +while the image data is losslessly transformed, metadata can be removed. See +the +.B \-copy +option for specifics. .PP .B jpegtran reads the named JPEG/JFIF file, or the standard input if no file is @@ -159,7 +167,8 @@ this does not hold for the given crop parameters, we silently move the upper left corner up and/or left to make it so, simultaneously increasing the region dimensions to keep the lower right crop corner unchanged. (Thus, the output image covers at least the requested region, but may cover more.) -The adjustment of the region dimensions may be optionally disabled. +The adjustment of the region dimensions may be optionally disabled by +attaching an 'f' character ("force") to the width or height number. The image can be losslessly cropped by giving the switch: .TP @@ -206,16 +215,17 @@ such as comment blocks: .TP .B \-copy none Copy no extra markers from source file. This setting suppresses all -comments and other excess baggage present in the source file. +comments and other metadata in the source file. .TP .B \-copy comments Copy only comment markers. This setting copies comments from the source file, -but discards any other inessential (for image display) data. +but discards any other metadata. .TP .B \-copy all -Copy all extra markers. This setting preserves miscellaneous markers +Copy all extra markers. This setting preserves metadata found in the source file, such as JFIF thumbnails, Exif data, and Photoshop -settings. In some files these extra markers can be sizable. +settings. In some files these extra markers can be sizable. Note that this +option will copy thumbnails as-is; they will not be transformed. .IP The default behavior is .BR "\-copy comments" . diff --git a/jversion.h b/jversion.h index a6e3ac73..0740b317 100644 --- a/jversion.h +++ b/jversion.h @@ -1,7 +1,7 @@ /* * jversion.h * - * Copyright (C) 1991-2014, Thomas G. Lane, Guido Vollbeding. + * Copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -9,6 +9,6 @@ */ -#define JVERSION "9a 19-Jan-2014" +#define JVERSION "9b 17-Jan-2016" -#define JCOPYRIGHT "Copyright (C) 2014, Thomas G. Lane, Guido Vollbeding" +#define JCOPYRIGHT "Copyright (C) 2016, Thomas G. Lane, Guido Vollbeding" diff --git a/ltmain.sh b/ltmain.sh index 63ae69dc..0f0a2da3 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -1,9 +1,12 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.2 +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -23,166 +26,670 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.2 -TIMESTAMP="" -package_revision=1.3337 +VERSION=2.4.6 +package_revision=2.4.6 -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL -$lt_unset CDPATH +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. -progpath="$0" +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac +## ----------------- ## +## Standard options. ## +## ----------------- ## -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. +opt_dry_run=false +opt_quiet=false +opt_verbose=false -exit_status=$EXIT_SUCCESS +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue -dirname="s,/[^/]*$,," -basename="s,^.*/,," +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all -# func_dirname file append nondir_replacement + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. -func_dirname () +eval 'func_dirname () { - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation + $debug_cmd + + '"$_d"' +}' -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation - - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result @@ -190,263 +697,327 @@ func_basename () # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () { - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation +} -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () { - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation + $debug_cmd + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' # func_normal_abspath PATH +# ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. -# value returned in "$func_normal_abspath_result" func_normal_abspath () { - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. ;; *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac - done - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=${PATH_SEPARATOR-:} - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' - -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () { - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} + $debug_cmd -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} + $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to @@ -454,450 +1025,1113 @@ func_verbose () : } -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () { - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} + $debug_cmd -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. - # bash bug again: : } -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. func_quote_for_eval () { - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac + $debug_cmd - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done } -# func_quote_for_expand arg +# func_quote_for_expand ARG +# ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { + $debug_cmd + case $1 in *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) - my_arg="$1" ;; + _G_arg=$1 ;; esac - case $my_arg in + case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" + _G_arg=\"$_G_arg\" ;; esac - func_quote_for_expand_result="$my_arg" + func_quote_for_expand_result=$_G_arg } -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { - my_cmd="$1" - my_fail_exp="${2-:}" + $debug_cmd - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } + _G_cmd=$1 + _G_fail_exp=${2-':'} - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" fi - fi + } } -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { - my_cmd="$1" - my_fail_exp="${2-:}" + $debug_cmd - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" fi - fi + } } + # func_tr_sh +# ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac } -# func_version -# Echo version message to standard output and exit. -func_version () +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () { - $opt_debug + $debug_cmd - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? + $opt_verbose && func_echo "$*" + + : } -# func_usage -# Echo short help message to standard output and exit. -func_usage () + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () { - $opt_debug + $debug_cmd - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + func_parse_options_result= + + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. func_help () { - $opt_debug + $debug_cmd - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi + func_usage_message + $ECHO "$long_help_message" + exit 0 } -# func_missing_arg argname + +# func_missing_arg ARGNAME +# ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { - $opt_debug + $debug_cmd - func_error "missing argument for $1." + func_error "Missing argument for '$1'." exit_cmd=exit } -# func_split_short_opt shortopt +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () { - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + $debug_cmd - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () { - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' + $debug_cmd - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation - -exit_cmd=: + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} - - - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () { - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation + $debug_cmd -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () { - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} -# func_arith arithmetic-term... -func_arith () +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () { - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation + $debug_cmd + + $warning_func ${1+"$@"} +} -# func_len string -# STRING may not start with a hyphen. -func_len () +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () { - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname (GNU libtool) 2.4.6 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation - - -# func_fatal_configuration arg... +# func_fatal_configuration ARG... +# ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." + func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." } # func_config +# ----------- # Display the configuration for all the tags in this script. func_config () { @@ -915,17 +2149,19 @@ func_config () exit $? } + # func_features +# ------------- # Display the features supported by this script. func_features () { echo "host: $host" - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" @@ -934,314 +2170,350 @@ func_features () exit $? } -# func_enable_tag tagname + +# func_enable_tag TAGNAME +# ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { - # Global variable: - tagname="$1" + # Global variable: + tagname=$1 - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac } + # func_check_version_match +# ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - else - cat >&2 <<_LT_EOF + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF - fi - else - cat >&2 <<_LT_EOF + fi + else + cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF - fi + fi - exit $EXIT_MISMATCH - fi + exit $EXIT_MISMATCH + fi } -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac - - - -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_warning=: -opt_verbose=: -opt_silent=false -opt_verbose=false - - -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () { - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; + $debug_mode - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-warning|--no-warn) - opt_warning=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; + nonopt= + preserve_args= - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; esac - done - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } - - - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result } +func_add_hook func_options_prep libtool_options_prep +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + ## ----------- ## ## Main. ## ## ----------- ## +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + # func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. +# True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. +# True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. +# fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no @@ -1249,13 +2521,13 @@ func_lalib_unsafe_p () for lalib_p_l in 1 2 3 4 do read lalib_p_line - case "$lalib_p_line" in + case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi - test "$lalib_p" = yes + test yes = "$lalib_p" } # func_ltwrapper_script_p file @@ -1264,7 +2536,8 @@ func_lalib_unsafe_p () # determined imposters. func_ltwrapper_script_p () { - func_lalib_p "$1" + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file @@ -1289,7 +2562,7 @@ func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file @@ -1308,11 +2581,13 @@ func_ltwrapper_p () # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { - $opt_debug + $debug_cmd + save_ifs=$IFS; IFS='~' for cmd in $1; do - IFS=$save_ifs + IFS=$sp$nl eval cmd=\"$cmd\" + IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs @@ -1324,10 +2599,11 @@ func_execute_cmds () # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. +# 'FILE.' does not work on cygwin managed mounts. func_source () { - $opt_debug + $debug_cmd + case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; @@ -1354,10 +2630,10 @@ func_resolve_sysroot () # store the result into func_replace_sysroot_result. func_replace_sysroot () { - case "$lt_sysroot:$1" in + case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" + func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. @@ -1374,7 +2650,8 @@ func_replace_sysroot () # arg is usually of the form 'gcc ...' func_infer_tag () { - $opt_debug + $debug_cmd + if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do @@ -1393,7 +2670,7 @@ func_infer_tag () for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. @@ -1418,7 +2695,7 @@ func_infer_tag () # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" + func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi @@ -1434,15 +2711,15 @@ func_infer_tag () # but don't create it if we're doing a dry run. func_write_libtool_object () { - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' else write_lobj=none fi - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' else write_oldobj=none fi @@ -1450,7 +2727,7 @@ func_write_libtool_object () $opt_dry_run || { cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` + $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi @@ -1514,18 +2792,19 @@ func_convert_core_file_wine_to_w32 () # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { - $opt_debug + $debug_cmd + # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" + func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi @@ -1554,7 +2833,8 @@ func_convert_core_path_wine_to_w32 () # environment variable; do not put it in $PATH. func_cygpath () { - $opt_debug + $debug_cmd + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then @@ -1563,7 +2843,7 @@ func_cygpath () fi else func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath @@ -1574,10 +2854,11 @@ func_cygpath () # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { - $opt_debug + $debug_cmd + # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 @@ -1588,13 +2869,14 @@ func_convert_core_msys_to_w32 () # func_to_host_file_result to ARG1). func_convert_file_check () { - $opt_debug - if test -z "$2" && test -n "$1" ; then + $debug_cmd + + if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" - func_error " \`$1'" + func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: - func_to_host_file_result="$1" + func_to_host_file_result=$1 fi } # end func_convert_file_check @@ -1606,10 +2888,11 @@ func_convert_file_check () # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { - $opt_debug + $debug_cmd + if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" - func_error " \`$3'" + func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. @@ -1618,7 +2901,7 @@ func_convert_path_check () func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else - func_to_host_path_result="$3" + func_to_host_path_result=$3 fi fi } @@ -1630,9 +2913,10 @@ func_convert_path_check () # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { - $opt_debug + $debug_cmd + case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" + $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in @@ -1646,7 +2930,7 @@ func_convert_path_front_back_pathsep () ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## -# invoked via `$to_host_file_cmd ARG' +# invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. @@ -1657,7 +2941,8 @@ func_convert_path_front_back_pathsep () # in func_to_host_file_result. func_to_host_file () { - $opt_debug + $debug_cmd + $to_host_file_cmd "$1" } # end func_to_host_file @@ -1669,7 +2954,8 @@ func_to_host_file () # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { - $opt_debug + $debug_cmd + case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 @@ -1687,7 +2973,7 @@ func_to_tool_file () # Copy ARG to func_to_host_file_result. func_convert_file_noop () { - func_to_host_file_result="$1" + func_to_host_file_result=$1 } # end func_convert_file_noop @@ -1698,11 +2984,12 @@ func_convert_file_noop () # func_to_host_file_result. func_convert_file_msys_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1714,8 +3001,9 @@ func_convert_file_msys_to_w32 () # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. @@ -1731,11 +3019,12 @@ func_convert_file_cygwin_to_w32 () # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1747,12 +3036,13 @@ func_convert_file_nix_to_w32 () # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" + func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1765,13 +3055,14 @@ func_convert_file_msys_to_cygwin () # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { - $opt_debug - func_to_host_file_result="$1" + $debug_cmd + + func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" + func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } @@ -1781,7 +3072,7 @@ func_convert_file_nix_to_cygwin () ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# -# invoked via `$to_host_path_cmd ARG' +# invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. @@ -1805,10 +3096,11 @@ func_convert_file_nix_to_cygwin () to_host_path_cmd= func_init_to_host_path_cmd () { - $opt_debug + $debug_cmd + if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" + to_host_path_cmd=func_convert_path_$func_stripname_result fi } @@ -1818,7 +3110,8 @@ func_init_to_host_path_cmd () # in func_to_host_path_result. func_to_host_path () { - $opt_debug + $debug_cmd + func_init_to_host_path_cmd $to_host_path_cmd "$1" } @@ -1829,7 +3122,7 @@ func_to_host_path () # Copy ARG to func_to_host_path_result. func_convert_path_noop () { - func_to_host_path_result="$1" + func_to_host_path_result=$1 } # end func_convert_path_noop @@ -1840,8 +3133,9 @@ func_convert_path_noop () # func_to_host_path_result. func_convert_path_msys_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; @@ -1849,7 +3143,7 @@ func_convert_path_msys_to_w32 () func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -1863,8 +3157,9 @@ func_convert_path_msys_to_w32 () # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" @@ -1883,14 +3178,15 @@ func_convert_path_cygwin_to_w32 () # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" @@ -1904,15 +3200,16 @@ func_convert_path_nix_to_w32 () # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" + func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -1927,8 +3224,9 @@ func_convert_path_msys_to_cygwin () # func_to_host_file_result. func_convert_path_nix_to_cygwin () { - $opt_debug - func_to_host_path_result="$1" + $debug_cmd + + func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them @@ -1937,7 +3235,7 @@ func_convert_path_nix_to_cygwin () func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" + func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" @@ -1946,13 +3244,31 @@ func_convert_path_nix_to_cygwin () # end func_convert_path_nix_to_cygwin +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + # func_mode_compile arg... func_mode_compile () { - $opt_debug + $debug_cmd + # Get the compilation command and the source file. base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" + srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal @@ -1965,12 +3281,12 @@ func_mode_compile () case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile - lastarg="$arg" + lastarg=$arg arg_mode=normal ;; target ) - libobj="$arg" + libobj=$arg arg_mode=normal continue ;; @@ -1980,7 +3296,7 @@ func_mode_compile () case $arg in -o) test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" + func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; @@ -2009,12 +3325,12 @@ func_mode_compile () func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for arg in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_append_quoted lastarg "$arg" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result @@ -2027,8 +3343,8 @@ func_mode_compile () # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # - lastarg="$srcfile" - srcfile="$arg" + lastarg=$srcfile + srcfile=$arg ;; esac # case $arg ;; @@ -2043,13 +3359,13 @@ func_mode_compile () func_fatal_error "you must specify an argument for -Xcompile" ;; target) - func_fatal_error "you must specify a target with \`-o'" + func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" - libobj="$func_basename_result" + libobj=$func_basename_result } ;; esac @@ -2069,7 +3385,7 @@ func_mode_compile () case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) - func_fatal_error "cannot determine name of library object from \`$libobj'" + func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac @@ -2078,8 +3394,8 @@ func_mode_compile () for arg in $later; do case $arg in -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; @@ -2105,17 +3421,17 @@ func_mode_compile () func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." + && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" @@ -2127,16 +3443,16 @@ func_mode_compile () pic_mode=default ;; esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock else output_obj= need_locks=no @@ -2145,12 +3461,12 @@ func_mode_compile () # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then + if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done - elif test "$need_locks" = warn; then + elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: @@ -2158,7 +3474,7 @@ func_mode_compile () This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you +your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -2180,11 +3496,11 @@ compiler." qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile - if test "$pic_mode" != no; then + if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code @@ -2201,7 +3517,7 @@ compiler." func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -2212,7 +3528,7 @@ $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you +your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -2228,20 +3544,20 @@ compiler." fi # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then + if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi - if test "$compiler_c_o" = yes; then + if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi @@ -2250,7 +3566,7 @@ compiler." func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - if test "$need_locks" = warn && + if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: @@ -2261,7 +3577,7 @@ $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you +your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." @@ -2281,7 +3597,7 @@ compiler." func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked - if test "$need_locks" != no; then + if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi @@ -2291,7 +3607,7 @@ compiler." } $opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () @@ -2311,7 +3627,7 @@ func_mode_help () Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated @@ -2330,16 +3646,16 @@ This mode accepts the following additional options: -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler -COMPILE-COMMAND is a command to be used in creating a \`standard' object file +COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." ;; execute) @@ -2352,7 +3668,7 @@ This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path -This mode sets the library path environment variable according to \`-dlopen' +This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated @@ -2371,7 +3687,7 @@ Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." +the '--dry-run' option if you just want to see what would be executed." ;; install) @@ -2381,7 +3697,7 @@ the \`--dry-run' option if you just want to see what would be executed." Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. +either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: @@ -2407,7 +3723,7 @@ The following components of LINK-COMMAND are treated specially: -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE @@ -2421,7 +3737,8 @@ The following components of LINK-COMMAND are treated specially: -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information @@ -2441,20 +3758,20 @@ The following components of LINK-COMMAND are treated specially: -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) -All other options (arguments beginning with \`-') are ignored. +All other options (arguments beginning with '-') are ignored. -Every other argument is treated as a filename. Files ending in \`.la' are +Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; @@ -2465,7 +3782,7 @@ is created, otherwise an executable program is created." Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. @@ -2473,17 +3790,17 @@ Otherwise, only FILE itself is deleted using RM." ;; *) - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo - $ECHO "Try \`$progname --help' for more information about other modes." + $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then - if test "$opt_help" = :; then + if test : = "$opt_help"; then func_mode_help else { @@ -2491,7 +3808,7 @@ if $opt_help; then for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do @@ -2499,7 +3816,7 @@ if $opt_help; then func_mode_help done } | - sed '1d + $SED '1d /^When reporting/,/^Report/{ H d @@ -2516,16 +3833,17 @@ fi # func_mode_execute arg... func_mode_execute () { - $opt_debug + $debug_cmd + # The first argument is the command name. - cmd="$nonopt" + cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ - || func_fatal_help "\`$file' is not a file" + || func_fatal_help "'$file' is not a file" dir= case $file in @@ -2535,7 +3853,7 @@ func_mode_execute () # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" + || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= @@ -2546,18 +3864,18 @@ func_mode_execute () if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" + func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; @@ -2565,18 +3883,18 @@ func_mode_execute () *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result ;; *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" + test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then @@ -2588,7 +3906,7 @@ func_mode_execute () # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. - libtool_execute_magic="$magic" + libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= @@ -2601,12 +3919,12 @@ func_mode_execute () if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. - file="$progdir/$program" + file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. - file="$progdir/$program" + file=$progdir/$program fi ;; esac @@ -2614,7 +3932,15 @@ func_mode_execute () func_append_quoted args "$file" done - if test "X$opt_dry_run" = Xfalse; then + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" @@ -2631,25 +3957,18 @@ func_mode_execute () done # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS + exec_cmd=\$cmd$args fi } -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { - $opt_debug + $debug_cmd + libs= libdirs= admincmds= @@ -2663,11 +3982,11 @@ func_mode_finish () if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else - func_warning "\`$opt' is not a valid libtool archive" + func_warning "'$opt' is not a valid libtool archive" fi else - func_fatal_error "invalid argument \`$opt'" + func_fatal_error "invalid argument '$opt'" fi done @@ -2682,12 +4001,12 @@ func_mode_finish () # Remove sysroot references if $opt_dry_run; then for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done @@ -2712,7 +4031,7 @@ func_mode_finish () fi # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS + $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" @@ -2723,27 +4042,27 @@ func_mode_finish () echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" + $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo @@ -2762,18 +4081,20 @@ func_mode_finish () exit $EXIT_SUCCESS } -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { - $opt_debug + $debug_cmd + # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then + case $nonopt in *shtool*) :;; *) false;; esac + then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -2800,7 +4121,7 @@ func_mode_install () opts= prev= install_type= - isdir=no + isdir=false stripme= no_mode=: for arg @@ -2813,7 +4134,7 @@ func_mode_install () fi case $arg in - -d) isdir=yes ;; + -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg @@ -2831,7 +4152,7 @@ func_mode_install () *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi @@ -2856,7 +4177,7 @@ func_mode_install () func_fatal_help "you must specify an install program" test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" + func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else @@ -2878,19 +4199,19 @@ func_mode_install () dest=$func_stripname_result # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" + destdir=$func_dirname_result + destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" + func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -2899,7 +4220,7 @@ func_mode_install () case $file in *.lo) ;; *) - func_fatal_help "\`$destdir' must be an absolute directory name" + func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done @@ -2908,7 +4229,7 @@ func_mode_install () # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic="$magic" + libtool_install_magic=$magic staticlibs= future_libdirs= @@ -2928,7 +4249,7 @@ func_mode_install () # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" + || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= @@ -2950,7 +4271,7 @@ func_mode_install () fi func_dirname "$file" "/" "" - dir="$func_dirname_result" + dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then @@ -2964,7 +4285,7 @@ func_mode_install () # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. @@ -2973,29 +4294,36 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi - func_warning "relinking \`$file'" + func_warning "relinking '$file'" func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then - realname="$1" + realname=$1 shift - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T + srcname=$realname + test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' - tstripme="$stripme" + tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) - tstripme="" + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= ;; esac ;; @@ -3006,7 +4334,7 @@ func_mode_install () if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on + # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname @@ -3017,14 +4345,14 @@ func_mode_install () fi # Do each command in the postinstall commands. - lib="$destdir/$realname" + lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i + name=$func_basename_result + instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. @@ -3036,11 +4364,11 @@ func_mode_install () # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile="$destdir/$destname" + destfile=$destdir/$destname else func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" + destfile=$func_basename_result + destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. @@ -3050,11 +4378,11 @@ func_mode_install () staticdest=$func_lo2o_result ;; *.$objext) - staticdest="$destfile" + staticdest=$destfile destfile= ;; *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" + func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac @@ -3063,7 +4391,7 @@ func_mode_install () func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. - if test "$build_old_libs" = yes; then + if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result @@ -3075,23 +4403,23 @@ func_mode_install () *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then - destfile="$destdir/$destname" + destfile=$destdir/$destname else func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" + destfile=$func_basename_result + destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install - stripped_ext="" + stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result - stripped_ext=".exe" + stripped_ext=.exe fi ;; esac @@ -3119,19 +4447,19 @@ func_mode_install () # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" + func_fatal_error "invalid libtool wrapper script '$wrapper'" - finalize=yes + finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false fi done @@ -3139,29 +4467,29 @@ func_mode_install () func_source "$wrapper" outputname= - if test "$fast_install" = no && test -n "$relink_command"; then + if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { - if test "$finalize" = yes; then + if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" + file=$func_basename_result + outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - $opt_silent || { + $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else - func_error "error: relink \`$file' with the above command before installing it" + func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi - file="$outputname" + file=$outputname else - func_warning "cannot relink \`$file'" + func_warning "cannot relink '$file'" fi } else @@ -3198,10 +4526,10 @@ func_mode_install () for file in $staticlibs; do func_basename "$file" - name="$func_basename_result" + name=$func_basename_result # Set up the ranlib parameters. - oldlib="$destdir/$name" + oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result @@ -3216,18 +4544,18 @@ func_mode_install () done test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" + func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } -test "$opt_mode" = install && func_mode_install ${1+"$@"} +test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -3235,16 +4563,17 @@ test "$opt_mode" = install && func_mode_install ${1+"$@"} # a dlpreopen symbol table. func_generate_dlsyms () { - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" + my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi @@ -3255,7 +4584,7 @@ func_generate_dlsyms () "") ;; *.c) # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" + nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" @@ -3263,34 +4592,36 @@ func_generate_dlsyms () func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST -#elif defined(__osf__) +#elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + /* External symbol declarations for the compiler. */\ " - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" @@ -3298,7 +4629,7 @@ extern \"C\" { progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done @@ -3318,10 +4649,10 @@ extern \"C\" { # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" + export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' @@ -3331,7 +4662,7 @@ extern \"C\" { } else $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in @@ -3345,22 +4676,22 @@ extern \"C\" { fi for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" + func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" - name="$func_basename_result" + name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" + dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then + if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" + dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" @@ -3368,7 +4699,7 @@ extern \"C\" { fi fi $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then + if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" @@ -3424,6 +4755,11 @@ extern \"C\" { echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ @@ -3432,11 +4768,30 @@ typedef struct { void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi case $need_lib_prefix in no) @@ -3478,9 +4833,7 @@ static const void *lt_preloaded_setup() { *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi + $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; @@ -3497,10 +4850,10 @@ static const void *lt_preloaded_setup() { func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" + symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then @@ -3518,7 +4871,7 @@ static const void *lt_preloaded_setup() { esac ;; *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" + func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else @@ -3532,6 +4885,32 @@ static const void *lt_preloaded_setup() { fi } +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + # func_win32_libid arg # return the library type of file 'arg' # @@ -3541,8 +4920,9 @@ static const void *lt_preloaded_setup() { # Despite the name, also deal with 64 bit binaries. func_win32_libid () { - $opt_debug - win32_libid_type="unknown" + $debug_cmd + + win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import @@ -3552,16 +4932,29 @@ func_win32_libid () # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' 1,100{ / I /{ - s,.*,import, + s|.*|import| p q } }'` + ;; + esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -3593,7 +4986,8 @@ func_win32_libid () # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { - $opt_debug + $debug_cmd + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } @@ -3610,7 +5004,8 @@ func_cygming_dll_for_implib () # specified import library. func_cygming_dll_for_implib_fallback_core () { - $opt_debug + $debug_cmd + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ @@ -3646,8 +5041,8 @@ func_cygming_dll_for_implib_fallback_core () /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually @@ -3658,30 +5053,6 @@ func_cygming_dll_for_implib_fallback_core () $SED -e '/^\./d;/^.\./d;q' } -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified @@ -3695,16 +5066,17 @@ func_cygming_ms_implib_p () # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then + elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown - sharedlib_from_linklib_result="" + sharedlib_from_linklib_result= fi } @@ -3712,10 +5084,11 @@ func_cygming_dll_for_implib_fallback () # func_extract_an_archive dir oldlib func_extract_an_archive () { - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" @@ -3724,7 +5097,7 @@ func_extract_an_archive () fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then + if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then @@ -3738,22 +5111,23 @@ func_extract_an_archive () # func_extract_archives gentop oldlib ... func_extract_archives () { - $opt_debug - my_gentop="$1"; shift + $debug_cmd + + my_gentop=$1; shift my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" - my_xlib="$func_basename_result" + my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in @@ -3765,7 +5139,7 @@ func_extract_archives () esac done extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" @@ -3778,22 +5152,23 @@ func_extract_archives () cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do @@ -3815,7 +5190,7 @@ func_extract_archives () my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done - func_extract_archives_result="$my_oldobjs" + func_extract_archives_result=$my_oldobjs } @@ -3830,7 +5205,7 @@ func_extract_archives () # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is +# will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () @@ -3841,7 +5216,7 @@ func_emit_wrapper () #! $SHELL # $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. @@ -3898,9 +5273,9 @@ _LTECHO_EOF' # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on +# /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match +# (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and @@ -3933,7 +5308,7 @@ func_parse_lt_options () # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } @@ -3944,7 +5319,7 @@ func_lt_dump_args () lt_dump_args_N=1; for lt_arg do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } @@ -3958,7 +5333,7 @@ func_exec_program_core () *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} @@ -3968,7 +5343,7 @@ func_exec_program_core () *) $ECHO "\ if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} @@ -4043,13 +5418,13 @@ func_exec_program () test -n \"\$absdir\" && thisdir=\"\$absdir\" " - if test "$fast_install" = yes; then + if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" @@ -4066,7 +5441,7 @@ func_exec_program () if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else - $ECHO \"\$relink_command_output\" >&2 + \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi @@ -4101,7 +5476,7 @@ func_exec_program () fi # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" @@ -4121,7 +5496,7 @@ func_exec_program () fi else # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 @@ -4140,7 +5515,7 @@ func_emit_cwrapperexe_src () cat < #include +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + /* declarations of non-ANSI functions */ -#if defined(__MINGW32__) +#if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif -#elif defined(__CYGWIN__) +#elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif -/* #elif defined (other platforms) ... */ +/* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) +#if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) +#elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv -#elif defined(__CYGWIN__) +#elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ +/* #elif defined other platforms ... */ #endif -#if defined(PATH_MAX) +#if defined PATH_MAX # define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) +#elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 @@ -4234,8 +5607,8 @@ int setenv (const char *, const char *, int); # define PATH_SEPARATOR ':' #endif -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 @@ -4268,10 +5641,10 @@ int setenv (const char *, const char *, int); #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ + if (stale) { free (stale); stale = 0; } \ } while (0) -#if defined(LT_DEBUGWRAPPER) +#if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; @@ -4300,11 +5673,16 @@ void lt_dump_script (FILE *f); EOF cat < 0) && IS_PATH_SEPARATOR (new_value[len-1])) + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { - new_value[len-1] = '\0'; + new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); @@ -5082,27 +6460,47 @@ EOF # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { - $opt_debug + $debug_cmd + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + # func_mode_link arg... func_mode_link () { - $opt_debug + $debug_cmd + case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra + # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not + # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. @@ -5146,10 +6544,11 @@ func_mode_link () module=no no_install=no objs= + os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no - preload=no + preload=false prev= prevarg= release= @@ -5161,7 +6560,7 @@ func_mode_link () vinfo= vinfo_number=no weak_libs= - single_module="${wl}-single_module" + single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. @@ -5169,15 +6568,15 @@ func_mode_link () do case $arg in -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then @@ -5210,7 +6609,7 @@ func_mode_link () # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do - arg="$1" + arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result @@ -5227,21 +6626,21 @@ func_mode_link () case $prev in bindir) - bindir="$arg" + bindir=$arg prev= continue ;; dlfiles|dlprefiles) - if test "$preload" = no; then + $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" - preload=yes - fi + preload=: + } case $arg in *.la | *.lo) ;; # We handle these cases below. force) - if test "$dlself" = no; then + if test no = "$dlself"; then dlself=needless export_dynamic=yes fi @@ -5249,9 +6648,9 @@ func_mode_link () continue ;; self) - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless @@ -5261,7 +6660,7 @@ func_mode_link () continue ;; *) - if test "$prev" = dlfiles; then + if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" @@ -5272,14 +6671,14 @@ func_mode_link () esac ;; expsyms) - export_symbols="$arg" + export_symbols=$arg test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" + || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) - export_symbols_regex="$arg" + export_symbols_regex=$arg prev= continue ;; @@ -5297,7 +6696,13 @@ func_mode_link () continue ;; inst_prefix) - inst_prefix_dir="$arg" + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. prev= continue ;; @@ -5321,21 +6726,21 @@ func_mode_link () if test -z "$pic_object" || test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result - if test "$pic_object" != none; then + if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" + pic_object=$xdir$pic_object - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue @@ -5346,7 +6751,7 @@ func_mode_link () fi # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -5354,23 +6759,23 @@ func_mode_link () # A PIC object. func_append libobjs " $pic_object" - arg="$pic_object" + arg=$pic_object fi # Non-PIC object. - if test "$non_pic_object" != none; then + if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" + non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" + non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else @@ -5378,7 +6783,7 @@ func_mode_link () if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -5386,24 +6791,29 @@ func_mode_link () func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "\`$arg' is not a valid libtool object" + func_fatal_error "'$arg' is not a valid libtool object" fi fi done else - func_fatal_error "link input file \`$arg' does not exist" + func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; precious_regex) - precious_files_regex="$arg" + precious_files_regex=$arg prev= continue ;; release) - release="-$arg" + release=-$arg prev= continue ;; @@ -5415,7 +6825,7 @@ func_mode_link () func_fatal_error "only absolute run-paths are allowed" ;; esac - if test "$prev" = rpath; then + if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; @@ -5430,7 +6840,7 @@ func_mode_link () continue ;; shrext) - shrext_cmds="$arg" + shrext_cmds=$arg prev= continue ;; @@ -5470,7 +6880,7 @@ func_mode_link () esac fi # test -n "$prev" - prevarg="$arg" + prevarg=$arg case $arg in -all-static) @@ -5484,7 +6894,7 @@ func_mode_link () -allow-undefined) # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" + func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) @@ -5516,7 +6926,7 @@ func_mode_link () if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi - if test "X$arg" = "X-export-symbols"; then + if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex @@ -5550,9 +6960,9 @@ func_mode_link () func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" + func_fatal_error "require no space between '-L' and '$1'" else - func_fatal_error "need path for \`-L' option" + func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" @@ -5563,8 +6973,8 @@ func_mode_link () *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir ;; esac case "$deplibs " in @@ -5599,7 +7009,7 @@ func_mode_link () ;; -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) @@ -5607,11 +7017,11 @@ func_mode_link () ;; *-*-os2*) # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework @@ -5620,16 +7030,16 @@ func_mode_link () ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue + test X-lc = "X$arg" && continue ;; esac - elif test "X$arg" = "X-lc_r"; then + elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -5639,6 +7049,11 @@ func_mode_link () continue ;; + -mllvm) + prev=mllvm + continue + ;; + -module) module=yes continue @@ -5668,7 +7083,7 @@ func_mode_link () ;; -multi_module) - single_module="${wl}-multi_module" + single_module=$wl-multi_module continue ;; @@ -5682,8 +7097,8 @@ func_mode_link () *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; @@ -5701,6 +7116,11 @@ func_mode_link () continue ;; + -os2dllname) + prev=os2dllname + continue + ;; + -o) prev=output ;; -precious-files-regex) @@ -5788,14 +7208,14 @@ func_mode_link () func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for flag in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -5804,15 +7224,15 @@ func_mode_link () func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= - save_ifs="$IFS"; IFS=',' + save_ifs=$IFS; IFS=, for flag in $args; do - IFS="$save_ifs" + IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done - IFS="$save_ifs" + IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; @@ -5835,7 +7255,7 @@ func_mode_link () # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: @@ -5847,25 +7267,46 @@ func_mode_link () # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; *.$objext) @@ -5886,21 +7327,21 @@ func_mode_link () if test -z "$pic_object" || test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result - if test "$pic_object" != none; then + test none = "$pic_object" || { # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" + pic_object=$xdir$pic_object - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue @@ -5911,7 +7352,7 @@ func_mode_link () fi # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then + if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= @@ -5919,23 +7360,23 @@ func_mode_link () # A PIC object. func_append libobjs " $pic_object" - arg="$pic_object" - fi + arg=$pic_object + } # Non-PIC object. - if test "$non_pic_object" != none; then + if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" + non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" + non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else @@ -5943,7 +7384,7 @@ func_mode_link () if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" - xdir="$func_dirname_result" + xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result @@ -5951,7 +7392,7 @@ func_mode_link () func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else - func_fatal_error "\`$arg' is not a valid libtool object" + func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; @@ -5967,11 +7408,11 @@ func_mode_link () # A libtool-controlled library. func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then + if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= - elif test "$prev" = dlprefiles; then + elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= @@ -5986,7 +7427,7 @@ func_mode_link () # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" + arg=$func_quote_for_eval_result ;; esac # arg @@ -5998,9 +7439,9 @@ func_mode_link () done # argument parsing loop test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" + func_fatal_help "the '$prevarg' option requires an argument" - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -6009,20 +7450,23 @@ func_mode_link () oldlibs= # calculate the name of the file, without its directory func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" + outputname=$func_basename_result + libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" + output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. @@ -6045,7 +7489,7 @@ func_mode_link () # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6053,7 +7497,7 @@ func_mode_link () func_append libs " $deplib" done - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps @@ -6085,7 +7529,7 @@ func_mode_link () case $file in *.la) ;; *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done @@ -6093,7 +7537,7 @@ func_mode_link () prog) compile_deplibs= finalize_deplibs= - alldeplibs=no + alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" @@ -6105,29 +7549,29 @@ func_mode_link () for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then + if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done - deplibs="$tmp_deplibs" + deplibs=$tmp_deplibs fi - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs deplibs= fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then + if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs @@ -6148,26 +7592,26 @@ func_mode_link () esac done done - libs="$dlprefiles" + libs=$dlprefiles fi - if test "$pass" = dlopen; then + if test dlopen = "$pass"; then # Collect dlpreopened libraries - save_deplibs="$deplibs" + save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= - found=no + found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then + if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -6177,13 +7621,13 @@ func_mode_link () continue ;; -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" @@ -6191,31 +7635,22 @@ func_mode_link () for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" + lib=$searchdir/lib$name$search_ext if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes + if test .la = "$search_ext"; then + found=: else - found=no + found=false fi break 2 fi done done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library + if $found; then + # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then @@ -6223,19 +7658,19 @@ func_mode_link () old_library= func_source "$lib" for l in $old_library $library_names; do - ll="$l" + ll=$l done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no + if test "X$ll" = "X$old_library"; then # only static version available + found=false func_dirname "$lib" "" "." - ladir="$func_dirname_result" + ladir=$func_dirname_result lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi @@ -6244,15 +7679,25 @@ func_mode_link () *) ;; esac fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue fi ;; # -l *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then + if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; @@ -6265,18 +7710,18 @@ func_mode_link () case $linkmode in lib) deplibs="$deplib $deplibs" - test "$pass" = conv && continue + test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi - if test "$pass" = scan; then + if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -6287,13 +7732,13 @@ func_mode_link () func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) - func_warning "\`-L' is ignored for archives/objects" + func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) - if test "$pass" = link; then + if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result @@ -6311,7 +7756,7 @@ func_mode_link () lib=$func_resolve_sysroot_result ;; *.$libext) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi @@ -6322,21 +7767,26 @@ func_mode_link () case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) - valid_a_lib=no + valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes + valid_a_lib=: fi ;; pass_all) - valid_a_lib=yes + valid_a_lib=: ;; esac - if test "$valid_a_lib" != yes; then + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" @@ -6344,18 +7794,13 @@ func_mode_link () echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) - if test "$pass" != link; then + if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" @@ -6366,10 +7811,10 @@ func_mode_link () esac # linkmode ;; # *.$libext *.lo | *.$objext) - if test "$pass" = conv; then + if test conv = "$pass"; then deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" @@ -6382,22 +7827,20 @@ func_mode_link () continue ;; %DEPLIBS%) - alldeplibs=yes + alldeplibs=: continue ;; esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" + || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." - ladir="$func_dirname_result" + ladir=$func_dirname_result dlname= dlopen= @@ -6427,30 +7870,30 @@ func_mode_link () done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi - if test "$pass" = conv; then + if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" + func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6464,26 +7907,26 @@ func_mode_link () # Get the name of the library we link against. linklib= if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do - linklib="$l" + linklib=$l done fi if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" + func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't @@ -6497,40 +7940,40 @@ func_mode_link () # We need an absolute path. case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" + abs_ladir=$ladir fi ;; esac func_basename "$lib" - laname="$func_basename_result" + laname=$func_basename_result # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then + if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" + dir=$ladir + absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi @@ -6539,11 +7982,11 @@ func_mode_link () name=$func_stripname_result # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi - case "$host" in + case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both @@ -6587,9 +8030,9 @@ func_mode_link () if test -z "$libdir"; then # Link the convenience library - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then + elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else @@ -6599,14 +8042,14 @@ func_mode_link () fi - if test "$linkmode" = prog && test "$pass" != link; then + if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: fi tmp_libs= @@ -6618,14 +8061,14 @@ func_mode_link () ;; esac # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then + if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac @@ -6635,15 +8078,15 @@ func_mode_link () continue fi # $linkmode = prog... - if test "$linkmode,$pass" = "prog,link"; then + if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in + case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac @@ -6672,9 +8115,9 @@ func_mode_link () esac fi # $linkmode,$pass = prog,link... - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue @@ -6683,19 +8126,19 @@ func_mode_link () link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then + if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then + { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in - *cygwin* | *mingw* | *cegcc*) + *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) - if test "$installed" = no; then + if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi @@ -6705,24 +8148,24 @@ func_mode_link () # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" + dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" + dlopenmodule=$dlpremoduletest break fi done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. @@ -6750,43 +8193,43 @@ func_mode_link () # figure out the soname set dummy $library_names shift - realname="$1" + realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then - soname="$dlname" + soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw* | *cegcc*) + *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result - versuffix="-$major" + versuffix=-$major ;; esac eval soname=\"$soname_spec\" else - soname="$realname" + soname=$realname fi # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" + soroot=$soname func_basename "$soroot" - soname="$func_basename_result" + soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else - func_verbose "extracting exported symbol list from \`$soname'" + func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" + func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library @@ -6794,58 +8237,58 @@ func_mode_link () linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$opt_mode" != relink; then + if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" + if test no = "$hardcode_direct"; then + add=$dir/$linklib case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; + *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not + # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then + $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then + if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else - add="$dir/$old_library" + add=$dir/$old_library fi elif test -n "$old_library"; then - add="$dir/$old_library" + add=$dir/$old_library fi fi esac - elif test "$hardcode_minus_L" = no; then + elif test no = "$hardcode_minus_L"; then case $host in - *-*-sunos*) add_shlibpath="$dir" ;; + *-*-sunos*) add_shlibpath=$dir ;; esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name else lib_linked=no fi ;; relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$absdir" + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -6854,10 +8297,10 @@ func_mode_link () ;; esac fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name else lib_linked=no fi @@ -6865,7 +8308,7 @@ func_mode_link () *) lib_linked=no ;; esac - if test "$lib_linked" != yes; then + if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi @@ -6875,15 +8318,15 @@ func_mode_link () *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; @@ -6892,33 +8335,33 @@ func_mode_link () fi fi - if test "$linkmode" = prog || test "$opt_mode" = relink; then + if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then + add=-l$name + elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib else - add="$libdir/$linklib" + add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" + add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -6927,10 +8370,10 @@ func_mode_link () ;; esac fi - add="-l$name" + add=-l$name fi - if test "$linkmode" = prog; then + if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else @@ -6938,43 +8381,43 @@ func_mode_link () test -n "$add" && deplibs="$add $deplibs" fi fi - elif test "$linkmode" = prog; then + elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi - elif test "$build_libtool_libs" = yes; then + elif test yes = "$build_libtool_libs"; then # Not a shared library - if test "$deplibs_check_method" != pass_all; then + if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." + $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then + if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + echo "*** 'nm' from GNU binutils and a full rebuild may help." fi - if test "$build_old_libs" = no; then + if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else @@ -6987,11 +8430,11 @@ func_mode_link () fi fi # link shared/static library? - if test "$linkmode" = lib; then + if test lib = "$linkmode"; then if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do @@ -7005,12 +8448,12 @@ func_mode_link () *) func_append temp_deplibs " $libdir";; esac done - dependency_libs="$temp_deplibs" + dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do @@ -7020,7 +8463,7 @@ func_mode_link () func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac - if $opt_preserve_dup_deps ; then + if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; @@ -7029,12 +8472,12 @@ func_mode_link () func_append tmp_libs " $func_resolve_sysroot_result" done - if test "$link_all_deplibs" != no; then + if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in - -L*) path="$deplib" ;; + -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result @@ -7042,12 +8485,12 @@ func_mode_link () dir=$func_dirname_result # We need an absolute path. case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir fi ;; esac @@ -7055,35 +8498,35 @@ func_mode_link () case $host in *-*-darwin*) depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do depdepl=$tmp done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) - path="-L$absdir/$objdir" + path=-L$absdir/$objdir ;; esac else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" + func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" + func_warning "'$deplib' seems to be moved" - path="-L$absdir" + path=-L$absdir fi ;; esac @@ -7095,23 +8538,23 @@ func_mode_link () fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then + if test link = "$pass"; then + if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then + if test dlopen != "$pass"; then + test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do @@ -7121,12 +8564,12 @@ func_mode_link () esac done newlib_search_path= - fi + } - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else + if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" + else + vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order @@ -7184,62 +8627,93 @@ func_mode_link () eval $var=\"$tmp_libs\" done # for var fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= - for i in $dependency_libs ; do + for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) - i="" + i= ;; esac - if test -n "$i" ; then + if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" + if test prog = "$linkmode"; then + dlfiles=$newdlfiles fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles fi case $linkmode in oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; + func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" + func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" + func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" + func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ - func_warning "\`-release' is ignored for archives" + func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" + func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no - oldlibs="$output" + oldlibs=$output func_append objs "$old_deplibs" ;; lib) - # Make sure we only generate libraries of the form `libNAME.la'. + # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" @@ -7248,10 +8722,10 @@ func_mode_link () eval libname=\"$libname_spec\" ;; *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" - if test "$need_lib_prefix" != no; then + if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result @@ -7265,8 +8739,8 @@ func_mode_link () esac if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" @@ -7275,21 +8749,21 @@ func_mode_link () fi fi - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" - install_libdir="$1" + install_libdir=$1 oldlibs= if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so + # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" @@ -7298,20 +8772,20 @@ func_mode_link () fi test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" + func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. - save_ifs="$IFS"; IFS=':' + save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift - IFS="$save_ifs" + IFS=$save_ifs test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" + func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts @@ -7319,42 +8793,42 @@ func_mode_link () case $vinfo_number in yes) - number_major="$1" - number_minor="$2" - number_revision="$3" + number_major=$1 + number_minor=$2 + number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix - # which has an extra 1 added just for fun + # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|linux|osf|windows|none) + darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result - age="$number_minor" - revision="$number_revision" + age=$number_minor + revision=$number_revision ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result - age="$number_minor" - revision="$number_minor" + age=$number_minor + revision=$number_minor lt_irix_increment=no ;; esac ;; no) - current="$1" - revision="$2" - age="$3" + current=$1 + revision=$2 + age=$3 ;; esac @@ -7362,30 +8836,30 @@ func_mode_link () case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. @@ -7400,26 +8874,36 @@ func_mode_link () # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result - versuffix="$major.$age.$revision" + versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac ;; freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; + major=.$current + versuffix=.$current.$revision ;; freebsd-elf) - major=".$current" - versuffix=".$current" + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision ;; irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then + if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 @@ -7430,69 +8914,74 @@ func_mode_link () nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac - verstring="$verstring_prefix$major.$revision" + verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision - while test "$loop" -ne 0; do + while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" + verstring=$verstring_prefix$major.$iface:$verstring done - # Before this point, $major must not contain `.'. + # Before this point, $major must not contain '.'. major=.$major - versuffix="$major.$revision" + versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result - versuffix="$major.$age.$revision" + versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age - while test "$loop" -ne 0; do + while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result - verstring="$verstring:${iface}.0" + verstring=$verstring:$iface.0 done # Make executables depend on our current version. - func_append verstring ":${current}.0" + func_append verstring ":$current.0" ;; qnx) - major=".$current" - versuffix=".$current" + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current ;; sunos) - major=".$current" - versuffix=".$current.$revision" + major=.$current + versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. + # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result - versuffix="-$major" + versuffix=-$major ;; *) - func_fatal_configuration "unknown library version type \`$version_type'" + func_fatal_configuration "unknown library version type '$version_type'" ;; esac @@ -7506,42 +8995,45 @@ func_mode_link () verstring= ;; *) - verstring="0.0" + verstring=0.0 ;; esac - if test "$need_version" = no; then + if test no = "$need_version"; then versuffix= else - versuffix=".0.0" + versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then + if test yes,no = "$avoid_version,$need_version"; then major= versuffix= - verstring="" + verstring= fi # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi fi else # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" + allow_undefined_flag=$no_undefined_flag fi fi - func_generate_dlsyms "$libname" "$libname" "yes" + func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= + test " " = "$libobjs" && libobjs= - if test "$opt_mode" != relink; then + if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -7550,8 +9042,8 @@ func_mode_link () case $p in *.$objext | *.gcno) ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue @@ -7567,11 +9059,11 @@ func_mode_link () fi # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. @@ -7592,13 +9084,13 @@ func_mode_link () *) func_append finalize_rpath " $libdir" ;; esac done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" + old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in @@ -7608,7 +9100,7 @@ func_mode_link () done # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" + old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in @@ -7617,7 +9109,7 @@ func_mode_link () esac done - if test "$build_libtool_libs" = yes; then + if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) @@ -7641,7 +9133,7 @@ func_mode_link () ;; *) # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then + if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; @@ -7657,9 +9149,9 @@ func_mode_link () # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? - release="" - versuffix="" - major="" + release= + versuffix= + major= newdeplibs= droppeddeps=no case $deplibs_check_method in @@ -7688,20 +9180,20 @@ EOF -l*) func_stripname -l '' "$i" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i="" + i= ;; esac fi - if test -n "$i" ; then + if test -n "$i"; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then func_append newdeplibs " $i" else droppeddeps=yes @@ -7731,20 +9223,20 @@ EOF $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" - i="" + i= ;; esac fi - if test -n "$i" ; then + if test -n "$i"; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then func_append newdeplibs " $i" else droppeddeps=yes @@ -7781,24 +9273,24 @@ EOF -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= ;; esac fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` if test -n "$file_magic_glob"; then libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` else libnameglob=$libname fi - test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` + test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test "$want_nocaseglob" = yes; then + if test yes = "$want_nocaseglob"; then shopt -s nocaseglob potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` $nocaseglob @@ -7816,25 +9308,25 @@ EOF # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? - potlib="$potent_lib" + potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= break 2 fi done done fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -7842,7 +9334,7 @@ EOF echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then + if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -7865,30 +9357,30 @@ EOF -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= ;; esac fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test + potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" - a_deplib="" + a_deplib= break 2 fi done done fi - if test -n "$a_deplib" ; then + if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." @@ -7896,7 +9388,7 @@ EOF echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then + if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" @@ -7912,18 +9404,18 @@ EOF done # Gone through all deplibs. ;; none | unknown | *) - newdeplibs="" + newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo - if test "X$deplibs_check_method" = "Xnone"; then + if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." @@ -7947,8 +9439,8 @@ EOF ;; esac - if test "$droppeddeps" = yes; then - if test "$module" = yes; then + if test yes = "$droppeddeps"; then + if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" @@ -7957,12 +9449,12 @@ EOF if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + echo "*** 'nm' from GNU binutils and a full rebuild may help." fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else @@ -7973,14 +9465,14 @@ EOF echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." - if test "$allow_undefined" = no; then + if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else @@ -8026,7 +9518,7 @@ EOF *) func_append new_libs " $deplib" ;; esac done - deplibs="$new_libs" + deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= @@ -8034,25 +9526,25 @@ EOF dlname= # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Remove ${wl} instances when linking with ld. + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac - if test "$hardcode_into_libs" = yes; then + if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8077,7 +9569,7 @@ EOF # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then @@ -8091,8 +9583,8 @@ EOF test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -8102,19 +9594,19 @@ EOF eval library_names=\"$library_names_spec\" set dummy $library_names shift - realname="$1" + realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else - soname="$realname" + soname=$realname fi if test -z "$dlname"; then dlname=$soname fi - lib="$output_objdir/$realname" + lib=$output_objdir/$realname linknames= for link do @@ -8128,7 +9620,7 @@ EOF delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi @@ -8137,31 +9629,31 @@ EOF cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. - orig_export_symbols="$export_symbols" + orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes - fi + } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do - IFS="$save_ifs" + IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in @@ -8175,7 +9667,7 @@ EOF try_normal_branch=no ;; esac - if test "$try_normal_branch" = yes \ + if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then @@ -8186,7 +9678,7 @@ EOF output_la=$func_basename_result save_libobjs=$libobjs save_output=$output - output=${output_objdir}/${output_la}.nm + output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" @@ -8209,8 +9701,8 @@ EOF break fi done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi @@ -8218,16 +9710,16 @@ EOF fi if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine + # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -8246,11 +9738,11 @@ EOF ;; esac done - deplibs="$tmp_deplibs" + deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && + test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. @@ -8261,7 +9753,7 @@ EOF eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -8270,18 +9762,18 @@ EOF fi fi - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then + if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds @@ -8299,7 +9791,7 @@ EOF fi fi - if test "X$skipped_export" != "X:" && + if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then @@ -8332,8 +9824,8 @@ EOF last_robj= k=1 - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs @@ -8345,14 +9837,14 @@ EOF func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= - if test "$compiler_needs_object" = yes; then + if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi @@ -8367,7 +9859,7 @@ EOF else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext + output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result @@ -8379,13 +9871,13 @@ EOF func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result - if test "X$objlist" = X || + if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. - if test "$k" -eq 1 ; then + if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" @@ -8395,10 +9887,10 @@ EOF reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi - last_robj=$output_objdir/$output_la-${k}.$objext + last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext + output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result @@ -8410,9 +9902,9 @@ EOF # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" @@ -8420,9 +9912,9 @@ EOF output= fi - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. @@ -8431,16 +9923,16 @@ EOF if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi - fi + } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { + IFS=$save_ifs + $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -8448,7 +9940,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8457,7 +9949,7 @@ EOF exit $lt_exit } done - IFS="$save_ifs" + IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' @@ -8465,18 +9957,18 @@ EOF fi fi - if ${skipped_export-false}; then + ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine + # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. @@ -8485,7 +9977,7 @@ EOF export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi - fi + } libobjs=$output # Restore the value of output. @@ -8499,7 +9991,7 @@ EOF # value of $libobjs for piecewise linking. # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then + if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else @@ -8521,7 +10013,7 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -8529,11 +10021,12 @@ EOF test "X$libobjs" = "X " && libobjs= fi - save_ifs="$IFS"; IFS='~' + save_ifs=$IFS; IFS='~' for cmd in $cmds; do - IFS="$save_ifs" + IFS=$sp$nl eval cmd=\"$cmd\" - $opt_silent || { + IFS=$save_ifs + $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } @@ -8541,7 +10034,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8550,10 +10043,10 @@ EOF exit $lt_exit } done - IFS="$save_ifs" + IFS=$save_ifs # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -8573,39 +10066,39 @@ EOF done # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then + if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. - dlname="$soname" + dlname=$soname fi fi ;; obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; + func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" + func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" + func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" + func_warning "'-version-info' is ignored for objects" test -n "$release" && \ - func_warning "\`-release' is ignored for objects" + func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" + func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" @@ -8613,7 +10106,7 @@ EOF ;; *) libobj= - obj="$output" + obj=$output ;; esac @@ -8626,17 +10119,19 @@ EOF # the extraction. reload_conv_objs= gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else - gentop="$output_objdir/${obj}x" + gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience @@ -8645,12 +10140,12 @@ EOF fi # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs - output="$obj" + output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. @@ -8662,7 +10157,7 @@ EOF exit $EXIT_SUCCESS fi - if test "$build_libtool_libs" != yes; then + test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi @@ -8672,12 +10167,12 @@ EOF # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS - fi + } - if test -n "$pic_flag" || test "$pic_mode" != default; then + if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" - output="$libobj" + output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi @@ -8694,16 +10189,14 @@ EOF output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" + func_warning "'-version-info' is ignored for programs" test -n "$release" && \ - func_warning "\`-release' is ignored for programs" + func_warning "'-release' is ignored for programs" - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) @@ -8717,11 +10210,11 @@ EOF *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then + if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" ;; esac fi @@ -8757,7 +10250,7 @@ EOF *) func_append new_libs " $deplib" ;; esac done - compile_deplibs="$new_libs" + compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" @@ -8781,7 +10274,7 @@ EOF if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8804,7 +10297,7 @@ EOF fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; @@ -8821,10 +10314,10 @@ EOF # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi - compile_rpath="$rpath" + compile_rpath=$rpath rpath= hardcode_libdirs= @@ -8832,7 +10325,7 @@ EOF if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" + hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in @@ -8857,45 +10350,43 @@ EOF # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" + libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi - finalize_rpath="$rpath" + finalize_rpath=$rpath - if test -n "$libobjs" && test "$build_old_libs" = yes; then + if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi - wrappers_required=yes + wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no + wrappers_required=false ;; *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi + test yes = "$build_libtool_libs" || wrappers_required=false ;; *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false fi ;; esac - if test "$wrappers_required" = no; then + $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" + link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 @@ -8908,12 +10399,12 @@ EOF fi # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status - fi + } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" @@ -8943,9 +10434,9 @@ EOF fi fi - if test "$no_install" = yes; then + if test yes = "$no_install"; then # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" + link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. @@ -8962,27 +10453,28 @@ EOF exit $EXIT_SUCCESS fi - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` @@ -9039,8 +10531,8 @@ EOF func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 @@ -9061,7 +10553,7 @@ EOF trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then + if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result @@ -9084,25 +10576,27 @@ EOF # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience build_libtool_libs=no - else + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs @@ -9110,13 +10604,13 @@ EOF fi # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles @@ -9137,7 +10631,7 @@ EOF : else echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" + gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs @@ -9146,7 +10640,7 @@ EOF for obj in $save_oldobjs do func_basename "$obj" - objbase="$func_basename_result" + objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) @@ -9215,18 +10709,18 @@ EOF else # the above command should be used before it gets too long oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then + if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist - if test "X$oldobjs" = "X" ; then + if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" @@ -9243,7 +10737,7 @@ EOF case $output in *.la) old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" + test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior @@ -9258,31 +10752,31 @@ EOF fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then + if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do - if test "$installed" = yes; then + if test yes = "$installed"; then if test -z "$install_libdir"; then break fi - output="$output_objdir/$outputname"i + output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" - name="$func_basename_result" + name=$func_basename_result func_resolve_sysroot "$deplib" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" + func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) @@ -9298,23 +10792,23 @@ EOF *) func_append newdependency_libs " $deplib" ;; esac done - dependency_libs="$newdependency_libs" + dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" + func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done - dlfiles="$newdlfiles" + dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in @@ -9324,34 +10818,34 @@ EOF # didn't already link the preopened objects directly into # the library: func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" + func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done - dlprefiles="$newdlprefiles" + dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done - dlfiles="$newdlfiles" + dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done - dlprefiles="$newdlprefiles" + dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin @@ -9367,10 +10861,9 @@ EOF case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then + if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname + tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname @@ -9379,7 +10872,7 @@ EOF esac $ECHO > $output "\ # $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. @@ -9393,7 +10886,7 @@ library_names='$library_names' # The name of the static archive. old_library='$old_library' -# Linker flags that can not go in dependency_libs. +# Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. @@ -9419,7 +10912,7 @@ dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then + if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi @@ -9434,27 +10927,29 @@ relink_command=\"$relink_command\"" exit $EXIT_SUCCESS } -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi # func_mode_uninstall arg... func_mode_uninstall () { - $opt_debug - RM="$nonopt" + $debug_cmd + + RM=$nonopt files= - rmforce= + rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. - libtool_install_magic="$magic" + libtool_install_magic=$magic for arg do case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; + -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac @@ -9467,18 +10962,18 @@ func_mode_uninstall () for file in $files; do func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir else - odir="$dir/$objdir" + odir=$dir/$objdir fi func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then + if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; @@ -9493,11 +10988,11 @@ func_mode_uninstall () elif test -d "$file"; then exit_status=1 continue - elif test "$rmforce" = yes; then + elif $rmforce; then continue fi - rmfiles="$file" + rmfiles=$file case $name in *.la) @@ -9511,7 +11006,7 @@ func_mode_uninstall () done test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$opt_mode" in + case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; @@ -9522,12 +11017,12 @@ func_mode_uninstall () uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; @@ -9543,21 +11038,19 @@ func_mode_uninstall () func_source $dir/$name # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then + if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then + if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$opt_mode" = clean ; then + if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) @@ -9584,12 +11077,12 @@ func_mode_uninstall () # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi - if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" fi fi fi @@ -9598,7 +11091,7 @@ func_mode_uninstall () func_show_eval "$RM $rmfiles" 'exit_status=1' done - # Try to remove the ${objdir}s in the directories where we deleted files + # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" @@ -9608,16 +11101,17 @@ func_mode_uninstall () exit $exit_status } -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi test -z "$opt_mode" && { - help="$generic_help" + help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" @@ -9628,7 +11122,7 @@ exit $exit_status # The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting +# where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support @@ -9651,5 +11145,3 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # mode:shell-script # sh-indentation:2 # End: -# vi:sw=2 - diff --git a/makefile.ansi b/makefile.ansi index c0fe72b1..8b980b6f 100644 --- a/makefile.ansi +++ b/makefile.ansi @@ -60,17 +60,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms diff --git a/makefile.b32 b/makefile.b32 new file mode 100644 index 00000000..ae189b0d --- /dev/null +++ b/makefile.b32 @@ -0,0 +1,243 @@ +# Makefile for Independent JPEG Group's software + +# This makefile is suitable for Borland C on MS-DOS. +# It works with Borland C++ 32-bit for DOS, revision 5.0 or later. +# Thanks to Tom Wright and Ge' Weijers (original DOS) and +# Joe Slater for adding 32-bit additions (needed for Borland +# revision 5.5). + +# Read installation instructions before saying "make" !! + +# The name of your C compiler: +CC= bcc32 + +# You may need to adjust these cc options: +CFLAGS= -O2 -w-par -w-stu -w-ccc -w-rch -w-aus +# -w-par suppresses warnings about unused function parameters +# -w-stu suppresses warnings about incomplete structures +# -w-ccc suppresses warnings about compile-time-constant conditions +# -w-rch suppresses warnings about unreachable code +# Generally, we recommend defining any configuration symbols in jconfig.h, +# NOT via -D switches here. + +# Link-time cc options: +LDFLAGS= +# -lc case-significant link + +# Put here the object file name for the correct system-dependent memory +# manager file. +# SYSDEPMEMLIB must list the same files with "+" signs for the librarian. +SYSDEPMEM= jmemnobs.obj +SYSDEPMEMLIB= +jmemnobs.obj + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \ + jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \ + jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \ + jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj +# decompression library object files +DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \ + jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \ + jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \ + jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \ + jdmerge.obj +# These objectfiles are included in libjpeg.lib +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \ + rdswitch.obj cdjpeg.obj +DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \ + rdcolmap.obj cdjpeg.obj +TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj + + +all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + +libjpeg.lib: $(LIBOBJECTS) + - del libjpeg.lib + tlib libjpeg.lib /E /C @&&| ++jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj +jcparam.obj & ++jdatadst.obj +jcinit.obj +jcmaster.obj +jcmarker.obj +jcmainct.obj & ++jcprepct.obj +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj & ++jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj +jfdctint.obj +jdapimin.obj & ++jdapistd.obj +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj & ++jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj +jdcoefct.obj & ++jdpostct.obj +jddctmgr.obj +jidctfst.obj +jidctflt.obj +jidctint.obj & ++jdsample.obj +jdcolor.obj +jquant1.obj +jquant2.obj +jdmerge.obj & ++jaricom.obj +jcomapi.obj +jutils.obj +jerror.obj +jmemmgr.obj & +$(SYSDEPMEMLIB) +| + +cjpeg.exe: $(COBJECTS) libjpeg.lib + $(CC) $(LDFLAGS) -ecjpeg.exe $(COBJECTS) libjpeg.lib + +djpeg.exe: $(DOBJECTS) libjpeg.lib + $(CC) $(LDFLAGS) -edjpeg.exe $(DOBJECTS) libjpeg.lib + +jpegtran.exe: $(TROBJECTS) libjpeg.lib + $(CC) $(LDFLAGS) -ejpegtran.exe $(TROBJECTS) libjpeg.lib + +rdjpgcom.exe: rdjpgcom.c + $(CC) $(CFLAGS) rdjpgcom.c + +wrjpgcom.exe: wrjpgcom.c + $(CC) $(CFLAGS) wrjpgcom.c + +# This "{}" syntax allows Borland Make to "batch" source files. +# In this way, each run of the compiler can build many modules. +.c.obj: + $(CC) $(CFLAGS) -c{ $<} + +jconfig.h: jconfig.txt + echo You must prepare a system-dependent jconfig.h file. + echo Please read the installation directions in install.txt. + exit 1 + +clean: + - del *.obj + - del libjpeg.lib + - del cjpeg.exe + - del djpeg.exe + - del jpegtran.exe + - del rdjpgcom.exe + - del wrjpgcom.exe + - del testout*.* + +test: cjpeg.exe djpeg.exe jpegtran.exe + - del testout*.* + djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + cjpeg -dct int -outfile testout.jpg testimg.ppm + djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + jpegtran -outfile testoutt.jpg testprog.jpg + echo n > n.tmp + comp testimg.ppm testout.ppm < n.tmp + comp testimg.bmp testout.bmp < n.tmp + comp testimg.jpg testout.jpg < n.tmp + comp testimg.ppm testoutp.ppm < n.tmp + comp testimgp.jpg testoutp.jpg < n.tmp + comp testorig.jpg testoutt.jpg < n.tmp + del n.tmp + + +jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h +cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +jmemdosa.obj: jmemdosa.asm + tasm /mx jmemdosa.asm diff --git a/makefile.bcc b/makefile.bcc index 68d68ef0..b573c901 100644 --- a/makefile.bcc +++ b/makefile.bcc @@ -87,17 +87,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms diff --git a/makefile.dj b/makefile.dj index f37c1216..e145d6a1 100644 --- a/makefile.dj +++ b/makefile.dj @@ -60,17 +60,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms diff --git a/makefile.manx b/makefile.manx index 57a1bb93..9f15d6a0 100644 --- a/makefile.manx +++ b/makefile.manx @@ -61,17 +61,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms diff --git a/makefile.mc6 b/makefile.mc6 index 7dd37f19..890eb422 100644 --- a/makefile.mc6 +++ b/makefile.mc6 @@ -58,17 +58,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms diff --git a/makefile.mms b/makefile.mms index 53493060..9a5fb9a5 100644 --- a/makefile.mms +++ b/makefile.mms @@ -47,17 +47,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms diff --git a/makefile.sas b/makefile.sas index ba0d63b9..cd513d53 100644 --- a/makefile.sas +++ b/makefile.sas @@ -69,17 +69,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms diff --git a/makefile.unix b/makefile.unix index 7dfaf10b..8d5ea883 100644 --- a/makefile.unix +++ b/makefile.unix @@ -64,17 +64,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms diff --git a/makefile.vc b/makefile.vc index ae461799..b9b82071 100644 --- a/makefile.vc +++ b/makefile.vc @@ -57,17 +57,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \ + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \ + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 \ + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 \ + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 \ + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 \ + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 \ + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 \ + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac \ + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx \ + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ jconfig.vms diff --git a/makefile.wat b/makefile.wat index 9cb8d611..d9002611 100644 --- a/makefile.wat +++ b/makefile.wat @@ -59,17 +59,17 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h & DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 & wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt & coderules.txt filelist.txt change.log -MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc & - makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 & - makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 & - makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 & - maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 & - makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 & - makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 & - makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 & - makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st & - makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas & - makefile.mms makefile.vms makvms.opt +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 & + makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc & + makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 & + makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 & + makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 & + makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 & + makejsln.v10 makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 & + makecfil.v10 makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 & + makervcx.v10 makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac & + makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st makefile.manx & + makefile.sas makefile.mms makefile.vms makvms.opt CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat & jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas & jconfig.vms diff --git a/missing b/missing index db98974f..f62bbae3 100755 --- a/missing +++ b/missing @@ -3,7 +3,7 @@ scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff --git a/rdswitch.c b/rdswitch.c index 7a839af7..b5aba83c 100644 --- a/rdswitch.c +++ b/rdswitch.c @@ -2,6 +2,7 @@ * rdswitch.c * * Copyright (C) 1991-1996, Thomas G. Lane. + * Modified 2003-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -347,8 +348,9 @@ set_sample_factors (j_compress_ptr cinfo, char *arg) return FALSE; if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */ return FALSE; - if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) { - fprintf(stderr, "JPEG sampling factors must be 1..4\n"); + if (val1 <= 0 || val1 > MAX_SAMP_FACTOR || + val2 <= 0 || val2 > MAX_SAMP_FACTOR) { + fprintf(stderr, "JPEG sampling factors must be 1..%d\n", MAX_SAMP_FACTOR); return FALSE; } cinfo->comp_info[ci].h_samp_factor = val1; diff --git a/usage.txt b/usage.txt index 75140e59..6752a77f 100644 --- a/usage.txt +++ b/usage.txt @@ -14,7 +14,7 @@ INTRODUCTION These programs implement JPEG image encoding, decoding, and transcoding. JPEG (pronounced "jay-peg") is a standardized compression method for -full-color and gray-scale images. +full-color and grayscale images. GENERAL USAGE @@ -47,12 +47,13 @@ or This syntax works on all systems, so it is useful for scripts. The currently supported image file formats are: PPM (PBMPLUS color format), -PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster Toolkit -format). (RLE is supported only if the URT library is available.) -cjpeg recognizes the input image format automatically, with the exception -of some Targa-format files. You have to tell djpeg which format to generate. +PGM (PBMPLUS grayscale format), BMP, Targa, and RLE (Utah Raster Toolkit +format). (RLE is supported only if the URT library is available, which it +isn't on most non-Unix systems.) cjpeg recognizes the input image format +automatically, with the exception of some Targa-format files. You have to +tell djpeg which format to generate. -JPEG files are in the defacto standard JFIF file format. There are other, +JPEG files are in the standard JFIF file format. There are other, less widely used JPEG-based file formats, but we don't support them. All switch names may be abbreviated; for example, -grayscale may be written @@ -292,10 +293,14 @@ The basic command line switches for djpeg are: highest quality output.) Currently, this is equivalent to "-dct fast -nosmooth -onepass -dither ordered". - -grayscale Force gray-scale output even if JPEG file is color. + -grayscale Force grayscale output even if JPEG file is color. Useful for viewing on monochrome displays; also, djpeg runs noticeably faster in this mode. + -rgb Force RGB output even if JPEG file is grayscale. + This is provided to support applications that don't + want to cope with grayscale as a separate case. + -scale M/N Scale the output image by a factor M/N. Currently supported scale factors are M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for @@ -309,7 +314,7 @@ The basic command line switches for djpeg are: -bmp Select BMP output format (Windows flavor). 8-bit colormapped format is emitted if -colors or -grayscale - is specified, or if the JPEG file is gray-scale; + is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color format is emitted. -gif Select GIF output format. Since GIF does not support @@ -319,18 +324,18 @@ The basic command line switches for djpeg are: -os2 Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format is emitted if -colors or -grayscale - is specified, or if the JPEG file is gray-scale; + is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color format is emitted. -pnm Select PBMPLUS (PPM/PGM) output format (this is the default format). PGM is emitted if the JPEG file is - gray-scale or if -grayscale is specified; otherwise + grayscale or if -grayscale is specified; otherwise PPM is emitted. -rle Select RLE output format. (Requires URT library.) - -targa Select Targa output format. Gray-scale format is - emitted if the JPEG file is gray-scale or if + -targa Select Targa output format. Grayscale format is + emitted if the JPEG file is grayscale or if -grayscale is specified; otherwise, colormapped format is emitted if -colors is specified; otherwise, 24-bit full-color format is emitted. @@ -372,7 +377,7 @@ Switches for advanced users: The one-pass method is faster and needs less memory, but it produces a lower-quality image. -onepass is ignored unless you also say -colors N. Also, - the one-pass method is always used for gray-scale + the one-pass method is always used for grayscale output (the two-pass method is no improvement then). -maxmemory N Set limit for amount of memory to use in processing @@ -479,14 +484,16 @@ jpegtran performs various useful transformations of JPEG files. It can translate the coded representation from one variant of JPEG to another, for example from baseline JPEG to progressive JPEG or vice versa. It can also perform some rearrangements of the image data, for example turning an image -from landscape to portrait format by rotation. +from landscape to portrait format by rotation. For EXIF files and JPEG files +containing Exif data, you may prefer to use exiftran instead. jpegtran works by rearranging the compressed data (DCT coefficients), without ever fully decoding the image. Therefore, its transformations are lossless: there is no image degradation at all, which would not be true if you used djpeg followed by cjpeg to accomplish the same conversion. But by the same token, jpegtran cannot perform lossy operations such as changing the image -quality. +quality. However, while the image data is losslessly transformed, metadata +can be removed. See the -copy option for specifics. jpegtran uses a command line syntax similar to cjpeg or djpeg. On Unix-like systems, you say: @@ -557,7 +564,8 @@ this does not hold for the given crop parameters, we silently move the upper left corner up and/or left to make it so, simultaneously increasing the region dimensions to keep the lower right crop corner unchanged. (Thus, the output image covers at least the requested region, but may cover more.) -The adjustment of the region dimensions may be optionally disabled. +The adjustment of the region dimensions may be optionally disabled by +attaching an 'f' character ("force") to the width or height number. The image can be losslessly cropped by giving the switch: -crop WxH+X+Y Crop to a rectangular subarea of width W, height H @@ -592,16 +600,18 @@ extended JPEG file at all. jpegtran also recognizes these switches that control what to do with "extra" markers, such as comment blocks: - -copy none Copy no extra markers from source file. This setting - suppresses all comments and other excess baggage - present in the source file. - -copy comments Copy only comment markers. This setting copies - comments from the source file, but discards - any other inessential (for image display) data. + -copy none Copy no extra markers from source file. + This setting suppresses all comments + and other metadata in the source file. + -copy comments Copy only comment markers. + This setting copies comments from the source file, + but discards any other metadata. -copy all Copy all extra markers. This setting preserves - miscellaneous markers found in the source file, such - as JFIF thumbnails, Exif data, and Photoshop settings. + metadata found in the source file, such as JFIF + thumbnails, Exif data, and Photoshop settings. In some files these extra markers can be sizable. + Note that this option will copy thumbnails as-is; + they will not be transformed. The default behavior is -copy comments. (Note: in IJG releases v6 and v6a, jpegtran always did the equivalent of -copy none.) diff --git a/wrgif.c b/wrgif.c index 5fe83283..e4f1e872 100644 --- a/wrgif.c +++ b/wrgif.c @@ -2,6 +2,7 @@ * wrgif.c * * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -218,7 +219,7 @@ put_3bytes (gif_dest_ptr dinfo, int val) LOCAL(void) emit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap) /* Output the GIF file header, including color map */ -/* If colormap==NULL, synthesize a gray-scale colormap */ +/* If colormap==NULL, synthesize a grayscale colormap */ { int BitsPerPixel, ColorMapSize, InitCodeSize, FlagByte; int cshift = dinfo->cinfo->data_precision - 8; @@ -270,7 +271,7 @@ emit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap) put_3bytes(dinfo, GETJSAMPLE(colormap[0][i]) >> cshift); } } else { - /* Create a gray-scale map of num_colors values, range 0..255 */ + /* Create a grayscale map of num_colors values, range 0..255 */ put_3bytes(dinfo, (i * 255 + (num_colors-1)/2) / (num_colors-1)); } } else { @@ -393,7 +394,7 @@ jinit_write_gif (j_decompress_ptr cinfo) ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->output_width, (JDIMENSION) 1); dest->pub.buffer_height = 1; - return (djpeg_dest_ptr) dest; + return &dest->pub; } #endif /* GIF_SUPPORTED */ diff --git a/wrjpgcom.c b/wrjpgcom.c index 8c04b055..d1bfcc9d 100644 --- a/wrjpgcom.c +++ b/wrjpgcom.c @@ -2,6 +2,7 @@ * wrjpgcom.c * * Copyright (C) 1994-1997, Thomas G. Lane. + * Modified 2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -453,6 +454,11 @@ main (int argc, char **argv) comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH); if (comment_arg == NULL) ERREXIT("Insufficient memory"); + if (strlen(argv[argn]+1) >= (size_t) MAX_COM_LENGTH) { + fprintf(stderr, "Comment text may not exceed %u bytes\n", + (unsigned int) MAX_COM_LENGTH); + exit(EXIT_FAILURE); + } strcpy(comment_arg, argv[argn]+1); for (;;) { comment_length = (unsigned int) strlen(comment_arg); @@ -462,9 +468,19 @@ main (int argc, char **argv) } if (++argn >= argc) ERREXIT("Missing ending quote mark"); + if (strlen(comment_arg) + 1 + strlen(argv[argn]) >= + (size_t) MAX_COM_LENGTH) { + fprintf(stderr, "Comment text may not exceed %u bytes\n", + (unsigned int) MAX_COM_LENGTH); + exit(EXIT_FAILURE); + } strcat(comment_arg, " "); strcat(comment_arg, argv[argn]); } + } else if (strlen(comment_arg) >= (size_t) MAX_COM_LENGTH) { + fprintf(stderr, "Comment text may not exceed %u bytes\n", + (unsigned int) MAX_COM_LENGTH); + exit(EXIT_FAILURE); } comment_length = (unsigned int) strlen(comment_arg); } else diff --git a/wrtarga.c b/wrtarga.c index cf104d2d..7b43169e 100644 --- a/wrtarga.c +++ b/wrtarga.c @@ -2,6 +2,7 @@ * wrtarga.c * * Copyright (C) 1991-1996, Thomas G. Lane. + * Modified 2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -73,7 +74,7 @@ write_header (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, int num_colors) targaheader[17] = 0x20; /* Top-down, non-interlaced */ if (cinfo->out_color_space == JCS_GRAYSCALE) { - targaheader[2] = 3; /* image type = uncompressed gray-scale */ + targaheader[2] = 3; /* image type = uncompressed grayscale */ targaheader[16] = 8; /* bits per pixel */ } else { /* must be RGB */ if (num_colors > 0) { @@ -247,7 +248,7 @@ jinit_write_targa (j_decompress_ptr cinfo) ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width, (JDIMENSION) 1); dest->pub.buffer_height = 1; - return (djpeg_dest_ptr) dest; + return &dest->pub; } #endif /* TARGA_SUPPORTED */ From 83aeb7b28cffa6926cf619b684be449c9c0954a5 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 17 Feb 2016 20:05:44 -0600 Subject: [PATCH 115/140] Wordsmith GIF limitations in cjpeg.1/djpeg.1 --- cjpeg.1 | 6 +++--- djpeg.1 | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cjpeg.1 b/cjpeg.1 index 9d09b810..d1dc3041 100644 --- a/cjpeg.1 +++ b/cjpeg.1 @@ -1,4 +1,4 @@ -.TH CJPEG 1 "17 December 2015" +.TH CJPEG 1 "17 February 2016" .SH NAME cjpeg \- compress an image file to a JPEG file .SH SYNOPSIS @@ -337,11 +337,11 @@ Independent JPEG Group This file was modified by The libjpeg-turbo Project to include only information relevant to libjpeg-turbo, to wordsmith certain sections, and to describe features not present in libjpeg. -.SH BUGS +.SH ISSUES Support for GIF input files was removed in cjpeg v6b due to concerns over the Unisys LZW patent. Although this patent expired in 2006, cjpeg still lacks GIF support, for these historical reasons. (Conversion of GIF files to -JPEG is usually a bad idea anyway.) +JPEG is usually a bad idea anyway, since GIF is a 256-color format.) .PP Not all variants of BMP and Targa file formats are supported. .PP diff --git a/djpeg.1 b/djpeg.1 index 17296abd..293939bf 100644 --- a/djpeg.1 +++ b/djpeg.1 @@ -1,4 +1,4 @@ -.TH DJPEG 1 "26 June 2015" +.TH DJPEG 1 "17 February 2016" .SH NAME djpeg \- decompress a JPEG file to an image file .SH SYNOPSIS @@ -281,8 +281,10 @@ Independent JPEG Group This file was modified by The libjpeg-turbo Project to include only information relevant to libjpeg-turbo, to wordsmith certain sections, and to describe features not present in libjpeg. -.SH BUGS -To avoid the Unisys LZW patent, -.B djpeg -produces uncompressed GIF files. These are larger than they should be, but -are readable by standard GIF decoders. +.SH ISSUES +Support for compressed GIF output files was removed in djpeg v6b due to +concerns over the Unisys LZW patent. Although this patent expired in 2006, +djpeg still lacks compressed GIF support, for these historical reasons. +(Conversion of JPEG files to GIF is usually a bad idea anyway, since GIF is a +256-color format.) The uncompressed GIF files that djpeg generates are larger +than they should be, but they are readable by standard GIF decoders. From ae4112884525c9ae4390c2020668831a9bade412 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 18 Feb 2016 16:02:28 -0600 Subject: [PATCH 116/140] Reorder copyright messages in cjpeg/djpeg/jpegtran Place the authors in the following order: * libjpeg-turbo authors (2009-) in descending order of the date of their most recent contribution to the project, then in ascending order of the date of their first contribution to the project * Upstream authors in descending order of the date of the first inclusion of their code (this indicates that their code serves as the foundation of this code.) This also adds Siarhei to the author list, since he contributed ARM SIMD code both as a Nokia employee and more recently as an independent developer. --- jversion.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/jversion.h b/jversion.h index d05a9596..b5ca9803 100644 --- a/jversion.h +++ b/jversion.h @@ -26,13 +26,23 @@ #endif -#define JCOPYRIGHT "Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding\n" \ - "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \ - "Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \ - "Copyright (C) 2009-2016 D. R. Commander\n" \ - "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ +/* + * NOTE: It is our convention to place the authors in the following order: + * - libjpeg-turbo authors (2009-) in descending order of the date of their + * most recent contribution to the project, then in ascending order of the + * date of their first contribution to the project + * - Upstream authors in descending order of the date of the first inclusion of + * their code + */ + +#define JCOPYRIGHT "Copyright (C) 2009-2016 D. R. Commander\n" \ + "Copyright (C) 2011-2016 Siarhei Siamashka\n" \ + "Copyright (C) 2015-2016 Matthieu Darbois\n" \ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \ "Copyright (C) 2013 Linaro Limited\n" \ - "Copyright (C) 2015 Matthieu Darbois" + "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ + "Copyright (C) 2009 Pierre Ossman for Cendio AB\n" \ + "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \ + "Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding" \ #define JCOPYRIGHT_SHORT "Copyright (C) 1991-2016 The libjpeg-turbo Project and many others" From bd49803f92da151be5c4bd3910a2840d2068e7e3 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 19 Feb 2016 08:53:33 -0600 Subject: [PATCH 117/140] Use consistent/modern code formatting for pointers The convention used by libjpeg: type * variable; is not very common anymore, because it looks too much like multiplication. Some (particularly C++ programmers) prefer to tuck the pointer symbol against the type: type* variable; to emphasize that a pointer to a type is effectively a new type. However, this can also be confusing, since defining multiple variables on the same line would not work properly: type* variable1, variable2; /* Only variable1 is actually a pointer. */ This commit reformats the entirety of the libjpeg-turbo code base so that it uses the same code formatting convention for pointers that the TurboJPEG API code uses: type *variable1, *variable2; This seems to be the most common convention among C programmers, and it is the convention used by other codec libraries, such as libpng and libtiff. --- cdjpeg.c | 2 +- cdjpeg.h | 16 ++-- cjpeg.c | 22 +++--- configure.ac | 2 +- djpeg.c | 14 ++-- example.c | 12 +-- jcapimin.c | 8 +- jcarith.c | 14 ++-- jccoefct.c | 2 +- jccolor.c | 8 +- jcdctmgr.c | 52 ++++++------- jchuff.c | 34 ++++---- jchuff.h | 2 +- jcmainct.c | 2 +- jcmarker.c | 8 +- jcmaster.c | 8 +- jcparam.c | 10 +-- jcphuff.c | 22 +++--- jcprepct.c | 8 +- jcsample.c | 18 ++--- jctrans.c | 14 ++-- jdarith.c | 14 ++-- jdatadst-tj.c | 16 ++-- jdatadst.c | 24 +++--- jdatasrc-tj.c | 6 +- jdatasrc.c | 14 ++-- jdcoefct.c | 8 +- jdcoefct.h | 6 +- jdcolor.c | 26 +++---- jdct.h | 42 +++++----- jddctmgr.c | 10 +-- jdhuff.c | 28 +++---- jdhuff.h | 8 +- jdinput.c | 4 +- jdmainct.h | 2 +- jdmarker.c | 16 ++-- jdmaster.c | 8 +- jdmerge.c | 10 +-- jdphuff.c | 16 ++-- jdpostct.c | 2 +- jdsample.c | 32 ++++---- jdsample.h | 6 +- jerror.c | 12 +-- jfdctflt.c | 2 +- jfdctfst.c | 2 +- jfdctint.c | 2 +- jidctflt.c | 6 +- jidctfst.c | 6 +- jidctint.c | 78 +++++++++---------- jidctred.c | 16 ++-- jmemmgr.c | 14 ++-- jmemnobs.c | 6 +- jmemsys.h | 12 +-- jpegint.h | 6 +- jpeglib.h | 132 +++++++++++++++---------------- jpegtran.c | 14 ++-- jquant1.c | 10 +-- jquant2.c | 20 ++--- jsimd.h | 28 +++---- jsimd_none.c | 63 +++++++-------- jsimddct.h | 32 ++++---- jutils.c | 2 +- libjpeg.txt | 18 ++--- rdbmp.c | 2 +- rdcolmap.c | 10 +-- rdjpgcom.c | 10 +-- rdppm.c | 18 ++--- rdrle.c | 8 +- rdswitch.c | 17 ++-- rdtarga.c | 2 +- simd/jchuff-sse2-64.asm | 2 +- simd/jchuff-sse2.asm | 4 +- simd/jdsample-altivec.c | 4 +- simd/jdsample-mmx.asm | 18 ++--- simd/jdsample-sse2-64.asm | 16 ++-- simd/jdsample-sse2.asm | 18 ++--- simd/jfdctflt-3dn.asm | 4 +- simd/jfdctflt-sse-64.asm | 4 +- simd/jfdctflt-sse.asm | 4 +- simd/jfdctfst-mmx.asm | 4 +- simd/jfdctfst-sse2-64.asm | 4 +- simd/jfdctfst-sse2.asm | 4 +- simd/jfdctint-mmx.asm | 4 +- simd/jfdctint-sse2-64.asm | 4 +- simd/jfdctint-sse2.asm | 4 +- simd/jidctflt-3dn.asm | 8 +- simd/jidctflt-sse.asm | 8 +- simd/jidctflt-sse2-64.asm | 8 +- simd/jidctflt-sse2.asm | 8 +- simd/jidctfst-altivec.c | 2 +- simd/jidctfst-mmx.asm | 8 +- simd/jidctfst-sse2-64.asm | 4 +- simd/jidctfst-sse2.asm | 4 +- simd/jidctint-altivec.c | 2 +- simd/jidctint-mmx.asm | 8 +- simd/jidctint-sse2-64.asm | 4 +- simd/jidctint-sse2.asm | 4 +- simd/jidctred-mmx.asm | 12 +-- simd/jidctred-sse2-64.asm | 8 +- simd/jidctred-sse2.asm | 8 +- simd/jquant-3dn.asm | 12 +-- simd/jquant-mmx.asm | 12 +-- simd/jquant-sse.asm | 12 +-- simd/jquantf-sse2-64.asm | 12 +-- simd/jquantf-sse2.asm | 12 +-- simd/jquanti-altivec.c | 6 +- simd/jquanti-sse2-64.asm | 12 +-- simd/jquanti-sse2.asm | 12 +-- simd/jsimd.h | 160 +++++++++++++++++++------------------- simd/jsimd_arm.c | 50 ++++++------ simd/jsimd_arm64.c | 50 ++++++------ simd/jsimd_arm64_neon.S | 8 +- simd/jsimd_arm_neon.S | 10 +-- simd/jsimd_i386.c | 50 ++++++------ simd/jsimd_mips.c | 68 ++++++++-------- simd/jsimd_powerpc.c | 50 ++++++------ simd/jsimd_x86_64.c | 50 ++++++------ transupp.c | 6 +- transupp.h | 2 +- wrbmp.c | 6 +- wrgif.c | 2 +- wrjpgcom.c | 18 ++--- wrppm.c | 8 +- wrrle.c | 4 +- wrtarga.c | 8 +- 125 files changed, 980 insertions(+), 978 deletions(-) diff --git a/cdjpeg.c b/cdjpeg.c index fe99de86..441d6714 100644 --- a/cdjpeg.c +++ b/cdjpeg.c @@ -82,7 +82,7 @@ end_progress_monitor (j_common_ptr cinfo) */ GLOBAL(boolean) -keymatch (char * arg, const char * keyword, int minchars) +keymatch (char *arg, const char *keyword, int minchars) { register int ca, ck; register int nmatched = 0; diff --git a/cdjpeg.h b/cdjpeg.h index 8fc337df..a65310e7 100644 --- a/cdjpeg.h +++ b/cdjpeg.h @@ -24,7 +24,7 @@ * Object interface for cjpeg's source file decoding modules */ -typedef struct cjpeg_source_struct * cjpeg_source_ptr; +typedef struct cjpeg_source_struct *cjpeg_source_ptr; struct cjpeg_source_struct { void (*start_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo); @@ -42,7 +42,7 @@ struct cjpeg_source_struct { * Object interface for djpeg's output file encoding modules */ -typedef struct djpeg_dest_struct * djpeg_dest_ptr; +typedef struct djpeg_dest_struct *djpeg_dest_ptr; struct djpeg_dest_struct { /* start_output is called after jpeg_start_decompress finishes. @@ -56,7 +56,7 @@ struct djpeg_dest_struct { void (*finish_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo); /* Target file spec; filled in by djpeg.c after object is created. */ - FILE * output_file; + FILE *output_file; /* Output pixel-row buffer. Created by module init or start_output. * Width is cinfo->output_width * cinfo->output_components; @@ -83,7 +83,7 @@ struct cdjpeg_progress_mgr { int percent_done; }; -typedef struct cdjpeg_progress_mgr * cd_progress_ptr; +typedef struct cdjpeg_progress_mgr *cd_progress_ptr; /* Module selection routines for I/O modules. */ @@ -102,9 +102,9 @@ EXTERN(djpeg_dest_ptr) jinit_write_targa (j_decompress_ptr cinfo); /* cjpeg support routines (in rdswitch.c) */ -EXTERN(boolean) read_quant_tables (j_compress_ptr cinfo, char * filename, +EXTERN(boolean) read_quant_tables (j_compress_ptr cinfo, char *filename, boolean force_baseline); -EXTERN(boolean) read_scan_script (j_compress_ptr cinfo, char * filename); +EXTERN(boolean) read_scan_script (j_compress_ptr cinfo, char *filename); EXTERN(boolean) set_quality_ratings (j_compress_ptr cinfo, char *arg, boolean force_baseline); EXTERN(boolean) set_quant_slots (j_compress_ptr cinfo, char *arg); @@ -112,7 +112,7 @@ EXTERN(boolean) set_sample_factors (j_compress_ptr cinfo, char *arg); /* djpeg support routines (in rdcolmap.c) */ -EXTERN(void) read_color_map (j_decompress_ptr cinfo, FILE * infile); +EXTERN(void) read_color_map (j_decompress_ptr cinfo, FILE *infile); /* common support routines (in cdjpeg.c) */ @@ -120,7 +120,7 @@ EXTERN(void) enable_signal_catcher (j_common_ptr cinfo); EXTERN(void) start_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress); EXTERN(void) end_progress_monitor (j_common_ptr cinfo); -EXTERN(boolean) keymatch (char * arg, const char * keyword, int minchars); +EXTERN(boolean) keymatch (char *arg, const char *keyword, int minchars); EXTERN(FILE *) read_stdin (void); EXTERN(FILE *) write_stdout (void); diff --git a/cjpeg.c b/cjpeg.c index 1816f59c..0d451930 100644 --- a/cjpeg.c +++ b/cjpeg.c @@ -82,7 +82,7 @@ static boolean is_targa; /* records user -targa switch */ LOCAL(cjpeg_source_ptr) -select_file_type (j_compress_ptr cinfo, FILE * infile) +select_file_type (j_compress_ptr cinfo, FILE *infile) { int c; @@ -138,8 +138,8 @@ select_file_type (j_compress_ptr cinfo, FILE * infile) */ -static const char * progname; /* program name for error messages */ -static char * outfilename; /* for -outfile switch */ +static const char *progname; /* program name for error messages */ +static char *outfilename; /* for -outfile switch */ boolean memdst; /* for -memdst switch */ @@ -220,14 +220,14 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, */ { int argn; - char * arg; + char *arg; boolean force_baseline; boolean simple_progressive; - char * qualityarg = NULL; /* saves -quality parm if any */ - char * qtablefile = NULL; /* saves -qtables filename if any */ - char * qslotsarg = NULL; /* saves -qslots parm if any */ - char * samplearg = NULL; /* saves -sample parm if any */ - char * scansarg = NULL; /* saves -scans parm if any */ + char *qualityarg = NULL; /* saves -quality parm if any */ + char *qtablefile = NULL; /* saves -qtables filename if any */ + char *qslotsarg = NULL; /* saves -qslots parm if any */ + char *samplearg = NULL; /* saves -sample parm if any */ + char *scansarg = NULL; /* saves -scans parm if any */ /* Set up default JPEG parameters. */ @@ -495,8 +495,8 @@ main (int argc, char **argv) #endif int file_index; cjpeg_source_ptr src_mgr; - FILE * input_file; - FILE * output_file = NULL; + FILE *input_file; + FILE *output_file = NULL; unsigned char *outbuffer = NULL; unsigned long outsize = 0; JDIMENSION num_scanlines; diff --git a/configure.ac b/configure.ac index 9dd4f970..8ef35c10 100644 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,7 @@ prefix=${old_prefix} # Check whether compiler supports pointers to undefined structures AC_MSG_CHECKING(whether compiler supports pointers to undefined structures) -AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], , +AC_TRY_COMPILE([ typedef struct undefined_structure *undef_struct_ptr; ], , AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1], diff --git a/djpeg.c b/djpeg.c index 80f620ff..6de5d2c6 100644 --- a/djpeg.c +++ b/djpeg.c @@ -88,8 +88,8 @@ static IMAGE_FORMATS requested_fmt; */ -static const char * progname; /* program name for error messages */ -static char * outfilename; /* for -outfile switch */ +static const char *progname; /* program name for error messages */ +static char *outfilename; /* for -outfile switch */ boolean memsrc; /* for -memsrc switch */ boolean strip, skip; JDIMENSION startY, endY; @@ -190,7 +190,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, */ { int argn; - char * arg; + char *arg; /* Set up default JPEG parameters. */ requested_fmt = DEFAULT_FMT; /* set default output file format */ @@ -307,7 +307,7 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, usage(); if (for_real) { /* too expensive to do twice! */ #ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */ - FILE * mapfile; + FILE *mapfile; if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) { fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); @@ -417,7 +417,7 @@ LOCAL(unsigned int) jpeg_getc (j_decompress_ptr cinfo) /* Read next byte */ { - struct jpeg_source_mgr * datasrc = cinfo->src; + struct jpeg_source_mgr *datasrc = cinfo->src; if (datasrc->bytes_in_buffer == 0) { if (! (*datasrc->fill_input_buffer) (cinfo)) @@ -493,8 +493,8 @@ main (int argc, char **argv) #endif int file_index; djpeg_dest_ptr dest_mgr = NULL; - FILE * input_file; - FILE * output_file; + FILE *input_file; + FILE *output_file; unsigned char *inbuffer = NULL; unsigned long insize = 0; JDIMENSION num_scanlines; diff --git a/example.c b/example.c index 0a65a6cc..ac27f498 100644 --- a/example.c +++ b/example.c @@ -58,7 +58,7 @@ * RGB color and is described by: */ -extern JSAMPLE * image_buffer; /* Points to large array of R,G,B-order data */ +extern JSAMPLE *image_buffer; /* Points to large array of R,G,B-order data */ extern int image_height; /* Number of rows in image */ extern int image_width; /* Number of columns in image */ @@ -69,7 +69,7 @@ extern int image_width; /* Number of columns in image */ */ GLOBAL(void) -write_JPEG_file (char * filename, int quality) +write_JPEG_file (char *filename, int quality) { /* This struct contains the JPEG compression parameters and pointers to * working space (which is allocated as needed by the JPEG library). @@ -88,7 +88,7 @@ write_JPEG_file (char * filename, int quality) */ struct jpeg_error_mgr jerr; /* More stuff */ - FILE * outfile; /* target file */ + FILE *outfile; /* target file */ JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */ int row_stride; /* physical row width in image buffer */ @@ -253,7 +253,7 @@ struct my_error_mgr { jmp_buf setjmp_buffer; /* for return to caller */ }; -typedef struct my_error_mgr * my_error_ptr; +typedef struct my_error_mgr *my_error_ptr; /* * Here's the routine that will replace the standard error_exit method: @@ -281,7 +281,7 @@ my_error_exit (j_common_ptr cinfo) GLOBAL(int) -read_JPEG_file (char * filename) +read_JPEG_file (char *filename) { /* This struct contains the JPEG decompression parameters and pointers to * working space (which is allocated as needed by the JPEG library). @@ -293,7 +293,7 @@ read_JPEG_file (char * filename) */ struct my_error_mgr jerr; /* More stuff */ - FILE * infile; /* source file */ + FILE *infile; /* source file */ JSAMPARRAY buffer; /* Output row buffer */ int row_stride; /* physical row width in output buffer */ diff --git a/jcapimin.c b/jcapimin.c index 3e68ce32..15674be5 100644 --- a/jcapimin.c +++ b/jcapimin.c @@ -50,8 +50,8 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) * complain here. */ { - struct jpeg_error_mgr * err = cinfo->err; - void * client_data = cinfo->client_data; /* ignore Purify complaint here */ + struct jpeg_error_mgr *err = cinfo->err; + void *client_data = cinfo->client_data; /* ignore Purify complaint here */ MEMZERO(cinfo, sizeof(struct jpeg_compress_struct)); cinfo->err = err; cinfo->client_data = client_data; @@ -134,8 +134,8 @@ GLOBAL(void) jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress) { int i; - JQUANT_TBL * qtbl; - JHUFF_TBL * htbl; + JQUANT_TBL *qtbl; + JHUFF_TBL *htbl; for (i = 0; i < NUM_QUANT_TBLS; i++) { if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL) diff --git a/jcarith.c b/jcarith.c index b960a349..6d3b8af5 100644 --- a/jcarith.c +++ b/jcarith.c @@ -41,14 +41,14 @@ typedef struct { int next_restart_num; /* next restart number to write (0-7) */ /* Pointers to statistics areas (these workspaces have image lifespan) */ - unsigned char * dc_stats[NUM_ARITH_TBLS]; - unsigned char * ac_stats[NUM_ARITH_TBLS]; + unsigned char *dc_stats[NUM_ARITH_TBLS]; + unsigned char *ac_stats[NUM_ARITH_TBLS]; /* Statistics bin for coding with fixed probability 0.5 */ unsigned char fixed_bin[4]; } arith_entropy_encoder; -typedef arith_entropy_encoder * arith_entropy_ptr; +typedef arith_entropy_encoder *arith_entropy_ptr; /* The following two definitions specify the allocation chunk size * for the statistics area. @@ -119,7 +119,7 @@ LOCAL(void) emit_byte (int val, j_compress_ptr cinfo) /* Write next output byte; we do not support suspension in this module. */ { - struct jpeg_destination_mgr * dest = cinfo->dest; + struct jpeg_destination_mgr *dest = cinfo->dest; *dest->next_output_byte++ = (JOCTET) val; if (--dest->free_in_buffer == 0) @@ -323,7 +323,7 @@ emit_restart (j_compress_ptr cinfo, int restart_num) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; int ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; finish_pass(cinfo); @@ -683,7 +683,7 @@ METHODDEF(boolean) encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; - jpeg_component_info * compptr; + jpeg_component_info *compptr; JBLOCKROW block; unsigned char *st; int blkn, ci, tbl, k, ke; @@ -826,7 +826,7 @@ start_pass (j_compress_ptr cinfo, boolean gather_statistics) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; int ci, tbl; - jpeg_component_info * compptr; + jpeg_component_info *compptr; if (gather_statistics) /* Make sure to avoid that in the master control logic! diff --git a/jccoefct.c b/jccoefct.c index c583d7d6..a08d6e32 100644 --- a/jccoefct.c +++ b/jccoefct.c @@ -54,7 +54,7 @@ typedef struct { jvirt_barray_ptr whole_image[MAX_COMPONENTS]; } my_coef_controller; -typedef my_coef_controller * my_coef_ptr; +typedef my_coef_controller *my_coef_ptr; /* Forward declarations */ diff --git a/jccolor.c b/jccolor.c index 12d68bc0..a93498ab 100644 --- a/jccolor.c +++ b/jccolor.c @@ -26,10 +26,10 @@ typedef struct { struct jpeg_color_converter pub; /* public fields */ /* Private state for RGB->YCC conversion */ - JLONG * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */ + JLONG *rgb_ycc_tab; /* => table for RGB to YCbCr conversion */ } my_color_converter; -typedef my_color_converter * my_cconvert_ptr; +typedef my_color_converter *my_cconvert_ptr; /**************** RGB -> YCbCr conversion: most common case **************/ @@ -198,7 +198,7 @@ METHODDEF(void) rgb_ycc_start (j_compress_ptr cinfo) { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - JLONG * rgb_ycc_tab; + JLONG *rgb_ycc_tab; JLONG i; /* Allocate and fill in the conversion tables. */ @@ -382,7 +382,7 @@ cmyk_ycck_convert (j_compress_ptr cinfo, { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; register int r, g, b; - register JLONG * ctab = cconvert->rgb_ycc_tab; + register JLONG *ctab = cconvert->rgb_ycc_tab; register JSAMPROW inptr; register JSAMPROW outptr0, outptr1, outptr2, outptr3; register JDIMENSION col; diff --git a/jcdctmgr.c b/jcdctmgr.c index abbbe2ac..f3919b9e 100644 --- a/jcdctmgr.c +++ b/jcdctmgr.c @@ -25,21 +25,21 @@ /* Private subobject for this module */ -typedef void (*forward_DCT_method_ptr) (DCTELEM * data); -typedef void (*float_DCT_method_ptr) (FAST_FLOAT * data); +typedef void (*forward_DCT_method_ptr) (DCTELEM *data); +typedef void (*float_DCT_method_ptr) (FAST_FLOAT *data); typedef void (*convsamp_method_ptr) (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace); + DCTELEM *workspace); typedef void (*float_convsamp_method_ptr) (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace); -typedef void (*quantize_method_ptr) (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace); +typedef void (*quantize_method_ptr) (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace); typedef void (*float_quantize_method_ptr) (JCOEFPTR coef_block, - FAST_FLOAT * divisors, - FAST_FLOAT * workspace); + FAST_FLOAT *divisors, + FAST_FLOAT *workspace); METHODDEF(void) quantize (JCOEFPTR, DCTELEM *, DCTELEM *); @@ -55,22 +55,22 @@ typedef struct { * entries, because of scaling (especially for an unnormalized DCT). * Each table is given in normal array order. */ - DCTELEM * divisors[NUM_QUANT_TBLS]; + DCTELEM *divisors[NUM_QUANT_TBLS]; /* work area for FDCT subroutine */ - DCTELEM * workspace; + DCTELEM *workspace; #ifdef DCT_FLOAT_SUPPORTED /* Same as above for the floating-point case. */ float_DCT_method_ptr float_dct; float_convsamp_method_ptr float_convsamp; float_quantize_method_ptr float_quantize; - FAST_FLOAT * float_divisors[NUM_QUANT_TBLS]; - FAST_FLOAT * float_workspace; + FAST_FLOAT *float_divisors[NUM_QUANT_TBLS]; + FAST_FLOAT *float_workspace; #endif } my_fdct_controller; -typedef my_fdct_controller * my_fdct_ptr; +typedef my_fdct_controller *my_fdct_ptr; #if BITS_IN_JSAMPLE == 8 @@ -170,7 +170,7 @@ flss (UINT16 val) */ LOCAL(int) -compute_reciprocal (UINT16 divisor, DCTELEM * dtbl) +compute_reciprocal (UINT16 divisor, DCTELEM *dtbl) { UDCTELEM2 fq, fr; UDCTELEM c; @@ -238,8 +238,8 @@ start_pass_fdctmgr (j_compress_ptr cinfo) my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; int ci, qtblno, i; jpeg_component_info *compptr; - JQUANT_TBL * qtbl; - DCTELEM * dtbl; + JQUANT_TBL *qtbl; + DCTELEM *dtbl; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { @@ -332,7 +332,7 @@ start_pass_fdctmgr (j_compress_ptr cinfo) * What's actually stored is 1/divisor so that the inner loop can * use a multiplication rather than a division. */ - FAST_FLOAT * fdtbl; + FAST_FLOAT *fdtbl; int row, col; static const double aanscalefactor[DCTSIZE] = { 1.0, 1.387039845, 1.306562965, 1.175875602, @@ -370,7 +370,7 @@ start_pass_fdctmgr (j_compress_ptr cinfo) */ METHODDEF(void) -convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace) +convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace) { register DCTELEM *workspaceptr; register JSAMPROW elemptr; @@ -405,7 +405,7 @@ convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace) */ METHODDEF(void) -quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace) +quantize (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace) { int i; DCTELEM temp; @@ -487,7 +487,7 @@ quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace) */ METHODDEF(void) -forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, +forward_DCT (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY sample_data, JBLOCKROW coef_blocks, JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks) @@ -495,8 +495,8 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, { /* This routine is heavily used, so it's worth coding it tightly. */ my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; - DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no]; - DCTELEM * workspace; + DCTELEM *divisors = fdct->divisors[compptr->quant_tbl_no]; + DCTELEM *workspace; JDIMENSION bi; /* Make sure the compiler doesn't look up these every pass */ @@ -524,7 +524,7 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, METHODDEF(void) -convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace) +convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace) { register FAST_FLOAT *workspaceptr; register JSAMPROW elemptr; @@ -555,7 +555,7 @@ convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * works METHODDEF(void) -quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace) +quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace) { register FAST_FLOAT temp; register int i; @@ -577,7 +577,7 @@ quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspa METHODDEF(void) -forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, +forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY sample_data, JBLOCKROW coef_blocks, JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks) @@ -585,8 +585,8 @@ forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, { /* This routine is heavily used, so it's worth coding it tightly. */ my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; - FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no]; - FAST_FLOAT * workspace; + FAST_FLOAT *divisors = fdct->float_divisors[compptr->quant_tbl_no]; + FAST_FLOAT *workspace; JDIMENSION bi; diff --git a/jchuff.c b/jchuff.c index f8e89cad..0462d0da 100644 --- a/jchuff.c +++ b/jchuff.c @@ -102,25 +102,25 @@ typedef struct { int next_restart_num; /* next restart number to write (0-7) */ /* Pointers to derived tables (these workspaces have image lifespan) */ - c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; - c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + c_derived_tbl *dc_derived_tbls[NUM_HUFF_TBLS]; + c_derived_tbl *ac_derived_tbls[NUM_HUFF_TBLS]; #ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */ - long * dc_count_ptrs[NUM_HUFF_TBLS]; - long * ac_count_ptrs[NUM_HUFF_TBLS]; + long *dc_count_ptrs[NUM_HUFF_TBLS]; + long *ac_count_ptrs[NUM_HUFF_TBLS]; #endif int simd; } huff_entropy_encoder; -typedef huff_entropy_encoder * huff_entropy_ptr; +typedef huff_entropy_encoder *huff_entropy_ptr; /* Working state while writing an MCU. * This struct contains all the fields that are needed by subroutines. */ typedef struct { - JOCTET * next_output_byte; /* => next byte to write in buffer */ + JOCTET *next_output_byte; /* => next byte to write in buffer */ size_t free_in_buffer; /* # of byte spaces remaining in buffer */ savable_state cur; /* Current bit buffer & DC state */ j_compress_ptr cinfo; /* dump_buffer needs access to this */ @@ -148,7 +148,7 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) { huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; int ci, dctbl, actbl; - jpeg_component_info * compptr; + jpeg_component_info *compptr; if (gather_statistics) { #ifdef ENTROPY_OPT_SUPPORTED @@ -318,10 +318,10 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, LOCAL(boolean) -dump_buffer (working_state * state) +dump_buffer (working_state *state) /* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ { - struct jpeg_destination_mgr * dest = state->cinfo->dest; + struct jpeg_destination_mgr *dest = state->cinfo->dest; if (! (*dest->empty_output_buffer) (state->cinfo)) return FALSE; @@ -461,7 +461,7 @@ dump_buffer (working_state * state) LOCAL(boolean) -flush_bits (working_state * state) +flush_bits (working_state *state) { JOCTET _buffer[BUFSIZE], *buffer; size_t put_buffer; int put_bits; @@ -486,7 +486,7 @@ flush_bits (working_state * state) /* Encode a single block's worth of coefficients */ LOCAL(boolean) -encode_one_block_simd (working_state * state, JCOEFPTR block, int last_dc_val, +encode_one_block_simd (working_state *state, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { JOCTET _buffer[BUFSIZE], *buffer; @@ -503,7 +503,7 @@ encode_one_block_simd (working_state * state, JCOEFPTR block, int last_dc_val, } LOCAL(boolean) -encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, +encode_one_block (working_state *state, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { int temp, temp2, temp3; @@ -616,7 +616,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, */ LOCAL(boolean) -emit_restart (working_state * state, int restart_num) +emit_restart (working_state *state, int restart_num) { int ci; @@ -646,7 +646,7 @@ encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data) huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; working_state state; int blkn, ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; /* Load up working state */ state.next_output_byte = cinfo->dest->next_output_byte; @@ -828,7 +828,7 @@ encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; int blkn, ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; /* Take care of restart intervals if needed */ if (cinfo->restart_interval) { @@ -884,7 +884,7 @@ encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data) */ GLOBAL(void) -jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) +jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[]) { #define MAX_CLEN 32 /* assumed maximum initial code length */ UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */ @@ -1029,7 +1029,7 @@ finish_pass_gather (j_compress_ptr cinfo) { huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; int ci, dctbl, actbl; - jpeg_component_info * compptr; + jpeg_component_info *compptr; JHUFF_TBL **htblptr; boolean did_dc[NUM_HUFF_TBLS]; boolean did_ac[NUM_HUFF_TBLS]; diff --git a/jchuff.h b/jchuff.h index 6a8fc9fe..4236089a 100644 --- a/jchuff.h +++ b/jchuff.h @@ -40,4 +40,4 @@ EXTERN(void) jpeg_make_c_derived_tbl /* Generate an optimal table definition given the specified counts */ EXTERN(void) jpeg_gen_optimal_table - (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]); + (j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[]); diff --git a/jcmainct.c b/jcmainct.c index 5efc7ebd..d01f4636 100644 --- a/jcmainct.c +++ b/jcmainct.c @@ -35,7 +35,7 @@ typedef struct { JSAMPARRAY buffer[MAX_COMPONENTS]; } my_main_controller; -typedef my_main_controller * my_main_ptr; +typedef my_main_controller *my_main_ptr; /* Forward declarations */ diff --git a/jcmarker.c b/jcmarker.c index 748244fa..463f6659 100644 --- a/jcmarker.c +++ b/jcmarker.c @@ -94,7 +94,7 @@ typedef struct { unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */ } my_marker_writer; -typedef my_marker_writer * my_marker_ptr; +typedef my_marker_writer *my_marker_ptr; /* @@ -113,7 +113,7 @@ LOCAL(void) emit_byte (j_compress_ptr cinfo, int val) /* Emit a byte */ { - struct jpeg_destination_mgr * dest = cinfo->dest; + struct jpeg_destination_mgr *dest = cinfo->dest; *(dest->next_output_byte)++ = (JOCTET) val; if (--dest->free_in_buffer == 0) { @@ -150,7 +150,7 @@ emit_dqt (j_compress_ptr cinfo, int index) /* Emit a DQT marker */ /* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */ { - JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index]; + JQUANT_TBL *qtbl = cinfo->quant_tbl_ptrs[index]; int prec; int i; @@ -189,7 +189,7 @@ LOCAL(void) emit_dht (j_compress_ptr cinfo, int index, boolean is_ac) /* Emit a DHT marker */ { - JHUFF_TBL * htbl; + JHUFF_TBL *htbl; int length, i; if (is_ac) { diff --git a/jcmaster.c b/jcmaster.c index 25b6712e..e715f0b7 100644 --- a/jcmaster.c +++ b/jcmaster.c @@ -40,7 +40,7 @@ typedef struct { int scan_number; /* current index in scan_info[] */ } my_comp_master; -typedef my_comp_master * my_master_ptr; +typedef my_comp_master *my_master_ptr; /* @@ -168,12 +168,12 @@ validate_script (j_compress_ptr cinfo) * determine whether it uses progressive JPEG, and set cinfo->progressive_mode. */ { - const jpeg_scan_info * scanptr; + const jpeg_scan_info *scanptr; int scanno, ncomps, ci, coefi, thisi; int Ss, Se, Ah, Al; boolean component_sent[MAX_COMPONENTS]; #ifdef C_PROGRESSIVE_SUPPORTED - int * last_bitpos_ptr; + int *last_bitpos_ptr; int last_bitpos[MAX_COMPONENTS][DCTSIZE2]; /* -1 until that coefficient has been seen; then last Al for it */ #endif @@ -309,7 +309,7 @@ select_scan_parameters (j_compress_ptr cinfo) if (cinfo->scan_info != NULL) { /* Prepare for current scan --- the script is already validated */ my_master_ptr master = (my_master_ptr) cinfo->master; - const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number; + const jpeg_scan_info *scanptr = cinfo->scan_info + master->scan_number; cinfo->comps_in_scan = scanptr->comps_in_scan; for (ci = 0; ci < scanptr->comps_in_scan; ci++) { diff --git a/jcparam.c b/jcparam.c index dc7838f2..544127e4 100644 --- a/jcparam.c +++ b/jcparam.c @@ -322,7 +322,7 @@ jpeg_default_colorspace (j_compress_ptr cinfo) GLOBAL(void) jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) { - jpeg_component_info * compptr; + jpeg_component_info *compptr; int ci; #define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \ @@ -404,7 +404,7 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) #ifdef C_PROGRESSIVE_SUPPORTED LOCAL(jpeg_scan_info *) -fill_a_scan (jpeg_scan_info * scanptr, int ci, +fill_a_scan (jpeg_scan_info *scanptr, int ci, int Ss, int Se, int Ah, int Al) /* Support routine: generate one scan for specified component */ { @@ -419,7 +419,7 @@ fill_a_scan (jpeg_scan_info * scanptr, int ci, } LOCAL(jpeg_scan_info *) -fill_scans (jpeg_scan_info * scanptr, int ncomps, +fill_scans (jpeg_scan_info *scanptr, int ncomps, int Ss, int Se, int Ah, int Al) /* Support routine: generate one scan for each component */ { @@ -438,7 +438,7 @@ fill_scans (jpeg_scan_info * scanptr, int ncomps, } LOCAL(jpeg_scan_info *) -fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al) +fill_dc_scans (jpeg_scan_info *scanptr, int ncomps, int Ah, int Al) /* Support routine: generate interleaved DC scan if possible, else N scans */ { int ci; @@ -470,7 +470,7 @@ jpeg_simple_progression (j_compress_ptr cinfo) { int ncomps = cinfo->num_components; int nscans; - jpeg_scan_info * scanptr; + jpeg_scan_info *scanptr; /* Safety check to ensure start_compress not called yet. */ if (cinfo->global_state != CSTATE_START) diff --git a/jcphuff.c b/jcphuff.c index 1e7e282d..046e2e18 100644 --- a/jcphuff.c +++ b/jcphuff.c @@ -33,7 +33,7 @@ typedef struct { /* Bit-level coding status. * next_output_byte/free_in_buffer are local copies of cinfo->dest fields. */ - JOCTET * next_output_byte; /* => next byte to write in buffer */ + JOCTET *next_output_byte; /* => next byte to write in buffer */ size_t free_in_buffer; /* # of byte spaces remaining in buffer */ size_t put_buffer; /* current bit-accumulation buffer */ int put_bits; /* # of bits now in it */ @@ -46,7 +46,7 @@ typedef struct { int ac_tbl_no; /* the table number of the single component */ unsigned int EOBRUN; /* run length of EOBs */ unsigned int BE; /* # of buffered correction bits before MCU */ - char * bit_buffer; /* buffer for correction bits (1 per char) */ + char *bit_buffer; /* buffer for correction bits (1 per char) */ /* packing correction bits tightly would save some space but cost time... */ unsigned int restarts_to_go; /* MCUs left in this restart interval */ @@ -56,13 +56,13 @@ typedef struct { * Since any one scan codes only DC or only AC, we only need one set * of tables, not one for DC and one for AC. */ - c_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + c_derived_tbl *derived_tbls[NUM_HUFF_TBLS]; /* Statistics tables for optimization; again, one set is enough */ - long * count_ptrs[NUM_HUFF_TBLS]; + long *count_ptrs[NUM_HUFF_TBLS]; } phuff_entropy_encoder; -typedef phuff_entropy_encoder * phuff_entropy_ptr; +typedef phuff_entropy_encoder *phuff_entropy_ptr; /* MAX_CORR_BITS is the number of bits the AC refinement correction-bit * buffer can hold. Larger sizes may slightly improve compression, but @@ -111,7 +111,7 @@ start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics) phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; boolean is_DC_band; int ci, tbl; - jpeg_component_info * compptr; + jpeg_component_info *compptr; entropy->cinfo = cinfo; entropy->gather_statistics = gather_statistics; @@ -208,7 +208,7 @@ LOCAL(void) dump_buffer (phuff_entropy_ptr entropy) /* Empty the output buffer; we do not support suspension in this module. */ { - struct jpeg_destination_mgr * dest = entropy->cinfo->dest; + struct jpeg_destination_mgr *dest = entropy->cinfo->dest; if (! (*dest->empty_output_buffer) (entropy->cinfo)) ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND); @@ -284,7 +284,7 @@ emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol) if (entropy->gather_statistics) entropy->count_ptrs[tbl_no][symbol]++; else { - c_derived_tbl * tbl = entropy->derived_tbls[tbl_no]; + c_derived_tbl *tbl = entropy->derived_tbls[tbl_no]; emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]); } } @@ -295,7 +295,7 @@ emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol) */ LOCAL(void) -emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart, +emit_buffered_bits (phuff_entropy_ptr entropy, char *bufstart, unsigned int nbits) { if (entropy->gather_statistics) @@ -383,7 +383,7 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) int blkn, ci; int Al = cinfo->Al; JBLOCKROW block; - jpeg_component_info * compptr; + jpeg_component_info *compptr; ISHIFT_TEMPS entropy->next_output_byte = cinfo->dest->next_output_byte; @@ -770,7 +770,7 @@ finish_pass_gather_phuff (j_compress_ptr cinfo) phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; boolean is_DC_band; int ci, tbl; - jpeg_component_info * compptr; + jpeg_component_info *compptr; JHUFF_TBL **htblptr; boolean did[NUM_HUFF_TBLS]; diff --git a/jcprepct.c b/jcprepct.c index 87d1c35d..e72ebd87 100644 --- a/jcprepct.c +++ b/jcprepct.c @@ -70,7 +70,7 @@ typedef struct { #endif } my_prep_controller; -typedef my_prep_controller * my_prep_ptr; +typedef my_prep_controller *my_prep_ptr; /* @@ -137,7 +137,7 @@ pre_process_data (j_compress_ptr cinfo, my_prep_ptr prep = (my_prep_ptr) cinfo->prep; int numrows, ci; JDIMENSION inrows; - jpeg_component_info * compptr; + jpeg_component_info *compptr; while (*in_row_ctr < in_rows_avail && *out_row_group_ctr < out_row_groups_avail) { @@ -272,7 +272,7 @@ create_context_buffer (j_compress_ptr cinfo) my_prep_ptr prep = (my_prep_ptr) cinfo->prep; int rgroup_height = cinfo->max_v_samp_factor; int ci, i; - jpeg_component_info * compptr; + jpeg_component_info *compptr; JSAMPARRAY true_buffer, fake_buffer; /* Grab enough space for fake row pointers for all the components; @@ -319,7 +319,7 @@ jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer) { my_prep_ptr prep; int ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; if (need_full_buffer) /* safety check */ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); diff --git a/jcsample.c b/jcsample.c index 7accfd16..879bd515 100644 --- a/jcsample.c +++ b/jcsample.c @@ -58,7 +58,7 @@ /* Pointer to routine to downsample a single component */ typedef void (*downsample1_ptr) (j_compress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data); @@ -71,7 +71,7 @@ typedef struct { downsample1_ptr methods[MAX_COMPONENTS]; } my_downsampler; -typedef my_downsampler * my_downsample_ptr; +typedef my_downsampler *my_downsample_ptr; /* @@ -124,7 +124,7 @@ sep_downsample (j_compress_ptr cinfo, { my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample; int ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; JSAMPARRAY in_ptr, out_ptr; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; @@ -144,7 +144,7 @@ sep_downsample (j_compress_ptr cinfo, */ METHODDEF(void) -int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +int_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v; @@ -191,7 +191,7 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { /* Copy the data */ @@ -216,7 +216,7 @@ fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { int outrow; @@ -253,7 +253,7 @@ h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { int inrow, outrow; @@ -296,7 +296,7 @@ h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { int inrow, outrow; @@ -472,7 +472,7 @@ jinit_downsampler (j_compress_ptr cinfo) { my_downsample_ptr downsample; int ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; boolean smoothok = TRUE; downsample = (my_downsample_ptr) diff --git a/jctrans.c b/jctrans.c index 28cd26d7..2c838575 100644 --- a/jctrans.c +++ b/jctrans.c @@ -21,9 +21,9 @@ /* Forward declarations */ LOCAL(void) transencode_master_selection - (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays); + (j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays); LOCAL(void) transencode_coef_controller - (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays); + (j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays); /* @@ -39,7 +39,7 @@ LOCAL(void) transencode_coef_controller */ GLOBAL(void) -jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays) +jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays) { if (cinfo->global_state != CSTATE_START) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); @@ -166,7 +166,7 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, LOCAL(void) transencode_master_selection (j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays) + jvirt_barray_ptr *coef_arrays) { /* Although we don't actually use input_components for transcoding, * jcmaster.c's initial_setup will complain if input_components is 0. @@ -228,13 +228,13 @@ typedef struct { int MCU_rows_per_iMCU_row; /* number of such rows needed */ /* Virtual block array for each component. */ - jvirt_barray_ptr * whole_image; + jvirt_barray_ptr *whole_image; /* Workspace for constructing dummy blocks at right/bottom edges. */ JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU]; } my_coef_controller; -typedef my_coef_controller * my_coef_ptr; +typedef my_coef_controller *my_coef_ptr; LOCAL(void) @@ -375,7 +375,7 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) LOCAL(void) transencode_coef_controller (j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays) + jvirt_barray_ptr *coef_arrays) { my_coef_ptr coef; JBLOCKROW buffer; diff --git a/jdarith.c b/jdarith.c index 83a05c69..905412bb 100644 --- a/jdarith.c +++ b/jdarith.c @@ -38,14 +38,14 @@ typedef struct { unsigned int restarts_to_go; /* MCUs left in this restart interval */ /* Pointers to statistics areas (these workspaces have image lifespan) */ - unsigned char * dc_stats[NUM_ARITH_TBLS]; - unsigned char * ac_stats[NUM_ARITH_TBLS]; + unsigned char *dc_stats[NUM_ARITH_TBLS]; + unsigned char *ac_stats[NUM_ARITH_TBLS]; /* Statistics bin for coding with fixed probability 0.5 */ unsigned char fixed_bin[4]; } arith_entropy_decoder; -typedef arith_entropy_decoder * arith_entropy_ptr; +typedef arith_entropy_decoder *arith_entropy_ptr; /* The following two definitions specify the allocation chunk size * for the statistics area. @@ -68,7 +68,7 @@ LOCAL(int) get_byte (j_decompress_ptr cinfo) /* Read next input byte; we do not support suspension in this module. */ { - struct jpeg_source_mgr * src = cinfo->src; + struct jpeg_source_mgr *src = cinfo->src; if (src->bytes_in_buffer == 0) if (! (*src->fill_input_buffer) (cinfo)) @@ -194,7 +194,7 @@ process_restart (j_decompress_ptr cinfo) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; int ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; /* Advance past the RSTn marker */ if (! (*cinfo->marker->read_restart_marker) (cinfo)) @@ -499,7 +499,7 @@ METHODDEF(boolean) decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; - jpeg_component_info * compptr; + jpeg_component_info *compptr; JBLOCKROW block; unsigned char *st; int blkn, ci, tbl, sign, k; @@ -627,7 +627,7 @@ start_pass (j_decompress_ptr cinfo) { arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; int ci, tbl; - jpeg_component_info * compptr; + jpeg_component_info *compptr; if (cinfo->progressive_mode) { /* Validate progressive scan parameters */ diff --git a/jdatadst-tj.c b/jdatadst-tj.c index 8d12018c..5d4260a9 100644 --- a/jdatadst-tj.c +++ b/jdatadst-tj.c @@ -24,7 +24,7 @@ #include "jerror.h" #ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ -extern void * malloc (size_t size); +extern void *malloc (size_t size); extern void free (void *ptr); #endif @@ -37,15 +37,15 @@ extern void free (void *ptr); typedef struct { struct jpeg_destination_mgr pub; /* public fields */ - unsigned char ** outbuffer; /* target buffer */ - unsigned long * outsize; - unsigned char * newbuffer; /* newly allocated buffer */ - JOCTET * buffer; /* start of buffer */ + unsigned char **outbuffer; /* target buffer */ + unsigned long *outsize; + unsigned char *newbuffer; /* newly allocated buffer */ + JOCTET *buffer; /* start of buffer */ size_t bufsize; boolean alloc; } my_mem_destination_mgr; -typedef my_mem_destination_mgr * my_mem_dest_ptr; +typedef my_mem_destination_mgr *my_mem_dest_ptr; /* @@ -87,7 +87,7 @@ METHODDEF(boolean) empty_mem_output_buffer (j_compress_ptr cinfo) { size_t nextsize; - JOCTET * nextbuffer; + JOCTET *nextbuffer; my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest; if (!dest->alloc) ERREXIT(cinfo, JERR_BUFFER_SIZE); @@ -148,7 +148,7 @@ term_mem_destination (j_compress_ptr cinfo) GLOBAL(void) jpeg_mem_dest_tj (j_compress_ptr cinfo, - unsigned char ** outbuffer, unsigned long * outsize, + unsigned char **outbuffer, unsigned long *outsize, boolean alloc) { boolean reused = FALSE; diff --git a/jdatadst.c b/jdatadst.c index ddaf080e..21018b0f 100644 --- a/jdatadst.c +++ b/jdatadst.c @@ -24,7 +24,7 @@ #include "jerror.h" #ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ -extern void * malloc (size_t size); +extern void *malloc (size_t size); extern void free (void *ptr); #endif @@ -34,11 +34,11 @@ extern void free (void *ptr); typedef struct { struct jpeg_destination_mgr pub; /* public fields */ - FILE * outfile; /* target stream */ - JOCTET * buffer; /* start of buffer */ + FILE *outfile; /* target stream */ + JOCTET *buffer; /* start of buffer */ } my_destination_mgr; -typedef my_destination_mgr * my_dest_ptr; +typedef my_destination_mgr *my_dest_ptr; #define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ @@ -49,14 +49,14 @@ typedef my_destination_mgr * my_dest_ptr; typedef struct { struct jpeg_destination_mgr pub; /* public fields */ - unsigned char ** outbuffer; /* target buffer */ - unsigned long * outsize; - unsigned char * newbuffer; /* newly allocated buffer */ - JOCTET * buffer; /* start of buffer */ + unsigned char **outbuffer; /* target buffer */ + unsigned long *outsize; + unsigned char *newbuffer; /* newly allocated buffer */ + JOCTET *buffer; /* start of buffer */ size_t bufsize; } my_mem_destination_mgr; -typedef my_mem_destination_mgr * my_mem_dest_ptr; +typedef my_mem_destination_mgr *my_mem_dest_ptr; #endif @@ -131,7 +131,7 @@ METHODDEF(boolean) empty_mem_output_buffer (j_compress_ptr cinfo) { size_t nextsize; - JOCTET * nextbuffer; + JOCTET *nextbuffer; my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest; /* Try to allocate new buffer with double size */ @@ -204,7 +204,7 @@ term_mem_destination (j_compress_ptr cinfo) */ GLOBAL(void) -jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile) +jpeg_stdio_dest (j_compress_ptr cinfo, FILE *outfile) { my_dest_ptr dest; @@ -245,7 +245,7 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile) GLOBAL(void) jpeg_mem_dest (j_compress_ptr cinfo, - unsigned char ** outbuffer, unsigned long * outsize) + unsigned char **outbuffer, unsigned long *outsize) { my_mem_dest_ptr dest; diff --git a/jdatasrc-tj.c b/jdatasrc-tj.c index 6624fd35..0b99ee18 100644 --- a/jdatasrc-tj.c +++ b/jdatasrc-tj.c @@ -106,7 +106,7 @@ fill_mem_input_buffer (j_decompress_ptr cinfo) METHODDEF(void) skip_input_data (j_decompress_ptr cinfo, long num_bytes) { - struct jpeg_source_mgr * src = cinfo->src; + struct jpeg_source_mgr *src = cinfo->src; /* Just a dumb implementation for now. Could use fseek() except * it doesn't work on pipes. Not clear that being smart is worth @@ -158,9 +158,9 @@ term_source (j_decompress_ptr cinfo) GLOBAL(void) jpeg_mem_src_tj (j_decompress_ptr cinfo, - const unsigned char * inbuffer, unsigned long insize) + const unsigned char *inbuffer, unsigned long insize) { - struct jpeg_source_mgr * src; + struct jpeg_source_mgr *src; if (inbuffer == NULL || insize == 0) /* Treat empty input as fatal error */ ERREXIT(cinfo, JERR_INPUT_EMPTY); diff --git a/jdatasrc.c b/jdatasrc.c index 1f46a962..acbeb8a7 100644 --- a/jdatasrc.c +++ b/jdatasrc.c @@ -29,12 +29,12 @@ typedef struct { struct jpeg_source_mgr pub; /* public fields */ - FILE * infile; /* source stream */ - JOCTET * buffer; /* start of buffer */ + FILE *infile; /* source stream */ + JOCTET *buffer; /* start of buffer */ boolean start_of_file; /* have we gotten any data yet? */ } my_source_mgr; -typedef my_source_mgr * my_src_ptr; +typedef my_source_mgr *my_src_ptr; #define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ @@ -162,7 +162,7 @@ fill_mem_input_buffer (j_decompress_ptr cinfo) METHODDEF(void) skip_input_data (j_decompress_ptr cinfo, long num_bytes) { - struct jpeg_source_mgr * src = cinfo->src; + struct jpeg_source_mgr *src = cinfo->src; /* Just a dumb implementation for now. Could use fseek() except * it doesn't work on pipes. Not clear that being smart is worth @@ -214,7 +214,7 @@ term_source (j_decompress_ptr cinfo) */ GLOBAL(void) -jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile) +jpeg_stdio_src (j_decompress_ptr cinfo, FILE *infile) { my_src_ptr src; @@ -255,9 +255,9 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile) GLOBAL(void) jpeg_mem_src (j_decompress_ptr cinfo, - const unsigned char * inbuffer, unsigned long insize) + const unsigned char *inbuffer, unsigned long insize) { - struct jpeg_source_mgr * src; + struct jpeg_source_mgr *src; if (inbuffer == NULL || insize == 0) /* Treat empty input as fatal error */ ERREXIT(cinfo, JERR_INPUT_EMPTY); diff --git a/jdcoefct.c b/jdcoefct.c index c51e3ffa..b291da93 100644 --- a/jdcoefct.c +++ b/jdcoefct.c @@ -346,9 +346,9 @@ smoothing_ok (j_decompress_ptr cinfo) boolean smoothing_useful = FALSE; int ci, coefi; jpeg_component_info *compptr; - JQUANT_TBL * qtable; - int * coef_bits; - int * coef_bits_latch; + JQUANT_TBL *qtable; + int *coef_bits; + int *coef_bits_latch; if (! cinfo->progressive_mode || cinfo->coef_bits == NULL) return FALSE; @@ -409,7 +409,7 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) jpeg_component_info *compptr; inverse_DCT_method_ptr inverse_DCT; boolean first_row, last_row; - JCOEF * workspace; + JCOEF *workspace; int *coef_bits; JQUANT_TBL *quanttbl; JLONG Q00,Q01,Q02,Q10,Q11,Q20, num; diff --git a/jdcoefct.h b/jdcoefct.h index 28e7a2d9..bf6beb27 100644 --- a/jdcoefct.h +++ b/jdcoefct.h @@ -41,7 +41,7 @@ typedef struct { JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU]; /* Temporary workspace for one MCU */ - JCOEF * workspace; + JCOEF *workspace; #ifdef D_MULTISCAN_FILES_SUPPORTED /* In multi-pass modes, we need a virtual block array for each component. */ @@ -50,12 +50,12 @@ typedef struct { #ifdef BLOCK_SMOOTHING_SUPPORTED /* When doing block smoothing, we latch coefficient Al values here */ - int * coef_bits_latch; + int *coef_bits_latch; #define SAVED_COEFS 6 /* we save coef_bits[0..5] */ #endif } my_coef_controller; -typedef my_coef_controller * my_coef_ptr; +typedef my_coef_controller *my_coef_ptr; LOCAL(void) diff --git a/jdcolor.c b/jdcolor.c index af7c5758..ab8fa249 100644 --- a/jdcolor.c +++ b/jdcolor.c @@ -27,16 +27,16 @@ typedef struct { struct jpeg_color_deconverter pub; /* public fields */ /* Private state for YCC->RGB conversion */ - int * Cr_r_tab; /* => table for Cr to R conversion */ - int * Cb_b_tab; /* => table for Cb to B conversion */ - JLONG * Cr_g_tab; /* => table for Cr to G conversion */ - JLONG * Cb_g_tab; /* => table for Cb to G conversion */ + int *Cr_r_tab; /* => table for Cr to R conversion */ + int *Cb_b_tab; /* => table for Cb to B conversion */ + JLONG *Cr_g_tab; /* => table for Cr to G conversion */ + JLONG *Cb_g_tab; /* => table for Cb to G conversion */ /* Private state for RGB->Y conversion */ - JLONG * rgb_y_tab; /* => table for RGB to Y conversion */ + JLONG *rgb_y_tab; /* => table for RGB to Y conversion */ } my_color_deconverter; -typedef my_color_deconverter * my_cconvert_ptr; +typedef my_color_deconverter *my_cconvert_ptr; /**************** YCbCr -> RGB conversion: most common case **************/ @@ -303,7 +303,7 @@ LOCAL(void) build_rgb_y_table (j_decompress_ptr cinfo) { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - JLONG * rgb_y_tab; + JLONG *rgb_y_tab; JLONG i; /* Allocate and fill in the conversion tables. */ @@ -330,7 +330,7 @@ rgb_gray_convert (j_decompress_ptr cinfo, { my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; register int r, g, b; - register JLONG * ctab = cconvert->rgb_y_tab; + register JLONG *ctab = cconvert->rgb_y_tab; register JSAMPROW outptr; register JSAMPROW inptr0, inptr1, inptr2; register JDIMENSION col; @@ -543,11 +543,11 @@ ycck_cmyk_convert (j_decompress_ptr cinfo, register JDIMENSION col; JDIMENSION num_cols = cinfo->output_width; /* copy these pointers into registers if possible */ - register JSAMPLE * range_limit = cinfo->sample_range_limit; - register int * Crrtab = cconvert->Cr_r_tab; - register int * Cbbtab = cconvert->Cb_b_tab; - register JLONG * Crgtab = cconvert->Cr_g_tab; - register JLONG * Cbgtab = cconvert->Cb_g_tab; + register JSAMPLE *range_limit = cinfo->sample_range_limit; + register int *Crrtab = cconvert->Cr_r_tab; + register int *Cbbtab = cconvert->Cb_b_tab; + register JLONG *Crgtab = cconvert->Cr_g_tab; + register JLONG *Cbgtab = cconvert->Cb_g_tab; SHIFT_TEMPS while (--num_rows >= 0) { diff --git a/jdct.h b/jdct.h index f1c7cdf4..faf8e1cf 100644 --- a/jdct.h +++ b/jdct.h @@ -90,63 +90,63 @@ typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ /* Extern declarations for the forward and inverse DCT routines. */ -EXTERN(void) jpeg_fdct_islow (DCTELEM * data); -EXTERN(void) jpeg_fdct_ifast (DCTELEM * data); -EXTERN(void) jpeg_fdct_float (FAST_FLOAT * data); +EXTERN(void) jpeg_fdct_islow (DCTELEM *data); +EXTERN(void) jpeg_fdct_ifast (DCTELEM *data); +EXTERN(void) jpeg_fdct_float (FAST_FLOAT *data); EXTERN(void) jpeg_idct_islow - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_ifast - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_float - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_7x7 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_6x6 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_5x5 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_4x4 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_3x3 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_2x2 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_1x1 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_9x9 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_10x10 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_11x11 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_12x12 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_13x13 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_14x14 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_15x15 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jpeg_idct_16x16 - (j_decompress_ptr cinfo, jpeg_component_info * compptr, + (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); diff --git a/jddctmgr.c b/jddctmgr.c index 5bab0179..bdf7c533 100644 --- a/jddctmgr.c +++ b/jddctmgr.c @@ -59,7 +59,7 @@ typedef struct { int cur_method[MAX_COMPONENTS]; } my_idct_controller; -typedef my_idct_controller * my_idct_ptr; +typedef my_idct_controller *my_idct_ptr; /* Allocated multiplier tables: big enough for any supported variant */ @@ -101,7 +101,7 @@ start_pass (j_decompress_ptr cinfo) jpeg_component_info *compptr; int method = 0; inverse_DCT_method_ptr method_ptr = NULL; - JQUANT_TBL * qtbl; + JQUANT_TBL *qtbl; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { @@ -246,7 +246,7 @@ start_pass (j_decompress_ptr cinfo) /* For LL&M IDCT method, multipliers are equal to raw quantization * coefficients, but are stored as ints to ensure access efficiency. */ - ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; + ISLOW_MULT_TYPE *ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; for (i = 0; i < DCTSIZE2; i++) { ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i]; } @@ -263,7 +263,7 @@ start_pass (j_decompress_ptr cinfo) * For integer operation, the multiplier table is to be scaled by * IFAST_SCALE_BITS. */ - IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; + IFAST_MULT_TYPE *ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; #define CONST_BITS 14 static const INT16 aanscales[DCTSIZE2] = { /* precomputed values scaled up by 14 bits */ @@ -295,7 +295,7 @@ start_pass (j_decompress_ptr cinfo) * scalefactor[0] = 1 * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 */ - FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; + FLOAT_MULT_TYPE *fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; int row, col; static const double aanscalefactor[DCTSIZE] = { 1.0, 1.387039845, 1.306562965, 1.175875602, diff --git a/jdhuff.c b/jdhuff.c index e0495ab8..02e533e7 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -67,20 +67,20 @@ typedef struct { unsigned int restarts_to_go; /* MCUs left in this restart interval */ /* Pointers to derived tables (these workspaces have image lifespan) */ - d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; - d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + d_derived_tbl *dc_derived_tbls[NUM_HUFF_TBLS]; + d_derived_tbl *ac_derived_tbls[NUM_HUFF_TBLS]; /* Precalculated info set up by start_pass for use in decode_mcu: */ /* Pointers to derived tables to be used for each block within an MCU */ - d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU]; - d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU]; + d_derived_tbl *dc_cur_tbls[D_MAX_BLOCKS_IN_MCU]; + d_derived_tbl *ac_cur_tbls[D_MAX_BLOCKS_IN_MCU]; /* Whether we care about the DC and AC coefficient values for each block */ boolean dc_needed[D_MAX_BLOCKS_IN_MCU]; boolean ac_needed[D_MAX_BLOCKS_IN_MCU]; } huff_entropy_decoder; -typedef huff_entropy_decoder * huff_entropy_ptr; +typedef huff_entropy_decoder *huff_entropy_ptr; /* @@ -93,7 +93,7 @@ start_pass_huff_decoder (j_decompress_ptr cinfo) huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; int ci, blkn, dctbl, actbl; d_derived_tbl **pdtbl; - jpeg_component_info * compptr; + jpeg_component_info *compptr; /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG. * This ought to be an error condition, but we make it a warning because @@ -296,13 +296,13 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, GLOBAL(boolean) -jpeg_fill_bit_buffer (bitread_working_state * state, +jpeg_fill_bit_buffer (bitread_working_state *state, register bit_buf_type get_buffer, register int bits_left, int nbits) /* Load up the bit buffer to a depth of at least nbits */ { /* Copy heavily used state fields into locals (hopefully registers) */ - register const JOCTET * next_input_byte = state->next_input_byte; + register const JOCTET *next_input_byte = state->next_input_byte; register size_t bytes_in_buffer = state->bytes_in_buffer; j_decompress_ptr cinfo = state->cinfo; @@ -446,9 +446,9 @@ jpeg_fill_bit_buffer (bitread_working_state * state, */ GLOBAL(int) -jpeg_huff_decode (bitread_working_state * state, +jpeg_huff_decode (bitread_working_state *state, register bit_buf_type get_buffer, register int bits_left, - d_derived_tbl * htbl, int min_bits) + d_derived_tbl *htbl, int min_bits) { register int l = min_bits; register JLONG code; @@ -566,8 +566,8 @@ decode_mcu_slow (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL; - d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; - d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; + d_derived_tbl *dctbl = entropy->dc_cur_tbls[blkn]; + d_derived_tbl *actbl = entropy->ac_cur_tbls[blkn]; register int s, k, r; /* Decode a single block's worth of coefficients */ @@ -665,8 +665,8 @@ decode_mcu_fast (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL; - d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; - d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; + d_derived_tbl *dctbl = entropy->dc_cur_tbls[blkn]; + d_derived_tbl *actbl = entropy->ac_cur_tbls[blkn]; register int s, k, r, l; HUFF_DECODE_FAST(s, l, dctbl); diff --git a/jdhuff.h b/jdhuff.h index 1bf0390e..87d4465f 100644 --- a/jdhuff.h +++ b/jdhuff.h @@ -101,7 +101,7 @@ typedef struct { /* Bitreading state saved across MCUs */ typedef struct { /* Bitreading working state within an MCU */ /* Current data source location */ /* We need a copy, rather than munging the original, in case of suspension */ - const JOCTET * next_input_byte; /* => next byte to read from source */ + const JOCTET *next_input_byte; /* => next byte to read from source */ size_t bytes_in_buffer; /* # of bytes remaining in source buffer */ /* Bit input buffer --- note these values are kept in register variables, * not in this struct, inside the inner loops. @@ -166,7 +166,7 @@ typedef struct { /* Bitreading working state within an MCU */ /* Load up the bit buffer to a depth of at least nbits */ EXTERN(boolean) jpeg_fill_bit_buffer - (bitread_working_state * state, register bit_buf_type get_buffer, + (bitread_working_state *state, register bit_buf_type get_buffer, register int bits_left, int nbits); @@ -230,5 +230,5 @@ slowlabel: \ /* Out-of-line case for Huffman code fetching */ EXTERN(int) jpeg_huff_decode - (bitread_working_state * state, register bit_buf_type get_buffer, - register int bits_left, d_derived_tbl * htbl, int min_bits); + (bitread_working_state *state, register bit_buf_type get_buffer, + register int bits_left, d_derived_tbl *htbl, int min_bits); diff --git a/jdinput.c b/jdinput.c index 0e0a18bf..23c4bf2d 100644 --- a/jdinput.c +++ b/jdinput.c @@ -28,7 +28,7 @@ typedef struct { boolean inheaders; /* TRUE until first SOS is reached */ } my_input_controller; -typedef my_input_controller * my_inputctl_ptr; +typedef my_input_controller *my_inputctl_ptr; /* Forward declarations */ @@ -239,7 +239,7 @@ latch_quant_tables (j_decompress_ptr cinfo) { int ci, qtblno; jpeg_component_info *compptr; - JQUANT_TBL * qtbl; + JQUANT_TBL *qtbl; for (ci = 0; ci < cinfo->comps_in_scan; ci++) { compptr = cinfo->cur_comp_info[ci]; diff --git a/jdmainct.h b/jdmainct.h index c7de6195..30903019 100644 --- a/jdmainct.h +++ b/jdmainct.h @@ -34,7 +34,7 @@ typedef struct { JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ } my_main_controller; -typedef my_main_controller * my_main_ptr; +typedef my_main_controller *my_main_ptr; /* context_state values: */ diff --git a/jdmarker.c b/jdmarker.c index 4f59d87d..e3b612c9 100644 --- a/jdmarker.c +++ b/jdmarker.c @@ -107,7 +107,7 @@ typedef struct { /* Note: cur_marker is not linked into marker_list until it's all read. */ } my_marker_reader; -typedef my_marker_reader * my_marker_ptr; +typedef my_marker_reader *my_marker_ptr; /* @@ -120,8 +120,8 @@ typedef my_marker_reader * my_marker_ptr; /* Declare and initialize local copies of input pointer/count */ #define INPUT_VARS(cinfo) \ - struct jpeg_source_mgr * datasrc = (cinfo)->src; \ - const JOCTET * next_input_byte = datasrc->next_input_byte; \ + struct jpeg_source_mgr *datasrc = (cinfo)->src; \ + const JOCTET *next_input_byte = datasrc->next_input_byte; \ size_t bytes_in_buffer = datasrc->bytes_in_buffer /* Unload the local copies --- do this only at a restart boundary */ @@ -242,7 +242,7 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith) { JLONG length; int c, ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; INPUT_VARS(cinfo); cinfo->progressive_mode = is_prog; @@ -306,7 +306,7 @@ get_sos (j_decompress_ptr cinfo) { JLONG length; int i, ci, n, c, cc, pi; - jpeg_component_info * compptr; + jpeg_component_info *compptr; INPUT_VARS(cinfo); if (! cinfo->marker->saw_SOF) @@ -598,7 +598,7 @@ get_dri (j_decompress_ptr cinfo) LOCAL(void) -examine_app0 (j_decompress_ptr cinfo, JOCTET * data, +examine_app0 (j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen, JLONG remaining) /* Examine first few bytes from an APP0. * Take appropriate action if it is a JFIF marker. @@ -674,7 +674,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET * data, LOCAL(void) -examine_app14 (j_decompress_ptr cinfo, JOCTET * data, +examine_app14 (j_decompress_ptr cinfo, JOCTET *data, unsigned int datalen, JLONG remaining) /* Examine first few bytes from an APP14. * Take appropriate action if it is an Adobe marker. @@ -759,7 +759,7 @@ save_marker (j_decompress_ptr cinfo) my_marker_ptr marker = (my_marker_ptr) cinfo->marker; jpeg_saved_marker_ptr cur_marker = marker->cur_marker; unsigned int bytes_read, data_length; - JOCTET * data; + JOCTET *data; JLONG length = 0; INPUT_VARS(cinfo); diff --git a/jdmaster.c b/jdmaster.c index 42c71bab..69b4f70c 100644 --- a/jdmaster.c +++ b/jdmaster.c @@ -34,11 +34,11 @@ typedef struct { /* Saved references to initialized quantizer modules, * in case we need to switch modes. */ - struct jpeg_color_quantizer * quantizer_1pass; - struct jpeg_color_quantizer * quantizer_2pass; + struct jpeg_color_quantizer *quantizer_1pass; + struct jpeg_color_quantizer *quantizer_2pass; } my_decomp_master; -typedef my_decomp_master * my_master_ptr; +typedef my_decomp_master *my_master_ptr; /* @@ -425,7 +425,7 @@ LOCAL(void) prepare_range_limit_table (j_decompress_ptr cinfo) /* Allocate and fill in the sample_range_limit table */ { - JSAMPLE * table; + JSAMPLE *table; int i; table = (JSAMPLE *) diff --git a/jdmerge.c b/jdmerge.c index 6e23f6f9..30bc5283 100644 --- a/jdmerge.c +++ b/jdmerge.c @@ -56,10 +56,10 @@ typedef struct { JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); /* Private state for YCC->RGB conversion */ - int * Cr_r_tab; /* => table for Cr to R conversion */ - int * Cb_b_tab; /* => table for Cb to B conversion */ - JLONG * Cr_g_tab; /* => table for Cr to G conversion */ - JLONG * Cb_g_tab; /* => table for Cb to G conversion */ + int *Cr_r_tab; /* => table for Cr to R conversion */ + int *Cb_b_tab; /* => table for Cb to B conversion */ + JLONG *Cr_g_tab; /* => table for Cr to G conversion */ + JLONG *Cb_g_tab; /* => table for Cb to G conversion */ /* For 2:1 vertical sampling, we produce two output rows at a time. * We need a "spare" row buffer to hold the second output row if the @@ -73,7 +73,7 @@ typedef struct { JDIMENSION rows_to_go; /* counts rows remaining in image */ } my_upsampler; -typedef my_upsampler * my_upsample_ptr; +typedef my_upsampler *my_upsample_ptr; #define SCALEBITS 16 /* speediest right-shift on some machines */ #define ONE_HALF ((JLONG) 1 << (SCALEBITS-1)) diff --git a/jdphuff.c b/jdphuff.c index eb52258e..42a7068b 100644 --- a/jdphuff.c +++ b/jdphuff.c @@ -69,12 +69,12 @@ typedef struct { unsigned int restarts_to_go; /* MCUs left in this restart interval */ /* Pointers to derived tables (these workspaces have image lifespan) */ - d_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + d_derived_tbl *derived_tbls[NUM_HUFF_TBLS]; - d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */ + d_derived_tbl *ac_derived_tbl; /* active table during an AC scan */ } phuff_entropy_decoder; -typedef phuff_entropy_decoder * phuff_entropy_ptr; +typedef phuff_entropy_decoder *phuff_entropy_ptr; /* Forward declarations */ METHODDEF(boolean) decode_mcu_DC_first (j_decompress_ptr cinfo, @@ -99,7 +99,7 @@ start_pass_phuff_decoder (j_decompress_ptr cinfo) int ci, coefi, tbl; d_derived_tbl **pdtbl; int *coef_bit_ptr; - jpeg_component_info * compptr; + jpeg_component_info *compptr; is_DC_band = (cinfo->Ss == 0); @@ -298,8 +298,8 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) JBLOCKROW block; BITREAD_STATE_VARS; savable_state state; - d_derived_tbl * tbl; - jpeg_component_info * compptr; + d_derived_tbl *tbl; + jpeg_component_info *compptr; /* Process restart marker if needed; may have to suspend */ if (cinfo->restart_interval) { @@ -369,7 +369,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) unsigned int EOBRUN; JBLOCKROW block; BITREAD_STATE_VARS; - d_derived_tbl * tbl; + d_derived_tbl *tbl; /* Process restart marker if needed; may have to suspend */ if (cinfo->restart_interval) { @@ -505,7 +505,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) JBLOCKROW block; JCOEFPTR thiscoef; BITREAD_STATE_VARS; - d_derived_tbl * tbl; + d_derived_tbl *tbl; int num_newnz; int newnz_pos[DCTSIZE2]; diff --git a/jdpostct.c b/jdpostct.c index d8597533..601fc2a7 100644 --- a/jdpostct.c +++ b/jdpostct.c @@ -42,7 +42,7 @@ typedef struct { JDIMENSION next_row; /* index of next row to fill/empty in strip */ } my_post_controller; -typedef my_post_controller * my_post_ptr; +typedef my_post_controller *my_post_ptr; /* Forward declarations */ diff --git a/jdsample.c b/jdsample.c index c9c815a5..0eb56b7a 100644 --- a/jdsample.c +++ b/jdsample.c @@ -63,7 +63,7 @@ sep_upsample (j_decompress_ptr cinfo, { my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; int ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; JDIMENSION num_rows; /* Fill the conversion buffer, if it's empty */ @@ -123,8 +123,8 @@ sep_upsample (j_decompress_ptr cinfo, */ METHODDEF(void) -fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { *output_data_ptr = input_data; } @@ -136,8 +136,8 @@ fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +noop_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { *output_data_ptr = NULL; /* safety check */ } @@ -155,8 +155,8 @@ noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +int_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; JSAMPARRAY output_data = *output_data_ptr; @@ -199,8 +199,8 @@ int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; register JSAMPROW inptr, outptr; @@ -227,8 +227,8 @@ h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; register JSAMPROW inptr, outptr; @@ -270,8 +270,8 @@ h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; register JSAMPROW inptr, outptr; @@ -311,8 +311,8 @@ h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ METHODDEF(void) -h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; register JSAMPROW inptr0, inptr1, outptr; @@ -369,7 +369,7 @@ jinit_upsampler (j_decompress_ptr cinfo) { my_upsample_ptr upsample; int ci; - jpeg_component_info * compptr; + jpeg_component_info *compptr; boolean need_buffer, do_fancy; int h_in_group, v_in_group, h_out_group, v_out_group; diff --git a/jdsample.h b/jdsample.h index 630d07e4..a6bf08a0 100644 --- a/jdsample.h +++ b/jdsample.h @@ -13,9 +13,9 @@ /* Pointer to routine to upsample a single component */ typedef void (*upsample1_ptr) (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); /* Private subobject */ @@ -47,4 +47,4 @@ typedef struct { UINT8 v_expand[MAX_COMPONENTS]; } my_upsampler; -typedef my_upsampler * my_upsample_ptr; +typedef my_upsampler *my_upsample_ptr; diff --git a/jerror.c b/jerror.c index c1fffe53..c31acd9e 100644 --- a/jerror.c +++ b/jerror.c @@ -126,7 +126,7 @@ output_message (j_common_ptr cinfo) METHODDEF(void) emit_message (j_common_ptr cinfo, int msg_level) { - struct jpeg_error_mgr * err = cinfo->err; + struct jpeg_error_mgr *err = cinfo->err; if (msg_level < 0) { /* It's a warning message. Since corrupt files may generate many warnings, @@ -153,12 +153,12 @@ emit_message (j_common_ptr cinfo, int msg_level) */ METHODDEF(void) -format_message (j_common_ptr cinfo, char * buffer) +format_message (j_common_ptr cinfo, char *buffer) { - struct jpeg_error_mgr * err = cinfo->err; + struct jpeg_error_mgr *err = cinfo->err; int msg_code = err->msg_code; - const char * msgtext = NULL; - const char * msgptr; + const char *msgtext = NULL; + const char *msgptr; char ch; boolean isstring; @@ -227,7 +227,7 @@ reset_error_mgr (j_common_ptr cinfo) */ GLOBAL(struct jpeg_error_mgr *) -jpeg_std_error (struct jpeg_error_mgr * err) +jpeg_std_error (struct jpeg_error_mgr *err) { err->error_exit = error_exit; err->emit_message = emit_message; diff --git a/jfdctflt.c b/jfdctflt.c index bb08475d..b3da3ebd 100644 --- a/jfdctflt.c +++ b/jfdctflt.c @@ -57,7 +57,7 @@ */ GLOBAL(void) -jpeg_fdct_float (FAST_FLOAT * data) +jpeg_fdct_float (FAST_FLOAT *data) { FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; FAST_FLOAT tmp10, tmp11, tmp12, tmp13; diff --git a/jfdctfst.c b/jfdctfst.c index 5ba6f137..82b2515a 100644 --- a/jfdctfst.c +++ b/jfdctfst.c @@ -114,7 +114,7 @@ */ GLOBAL(void) -jpeg_fdct_ifast (DCTELEM * data) +jpeg_fdct_ifast (DCTELEM *data) { DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; DCTELEM tmp10, tmp11, tmp12, tmp13; diff --git a/jfdctint.c b/jfdctint.c index adfb6e36..73e0b590 100644 --- a/jfdctint.c +++ b/jfdctint.c @@ -140,7 +140,7 @@ */ GLOBAL(void) -jpeg_fdct_islow (DCTELEM * data) +jpeg_fdct_islow (DCTELEM *data) { JLONG tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; JLONG tmp10, tmp11, tmp12, tmp13; diff --git a/jidctflt.c b/jidctflt.c index ed41fb1e..68c521ed 100644 --- a/jidctflt.c +++ b/jidctflt.c @@ -69,7 +69,7 @@ */ GLOBAL(void) -jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -77,8 +77,8 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, FAST_FLOAT tmp10, tmp11, tmp12, tmp13; FAST_FLOAT z5, z10, z11, z12, z13; JCOEFPTR inptr; - FLOAT_MULT_TYPE * quantptr; - FAST_FLOAT * wsptr; + FLOAT_MULT_TYPE *quantptr; + FAST_FLOAT *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = cinfo->sample_range_limit; int ctr; diff --git a/jidctfst.c b/jidctfst.c index 98205eb8..10db739b 100644 --- a/jidctfst.c +++ b/jidctfst.c @@ -168,7 +168,7 @@ */ GLOBAL(void) -jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -176,8 +176,8 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, DCTELEM tmp10, tmp11, tmp12, tmp13; DCTELEM z5, z10, z11, z12, z13; JCOEFPTR inptr; - IFAST_MULT_TYPE * quantptr; - int * wsptr; + IFAST_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; diff --git a/jidctint.c b/jidctint.c index 66d6cb32..a2d03fca 100644 --- a/jidctint.c +++ b/jidctint.c @@ -170,7 +170,7 @@ */ GLOBAL(void) -jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -178,8 +178,8 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, JLONG tmp10, tmp11, tmp12, tmp13; JLONG z1, z2, z3, z4, z5; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -424,15 +424,15 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13; JLONG z1, z2, z3; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -573,15 +573,15 @@ jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12; JLONG z1, z2, z3; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -694,15 +694,15 @@ jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { JLONG tmp0, tmp1, tmp10, tmp11, tmp12; JLONG z1, z2, z3; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -809,14 +809,14 @@ jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { JLONG tmp0, tmp2, tmp10, tmp12; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -899,15 +899,15 @@ jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14; JLONG z1, z2, z3, z4; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -1070,7 +1070,7 @@ jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1078,8 +1078,8 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JLONG tmp20, tmp21, tmp22, tmp23, tmp24; JLONG z1, z2, z3, z4, z5; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -1265,7 +1265,7 @@ jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1273,8 +1273,8 @@ jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; JLONG z1, z2, z3, z4; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -1459,7 +1459,7 @@ jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1467,8 +1467,8 @@ jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; JLONG z1, z2, z3, z4; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -1675,7 +1675,7 @@ jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1683,8 +1683,8 @@ jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; JLONG z1, z2, z3, z4; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -1903,7 +1903,7 @@ jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1911,8 +1911,8 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; JLONG z1, z2, z3, z4; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -2129,7 +2129,7 @@ jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -2137,8 +2137,8 @@ jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; JLONG z1, z2, z3, z4; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -2371,7 +2371,7 @@ jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -2379,8 +2379,8 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; JLONG z1, z2, z3, z4; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; diff --git a/jidctred.c b/jidctred.c index 2d2d6242..2d5b5466 100644 --- a/jidctred.c +++ b/jidctred.c @@ -118,15 +118,15 @@ */ GLOBAL(void) -jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { JLONG tmp0, tmp2, tmp10, tmp12; JLONG z1, z2, z3, z4; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -272,14 +272,14 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { JLONG tmp0, tmp10, z1; JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; + ISLOW_MULT_TYPE *quantptr; + int *wsptr; JSAMPROW outptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); int ctr; @@ -381,12 +381,12 @@ jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, */ GLOBAL(void) -jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { int dcval; - ISLOW_MULT_TYPE * quantptr; + ISLOW_MULT_TYPE *quantptr; JSAMPLE *range_limit = IDCT_range_limit(cinfo); SHIFT_TEMPS diff --git a/jmemmgr.c b/jmemmgr.c index 73e770f6..9174ad3f 100644 --- a/jmemmgr.c +++ b/jmemmgr.c @@ -35,7 +35,7 @@ #ifndef NO_GETENV #ifndef HAVE_STDLIB_H /* should declare getenv() */ -extern char * getenv (const char * name); +extern char *getenv (const char *name); #endif #endif @@ -97,7 +97,7 @@ round_up_pow2 (size_t a, size_t b) * Small and large pool headers are identical. */ -typedef struct small_pool_struct * small_pool_ptr; +typedef struct small_pool_struct *small_pool_ptr; typedef struct small_pool_struct { small_pool_ptr next; /* next in list of pools */ @@ -105,7 +105,7 @@ typedef struct small_pool_struct { size_t bytes_left; /* bytes still available in this pool */ } small_pool_hdr; -typedef struct large_pool_struct * large_pool_ptr; +typedef struct large_pool_struct *large_pool_ptr; typedef struct large_pool_struct { large_pool_ptr next; /* next in list of pools */ @@ -141,7 +141,7 @@ typedef struct { JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */ } my_memory_mgr; -typedef my_memory_mgr * my_mem_ptr; +typedef my_memory_mgr *my_mem_ptr; /* @@ -267,7 +267,7 @@ alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject) { my_mem_ptr mem = (my_mem_ptr) cinfo->mem; small_pool_ptr hdr_ptr, prev_hdr_ptr; - char * data_ptr; + char *data_ptr; size_t min_request, slop; /* @@ -363,7 +363,7 @@ alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject) { my_mem_ptr mem = (my_mem_ptr) cinfo->mem; large_pool_ptr hdr_ptr; - char * data_ptr; + char *data_ptr; /* * Round up the requested size to a multiple of ALIGN_SIZE so that @@ -1154,7 +1154,7 @@ jinit_memory_mgr (j_common_ptr cinfo) * this feature. */ #ifndef NO_GETENV - { char * memenv; + { char *memenv; if ((memenv = getenv("JPEGMEM")) != NULL) { char ch = 'x'; diff --git a/jmemnobs.c b/jmemnobs.c index 63bdd895..5797198d 100644 --- a/jmemnobs.c +++ b/jmemnobs.c @@ -24,7 +24,7 @@ #include "jmemsys.h" /* import the system-dependent declarations */ #ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ -extern void * malloc (size_t size); +extern void *malloc (size_t size); extern void free (void *ptr); #endif @@ -41,7 +41,7 @@ jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) } GLOBAL(void) -jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +jpeg_free_small (j_common_ptr cinfo, void *object, size_t sizeofobject) { free(object); } @@ -58,7 +58,7 @@ jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) } GLOBAL(void) -jpeg_free_large (j_common_ptr cinfo, void * object, size_t sizeofobject) +jpeg_free_large (j_common_ptr cinfo, void *object, size_t sizeofobject) { free(object); } diff --git a/jmemsys.h b/jmemsys.h index 614ac7f8..f7dfe87a 100644 --- a/jmemsys.h +++ b/jmemsys.h @@ -32,7 +32,7 @@ */ EXTERN(void *) jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject); -EXTERN(void) jpeg_free_small (j_common_ptr cinfo, void * object, +EXTERN(void) jpeg_free_small (j_common_ptr cinfo, void *object, size_t sizeofobject); /* @@ -44,7 +44,7 @@ EXTERN(void) jpeg_free_small (j_common_ptr cinfo, void * object, */ EXTERN(void *) jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject); -EXTERN(void) jpeg_free_large (j_common_ptr cinfo, void * object, +EXTERN(void) jpeg_free_large (j_common_ptr cinfo, void *object, size_t sizeofobject); /* @@ -117,15 +117,15 @@ typedef union { #endif /* USE_MAC_MEMMGR */ -typedef struct backing_store_struct * backing_store_ptr; +typedef struct backing_store_struct *backing_store_ptr; typedef struct backing_store_struct { /* Methods for reading/writing/closing this backing-store object */ void (*read_backing_store) (j_common_ptr cinfo, backing_store_ptr info, - void * buffer_address, long file_offset, + void *buffer_address, long file_offset, long byte_count); void (*write_backing_store) (j_common_ptr cinfo, backing_store_ptr info, - void * buffer_address, long file_offset, + void *buffer_address, long file_offset, long byte_count); void (*close_backing_store) (j_common_ptr cinfo, backing_store_ptr info); @@ -142,7 +142,7 @@ typedef struct backing_store_struct { char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ #else /* For a typical implementation with temp files, we need: */ - FILE * temp_file; /* stdio reference to temp file */ + FILE *temp_file; /* stdio reference to temp file */ char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ #endif #endif diff --git a/jpegint.h b/jpegint.h index 1530e0c7..1ad07ee4 100644 --- a/jpegint.h +++ b/jpegint.h @@ -113,7 +113,7 @@ struct jpeg_downsampler { struct jpeg_forward_dct { void (*start_pass) (j_compress_ptr cinfo); /* perhaps this should be an array??? */ - void (*forward_DCT) (j_compress_ptr cinfo, jpeg_component_info * compptr, + void (*forward_DCT) (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY sample_data, JBLOCKROW coef_blocks, JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks); @@ -223,7 +223,7 @@ struct jpeg_entropy_decoder { /* Inverse DCT (also performs dequantization) */ typedef void (*inverse_DCT_method_ptr) (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); @@ -340,7 +340,7 @@ EXTERN(void) jcopy_sample_rows (JSAMPARRAY input_array, int source_row, int num_rows, JDIMENSION num_cols); EXTERN(void) jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks); -EXTERN(void) jzero_far (void * target, size_t bytestozero); +EXTERN(void) jzero_far (void *target, size_t bytestozero); /* Constant tables in jutils.c */ #if 0 /* This table is not actually needed in v6a */ extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ diff --git a/jpeglib.h b/jpeglib.h index 7d9c6ccd..01b4c3dc 100644 --- a/jpeglib.h +++ b/jpeglib.h @@ -180,10 +180,10 @@ typedef struct { * See jdinput.c comments about the need for this information. * This field is currently used only for decompression. */ - JQUANT_TBL * quant_table; + JQUANT_TBL *quant_table; /* Private per-component storage for DCT or IDCT subsystem. */ - void * dct_table; + void *dct_table; } jpeg_component_info; @@ -198,14 +198,14 @@ typedef struct { /* The decompressor can save APPn and COM markers in a list of these: */ -typedef struct jpeg_marker_struct * jpeg_saved_marker_ptr; +typedef struct jpeg_marker_struct *jpeg_saved_marker_ptr; struct jpeg_marker_struct { jpeg_saved_marker_ptr next; /* next in list, or NULL */ UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ unsigned int original_length; /* # bytes of data in the file */ unsigned int data_length; /* # bytes of data saved at data[] */ - JOCTET * data; /* the data contained in the marker */ + JOCTET *data; /* the data contained in the marker */ /* the marker length word is not counted in data_length or original_length */ }; @@ -268,10 +268,10 @@ typedef enum { /* Common fields between JPEG compression and decompression master structs. */ #define jpeg_common_fields \ - struct jpeg_error_mgr * err; /* Error handler module */\ - struct jpeg_memory_mgr * mem; /* Memory manager module */\ - struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ - void * client_data; /* Available for use by application */\ + struct jpeg_error_mgr *err; /* Error handler module */\ + struct jpeg_memory_mgr *mem; /* Memory manager module */\ + struct jpeg_progress_mgr *progress; /* Progress monitor, or NULL if none */\ + void *client_data; /* Available for use by application */\ boolean is_decompressor; /* So common code can tell which is which */\ int global_state /* For checking call sequence validity */ @@ -287,9 +287,9 @@ struct jpeg_common_struct { */ }; -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; +typedef struct jpeg_common_struct *j_common_ptr; +typedef struct jpeg_compress_struct *j_compress_ptr; +typedef struct jpeg_decompress_struct *j_decompress_ptr; /* Master record for a compression instance */ @@ -298,7 +298,7 @@ struct jpeg_compress_struct { jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ /* Destination for compressed data */ - struct jpeg_destination_mgr * dest; + struct jpeg_destination_mgr *dest; /* Description of source image --- these fields must be filled in by * outer application before starting compression. in_color_space must @@ -338,10 +338,10 @@ struct jpeg_compress_struct { int num_components; /* # of color components in JPEG image */ J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - jpeg_component_info * comp_info; + jpeg_component_info *comp_info; /* comp_info[i] describes component that appears i'th in SOF */ - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + JQUANT_TBL *quant_tbl_ptrs[NUM_QUANT_TBLS]; #if JPEG_LIB_VERSION >= 70 int q_scale_factor[NUM_QUANT_TBLS]; #endif @@ -349,8 +349,8 @@ struct jpeg_compress_struct { * and corresponding scale factors (percentage, initialized 100). */ - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL *dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL *ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; /* ptrs to Huffman coding tables, or NULL if not defined */ UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ @@ -358,7 +358,7 @@ struct jpeg_compress_struct { UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ int num_scans; /* # of entries in scan_info array */ - const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ + const jpeg_scan_info *scan_info; /* script for multi-scan file, or NULL */ /* The default value of scan_info is NULL, which causes a single-scan * sequential JPEG file to be emitted. To create a multi-scan file, * set num_scans and scan_info to point to an array of scan definitions. @@ -431,7 +431,7 @@ struct jpeg_compress_struct { * They describe the components and MCUs actually appearing in the scan. */ int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + jpeg_component_info *cur_comp_info[MAX_COMPS_IN_SCAN]; /* *cur_comp_info[i] describes component that appears i'th in SOS */ JDIMENSION MCUs_per_row; /* # of MCUs across the image */ @@ -446,23 +446,23 @@ struct jpeg_compress_struct { #if JPEG_LIB_VERSION >= 80 int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array */ + const int *natural_order; /* natural-order position array */ int lim_Se; /* min( Se, DCTSIZE2-1 ) */ #endif /* * Links to compression subobjects (methods and private variables of modules) */ - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; - jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ + struct jpeg_comp_master *master; + struct jpeg_c_main_controller *main; + struct jpeg_c_prep_controller *prep; + struct jpeg_c_coef_controller *coef; + struct jpeg_marker_writer *marker; + struct jpeg_color_converter *cconvert; + struct jpeg_downsampler *downsample; + struct jpeg_forward_dct *fdct; + struct jpeg_entropy_encoder *entropy; + jpeg_scan_info *script_space; /* workspace for jpeg_simple_progression */ int script_space_size; }; @@ -473,7 +473,7 @@ struct jpeg_decompress_struct { jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ /* Source of compressed data */ - struct jpeg_source_mgr * src; + struct jpeg_source_mgr *src; /* Basic description of image --- filled in by jpeg_read_header(). */ /* Application may inspect these values to decide how to process image. */ @@ -580,11 +580,11 @@ struct jpeg_decompress_struct { * datastreams when processing abbreviated JPEG datastreams. */ - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + JQUANT_TBL *quant_tbl_ptrs[NUM_QUANT_TBLS]; /* ptrs to coefficient quantization tables, or NULL if not defined */ - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL *dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL *ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; /* ptrs to Huffman coding tables, or NULL if not defined */ /* These parameters are never carried across datastreams, since they @@ -593,7 +593,7 @@ struct jpeg_decompress_struct { int data_precision; /* bits of precision in image data */ - jpeg_component_info * comp_info; + jpeg_component_info *comp_info; /* comp_info[i] describes component that appears i'th in SOF */ #if JPEG_LIB_VERSION >= 80 @@ -655,7 +655,7 @@ struct jpeg_decompress_struct { * v_samp_factor*DCT_[v_]scaled_size sample rows of a component per iMCU row. */ - JSAMPLE * sample_range_limit; /* table for fast range-limiting */ + JSAMPLE *sample_range_limit; /* table for fast range-limiting */ /* * These fields are valid during any one scan. @@ -663,7 +663,7 @@ struct jpeg_decompress_struct { * Note that the decompressor output side must not use these fields. */ int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + jpeg_component_info *cur_comp_info[MAX_COMPS_IN_SCAN]; /* *cur_comp_info[i] describes component that appears i'th in SOS */ JDIMENSION MCUs_per_row; /* # of MCUs across the image */ @@ -680,7 +680,7 @@ struct jpeg_decompress_struct { /* These fields are derived from Se of first SOS marker. */ int block_size; /* the basic DCT block size: 1..16 */ - const int * natural_order; /* natural-order position array for entropy decode */ + const int *natural_order; /* natural-order position array for entropy decode */ int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */ #endif @@ -693,17 +693,17 @@ struct jpeg_decompress_struct { /* * Links to decompression subobjects (methods, private variables of modules) */ - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; + struct jpeg_decomp_master *master; + struct jpeg_d_main_controller *main; + struct jpeg_d_coef_controller *coef; + struct jpeg_d_post_controller *post; + struct jpeg_input_controller *inputctl; + struct jpeg_marker_reader *marker; + struct jpeg_entropy_decoder *entropy; + struct jpeg_inverse_dct *idct; + struct jpeg_upsampler *upsample; + struct jpeg_color_deconverter *cconvert; + struct jpeg_color_quantizer *cquantize; }; @@ -725,7 +725,7 @@ struct jpeg_error_mgr { /* Routine that actually outputs a trace or error message */ void (*output_message) (j_common_ptr cinfo); /* Format a message string for the most recent JPEG error or message */ - void (*format_message) (j_common_ptr cinfo, char * buffer); + void (*format_message) (j_common_ptr cinfo, char *buffer); #define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ /* Reset error state variables at start of a new image */ void (*reset_error_mgr) (j_common_ptr cinfo); @@ -762,12 +762,12 @@ struct jpeg_error_mgr { * First table includes all errors generated by JPEG library itself. * Error code 0 is reserved for a "no such error string" message. */ - const char * const * jpeg_message_table; /* Library errors */ + const char * const *jpeg_message_table; /* Library errors */ int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ /* Second table can be added by application (see cjpeg/djpeg for example). * It contains strings numbered first_addon_message..last_addon_message. */ - const char * const * addon_message_table; /* Non-library errors */ + const char * const *addon_message_table; /* Non-library errors */ int first_addon_message; /* code for first string in addon table */ int last_addon_message; /* code for last string in addon table */ }; @@ -788,7 +788,7 @@ struct jpeg_progress_mgr { /* Data destination object for compression */ struct jpeg_destination_mgr { - JOCTET * next_output_byte; /* => next byte to write in buffer */ + JOCTET *next_output_byte; /* => next byte to write in buffer */ size_t free_in_buffer; /* # of byte spaces remaining in buffer */ void (*init_destination) (j_compress_ptr cinfo); @@ -800,7 +800,7 @@ struct jpeg_destination_mgr { /* Data source object for decompression */ struct jpeg_source_mgr { - const JOCTET * next_input_byte; /* => next byte to read from buffer */ + const JOCTET *next_input_byte; /* => next byte to read from buffer */ size_t bytes_in_buffer; /* # of bytes remaining in buffer */ void (*init_source) (j_decompress_ptr cinfo); @@ -826,15 +826,15 @@ struct jpeg_source_mgr { #define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ #define JPOOL_NUMPOOLS 2 -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; +typedef struct jvirt_sarray_control *jvirt_sarray_ptr; +typedef struct jvirt_barray_control *jvirt_barray_ptr; struct jpeg_memory_mgr { /* Method pointers */ - void * (*alloc_small) (j_common_ptr cinfo, int pool_id, size_t sizeofobject); - void * (*alloc_large) (j_common_ptr cinfo, int pool_id, - size_t sizeofobject); + void *(*alloc_small) (j_common_ptr cinfo, int pool_id, size_t sizeofobject); + void *(*alloc_large) (j_common_ptr cinfo, int pool_id, + size_t sizeofobject); JSAMPARRAY (*alloc_sarray) (j_common_ptr cinfo, int pool_id, JDIMENSION samplesperrow, JDIMENSION numrows); JBLOCKARRAY (*alloc_barray) (j_common_ptr cinfo, int pool_id, @@ -888,7 +888,7 @@ typedef boolean (*jpeg_marker_parser_method) (j_decompress_ptr cinfo); /* Default error-management setup */ -EXTERN(struct jpeg_error_mgr *) jpeg_std_error (struct jpeg_error_mgr * err); +EXTERN(struct jpeg_error_mgr *) jpeg_std_error (struct jpeg_error_mgr *err); /* Initialization of JPEG compression objects. * jpeg_create_compress() and jpeg_create_decompress() are the exported @@ -913,15 +913,15 @@ EXTERN(void) jpeg_destroy_decompress (j_decompress_ptr cinfo); /* Standard data source and destination managers: stdio streams. */ /* Caller is responsible for opening the file before and closing after. */ -EXTERN(void) jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile); -EXTERN(void) jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile); +EXTERN(void) jpeg_stdio_dest (j_compress_ptr cinfo, FILE *outfile); +EXTERN(void) jpeg_stdio_src (j_decompress_ptr cinfo, FILE *infile); #if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED) /* Data source and destination managers: memory buffers. */ -EXTERN(void) jpeg_mem_dest (j_compress_ptr cinfo, unsigned char ** outbuffer, - unsigned long * outsize); +EXTERN(void) jpeg_mem_dest (j_compress_ptr cinfo, unsigned char **outbuffer, + unsigned long *outsize); EXTERN(void) jpeg_mem_src (j_decompress_ptr cinfo, - const unsigned char * inbuffer, + const unsigned char *inbuffer, unsigned long insize); #endif @@ -967,7 +967,7 @@ EXTERN(JDIMENSION) jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, /* Write a special marker. See libjpeg.txt concerning safe usage. */ EXTERN(void) jpeg_write_marker (j_compress_ptr cinfo, int marker, - const JOCTET * dataptr, unsigned int datalen); + const JOCTET *dataptr, unsigned int datalen); /* Same, but piecemeal. */ EXTERN(void) jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen); @@ -1033,7 +1033,7 @@ EXTERN(void) jpeg_set_marker_processor (j_decompress_ptr cinfo, /* Read or write raw DCT coefficients --- useful for lossless transcoding. */ EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients (j_decompress_ptr cinfo); EXTERN(void) jpeg_write_coefficients (j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays); + jvirt_barray_ptr *coef_arrays); EXTERN(void) jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, j_compress_ptr dstinfo); diff --git a/jpegtran.c b/jpegtran.c index f5ebd7be..c44f21e4 100644 --- a/jpegtran.c +++ b/jpegtran.c @@ -39,8 +39,8 @@ */ -static const char * progname; /* program name for error messages */ -static char * outfilename; /* for -outfile switch */ +static const char *progname; /* program name for error messages */ +static char *outfilename; /* for -outfile switch */ static JCOPY_OPTION copyoption; /* -copy switch */ static jpeg_transform_info transformoption; /* image transformation options */ @@ -132,9 +132,9 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, */ { int argn; - char * arg; + char *arg; boolean simple_progressive; - char * scansarg = NULL; /* saves -scans parm if any */ + char *scansarg = NULL; /* saves -scans parm if any */ /* Set up default JPEG parameters. */ simple_progressive = FALSE; @@ -378,13 +378,13 @@ main (int argc, char **argv) #ifdef PROGRESS_REPORT struct cdjpeg_progress_mgr progress; #endif - jvirt_barray_ptr * src_coef_arrays; - jvirt_barray_ptr * dst_coef_arrays; + jvirt_barray_ptr *src_coef_arrays; + jvirt_barray_ptr *dst_coef_arrays; int file_index; /* We assume all-in-memory processing and can therefore use only a * single file pointer for sequential input and output operation. */ - FILE * fp; + FILE *fp; /* On Mac, fetch a command line. */ #ifdef USE_CCOMMAND diff --git a/jquant1.c b/jquant1.c index 0082c2f0..e7814815 100644 --- a/jquant1.c +++ b/jquant1.c @@ -164,7 +164,7 @@ typedef struct { boolean on_odd_row; /* flag to remember which row we are on */ } my_cquantizer; -typedef my_cquantizer * my_cquantize_ptr; +typedef my_cquantizer *my_cquantize_ptr; /* @@ -523,7 +523,7 @@ quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, register JSAMPROW input_ptr; register JSAMPROW output_ptr; JSAMPROW colorindex_ci; - int * dither; /* points to active row of dither matrix */ + int *dither; /* points to active row of dither matrix */ int row_index, col_index; /* current indexes into dither matrix */ int nc = cinfo->out_color_components; int ci; @@ -575,9 +575,9 @@ quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPROW colorindex0 = cquantize->colorindex[0]; JSAMPROW colorindex1 = cquantize->colorindex[1]; JSAMPROW colorindex2 = cquantize->colorindex[2]; - int * dither0; /* points to active row of dither matrix */ - int * dither1; - int * dither2; + int *dither0; /* points to active row of dither matrix */ + int *dither1; + int *dither2; int row_index, col_index; /* current indexes into dither matrix */ int row; JDIMENSION col; diff --git a/jquant2.c b/jquant2.c index fec4e4e3..cfbd0f15 100644 --- a/jquant2.c +++ b/jquant2.c @@ -128,11 +128,11 @@ static const int c_scales[3]={R_SCALE, G_SCALE, B_SCALE}; typedef UINT16 histcell; /* histogram cell; prefer an unsigned type */ -typedef histcell * histptr; /* for pointers to histogram cells */ +typedef histcell *histptr; /* for pointers to histogram cells */ typedef histcell hist1d[HIST_C2_ELEMS]; /* typedefs for the array */ -typedef hist1d * hist2d; /* type for the 2nd-level pointers */ -typedef hist2d * hist3d; /* type for top-level pointer */ +typedef hist1d *hist2d; /* type for the 2nd-level pointers */ +typedef hist2d *hist3d; /* type for top-level pointer */ /* Declarations for Floyd-Steinberg dithering. @@ -184,10 +184,10 @@ typedef struct { /* Variables for Floyd-Steinberg dithering */ FSERRPTR fserrors; /* accumulated errors */ boolean on_odd_row; /* flag to remember which row we are on */ - int * error_limiter; /* table for clamping the applied error */ + int *error_limiter; /* table for clamping the applied error */ } my_cquantizer; -typedef my_cquantizer * my_cquantize_ptr; +typedef my_cquantizer *my_cquantize_ptr; /* @@ -245,7 +245,7 @@ typedef struct { long colorcount; } box; -typedef box * boxptr; +typedef box *boxptr; LOCAL(boxptr) @@ -763,8 +763,8 @@ find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, { int ic0, ic1, ic2; int i, icolor; - register JLONG * bptr; /* pointer into bestdist[] array */ - JSAMPLE * cptr; /* pointer into bestcolor[] array */ + register JLONG *bptr; /* pointer into bestdist[] array */ + JSAMPLE *cptr; /* pointer into bestcolor[] array */ JLONG dist0, dist1; /* initial distance values */ register JLONG dist2; /* current distance in inner loop */ JLONG xx0, xx1; /* distance increments */ @@ -841,7 +841,7 @@ fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2) hist3d histogram = cquantize->histogram; int minc0, minc1, minc2; /* lower left corner of update box */ int ic0, ic1, ic2; - register JSAMPLE * cptr; /* pointer into bestcolor[] array */ + register JSAMPLE *cptr; /* pointer into bestcolor[] array */ register histptr cachep; /* pointer into main cache array */ /* This array lists the candidate colormap indexes. */ JSAMPLE colorlist[MAXNUMCOLORS]; @@ -1080,7 +1080,7 @@ init_error_limit (j_decompress_ptr cinfo) /* Allocate and fill in the error_limiter table */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - int * table; + int *table; int in, out; table = (int *) (*cinfo->mem->alloc_small) diff --git a/jsimd.h b/jsimd.h index 7fc7a0b7..f2e24846 100644 --- a/jsimd.h +++ b/jsimd.h @@ -39,17 +39,17 @@ EXTERN(int) jsimd_can_h2v2_downsample (void); EXTERN(int) jsimd_can_h2v1_downsample (void); EXTERN(void) jsimd_h2v2_downsample - (j_compress_ptr cinfo, jpeg_component_info * compptr, + (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(int) jsimd_can_h2v2_smooth_downsample (void); EXTERN(void) jsimd_h2v2_smooth_downsample - (j_compress_ptr cinfo, jpeg_component_info * compptr, + (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(void) jsimd_h2v1_downsample - (j_compress_ptr cinfo, jpeg_component_info * compptr, + (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data); EXTERN(int) jsimd_can_h2v2_upsample (void); @@ -57,24 +57,24 @@ EXTERN(int) jsimd_can_h2v1_upsample (void); EXTERN(int) jsimd_can_int_upsample (void); EXTERN(void) jsimd_h2v2_upsample - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v1_upsample - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_int_upsample - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(int) jsimd_can_h2v2_fancy_upsample (void); EXTERN(int) jsimd_can_h2v1_fancy_upsample (void); EXTERN(void) jsimd_h2v2_fancy_upsample - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v1_fancy_upsample - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(int) jsimd_can_h2v2_merged_upsample (void); EXTERN(int) jsimd_can_h2v1_merged_upsample (void); @@ -89,5 +89,5 @@ EXTERN(void) jsimd_h2v1_merged_upsample EXTERN(int) jsimd_can_huff_encode_one_block (void); EXTERN(JOCTET*) jsimd_huff_encode_one_block - (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, + (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl); diff --git a/jsimd_none.c b/jsimd_none.c index 65e3f8f8..90dc9651 100644 --- a/jsimd_none.c +++ b/jsimd_none.c @@ -103,19 +103,20 @@ jsimd_can_h2v2_smooth_downsample (void) } GLOBAL(void) -jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { } GLOBAL(void) -jsimd_h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY output_data) +jsimd_h2v2_smooth_downsample (j_compress_ptr cinfo, + jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) { } GLOBAL(void) -jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { } @@ -139,24 +140,24 @@ jsimd_can_int_upsample (void) } GLOBAL(void) -jsimd_int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +jsimd_int_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { } GLOBAL(void) jsimd_h2v2_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } GLOBAL(void) jsimd_h2v1_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } @@ -174,17 +175,17 @@ jsimd_can_h2v1_fancy_upsample (void) GLOBAL(void) jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } GLOBAL(void) jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } @@ -230,13 +231,13 @@ jsimd_can_convsamp_float (void) GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace) + DCTELEM *workspace) { } GLOBAL(void) jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, - FAST_FLOAT * workspace) + FAST_FLOAT *workspace) { } @@ -259,17 +260,17 @@ jsimd_can_fdct_float (void) } GLOBAL(void) -jsimd_fdct_islow (DCTELEM * data) +jsimd_fdct_islow (DCTELEM *data) { } GLOBAL(void) -jsimd_fdct_ifast (DCTELEM * data) +jsimd_fdct_ifast (DCTELEM *data) { } GLOBAL(void) -jsimd_fdct_float (FAST_FLOAT * data) +jsimd_fdct_float (FAST_FLOAT *data) { } @@ -286,14 +287,14 @@ jsimd_can_quantize_float (void) } GLOBAL(void) -jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace) +jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace) { } GLOBAL(void) -jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, - FAST_FLOAT * workspace) +jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, + FAST_FLOAT *workspace) { } @@ -322,28 +323,28 @@ jsimd_can_idct_12x12 (void) } GLOBAL(void) -jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { } GLOBAL(void) -jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { } GLOBAL(void) -jsimd_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { } GLOBAL(void) -jsimd_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -368,21 +369,21 @@ jsimd_can_idct_float (void) } GLOBAL(void) -jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { } GLOBAL(void) -jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { } GLOBAL(void) -jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -395,7 +396,7 @@ jsimd_can_huff_encode_one_block (void) } GLOBAL(JOCTET*) -jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, +jsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { diff --git a/jsimddct.h b/jsimddct.h index aa421fb1..b19ab48d 100644 --- a/jsimddct.h +++ b/jsimddct.h @@ -13,26 +13,26 @@ EXTERN(int) jsimd_can_convsamp (void); EXTERN(int) jsimd_can_convsamp_float (void); EXTERN(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace); + DCTELEM *workspace); EXTERN(void) jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, - FAST_FLOAT * workspace); + FAST_FLOAT *workspace); EXTERN(int) jsimd_can_fdct_islow (void); EXTERN(int) jsimd_can_fdct_ifast (void); EXTERN(int) jsimd_can_fdct_float (void); -EXTERN(void) jsimd_fdct_islow (DCTELEM * data); -EXTERN(void) jsimd_fdct_ifast (DCTELEM * data); -EXTERN(void) jsimd_fdct_float (FAST_FLOAT * data); +EXTERN(void) jsimd_fdct_islow (DCTELEM *data); +EXTERN(void) jsimd_fdct_ifast (DCTELEM *data); +EXTERN(void) jsimd_fdct_float (FAST_FLOAT *data); EXTERN(int) jsimd_can_quantize (void); EXTERN(int) jsimd_can_quantize_float (void); -EXTERN(void) jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace); -EXTERN(void) jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, - FAST_FLOAT * workspace); +EXTERN(void) jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace); +EXTERN(void) jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, + FAST_FLOAT *workspace); EXTERN(int) jsimd_can_idct_2x2 (void); EXTERN(int) jsimd_can_idct_4x4 (void); @@ -40,19 +40,19 @@ EXTERN(int) jsimd_can_idct_6x6 (void); EXTERN(int) jsimd_can_idct_12x12 (void); EXTERN(void) jsimd_idct_2x2 (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_4x4 (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_6x6 (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_12x12 (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); @@ -61,14 +61,14 @@ EXTERN(int) jsimd_can_idct_ifast (void); EXTERN(int) jsimd_can_idct_float (void); EXTERN(void) jsimd_idct_islow (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_ifast (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_float (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); diff --git a/jutils.c b/jutils.c index 883cc2ac..f9d35023 100644 --- a/jutils.c +++ b/jutils.c @@ -125,7 +125,7 @@ jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, GLOBAL(void) -jzero_far (void * target, size_t bytestozero) +jzero_far (void *target, size_t bytestozero) /* Zero out a chunk of memory. */ /* This might be sample-array data, block-array data, or alloc_large data. */ { diff --git a/libjpeg.txt b/libjpeg.txt index 58f11b31..da577ef7 100644 --- a/libjpeg.txt +++ b/libjpeg.txt @@ -293,7 +293,7 @@ destination module if you want to do something else, as discussed later. If you use the standard destination module, you must open the target stdio stream beforehand. Typical code for this step looks like: - FILE * outfile; + FILE *outfile; ... if ((outfile = fopen(filename, "wb")) == NULL) { fprintf(stderr, "can't open %s\n", filename); @@ -540,7 +540,7 @@ to do something else, as discussed later. If you use the standard source module, you must open the source stdio stream beforehand. Typical code for this step looks like: - FILE * infile; + FILE *infile; ... if ((infile = fopen(filename, "rb")) == NULL) { fprintf(stderr, "can't open %s\n", filename); @@ -976,7 +976,7 @@ int restart_in_rows If you use restarts, you may want to use larger intervals in those cases. -const jpeg_scan_info * scan_info +const jpeg_scan_info *scan_info int num_scans By default, scan_info is NULL; this causes the compressor to write a single-scan sequential JPEG file. If not NULL, scan_info points to @@ -1022,7 +1022,7 @@ boolean write_Adobe_marker default behavior ensures that the JPEG file's color space can be recognized by the decoder. -JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS] +JQUANT_TBL *quant_tbl_ptrs[NUM_QUANT_TBLS] Pointers to coefficient quantization tables, one per table slot, or NULL if no table is defined for a slot. Usually these should be set via one of the above helper routines; jpeg_add_quant_table() @@ -1057,8 +1057,8 @@ int q_scale_factor[NUM_QUANT_TBLS] cinfo->comp_info[0].v_samp_factor = 1; cinfo->comp_info[0].h_samp_factor = 1; -JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS] -JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS] +JHUFF_TBL *dc_huff_tbl_ptrs[NUM_HUFF_TBLS] +JHUFF_TBL *ac_huff_tbl_ptrs[NUM_HUFF_TBLS] Pointers to Huffman coding tables, one per table slot, or NULL if no table is defined for a slot. Slots 0 and 1 are filled with the JPEG sample tables by jpeg_set_defaults(). If you need to allocate @@ -1442,7 +1442,7 @@ output_message (j_common_ptr cinfo) somewhere other than stderr. Note that this method does not know how to generate a message, only where to send it. -format_message (j_common_ptr cinfo, char * buffer) +format_message (j_common_ptr cinfo, char *buffer) Constructs a readable error message string based on the error info stored in cinfo->err. This method is called by output_message. Few applications should need to override this method. One possible @@ -1519,7 +1519,7 @@ on external storage. A data destination manager struct contains a pointer and count defining the next byte to write in the work buffer and the remaining free space: - JOCTET * next_output_byte; /* => next byte to write in buffer */ + JOCTET *next_output_byte; /* => next byte to write in buffer */ size_t free_in_buffer; /* # of byte spaces remaining in buffer */ The library increments the pointer and decrements the count until the buffer @@ -1568,7 +1568,7 @@ additional frammishes. The source manager struct contains a pointer and count defining the next byte to read from the work buffer and the number of bytes remaining: - const JOCTET * next_input_byte; /* => next byte to read from buffer */ + const JOCTET *next_input_byte; /* => next byte to read from buffer */ size_t bytes_in_buffer; /* # of bytes remaining in buffer */ The library increments the pointer and decrements the count until the buffer diff --git a/rdbmp.c b/rdbmp.c index e09a3cce..eaa70864 100644 --- a/rdbmp.c +++ b/rdbmp.c @@ -52,7 +52,7 @@ typedef char U_CHAR; /* Private version of data source object */ -typedef struct _bmp_source_struct * bmp_source_ptr; +typedef struct _bmp_source_struct *bmp_source_ptr; typedef struct _bmp_source_struct { struct cjpeg_source_struct pub; /* public fields */ diff --git a/rdcolmap.c b/rdcolmap.c index deb2d15f..ed8ca3b6 100644 --- a/rdcolmap.c +++ b/rdcolmap.c @@ -77,7 +77,7 @@ add_map_entry (j_decompress_ptr cinfo, int R, int G, int B) */ LOCAL(void) -read_gif_map (j_decompress_ptr cinfo, FILE * infile) +read_gif_map (j_decompress_ptr cinfo, FILE *infile) { int header[13]; int i, colormaplen; @@ -119,7 +119,7 @@ read_gif_map (j_decompress_ptr cinfo, FILE * infile) LOCAL(int) -pbm_getc (FILE * infile) +pbm_getc (FILE *infile) /* Read next char, skipping over any comments */ /* A comment/newline sequence is returned as a newline */ { @@ -136,7 +136,7 @@ pbm_getc (FILE * infile) LOCAL(unsigned int) -read_pbm_integer (j_decompress_ptr cinfo, FILE * infile) +read_pbm_integer (j_decompress_ptr cinfo, FILE *infile) /* Read an unsigned decimal integer from the PPM file */ /* Swallows one trailing character after the integer */ /* Note that on a 16-bit-int machine, only values up to 64k can be read. */ @@ -169,7 +169,7 @@ read_pbm_integer (j_decompress_ptr cinfo, FILE * infile) */ LOCAL(void) -read_ppm_map (j_decompress_ptr cinfo, FILE * infile) +read_ppm_map (j_decompress_ptr cinfo, FILE *infile) { int c; unsigned int w, h, maxval, row, col; @@ -229,7 +229,7 @@ read_ppm_map (j_decompress_ptr cinfo, FILE * infile) */ GLOBAL(void) -read_color_map (j_decompress_ptr cinfo, FILE * infile) +read_color_map (j_decompress_ptr cinfo, FILE *infile) { /* Allocate space for a color map of maximum supported size. */ cinfo->colormap = (*cinfo->mem->alloc_sarray) diff --git a/rdjpgcom.c b/rdjpgcom.c index 66f276d3..b3076ddf 100644 --- a/rdjpgcom.c +++ b/rdjpgcom.c @@ -57,7 +57,7 @@ * To reuse this code in another application, you might need to change these. */ -static FILE * infile; /* input JPEG file */ +static FILE *infile; /* input JPEG file */ /* Return next input byte, or EOF if no more */ #define NEXTBYTE() getc(infile) @@ -279,7 +279,7 @@ process_SOFn (int marker) unsigned int length; unsigned int image_height, image_width; int data_precision, num_components; - const char * process; + const char *process; int ci; length = read_2_bytes(); /* usual parameter length count */ @@ -397,7 +397,7 @@ scan_JPEG_header (int verbose, int raw) /* Command line parsing code */ -static const char * progname; /* program name for error messages */ +static const char *progname; /* program name for error messages */ static void @@ -417,7 +417,7 @@ usage (void) static int -keymatch (char * arg, const char * keyword, int minchars) +keymatch (char *arg, const char *keyword, int minchars) /* Case-insensitive matching of (possibly abbreviated) keyword switches. */ /* keyword is the constant keyword (must be lower case already), */ /* minchars is length of minimum legal abbreviation. */ @@ -449,7 +449,7 @@ int main (int argc, char **argv) { int argn; - char * arg; + char *arg; int verbose = 0, raw = 0; /* On Mac, fetch a command line. */ diff --git a/rdppm.c b/rdppm.c index a2491422..aef49239 100644 --- a/rdppm.c +++ b/rdppm.c @@ -72,11 +72,11 @@ typedef struct { int maxval; } ppm_source_struct; -typedef ppm_source_struct * ppm_source_ptr; +typedef ppm_source_struct *ppm_source_ptr; LOCAL(int) -pbm_getc (FILE * infile) +pbm_getc (FILE *infile) /* Read next char, skipping over any comments */ /* A comment/newline sequence is returned as a newline */ { @@ -93,7 +93,7 @@ pbm_getc (FILE * infile) LOCAL(unsigned int) -read_pbm_integer (j_compress_ptr cinfo, FILE * infile, unsigned int maxval) +read_pbm_integer (j_compress_ptr cinfo, FILE *infile, unsigned int maxval) /* Read an unsigned decimal integer from the PPM file */ /* Swallows one trailing character after the integer */ /* Note that on a 16-bit-int machine, only values up to 64k can be read. */ @@ -141,7 +141,7 @@ get_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) /* This version is for reading text-format PGM files with any maxval */ { ppm_source_ptr source = (ppm_source_ptr) sinfo; - FILE * infile = source->pub.input_file; + FILE *infile = source->pub.input_file; register JSAMPROW ptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; @@ -160,7 +160,7 @@ get_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) /* This version is for reading text-format PPM files with any maxval */ { ppm_source_ptr source = (ppm_source_ptr) sinfo; - FILE * infile = source->pub.input_file; + FILE *infile = source->pub.input_file; register JSAMPROW ptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; @@ -182,7 +182,7 @@ get_scaled_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) { ppm_source_ptr source = (ppm_source_ptr) sinfo; register JSAMPROW ptr; - register U_CHAR * bufferptr; + register U_CHAR *bufferptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; @@ -203,7 +203,7 @@ get_scaled_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) { ppm_source_ptr source = (ppm_source_ptr) sinfo; register JSAMPROW ptr; - register U_CHAR * bufferptr; + register U_CHAR *bufferptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; @@ -241,7 +241,7 @@ get_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) { ppm_source_ptr source = (ppm_source_ptr) sinfo; register JSAMPROW ptr; - register U_CHAR * bufferptr; + register U_CHAR *bufferptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; @@ -265,7 +265,7 @@ get_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) { ppm_source_ptr source = (ppm_source_ptr) sinfo; register JSAMPROW ptr; - register U_CHAR * bufferptr; + register U_CHAR *bufferptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; diff --git a/rdrle.c b/rdrle.c index bb14879e..e3509e7e 100644 --- a/rdrle.c +++ b/rdrle.c @@ -62,7 +62,7 @@ typedef enum * then fetch the required row from the virtual array on subsequent calls. */ -typedef struct _rle_source_struct * rle_source_ptr; +typedef struct _rle_source_struct *rle_source_ptr; typedef struct _rle_source_struct { struct cjpeg_source_struct pub; /* public fields */ @@ -216,7 +216,7 @@ get_pseudocolor_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) colormap = source->header.cmap; dest_row = source->pub.buffer[0]; source->row--; - src_row = * (*cinfo->mem->access_virt_sarray) + src_row = *(*cinfo->mem->access_virt_sarray) ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE); for (col = cinfo->image_width; col > 0; col--) { @@ -289,7 +289,7 @@ load_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) case MAPPEDGRAY: case TRUECOLOR: for (row = 0; row < cinfo->image_height; row++) { - scanline = * (*cinfo->mem->access_virt_sarray) + scanline = *(*cinfo->mem->access_virt_sarray) ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE); rle_row = source->rle_row; rle_getrow(&source->header, rle_row); @@ -312,7 +312,7 @@ load_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) case DIRECTCOLOR: for (row = 0; row < cinfo->image_height; row++) { - scanline = * (*cinfo->mem->access_virt_sarray) + scanline = *(*cinfo->mem->access_virt_sarray) ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE); rle_getrow(&source->header, rle_row); diff --git a/rdswitch.c b/rdswitch.c index 6e6ab1b3..7d870c30 100644 --- a/rdswitch.c +++ b/rdswitch.c @@ -22,7 +22,7 @@ LOCAL(int) -text_getc (FILE * file) +text_getc (FILE *file) /* Read next char, skipping over any comments (# to end of line) */ /* A comment/newline sequence is returned as a newline */ { @@ -39,7 +39,7 @@ text_getc (FILE * file) LOCAL(boolean) -read_text_integer (FILE * file, long * result, int * termchar) +read_text_integer (FILE *file, long *result, int *termchar) /* Read an unsigned decimal integer from a file, store it in result */ /* Reads one trailing character after the integer; returns it in termchar */ { @@ -78,7 +78,8 @@ static int q_scale_factor[NUM_QUANT_TBLS] = {100, 100, 100, 100}; #endif GLOBAL(boolean) -read_quant_tables (j_compress_ptr cinfo, char * filename, boolean force_baseline) +read_quant_tables (j_compress_ptr cinfo, char *filename, + boolean force_baseline) /* Read a set of quantization tables from the specified file. * The file is plain ASCII text: decimal numbers with whitespace between. * Comments preceded by '#' may be included in the file. @@ -89,7 +90,7 @@ read_quant_tables (j_compress_ptr cinfo, char * filename, boolean force_baseline * You must use -qslots if you want a different component->table mapping. */ { - FILE * fp; + FILE *fp; int tblno, i, termchar; long val; unsigned int table[DCTSIZE2]; @@ -139,7 +140,7 @@ read_quant_tables (j_compress_ptr cinfo, char * filename, boolean force_baseline #ifdef C_MULTISCAN_FILES_SUPPORTED LOCAL(boolean) -read_scan_integer (FILE * file, long * result, int * termchar) +read_scan_integer (FILE *file, long *result, int *termchar) /* Variant of read_text_integer that always looks for a non-space termchar; * this simplifies parsing of punctuation in scan scripts. */ @@ -168,7 +169,7 @@ read_scan_integer (FILE * file, long * result, int * termchar) GLOBAL(boolean) -read_scan_script (j_compress_ptr cinfo, char * filename) +read_scan_script (j_compress_ptr cinfo, char *filename) /* Read a scan script from the specified text file. * Each entry in the file defines one scan to be emitted. * Entries are separated by semicolons ';'. @@ -185,10 +186,10 @@ read_scan_script (j_compress_ptr cinfo, char * filename) * jcmaster.c will validate the script parameters. */ { - FILE * fp; + FILE *fp; int scanno, ncomps, termchar; long val; - jpeg_scan_info * scanptr; + jpeg_scan_info *scanptr; #define MAX_SCANS 100 /* quite arbitrary limit */ jpeg_scan_info scans[MAX_SCANS]; diff --git a/rdtarga.c b/rdtarga.c index 3f1b0114..b9bbd07c 100644 --- a/rdtarga.c +++ b/rdtarga.c @@ -46,7 +46,7 @@ typedef char U_CHAR; /* Private version of data source object */ -typedef struct _tga_source_struct * tga_source_ptr; +typedef struct _tga_source_struct *tga_source_ptr; typedef struct _tga_source_struct { struct cjpeg_source_struct pub; /* public fields */ diff --git a/simd/jchuff-sse2-64.asm b/simd/jchuff-sse2-64.asm index f9949cb3..d22efc36 100644 --- a/simd/jchuff-sse2-64.asm +++ b/simd/jchuff-sse2-64.asm @@ -165,7 +165,7 @@ EXTN(jconst_huff_encode_one_block): ; Encode a single block's worth of coefficients. ; ; GLOBAL(JOCTET*) -; jsimd_huff_encode_one_block_sse2 (working_state * state, JOCTET *buffer, +; jsimd_huff_encode_one_block_sse2 (working_state *state, JOCTET *buffer, ; JCOEFPTR block, int last_dc_val, ; c_derived_tbl *dctbl, c_derived_tbl *actbl) ; diff --git a/simd/jchuff-sse2.asm b/simd/jchuff-sse2.asm index 5d48cff9..1d82273f 100644 --- a/simd/jchuff-sse2.asm +++ b/simd/jchuff-sse2.asm @@ -152,7 +152,7 @@ EXTN(jconst_huff_encode_one_block): ; Encode a single block's worth of coefficients. ; ; GLOBAL(JOCTET*) -; jsimd_huff_encode_one_block_sse2 (working_state * state, JOCTET *buffer, +; jsimd_huff_encode_one_block_sse2 (working_state *state, JOCTET *buffer, ; JCOEFPTR block, int last_dc_val, ; c_derived_tbl *dctbl, c_derived_tbl *actbl) ; @@ -175,7 +175,7 @@ EXTN(jconst_huff_encode_one_block): %define temp3 temp2+SIZEOF_DWORD %define temp4 temp3+SIZEOF_DWORD %define temp5 temp4+SIZEOF_DWORD -%define gotptr temp5+SIZEOF_DWORD ; void * gotptr +%define gotptr temp5+SIZEOF_DWORD ; void *gotptr %define put_buffer ebx %define put_bits edi diff --git a/simd/jdsample-altivec.c b/simd/jdsample-altivec.c index 6b77d04c..63d6d8ca 100644 --- a/simd/jdsample-altivec.c +++ b/simd/jdsample-altivec.c @@ -310,7 +310,7 @@ void jsimd_h2v1_upsample_altivec (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; JSAMPROW inptr, outptr; @@ -349,7 +349,7 @@ void jsimd_h2v2_upsample_altivec (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { JSAMPARRAY output_data = *output_data_ptr; JSAMPROW inptr, outptr0, outptr1; diff --git a/simd/jdsample-mmx.asm b/simd/jdsample-mmx.asm index 88564e43..c9e2b8ba 100644 --- a/simd/jdsample-mmx.asm +++ b/simd/jdsample-mmx.asm @@ -49,13 +49,13 @@ PW_EIGHT times 4 dw 8 ; jsimd_h2v1_fancy_upsample_mmx (int max_v_samp_factor, ; JDIMENSION downsampled_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; %define max_v_samp(b) (b)+8 ; int max_v_samp_factor %define downsamp_width(b) (b)+12 ; JDIMENSION downsampled_width %define input_data(b) (b)+16 ; JSAMPARRAY input_data -%define output_data_ptr(b) (b)+20 ; JSAMPARRAY * output_data_ptr +%define output_data_ptr(b) (b)+20 ; JSAMPARRAY *output_data_ptr align 16 global EXTN(jsimd_h2v1_fancy_upsample_mmx) @@ -202,18 +202,18 @@ EXTN(jsimd_h2v1_fancy_upsample_mmx): ; jsimd_h2v2_fancy_upsample_mmx (int max_v_samp_factor, ; JDIMENSION downsampled_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; %define max_v_samp(b) (b)+8 ; int max_v_samp_factor %define downsamp_width(b) (b)+12 ; JDIMENSION downsampled_width %define input_data(b) (b)+16 ; JSAMPARRAY input_data -%define output_data_ptr(b) (b)+20 ; JSAMPARRAY * output_data_ptr +%define output_data_ptr(b) (b)+20 ; JSAMPARRAY *output_data_ptr %define original_ebp ebp+0 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_MMWORD ; mmword wk[WK_NUM] %define WK_NUM 4 -%define gotptr wk(0)-SIZEOF_POINTER ; void * gotptr +%define gotptr wk(0)-SIZEOF_POINTER ; void *gotptr align 16 global EXTN(jsimd_h2v2_fancy_upsample_mmx) @@ -533,13 +533,13 @@ EXTN(jsimd_h2v2_fancy_upsample_mmx): ; jsimd_h2v1_upsample_mmx (int max_v_samp_factor, ; JDIMENSION output_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; %define max_v_samp(b) (b)+8 ; int max_v_samp_factor %define output_width(b) (b)+12 ; JDIMENSION output_width %define input_data(b) (b)+16 ; JSAMPARRAY input_data -%define output_data_ptr(b) (b)+20 ; JSAMPARRAY * output_data_ptr +%define output_data_ptr(b) (b)+20 ; JSAMPARRAY *output_data_ptr align 16 global EXTN(jsimd_h2v1_upsample_mmx) @@ -634,13 +634,13 @@ EXTN(jsimd_h2v1_upsample_mmx): ; jsimd_h2v2_upsample_mmx (int max_v_samp_factor, ; JDIMENSION output_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; %define max_v_samp(b) (b)+8 ; int max_v_samp_factor %define output_width(b) (b)+12 ; JDIMENSION output_width %define input_data(b) (b)+16 ; JSAMPARRAY input_data -%define output_data_ptr(b) (b)+20 ; JSAMPARRAY * output_data_ptr +%define output_data_ptr(b) (b)+20 ; JSAMPARRAY *output_data_ptr align 16 global EXTN(jsimd_h2v2_upsample_mmx) diff --git a/simd/jdsample-sse2-64.asm b/simd/jdsample-sse2-64.asm index 2287c00e..3aec69f4 100644 --- a/simd/jdsample-sse2-64.asm +++ b/simd/jdsample-sse2-64.asm @@ -50,13 +50,13 @@ PW_EIGHT times 8 dw 8 ; jsimd_h2v1_fancy_upsample_sse2 (int max_v_samp_factor, ; JDIMENSION downsampled_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; ; r10 = int max_v_samp_factor ; r11 = JDIMENSION downsampled_width ; r12 = JSAMPARRAY input_data -; r13 = JSAMPARRAY * output_data_ptr +; r13 = JSAMPARRAY *output_data_ptr align 16 global EXTN(jsimd_h2v1_fancy_upsample_sse2) @@ -189,13 +189,13 @@ EXTN(jsimd_h2v1_fancy_upsample_sse2): ; jsimd_h2v2_fancy_upsample_sse2 (int max_v_samp_factor, ; JDIMENSION downsampled_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; ; r10 = int max_v_samp_factor ; r11 = JDIMENSION downsampled_width ; r12 = JSAMPARRAY input_data -; r13 = JSAMPARRAY * output_data_ptr +; r13 = JSAMPARRAY *output_data_ptr %define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 4 @@ -489,13 +489,13 @@ EXTN(jsimd_h2v2_fancy_upsample_sse2): ; jsimd_h2v1_upsample_sse2 (int max_v_samp_factor, ; JDIMENSION output_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; ; r10 = int max_v_samp_factor ; r11 = JDIMENSION output_width ; r12 = JSAMPARRAY input_data -; r13 = JSAMPARRAY * output_data_ptr +; r13 = JSAMPARRAY *output_data_ptr align 16 global EXTN(jsimd_h2v1_upsample_sse2) @@ -578,13 +578,13 @@ EXTN(jsimd_h2v1_upsample_sse2): ; jsimd_h2v2_upsample_sse2 (nt max_v_samp_factor, ; JDIMENSION output_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; ; r10 = int max_v_samp_factor ; r11 = JDIMENSION output_width ; r12 = JSAMPARRAY input_data -; r13 = JSAMPARRAY * output_data_ptr +; r13 = JSAMPARRAY *output_data_ptr align 16 global EXTN(jsimd_h2v2_upsample_sse2) diff --git a/simd/jdsample-sse2.asm b/simd/jdsample-sse2.asm index 51176d45..f75e5944 100644 --- a/simd/jdsample-sse2.asm +++ b/simd/jdsample-sse2.asm @@ -49,13 +49,13 @@ PW_EIGHT times 8 dw 8 ; jsimd_h2v1_fancy_upsample_sse2 (int max_v_samp_factor, ; JDIMENSION downsampled_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; %define max_v_samp(b) (b)+8 ; int max_v_samp_factor %define downsamp_width(b) (b)+12 ; JDIMENSION downsampled_width %define input_data(b) (b)+16 ; JSAMPARRAY input_data -%define output_data_ptr(b) (b)+20 ; JSAMPARRAY * output_data_ptr +%define output_data_ptr(b) (b)+20 ; JSAMPARRAY *output_data_ptr align 16 global EXTN(jsimd_h2v1_fancy_upsample_sse2) @@ -200,18 +200,18 @@ EXTN(jsimd_h2v1_fancy_upsample_sse2): ; jsimd_h2v2_fancy_upsample_sse2 (int max_v_samp_factor, ; JDIMENSION downsampled_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; %define max_v_samp(b) (b)+8 ; int max_v_samp_factor %define downsamp_width(b) (b)+12 ; JDIMENSION downsampled_width %define input_data(b) (b)+16 ; JSAMPARRAY input_data -%define output_data_ptr(b) (b)+20 ; JSAMPARRAY * output_data_ptr +%define output_data_ptr(b) (b)+20 ; JSAMPARRAY *output_data_ptr %define original_ebp ebp+0 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 4 -%define gotptr wk(0)-SIZEOF_POINTER ; void * gotptr +%define gotptr wk(0)-SIZEOF_POINTER ; void *gotptr align 16 global EXTN(jsimd_h2v2_fancy_upsample_sse2) @@ -529,13 +529,13 @@ EXTN(jsimd_h2v2_fancy_upsample_sse2): ; jsimd_h2v1_upsample_sse2 (int max_v_samp_factor, ; JDIMENSION output_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; %define max_v_samp(b) (b)+8 ; int max_v_samp_factor %define output_width(b) (b)+12 ; JDIMENSION output_width %define input_data(b) (b)+16 ; JSAMPARRAY input_data -%define output_data_ptr(b) (b)+20 ; JSAMPARRAY * output_data_ptr +%define output_data_ptr(b) (b)+20 ; JSAMPARRAY *output_data_ptr align 16 global EXTN(jsimd_h2v1_upsample_sse2) @@ -628,13 +628,13 @@ EXTN(jsimd_h2v1_upsample_sse2): ; jsimd_h2v2_upsample_sse2 (nt max_v_samp_factor, ; JDIMENSION output_width, ; JSAMPARRAY input_data, -; JSAMPARRAY * output_data_ptr); +; JSAMPARRAY *output_data_ptr); ; %define max_v_samp(b) (b)+8 ; int max_v_samp_factor %define output_width(b) (b)+12 ; JDIMENSION output_width %define input_data(b) (b)+16 ; JSAMPARRAY input_data -%define output_data_ptr(b) (b)+20 ; JSAMPARRAY * output_data_ptr +%define output_data_ptr(b) (b)+20 ; JSAMPARRAY *output_data_ptr align 16 global EXTN(jsimd_h2v2_upsample_sse2) diff --git a/simd/jfdctflt-3dn.asm b/simd/jfdctflt-3dn.asm index e23c5218..133fe4df 100644 --- a/simd/jfdctflt-3dn.asm +++ b/simd/jfdctflt-3dn.asm @@ -45,10 +45,10 @@ PD_1_306 times 2 dd 1.306562964876376527856643 ; Perform the forward DCT on one block of samples. ; ; GLOBAL(void) -; jsimd_fdct_float_3dnow (FAST_FLOAT * data) +; jsimd_fdct_float_3dnow (FAST_FLOAT *data) ; -%define data(b) (b)+8 ; FAST_FLOAT * data +%define data(b) (b)+8 ; FAST_FLOAT *data %define original_ebp ebp+0 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_MMWORD ; mmword wk[WK_NUM] diff --git a/simd/jfdctflt-sse-64.asm b/simd/jfdctflt-sse-64.asm index 4184e95f..02d54635 100644 --- a/simd/jfdctflt-sse-64.asm +++ b/simd/jfdctflt-sse-64.asm @@ -56,10 +56,10 @@ PD_1_306 times 4 dd 1.306562964876376527856643 ; Perform the forward DCT on one block of samples. ; ; GLOBAL(void) -; jsimd_fdct_float_sse (FAST_FLOAT * data) +; jsimd_fdct_float_sse (FAST_FLOAT *data) ; -; r10 = FAST_FLOAT * data +; r10 = FAST_FLOAT *data %define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 2 diff --git a/simd/jfdctflt-sse.asm b/simd/jfdctflt-sse.asm index 477f5c83..c2f61c83 100644 --- a/simd/jfdctflt-sse.asm +++ b/simd/jfdctflt-sse.asm @@ -55,10 +55,10 @@ PD_1_306 times 4 dd 1.306562964876376527856643 ; Perform the forward DCT on one block of samples. ; ; GLOBAL(void) -; jsimd_fdct_float_sse (FAST_FLOAT * data) +; jsimd_fdct_float_sse (FAST_FLOAT *data) ; -%define data(b) (b)+8 ; FAST_FLOAT * data +%define data(b) (b)+8 ; FAST_FLOAT *data %define original_ebp ebp+0 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] diff --git a/simd/jfdctfst-mmx.asm b/simd/jfdctfst-mmx.asm index 2c2d20c2..41ba00e1 100644 --- a/simd/jfdctfst-mmx.asm +++ b/simd/jfdctfst-mmx.asm @@ -70,10 +70,10 @@ PW_F1306 times 4 dw F_1_306 << CONST_SHIFT ; Perform the forward DCT on one block of samples. ; ; GLOBAL(void) -; jsimd_fdct_ifast_mmx (DCTELEM * data) +; jsimd_fdct_ifast_mmx (DCTELEM *data) ; -%define data(b) (b)+8 ; DCTELEM * data +%define data(b) (b)+8 ; DCTELEM *data %define original_ebp ebp+0 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_MMWORD ; mmword wk[WK_NUM] diff --git a/simd/jfdctfst-sse2-64.asm b/simd/jfdctfst-sse2-64.asm index 13c4efc0..f9b15512 100644 --- a/simd/jfdctfst-sse2-64.asm +++ b/simd/jfdctfst-sse2-64.asm @@ -71,10 +71,10 @@ PW_F1306 times 8 dw F_1_306 << CONST_SHIFT ; Perform the forward DCT on one block of samples. ; ; GLOBAL(void) -; jsimd_fdct_ifast_sse2 (DCTELEM * data) +; jsimd_fdct_ifast_sse2 (DCTELEM *data) ; -; r10 = DCTELEM * data +; r10 = DCTELEM *data %define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 2 diff --git a/simd/jfdctfst-sse2.asm b/simd/jfdctfst-sse2.asm index e6e4b72f..ebbadadf 100644 --- a/simd/jfdctfst-sse2.asm +++ b/simd/jfdctfst-sse2.asm @@ -70,10 +70,10 @@ PW_F1306 times 8 dw F_1_306 << CONST_SHIFT ; Perform the forward DCT on one block of samples. ; ; GLOBAL(void) -; jsimd_fdct_ifast_sse2 (DCTELEM * data) +; jsimd_fdct_ifast_sse2 (DCTELEM *data) ; -%define data(b) (b)+8 ; DCTELEM * data +%define data(b) (b)+8 ; DCTELEM *data %define original_ebp ebp+0 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] diff --git a/simd/jfdctint-mmx.asm b/simd/jfdctint-mmx.asm index 8536ae2c..47f6041b 100644 --- a/simd/jfdctint-mmx.asm +++ b/simd/jfdctint-mmx.asm @@ -91,10 +91,10 @@ PW_DESCALE_P2X times 4 dw 1 << (PASS1_BITS-1) ; Perform the forward DCT on one block of samples. ; ; GLOBAL(void) -; jsimd_fdct_islow_mmx (DCTELEM * data) +; jsimd_fdct_islow_mmx (DCTELEM *data) ; -%define data(b) (b)+8 ; DCTELEM * data +%define data(b) (b)+8 ; DCTELEM *data %define original_ebp ebp+0 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_MMWORD ; mmword wk[WK_NUM] diff --git a/simd/jfdctint-sse2-64.asm b/simd/jfdctint-sse2-64.asm index 53ec5276..c23fcfb9 100644 --- a/simd/jfdctint-sse2-64.asm +++ b/simd/jfdctint-sse2-64.asm @@ -92,10 +92,10 @@ PW_DESCALE_P2X times 8 dw 1 << (PASS1_BITS-1) ; Perform the forward DCT on one block of samples. ; ; GLOBAL(void) -; jsimd_fdct_islow_sse2 (DCTELEM * data) +; jsimd_fdct_islow_sse2 (DCTELEM *data) ; -; r10 = DCTELEM * data +; r10 = DCTELEM *data %define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] %define WK_NUM 6 diff --git a/simd/jfdctint-sse2.asm b/simd/jfdctint-sse2.asm index 85133f80..6b42ce5c 100644 --- a/simd/jfdctint-sse2.asm +++ b/simd/jfdctint-sse2.asm @@ -91,10 +91,10 @@ PW_DESCALE_P2X times 8 dw 1 << (PASS1_BITS-1) ; Perform the forward DCT on one block of samples. ; ; GLOBAL(void) -; jsimd_fdct_islow_sse2 (DCTELEM * data) +; jsimd_fdct_islow_sse2 (DCTELEM *data) ; -%define data(b) (b)+8 ; DCTELEM * data +%define data(b) (b)+8 ; DCTELEM *data %define original_ebp ebp+0 %define wk(i) ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM] diff --git a/simd/jidctflt-3dn.asm b/simd/jidctflt-3dn.asm index ea2e2701..24bd1059 100644 --- a/simd/jidctflt-3dn.asm +++ b/simd/jidctflt-3dn.asm @@ -47,11 +47,11 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_float_3dnow (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_float_3dnow (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; void * dct_table +%define dct_table(b) (b)+8 ; void *dct_table %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col @@ -86,7 +86,7 @@ EXTN(jsimd_idct_float_3dnow): ; mov eax, [original_ebp] mov edx, POINTER [dct_table(eax)] ; quantptr mov esi, JCOEFPTR [coef_block(eax)] ; inptr - lea edi, [workspace] ; FAST_FLOAT * wsptr + lea edi, [workspace] ; FAST_FLOAT *wsptr mov ecx, DCTSIZE/2 ; ctr alignx 16,7 .columnloop: @@ -290,7 +290,7 @@ EXTN(jsimd_idct_float_3dnow): ; ---- Pass 2: process rows from work array, store into output array. mov eax, [original_ebp] - lea esi, [workspace] ; FAST_FLOAT * wsptr + lea esi, [workspace] ; FAST_FLOAT *wsptr mov edi, JSAMPARRAY [output_buf(eax)] ; (JSAMPROW *) mov eax, JDIMENSION [output_col(eax)] mov ecx, DCTSIZE/2 ; ctr diff --git a/simd/jidctflt-sse.asm b/simd/jidctflt-sse.asm index 6160e417..9605b730 100644 --- a/simd/jidctflt-sse.asm +++ b/simd/jidctflt-sse.asm @@ -57,11 +57,11 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_float_sse (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_float_sse (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; void * dct_table +%define dct_table(b) (b)+8 ; void *dct_table %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col @@ -96,7 +96,7 @@ EXTN(jsimd_idct_float_sse): ; mov eax, [original_ebp] mov edx, POINTER [dct_table(eax)] ; quantptr mov esi, JCOEFPTR [coef_block(eax)] ; inptr - lea edi, [workspace] ; FAST_FLOAT * wsptr + lea edi, [workspace] ; FAST_FLOAT *wsptr mov ecx, DCTSIZE/4 ; ctr alignx 16,7 .columnloop: @@ -369,7 +369,7 @@ EXTN(jsimd_idct_float_sse): ; ---- Pass 2: process rows from work array, store into output array. mov eax, [original_ebp] - lea esi, [workspace] ; FAST_FLOAT * wsptr + lea esi, [workspace] ; FAST_FLOAT *wsptr mov edi, JSAMPARRAY [output_buf(eax)] ; (JSAMPROW *) mov eax, JDIMENSION [output_col(eax)] mov ecx, DCTSIZE/4 ; ctr diff --git a/simd/jidctflt-sse2-64.asm b/simd/jidctflt-sse2-64.asm index 95bd4dcd..3f535010 100644 --- a/simd/jidctflt-sse2-64.asm +++ b/simd/jidctflt-sse2-64.asm @@ -58,11 +58,11 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_float_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_float_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -; r10 = void * dct_table +; r10 = void *dct_table ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13 = JDIMENSION output_col @@ -91,7 +91,7 @@ EXTN(jsimd_idct_float_sse2): mov rdx, r10 ; quantptr mov rsi, r11 ; inptr - lea rdi, [workspace] ; FAST_FLOAT * wsptr + lea rdi, [workspace] ; FAST_FLOAT *wsptr mov rcx, DCTSIZE/4 ; ctr .columnloop: %ifndef NO_ZERO_COLUMN_TEST_FLOAT_SSE @@ -324,7 +324,7 @@ EXTN(jsimd_idct_float_sse2): ; ---- Pass 2: process rows from work array, store into output array. mov rax, [original_rbp] - lea rsi, [workspace] ; FAST_FLOAT * wsptr + lea rsi, [workspace] ; FAST_FLOAT *wsptr mov rdi, r12 ; (JSAMPROW *) mov eax, r13d mov rcx, DCTSIZE/4 ; ctr diff --git a/simd/jidctflt-sse2.asm b/simd/jidctflt-sse2.asm index de2cd1f6..be899b3d 100644 --- a/simd/jidctflt-sse2.asm +++ b/simd/jidctflt-sse2.asm @@ -57,11 +57,11 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_float_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_float_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; void * dct_table +%define dct_table(b) (b)+8 ; void *dct_table %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col @@ -96,7 +96,7 @@ EXTN(jsimd_idct_float_sse2): ; mov eax, [original_ebp] mov edx, POINTER [dct_table(eax)] ; quantptr mov esi, JCOEFPTR [coef_block(eax)] ; inptr - lea edi, [workspace] ; FAST_FLOAT * wsptr + lea edi, [workspace] ; FAST_FLOAT *wsptr mov ecx, DCTSIZE/4 ; ctr alignx 16,7 .columnloop: @@ -331,7 +331,7 @@ EXTN(jsimd_idct_float_sse2): ; ---- Pass 2: process rows from work array, store into output array. mov eax, [original_ebp] - lea esi, [workspace] ; FAST_FLOAT * wsptr + lea esi, [workspace] ; FAST_FLOAT *wsptr mov edi, JSAMPARRAY [output_buf(eax)] ; (JSAMPROW *) mov eax, JDIMENSION [output_col(eax)] mov ecx, DCTSIZE/4 ; ctr diff --git a/simd/jidctfst-altivec.c b/simd/jidctfst-altivec.c index fd7a2a34..67cbe842 100644 --- a/simd/jidctfst-altivec.c +++ b/simd/jidctfst-altivec.c @@ -111,7 +111,7 @@ void -jsimd_idct_ifast_altivec (void * dct_table_, JCOEFPTR coef_block, +jsimd_idct_ifast_altivec (void *dct_table_, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { short *dct_table = (short *)dct_table_; diff --git a/simd/jidctfst-mmx.asm b/simd/jidctfst-mmx.asm index d97c02a2..0e3963db 100644 --- a/simd/jidctfst-mmx.asm +++ b/simd/jidctfst-mmx.asm @@ -78,11 +78,11 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_ifast_mmx (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_ifast_mmx (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; jpeg_component_info * compptr +%define dct_table(b) (b)+8 ; jpeg_component_info *compptr %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col @@ -117,7 +117,7 @@ EXTN(jsimd_idct_ifast_mmx): ; mov eax, [original_ebp] mov edx, POINTER [dct_table(eax)] ; quantptr mov esi, JCOEFPTR [coef_block(eax)] ; inptr - lea edi, [workspace] ; JCOEF * wsptr + lea edi, [workspace] ; JCOEF *wsptr mov ecx, DCTSIZE/4 ; ctr alignx 16,7 .columnloop: @@ -323,7 +323,7 @@ EXTN(jsimd_idct_ifast_mmx): ; ---- Pass 2: process rows from work array, store into output array. mov eax, [original_ebp] - lea esi, [workspace] ; JCOEF * wsptr + lea esi, [workspace] ; JCOEF *wsptr mov edi, JSAMPARRAY [output_buf(eax)] ; (JSAMPROW *) mov eax, JDIMENSION [output_col(eax)] mov ecx, DCTSIZE/4 ; ctr diff --git a/simd/jidctfst-sse2-64.asm b/simd/jidctfst-sse2-64.asm index 0f864291..da4ecf2f 100644 --- a/simd/jidctfst-sse2-64.asm +++ b/simd/jidctfst-sse2-64.asm @@ -79,11 +79,11 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_ifast_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_ifast_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -; r10 = jpeg_component_info * compptr +; r10 = jpeg_component_info *compptr ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13 = JDIMENSION output_col diff --git a/simd/jidctfst-sse2.asm b/simd/jidctfst-sse2.asm index 4658be3e..065842c6 100644 --- a/simd/jidctfst-sse2.asm +++ b/simd/jidctfst-sse2.asm @@ -78,11 +78,11 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_ifast_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_ifast_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; jpeg_component_info * compptr +%define dct_table(b) (b)+8 ; jpeg_component_info *compptr %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col diff --git a/simd/jidctint-altivec.c b/simd/jidctint-altivec.c index 7f0f8d0d..5f1a5dfc 100644 --- a/simd/jidctint-altivec.c +++ b/simd/jidctint-altivec.c @@ -206,7 +206,7 @@ void -jsimd_idct_islow_altivec (void * dct_table_, JCOEFPTR coef_block, +jsimd_idct_islow_altivec (void *dct_table_, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { short *dct_table = (short *)dct_table_; diff --git a/simd/jidctint-mmx.asm b/simd/jidctint-mmx.asm index 7e25b820..fda3b63e 100644 --- a/simd/jidctint-mmx.asm +++ b/simd/jidctint-mmx.asm @@ -91,11 +91,11 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_islow_mmx (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_islow_mmx (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; jpeg_component_info * compptr +%define dct_table(b) (b)+8 ; jpeg_component_info *compptr %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col @@ -130,7 +130,7 @@ EXTN(jsimd_idct_islow_mmx): ; mov eax, [original_ebp] mov edx, POINTER [dct_table(eax)] ; quantptr mov esi, JCOEFPTR [coef_block(eax)] ; inptr - lea edi, [workspace] ; JCOEF * wsptr + lea edi, [workspace] ; JCOEF *wsptr mov ecx, DCTSIZE/4 ; ctr alignx 16,7 .columnloop: @@ -510,7 +510,7 @@ EXTN(jsimd_idct_islow_mmx): ; ---- Pass 2: process rows from work array, store into output array. mov eax, [original_ebp] - lea esi, [workspace] ; JCOEF * wsptr + lea esi, [workspace] ; JCOEF *wsptr mov edi, JSAMPARRAY [output_buf(eax)] ; (JSAMPROW *) mov eax, JDIMENSION [output_col(eax)] mov ecx, DCTSIZE/4 ; ctr diff --git a/simd/jidctint-sse2-64.asm b/simd/jidctint-sse2-64.asm index 1cc30866..bfec4994 100644 --- a/simd/jidctint-sse2-64.asm +++ b/simd/jidctint-sse2-64.asm @@ -92,11 +92,11 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_islow_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_islow_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -; r10 = jpeg_component_info * compptr +; r10 = jpeg_component_info *compptr ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13 = JDIMENSION output_col diff --git a/simd/jidctint-sse2.asm b/simd/jidctint-sse2.asm index 4a35f3df..1960bcd5 100644 --- a/simd/jidctint-sse2.asm +++ b/simd/jidctint-sse2.asm @@ -91,11 +91,11 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE ; Perform dequantization and inverse DCT on one block of coefficients. ; ; GLOBAL(void) -; jsimd_idct_islow_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_islow_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; jpeg_component_info * compptr +%define dct_table(b) (b)+8 ; jpeg_component_info *compptr %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col diff --git a/simd/jidctred-mmx.asm b/simd/jidctred-mmx.asm index 1c939013..21e17fce 100644 --- a/simd/jidctred-mmx.asm +++ b/simd/jidctred-mmx.asm @@ -99,11 +99,11 @@ PB_CENTERJSAMP times 8 db CENTERJSAMPLE ; producing a reduced-size 4x4 output block. ; ; GLOBAL(void) -; jsimd_idct_4x4_mmx (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_4x4_mmx (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; void * dct_table +%define dct_table(b) (b)+8 ; void *dct_table %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col @@ -138,7 +138,7 @@ EXTN(jsimd_idct_4x4_mmx): ; mov eax, [original_ebp] mov edx, POINTER [dct_table(eax)] ; quantptr mov esi, JCOEFPTR [coef_block(eax)] ; inptr - lea edi, [workspace] ; JCOEF * wsptr + lea edi, [workspace] ; JCOEF *wsptr mov ecx, DCTSIZE/4 ; ctr alignx 16,7 .columnloop: @@ -332,7 +332,7 @@ EXTN(jsimd_idct_4x4_mmx): ; ---- Pass 2: process rows from work array, store into output array. mov eax, [original_ebp] - lea esi, [workspace] ; JCOEF * wsptr + lea esi, [workspace] ; JCOEF *wsptr mov edi, JSAMPARRAY [output_buf(eax)] ; (JSAMPROW *) mov eax, JDIMENSION [output_col(eax)] @@ -493,11 +493,11 @@ EXTN(jsimd_idct_4x4_mmx): ; producing a reduced-size 2x2 output block. ; ; GLOBAL(void) -; jsimd_idct_2x2_mmx (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_2x2_mmx (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; void * dct_table +%define dct_table(b) (b)+8 ; void *dct_table %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col diff --git a/simd/jidctred-sse2-64.asm b/simd/jidctred-sse2-64.asm index 02b155a8..d1b18742 100644 --- a/simd/jidctred-sse2-64.asm +++ b/simd/jidctred-sse2-64.asm @@ -100,11 +100,11 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE ; producing a reduced-size 4x4 output block. ; ; GLOBAL(void) -; jsimd_idct_4x4_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_4x4_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -; r10 = void * dct_table +; r10 = void *dct_table ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13 = JDIMENSION output_col @@ -403,11 +403,11 @@ EXTN(jsimd_idct_4x4_sse2): ; producing a reduced-size 2x2 output block. ; ; GLOBAL(void) -; jsimd_idct_2x2_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_2x2_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -; r10 = void * dct_table +; r10 = void *dct_table ; r11 = JCOEFPTR coef_block ; r12 = JSAMPARRAY output_buf ; r13 = JDIMENSION output_col diff --git a/simd/jidctred-sse2.asm b/simd/jidctred-sse2.asm index 06dade8a..e48c0c5b 100644 --- a/simd/jidctred-sse2.asm +++ b/simd/jidctred-sse2.asm @@ -99,11 +99,11 @@ PB_CENTERJSAMP times 16 db CENTERJSAMPLE ; producing a reduced-size 4x4 output block. ; ; GLOBAL(void) -; jsimd_idct_4x4_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_4x4_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; void * dct_table +%define dct_table(b) (b)+8 ; void *dct_table %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col @@ -414,11 +414,11 @@ EXTN(jsimd_idct_4x4_sse2): ; producing a reduced-size 2x2 output block. ; ; GLOBAL(void) -; jsimd_idct_2x2_sse2 (void * dct_table, JCOEFPTR coef_block, +; jsimd_idct_2x2_sse2 (void *dct_table, JCOEFPTR coef_block, ; JSAMPARRAY output_buf, JDIMENSION output_col) ; -%define dct_table(b) (b)+8 ; void * dct_table +%define dct_table(b) (b)+8 ; void *dct_table %define coef_block(b) (b)+12 ; JCOEFPTR coef_block %define output_buf(b) (b)+16 ; JSAMPARRAY output_buf %define output_col(b) (b)+20 ; JDIMENSION output_col diff --git a/simd/jquant-3dn.asm b/simd/jquant-3dn.asm index 76e19f70..6b7c11c8 100644 --- a/simd/jquant-3dn.asm +++ b/simd/jquant-3dn.asm @@ -27,12 +27,12 @@ ; ; GLOBAL(void) ; jsimd_convsamp_float_3dnow (JSAMPARRAY sample_data, JDIMENSION start_col, -; FAST_FLOAT * workspace); +; FAST_FLOAT *workspace); ; %define sample_data ebp+8 ; JSAMPARRAY sample_data %define start_col ebp+12 ; JDIMENSION start_col -%define workspace ebp+16 ; FAST_FLOAT * workspace +%define workspace ebp+16 ; FAST_FLOAT *workspace align 16 global EXTN(jsimd_convsamp_float_3dnow) @@ -129,13 +129,13 @@ EXTN(jsimd_convsamp_float_3dnow): ; Quantize/descale the coefficients, and store into coef_block ; ; GLOBAL(void) -; jsimd_quantize_float_3dnow (JCOEFPTR coef_block, FAST_FLOAT * divisors, -; FAST_FLOAT * workspace); +; jsimd_quantize_float_3dnow (JCOEFPTR coef_block, FAST_FLOAT *divisors, +; FAST_FLOAT *workspace); ; %define coef_block ebp+8 ; JCOEFPTR coef_block -%define divisors ebp+12 ; FAST_FLOAT * divisors -%define workspace ebp+16 ; FAST_FLOAT * workspace +%define divisors ebp+12 ; FAST_FLOAT *divisors +%define workspace ebp+16 ; FAST_FLOAT *workspace align 16 global EXTN(jsimd_quantize_float_3dnow) diff --git a/simd/jquant-mmx.asm b/simd/jquant-mmx.asm index 822c7ee5..dbfeceec 100644 --- a/simd/jquant-mmx.asm +++ b/simd/jquant-mmx.asm @@ -27,12 +27,12 @@ ; ; GLOBAL(void) ; jsimd_convsamp_mmx (JSAMPARRAY sample_data, JDIMENSION start_col, -; DCTELEM * workspace); +; DCTELEM *workspace); ; %define sample_data ebp+8 ; JSAMPARRAY sample_data %define start_col ebp+12 ; JDIMENSION start_col -%define workspace ebp+16 ; DCTELEM * workspace +%define workspace ebp+16 ; DCTELEM *workspace align 16 global EXTN(jsimd_convsamp_mmx) @@ -126,8 +126,8 @@ EXTN(jsimd_convsamp_mmx): ; (http://www.agner.org/assem/). ; ; GLOBAL(void) -; jsimd_quantize_mmx (JCOEFPTR coef_block, DCTELEM * divisors, -; DCTELEM * workspace); +; jsimd_quantize_mmx (JCOEFPTR coef_block, DCTELEM *divisors, +; DCTELEM *workspace); ; %define RECIPROCAL(m,n,b) MMBLOCK(DCTSIZE*0+(m),(n),(b),SIZEOF_DCTELEM) @@ -136,8 +136,8 @@ EXTN(jsimd_convsamp_mmx): %define SHIFT(m,n,b) MMBLOCK(DCTSIZE*3+(m),(n),(b),SIZEOF_DCTELEM) %define coef_block ebp+8 ; JCOEFPTR coef_block -%define divisors ebp+12 ; DCTELEM * divisors -%define workspace ebp+16 ; DCTELEM * workspace +%define divisors ebp+12 ; DCTELEM *divisors +%define workspace ebp+16 ; DCTELEM *workspace align 16 global EXTN(jsimd_quantize_mmx) diff --git a/simd/jquant-sse.asm b/simd/jquant-sse.asm index 3f7fa5d3..796723ac 100644 --- a/simd/jquant-sse.asm +++ b/simd/jquant-sse.asm @@ -27,12 +27,12 @@ ; ; GLOBAL(void) ; jsimd_convsamp_float_sse (JSAMPARRAY sample_data, JDIMENSION start_col, -; FAST_FLOAT * workspace); +; FAST_FLOAT *workspace); ; %define sample_data ebp+8 ; JSAMPARRAY sample_data %define start_col ebp+12 ; JDIMENSION start_col -%define workspace ebp+16 ; FAST_FLOAT * workspace +%define workspace ebp+16 ; FAST_FLOAT *workspace align 16 global EXTN(jsimd_convsamp_float_sse) @@ -129,13 +129,13 @@ EXTN(jsimd_convsamp_float_sse): ; Quantize/descale the coefficients, and store into coef_block ; ; GLOBAL(void) -; jsimd_quantize_float_sse (JCOEFPTR coef_block, FAST_FLOAT * divisors, -; FAST_FLOAT * workspace); +; jsimd_quantize_float_sse (JCOEFPTR coef_block, FAST_FLOAT *divisors, +; FAST_FLOAT *workspace); ; %define coef_block ebp+8 ; JCOEFPTR coef_block -%define divisors ebp+12 ; FAST_FLOAT * divisors -%define workspace ebp+16 ; FAST_FLOAT * workspace +%define divisors ebp+12 ; FAST_FLOAT *divisors +%define workspace ebp+16 ; FAST_FLOAT *workspace align 16 global EXTN(jsimd_quantize_float_sse) diff --git a/simd/jquantf-sse2-64.asm b/simd/jquantf-sse2-64.asm index cf7f0d82..8af256c4 100644 --- a/simd/jquantf-sse2-64.asm +++ b/simd/jquantf-sse2-64.asm @@ -28,12 +28,12 @@ ; ; GLOBAL(void) ; jsimd_convsamp_float_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col, -; FAST_FLOAT * workspace); +; FAST_FLOAT *workspace); ; ; r10 = JSAMPARRAY sample_data ; r11 = JDIMENSION start_col -; r12 = FAST_FLOAT * workspace +; r12 = FAST_FLOAT *workspace align 16 global EXTN(jsimd_convsamp_float_sse2) @@ -101,13 +101,13 @@ EXTN(jsimd_convsamp_float_sse2): ; Quantize/descale the coefficients, and store into coef_block ; ; GLOBAL(void) -; jsimd_quantize_float_sse2 (JCOEFPTR coef_block, FAST_FLOAT * divisors, -; FAST_FLOAT * workspace); +; jsimd_quantize_float_sse2 (JCOEFPTR coef_block, FAST_FLOAT *divisors, +; FAST_FLOAT *workspace); ; ; r10 = JCOEFPTR coef_block -; r11 = FAST_FLOAT * divisors -; r12 = FAST_FLOAT * workspace +; r11 = FAST_FLOAT *divisors +; r12 = FAST_FLOAT *workspace align 16 global EXTN(jsimd_quantize_float_sse2) diff --git a/simd/jquantf-sse2.asm b/simd/jquantf-sse2.asm index b1d3efcc..a8d4cd39 100644 --- a/simd/jquantf-sse2.asm +++ b/simd/jquantf-sse2.asm @@ -27,12 +27,12 @@ ; ; GLOBAL(void) ; jsimd_convsamp_float_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col, -; FAST_FLOAT * workspace); +; FAST_FLOAT *workspace); ; %define sample_data ebp+8 ; JSAMPARRAY sample_data %define start_col ebp+12 ; JDIMENSION start_col -%define workspace ebp+16 ; FAST_FLOAT * workspace +%define workspace ebp+16 ; FAST_FLOAT *workspace align 16 global EXTN(jsimd_convsamp_float_sse2) @@ -106,13 +106,13 @@ EXTN(jsimd_convsamp_float_sse2): ; Quantize/descale the coefficients, and store into coef_block ; ; GLOBAL(void) -; jsimd_quantize_float_sse2 (JCOEFPTR coef_block, FAST_FLOAT * divisors, -; FAST_FLOAT * workspace); +; jsimd_quantize_float_sse2 (JCOEFPTR coef_block, FAST_FLOAT *divisors, +; FAST_FLOAT *workspace); ; %define coef_block ebp+8 ; JCOEFPTR coef_block -%define divisors ebp+12 ; FAST_FLOAT * divisors -%define workspace ebp+16 ; FAST_FLOAT * workspace +%define divisors ebp+12 ; FAST_FLOAT *divisors +%define workspace ebp+16 ; FAST_FLOAT *workspace align 16 global EXTN(jsimd_quantize_float_sse2) diff --git a/simd/jquanti-altivec.c b/simd/jquanti-altivec.c index 2fbec2d5..b3adab9a 100644 --- a/simd/jquanti-altivec.c +++ b/simd/jquanti-altivec.c @@ -50,7 +50,7 @@ void jsimd_convsamp_altivec (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace) + DCTELEM *workspace) { JSAMPROW elemptr; @@ -115,8 +115,8 @@ jsimd_convsamp_altivec (JSAMPARRAY sample_data, JDIMENSION start_col, } void -jsimd_quantize_altivec (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace) +jsimd_quantize_altivec (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace) { __vector short row0, row1, row2, row3, row4, row5, row6, row7, row0s, row1s, row2s, row3s, row4s, row5s, row6s, row7s, diff --git a/simd/jquanti-sse2-64.asm b/simd/jquanti-sse2-64.asm index b61f4db2..9b3f4eee 100644 --- a/simd/jquanti-sse2-64.asm +++ b/simd/jquanti-sse2-64.asm @@ -28,12 +28,12 @@ ; ; GLOBAL(void) ; jsimd_convsamp_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col, -; DCTELEM * workspace); +; DCTELEM *workspace); ; ; r10 = JSAMPARRAY sample_data ; r11 = JDIMENSION start_col -; r12 = DCTELEM * workspace +; r12 = DCTELEM *workspace align 16 global EXTN(jsimd_convsamp_sse2) @@ -99,8 +99,8 @@ EXTN(jsimd_convsamp_sse2): ; (http://www.agner.org/assem/). ; ; GLOBAL(void) -; jsimd_quantize_sse2 (JCOEFPTR coef_block, DCTELEM * divisors, -; DCTELEM * workspace); +; jsimd_quantize_sse2 (JCOEFPTR coef_block, DCTELEM *divisors, +; DCTELEM *workspace); ; %define RECIPROCAL(m,n,b) XMMBLOCK(DCTSIZE*0+(m),(n),(b),SIZEOF_DCTELEM) @@ -108,8 +108,8 @@ EXTN(jsimd_convsamp_sse2): %define SCALE(m,n,b) XMMBLOCK(DCTSIZE*2+(m),(n),(b),SIZEOF_DCTELEM) ; r10 = JCOEFPTR coef_block -; r11 = DCTELEM * divisors -; r12 = DCTELEM * workspace +; r11 = DCTELEM *divisors +; r12 = DCTELEM *workspace align 16 global EXTN(jsimd_quantize_sse2) diff --git a/simd/jquanti-sse2.asm b/simd/jquanti-sse2.asm index 79ca3db4..4299c333 100644 --- a/simd/jquanti-sse2.asm +++ b/simd/jquanti-sse2.asm @@ -27,12 +27,12 @@ ; ; GLOBAL(void) ; jsimd_convsamp_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col, -; DCTELEM * workspace); +; DCTELEM *workspace); ; %define sample_data ebp+8 ; JSAMPARRAY sample_data %define start_col ebp+12 ; JDIMENSION start_col -%define workspace ebp+16 ; DCTELEM * workspace +%define workspace ebp+16 ; DCTELEM *workspace align 16 global EXTN(jsimd_convsamp_sse2) @@ -104,8 +104,8 @@ EXTN(jsimd_convsamp_sse2): ; (http://www.agner.org/assem/). ; ; GLOBAL(void) -; jsimd_quantize_sse2 (JCOEFPTR coef_block, DCTELEM * divisors, -; DCTELEM * workspace); +; jsimd_quantize_sse2 (JCOEFPTR coef_block, DCTELEM *divisors, +; DCTELEM *workspace); ; %define RECIPROCAL(m,n,b) XMMBLOCK(DCTSIZE*0+(m),(n),(b),SIZEOF_DCTELEM) @@ -113,8 +113,8 @@ EXTN(jsimd_convsamp_sse2): %define SCALE(m,n,b) XMMBLOCK(DCTSIZE*2+(m),(n),(b),SIZEOF_DCTELEM) %define coef_block ebp+8 ; JCOEFPTR coef_block -%define divisors ebp+12 ; DCTELEM * divisors -%define workspace ebp+16 ; DCTELEM * workspace +%define divisors ebp+12 ; DCTELEM *divisors +%define workspace ebp+16 ; DCTELEM *workspace align 16 global EXTN(jsimd_quantize_sse2) diff --git a/simd/jsimd.h b/simd/jsimd.h index d05a2ec0..a39fafa7 100644 --- a/simd/jsimd.h +++ b/simd/jsimd.h @@ -426,70 +426,70 @@ EXTERN(void) jsimd_h2v2_smooth_downsample_mips_dspr2 /* Upsampling */ EXTERN(void) jsimd_h2v1_upsample_mmx (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v2_upsample_mmx (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v1_upsample_sse2 (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v2_upsample_sse2 (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v1_upsample_mips_dspr2 (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v2_upsample_mips_dspr2 (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_int_upsample_mips_dspr2 (UINT8 h_expand, UINT8 v_expand, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr, JDIMENSION output_width, + JSAMPARRAY *output_data_ptr, JDIMENSION output_width, int max_v_samp_factor); EXTERN(void) jsimd_h2v1_upsample_altivec (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v2_upsample_altivec (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); /* Fancy Upsampling */ EXTERN(void) jsimd_h2v1_fancy_upsample_mmx (int max_v_samp_factor, JDIMENSION downsampled_width, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v2_fancy_upsample_mmx (int max_v_samp_factor, JDIMENSION downsampled_width, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); extern const int jconst_fancy_upsample_sse2[]; EXTERN(void) jsimd_h2v1_fancy_upsample_sse2 (int max_v_samp_factor, JDIMENSION downsampled_width, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v2_fancy_upsample_sse2 (int max_v_samp_factor, JDIMENSION downsampled_width, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v1_fancy_upsample_neon (int max_v_samp_factor, JDIMENSION downsampled_width, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v1_fancy_upsample_mips_dspr2 (int max_v_samp_factor, JDIMENSION downsampled_width, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v2_fancy_upsample_mips_dspr2 (int max_v_samp_factor, JDIMENSION downsampled_width, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor, JDIMENSION downsampled_width, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); EXTERN(void) jsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor, JDIMENSION downsampled_width, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr); + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr); /* Merged Upsampling */ EXTERN(void) jsimd_h2v1_merged_upsample_mmx @@ -671,201 +671,201 @@ EXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_altivec /* Sample Conversion */ EXTERN(void) jsimd_convsamp_mmx - (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace); + (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace); EXTERN(void) jsimd_convsamp_sse2 - (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace); + (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace); EXTERN(void) jsimd_convsamp_neon - (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace); + (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace); EXTERN(void) jsimd_convsamp_mips_dspr2 - (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace); + (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace); EXTERN(void) jsimd_convsamp_altivec - (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace); + (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace); /* Floating Point Sample Conversion */ EXTERN(void) jsimd_convsamp_float_3dnow - (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace); + (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace); EXTERN(void) jsimd_convsamp_float_sse - (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace); + (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace); EXTERN(void) jsimd_convsamp_float_sse2 - (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace); + (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace); EXTERN(void) jsimd_convsamp_float_mips_dspr2 - (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace); + (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace); /* Slow Integer Forward DCT */ -EXTERN(void) jsimd_fdct_islow_mmx (DCTELEM * data); +EXTERN(void) jsimd_fdct_islow_mmx (DCTELEM *data); extern const int jconst_fdct_islow_sse2[]; -EXTERN(void) jsimd_fdct_islow_sse2 (DCTELEM * data); +EXTERN(void) jsimd_fdct_islow_sse2 (DCTELEM *data); -EXTERN(void) jsimd_fdct_islow_neon (DCTELEM * data); +EXTERN(void) jsimd_fdct_islow_neon (DCTELEM *data); -EXTERN(void) jsimd_fdct_islow_mips_dspr2 (DCTELEM * data); +EXTERN(void) jsimd_fdct_islow_mips_dspr2 (DCTELEM *data); -EXTERN(void) jsimd_fdct_islow_altivec (DCTELEM * data); +EXTERN(void) jsimd_fdct_islow_altivec (DCTELEM *data); /* Fast Integer Forward DCT */ -EXTERN(void) jsimd_fdct_ifast_mmx (DCTELEM * data); +EXTERN(void) jsimd_fdct_ifast_mmx (DCTELEM *data); extern const int jconst_fdct_ifast_sse2[]; -EXTERN(void) jsimd_fdct_ifast_sse2 (DCTELEM * data); +EXTERN(void) jsimd_fdct_ifast_sse2 (DCTELEM *data); -EXTERN(void) jsimd_fdct_ifast_neon (DCTELEM * data); +EXTERN(void) jsimd_fdct_ifast_neon (DCTELEM *data); -EXTERN(void) jsimd_fdct_ifast_mips_dspr2 (DCTELEM * data); +EXTERN(void) jsimd_fdct_ifast_mips_dspr2 (DCTELEM *data); -EXTERN(void) jsimd_fdct_ifast_altivec (DCTELEM * data); +EXTERN(void) jsimd_fdct_ifast_altivec (DCTELEM *data); /* Floating Point Forward DCT */ -EXTERN(void) jsimd_fdct_float_3dnow (FAST_FLOAT * data); +EXTERN(void) jsimd_fdct_float_3dnow (FAST_FLOAT *data); extern const int jconst_fdct_float_sse[]; -EXTERN(void) jsimd_fdct_float_sse (FAST_FLOAT * data); +EXTERN(void) jsimd_fdct_float_sse (FAST_FLOAT *data); /* Quantization */ EXTERN(void) jsimd_quantize_mmx - (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace); + (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace); EXTERN(void) jsimd_quantize_sse2 - (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace); + (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace); EXTERN(void) jsimd_quantize_neon - (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace); + (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace); EXTERN(void) jsimd_quantize_mips_dspr2 - (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace); + (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace); EXTERN(void) jsimd_quantize_altivec - (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace); + (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace); /* Floating Point Quantization */ EXTERN(void) jsimd_quantize_float_3dnow - (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace); + (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace); EXTERN(void) jsimd_quantize_float_sse - (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace); + (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace); EXTERN(void) jsimd_quantize_float_sse2 - (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace); + (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace); EXTERN(void) jsimd_quantize_float_mips_dspr2 - (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace); + (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace); /* Scaled Inverse DCT */ EXTERN(void) jsimd_idct_2x2_mmx - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_4x4_mmx - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); extern const int jconst_idct_red_sse2[]; EXTERN(void) jsimd_idct_2x2_sse2 - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_4x4_sse2 - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_2x2_neon - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_4x4_neon - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_2x2_mips_dspr2 - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_4x4_mips_dspr2 - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, - JDIMENSION output_col, int * workspace); + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + JDIMENSION output_col, int *workspace); EXTERN(void) jsimd_idct_6x6_mips_dspr2 - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_12x12_pass1_mips_dspr2 - (JCOEFPTR coef_block, void * dct_table, int * workspace); + (JCOEFPTR coef_block, void *dct_table, int *workspace); EXTERN(void) jsimd_idct_12x12_pass2_mips_dspr2 - (int * workspace, int * output); + (int *workspace, int *output); /* Slow Integer Inverse DCT */ EXTERN(void) jsimd_idct_islow_mmx - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); extern const int jconst_idct_islow_sse2[]; EXTERN(void) jsimd_idct_islow_sse2 - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_islow_neon - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_islow_mips_dspr2 - (void * dct_table, JCOEFPTR coef_block, int * output_buf, - JSAMPLE * output_col); + (void *dct_table, JCOEFPTR coef_block, int *output_buf, + JSAMPLE *output_col); EXTERN(void) jsimd_idct_islow_altivec - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); /* Fast Integer Inverse DCT */ EXTERN(void) jsimd_idct_ifast_mmx - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); extern const int jconst_idct_ifast_sse2[]; EXTERN(void) jsimd_idct_ifast_sse2 - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_ifast_neon - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); EXTERN(void) jsimd_idct_ifast_cols_mips_dspr2 - (JCOEF * inptr, IFAST_MULT_TYPE * quantptr, DCTELEM * wsptr, - const int * idct_coefs); + (JCOEF *inptr, IFAST_MULT_TYPE *quantptr, DCTELEM *wsptr, + const int *idct_coefs); EXTERN(void) jsimd_idct_ifast_rows_mips_dspr2 - (DCTELEM * wsptr, JSAMPARRAY output_buf, JDIMENSION output_col, - const int * idct_coefs); + (DCTELEM *wsptr, JSAMPARRAY output_buf, JDIMENSION output_col, + const int *idct_coefs); EXTERN(void) jsimd_idct_ifast_altivec - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); /* Floating Point Inverse DCT */ EXTERN(void) jsimd_idct_float_3dnow - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); extern const int jconst_idct_float_sse[]; EXTERN(void) jsimd_idct_float_sse - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); extern const int jconst_idct_float_sse2[]; EXTERN(void) jsimd_idct_float_sse2 - (void * dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, + (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col); /* Huffman coding */ extern const int jconst_huff_encode_one_block[]; EXTERN(JOCTET*) jsimd_huff_encode_one_block_sse2 - (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, + (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl); EXTERN(JOCTET*) jsimd_huff_encode_one_block_neon - (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, + (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl); EXTERN(JOCTET*) jsimd_huff_encode_one_block_neon_slowtbl - (void * state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, + (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl); diff --git a/simd/jsimd_arm.c b/simd/jsimd_arm.c index 0cf5ae5d..ea621da8 100644 --- a/simd/jsimd_arm.c +++ b/simd/jsimd_arm.c @@ -306,13 +306,13 @@ jsimd_can_h2v1_downsample (void) } GLOBAL(void) -jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { } GLOBAL(void) -jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { } @@ -335,17 +335,17 @@ jsimd_can_h2v1_upsample (void) GLOBAL(void) jsimd_h2v2_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } GLOBAL(void) jsimd_h2v1_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } @@ -376,17 +376,17 @@ jsimd_can_h2v1_fancy_upsample (void) GLOBAL(void) jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } GLOBAL(void) jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor, compptr->downsampled_width, input_data, @@ -456,14 +456,14 @@ jsimd_can_convsamp_float (void) GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace) + DCTELEM *workspace) { jsimd_convsamp_neon(sample_data, start_col, workspace); } GLOBAL(void) jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, - FAST_FLOAT * workspace) + FAST_FLOAT *workspace) { } @@ -501,18 +501,18 @@ jsimd_can_fdct_float (void) } GLOBAL(void) -jsimd_fdct_islow (DCTELEM * data) +jsimd_fdct_islow (DCTELEM *data) { } GLOBAL(void) -jsimd_fdct_ifast (DCTELEM * data) +jsimd_fdct_ifast (DCTELEM *data) { jsimd_fdct_ifast_neon(data); } GLOBAL(void) -jsimd_fdct_float (FAST_FLOAT * data) +jsimd_fdct_float (FAST_FLOAT *data) { } @@ -544,15 +544,15 @@ jsimd_can_quantize_float (void) } GLOBAL(void) -jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace) +jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace) { jsimd_quantize_neon(coef_block, divisors, workspace); } GLOBAL(void) -jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, - FAST_FLOAT * workspace) +jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, + FAST_FLOAT *workspace) { } @@ -603,7 +603,7 @@ jsimd_can_idct_4x4 (void) } GLOBAL(void) -jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -612,7 +612,7 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -677,7 +677,7 @@ jsimd_can_idct_float (void) } GLOBAL(void) -jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -686,7 +686,7 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -695,7 +695,7 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -718,7 +718,7 @@ jsimd_can_huff_encode_one_block (void) } GLOBAL(JOCTET*) -jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, +jsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { diff --git a/simd/jsimd_arm64.c b/simd/jsimd_arm64.c index cb482584..62dbc450 100644 --- a/simd/jsimd_arm64.c +++ b/simd/jsimd_arm64.c @@ -373,7 +373,7 @@ jsimd_can_h2v1_downsample (void) } GLOBAL(void) -jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { jsimd_h2v2_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor, @@ -382,7 +382,7 @@ jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { jsimd_h2v1_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor, @@ -408,17 +408,17 @@ jsimd_can_h2v1_upsample (void) GLOBAL(void) jsimd_h2v2_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } GLOBAL(void) jsimd_h2v1_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } @@ -440,17 +440,17 @@ jsimd_can_h2v1_fancy_upsample (void) GLOBAL(void) jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } GLOBAL(void) jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { } @@ -517,14 +517,14 @@ jsimd_can_convsamp_float (void) GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace) + DCTELEM *workspace) { jsimd_convsamp_neon(sample_data, start_col, workspace); } GLOBAL(void) jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, - FAST_FLOAT * workspace) + FAST_FLOAT *workspace) { } @@ -571,19 +571,19 @@ jsimd_can_fdct_float (void) } GLOBAL(void) -jsimd_fdct_islow (DCTELEM * data) +jsimd_fdct_islow (DCTELEM *data) { jsimd_fdct_islow_neon(data); } GLOBAL(void) -jsimd_fdct_ifast (DCTELEM * data) +jsimd_fdct_ifast (DCTELEM *data) { jsimd_fdct_ifast_neon(data); } GLOBAL(void) -jsimd_fdct_float (FAST_FLOAT * data) +jsimd_fdct_float (FAST_FLOAT *data) { } @@ -615,15 +615,15 @@ jsimd_can_quantize_float (void) } GLOBAL(void) -jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace) +jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace) { jsimd_quantize_neon(coef_block, divisors, workspace); } GLOBAL(void) -jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, - FAST_FLOAT * workspace) +jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, + FAST_FLOAT *workspace) { } @@ -674,7 +674,7 @@ jsimd_can_idct_4x4 (void) } GLOBAL(void) -jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -683,7 +683,7 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -748,7 +748,7 @@ jsimd_can_idct_float (void) } GLOBAL(void) -jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -757,7 +757,7 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -766,7 +766,7 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -789,7 +789,7 @@ jsimd_can_huff_encode_one_block (void) } GLOBAL(JOCTET*) -jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, +jsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { diff --git a/simd/jsimd_arm64_neon.S b/simd/jsimd_arm64_neon.S index b9bb5de4..d236314e 100644 --- a/simd/jsimd_arm64_neon.S +++ b/simd/jsimd_arm64_neon.S @@ -131,7 +131,7 @@ _\fname: * Perform dequantization and inverse DCT on one block of coefficients. * * GLOBAL(void) - * jsimd_idct_islow_neon (void * dct_table, JCOEFPTR coef_block, + * jsimd_idct_islow_neon (void *dct_table, JCOEFPTR coef_block, * JSAMPARRAY output_buf, JDIMENSION output_col) */ @@ -2703,8 +2703,8 @@ asm_function jsimd_fdct_ifast_neon /* * GLOBAL(void) - * jsimd_quantize_neon (JCOEFPTR coef_block, DCTELEM * divisors, - * DCTELEM * workspace); + * jsimd_quantize_neon (JCOEFPTR coef_block, DCTELEM *divisors, + * DCTELEM *workspace); * */ asm_function jsimd_quantize_neon @@ -2988,7 +2988,7 @@ asm_function jsimd_h2v2_downsample_neon /* * GLOBAL(JOCTET*) - * jsimd_huff_encode_one_block (working_state * state, JOCTET *buffer, + * jsimd_huff_encode_one_block (working_state *state, JOCTET *buffer, * JCOEFPTR block, int last_dc_val, * c_derived_tbl *dctbl, c_derived_tbl *actbl) * diff --git a/simd/jsimd_arm_neon.S b/simd/jsimd_arm_neon.S index aa6d37ae..15c54095 100644 --- a/simd/jsimd_arm_neon.S +++ b/simd/jsimd_arm_neon.S @@ -74,7 +74,7 @@ _\fname: * Perform dequantization and inverse DCT on one block of coefficients. * * GLOBAL(void) - * jsimd_idct_islow_neon (void * dct_table, JCOEFPTR coef_block, + * jsimd_idct_islow_neon (void *dct_table, JCOEFPTR coef_block, * JSAMPARRAY output_buf, JDIMENSION output_col) */ @@ -2106,8 +2106,8 @@ asm_function jsimd_fdct_ifast_neon /* * GLOBAL(void) - * jsimd_quantize_neon (JCOEFPTR coef_block, DCTELEM * divisors, - * DCTELEM * workspace); + * jsimd_quantize_neon (JCOEFPTR coef_block, DCTELEM *divisors, + * DCTELEM *workspace); * * Note: the code uses 2 stage pipelining in order to improve instructions * scheduling and eliminate stalls (this provides ~15% better @@ -2210,7 +2210,7 @@ asm_function jsimd_quantize_neon * jsimd_h2v1_fancy_upsample_neon (int max_v_samp_factor, * JDIMENSION downsampled_width, * JSAMPARRAY input_data, - * JSAMPARRAY * output_data_ptr); + * JSAMPARRAY *output_data_ptr); * * Note: the use of unaligned writes is the main remaining bottleneck in * this code, which can be potentially solved to get up to tens @@ -2444,7 +2444,7 @@ asm_function jsimd_h2v1_fancy_upsample_neon /* * GLOBAL(JOCTET*) - * jsimd_huff_encode_one_block (working_state * state, JOCTET *buffer, + * jsimd_huff_encode_one_block (working_state *state, JOCTET *buffer, * JCOEFPTR block, int last_dc_val, * c_derived_tbl *dctbl, c_derived_tbl *actbl) * diff --git a/simd/jsimd_i386.c b/simd/jsimd_i386.c index 6362aaae..aef1ad4c 100644 --- a/simd/jsimd_i386.c +++ b/simd/jsimd_i386.c @@ -337,7 +337,7 @@ jsimd_can_h2v1_downsample (void) } GLOBAL(void) -jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { if (simd_support & JSIMD_SSE2) @@ -352,7 +352,7 @@ jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { if (simd_support & JSIMD_SSE2) @@ -406,9 +406,9 @@ jsimd_can_h2v1_upsample (void) GLOBAL(void) jsimd_h2v2_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { if (simd_support & JSIMD_SSE2) jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width, @@ -420,9 +420,9 @@ jsimd_h2v2_upsample (j_decompress_ptr cinfo, GLOBAL(void) jsimd_h2v1_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { if (simd_support & JSIMD_SSE2) jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width, @@ -474,9 +474,9 @@ jsimd_can_h2v1_fancy_upsample (void) GLOBAL(void) jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) @@ -491,9 +491,9 @@ jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, GLOBAL(void) jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fancy_upsample_sse2)) @@ -698,7 +698,7 @@ jsimd_can_convsamp_float (void) GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace) + DCTELEM *workspace) { if (simd_support & JSIMD_SSE2) jsimd_convsamp_sse2(sample_data, start_col, workspace); @@ -708,7 +708,7 @@ jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, GLOBAL(void) jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, - FAST_FLOAT * workspace) + FAST_FLOAT *workspace) { if (simd_support & JSIMD_SSE2) jsimd_convsamp_float_sse2(sample_data, start_col, workspace); @@ -776,7 +776,7 @@ jsimd_can_fdct_float (void) } GLOBAL(void) -jsimd_fdct_islow (DCTELEM * data) +jsimd_fdct_islow (DCTELEM *data) { if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2)) jsimd_fdct_islow_sse2(data); @@ -785,7 +785,7 @@ jsimd_fdct_islow (DCTELEM * data) } GLOBAL(void) -jsimd_fdct_ifast (DCTELEM * data) +jsimd_fdct_ifast (DCTELEM *data) { if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2)) jsimd_fdct_ifast_sse2(data); @@ -794,7 +794,7 @@ jsimd_fdct_ifast (DCTELEM * data) } GLOBAL(void) -jsimd_fdct_float (FAST_FLOAT * data) +jsimd_fdct_float (FAST_FLOAT *data) { if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse)) jsimd_fdct_float_sse(data); @@ -847,8 +847,8 @@ jsimd_can_quantize_float (void) } GLOBAL(void) -jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace) +jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace) { if (simd_support & JSIMD_SSE2) jsimd_quantize_sse2(coef_block, divisors, workspace); @@ -857,8 +857,8 @@ jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, } GLOBAL(void) -jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, - FAST_FLOAT * workspace) +jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, + FAST_FLOAT *workspace) { if (simd_support & JSIMD_SSE2) jsimd_quantize_float_sse2(coef_block, divisors, workspace); @@ -919,7 +919,7 @@ jsimd_can_idct_4x4 (void) } GLOBAL(void) -jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -931,7 +931,7 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1023,7 +1023,7 @@ jsimd_can_idct_float (void) } GLOBAL(void) -jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1036,7 +1036,7 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1049,7 +1049,7 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1082,7 +1082,7 @@ jsimd_can_huff_encode_one_block (void) } GLOBAL(JOCTET*) -jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, +jsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { diff --git a/simd/jsimd_mips.c b/simd/jsimd_mips.c index 62d3215b..bdd99129 100644 --- a/simd/jsimd_mips.c +++ b/simd/jsimd_mips.c @@ -88,9 +88,9 @@ static const int mips_idct_ifast_coefs[4] = { /* The following struct is borrowed from jdsample.c */ typedef void (*upsample1_ptr) (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr); + JSAMPARRAY *output_data_ptr); typedef struct { struct jpeg_upsampler pub; @@ -103,7 +103,7 @@ typedef struct { UINT8 v_expand[MAX_COMPONENTS]; } my_upsampler; -typedef my_upsampler * my_upsample_ptr; +typedef my_upsampler *my_upsample_ptr; GLOBAL(int) jsimd_can_rgb_ycc (void) @@ -378,7 +378,7 @@ jsimd_can_h2v1_downsample (void) } GLOBAL(void) -jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { if (simd_support & JSIMD_MIPS_DSPR2) @@ -391,7 +391,7 @@ jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, GLOBAL(void) jsimd_h2v2_smooth_downsample (j_compress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { jsimd_h2v2_smooth_downsample_mips_dspr2(input_data, output_data, @@ -403,7 +403,7 @@ jsimd_h2v2_smooth_downsample (j_compress_ptr cinfo, } GLOBAL(void) -jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { if (simd_support & JSIMD_MIPS_DSPR2) @@ -467,9 +467,9 @@ jsimd_can_int_upsample (void) GLOBAL(void) jsimd_h2v2_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { if (simd_support & JSIMD_MIPS_DSPR2) jsimd_h2v2_upsample_mips_dspr2(cinfo->max_v_samp_factor, @@ -479,9 +479,9 @@ jsimd_h2v2_upsample (j_decompress_ptr cinfo, GLOBAL(void) jsimd_h2v1_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { if (simd_support & JSIMD_MIPS_DSPR2) jsimd_h2v1_upsample_mips_dspr2(cinfo->max_v_samp_factor, @@ -490,8 +490,8 @@ jsimd_h2v1_upsample (j_decompress_ptr cinfo, } GLOBAL(void) -jsimd_int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +jsimd_int_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr) { my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; @@ -538,9 +538,9 @@ jsimd_can_h2v1_fancy_upsample (void) GLOBAL(void) jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { if (simd_support & JSIMD_MIPS_DSPR2) jsimd_h2v2_fancy_upsample_mips_dspr2(cinfo->max_v_samp_factor, @@ -550,9 +550,9 @@ jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, GLOBAL(void) jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { if (simd_support & JSIMD_MIPS_DSPR2) jsimd_h2v1_fancy_upsample_mips_dspr2(cinfo->max_v_samp_factor, @@ -720,7 +720,7 @@ jsimd_can_convsamp_float (void) GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace) + DCTELEM *workspace) { if (simd_support & JSIMD_MIPS_DSPR2) jsimd_convsamp_mips_dspr2(sample_data, start_col, workspace); @@ -728,7 +728,7 @@ jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, GLOBAL(void) jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, - FAST_FLOAT * workspace) + FAST_FLOAT *workspace) { if ((simd_support & JSIMD_MIPS_DSPR2)) jsimd_convsamp_float_mips_dspr2(sample_data, start_col, workspace); @@ -777,21 +777,21 @@ jsimd_can_fdct_float (void) } GLOBAL(void) -jsimd_fdct_islow (DCTELEM * data) +jsimd_fdct_islow (DCTELEM *data) { if (simd_support & JSIMD_MIPS_DSPR2) jsimd_fdct_islow_mips_dspr2(data); } GLOBAL(void) -jsimd_fdct_ifast (DCTELEM * data) +jsimd_fdct_ifast (DCTELEM *data) { if (simd_support & JSIMD_MIPS_DSPR2) jsimd_fdct_ifast_mips_dspr2(data); } GLOBAL(void) -jsimd_fdct_float (FAST_FLOAT * data) +jsimd_fdct_float (FAST_FLOAT *data) { } @@ -838,16 +838,16 @@ jsimd_can_quantize_float (void) } GLOBAL(void) -jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace) +jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace) { if (simd_support & JSIMD_MIPS_DSPR2) jsimd_quantize_mips_dspr2(coef_block, divisors, workspace); } GLOBAL(void) -jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, - FAST_FLOAT * workspace) +jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, + FAST_FLOAT *workspace) { if (simd_support & JSIMD_MIPS_DSPR2) jsimd_quantize_float_mips_dspr2(coef_block, divisors, workspace); @@ -945,7 +945,7 @@ jsimd_can_idct_12x12 (void) } GLOBAL(void) -jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -955,7 +955,7 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -967,7 +967,7 @@ jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -977,7 +977,7 @@ jsimd_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1060,7 +1060,7 @@ jsimd_can_idct_float (void) } GLOBAL(void) -jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1082,13 +1082,13 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { if (simd_support & JSIMD_MIPS_DSPR2) { JCOEFPTR inptr; - IFAST_MULT_TYPE * quantptr; + IFAST_MULT_TYPE *quantptr; DCTELEM workspace[DCTSIZE2]; /* buffers data between passes */ /* Pass 1: process columns from input, store into work array. */ @@ -1109,7 +1109,7 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -1122,7 +1122,7 @@ jsimd_can_huff_encode_one_block (void) } GLOBAL(JOCTET*) -jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, +jsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { diff --git a/simd/jsimd_powerpc.c b/simd/jsimd_powerpc.c index 5a3036f1..afbaa821 100644 --- a/simd/jsimd_powerpc.c +++ b/simd/jsimd_powerpc.c @@ -259,7 +259,7 @@ jsimd_can_h2v1_downsample (void) } GLOBAL(void) -jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { jsimd_h2v2_downsample_altivec(cinfo->image_width, cinfo->max_v_samp_factor, @@ -269,7 +269,7 @@ jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { jsimd_h2v1_downsample_altivec(cinfo->image_width, cinfo->max_v_samp_factor, @@ -314,9 +314,9 @@ jsimd_can_h2v1_upsample (void) GLOBAL(void) jsimd_h2v2_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { jsimd_h2v2_upsample_altivec(cinfo->max_v_samp_factor, cinfo->output_width, input_data, output_data_ptr); @@ -324,9 +324,9 @@ jsimd_h2v2_upsample (j_decompress_ptr cinfo, GLOBAL(void) jsimd_h2v1_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { jsimd_h2v1_upsample_altivec(cinfo->max_v_samp_factor, cinfo->output_width, input_data, output_data_ptr); @@ -368,9 +368,9 @@ jsimd_can_h2v1_fancy_upsample (void) GLOBAL(void) jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { jsimd_h2v2_fancy_upsample_altivec(cinfo->max_v_samp_factor, compptr->downsampled_width, input_data, @@ -379,9 +379,9 @@ jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, GLOBAL(void) jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { jsimd_h2v1_fancy_upsample_altivec(cinfo->max_v_samp_factor, compptr->downsampled_width, input_data, @@ -529,14 +529,14 @@ jsimd_can_convsamp_float (void) GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace) + DCTELEM *workspace) { jsimd_convsamp_altivec(sample_data, start_col, workspace); } GLOBAL(void) jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, - FAST_FLOAT * workspace) + FAST_FLOAT *workspace) { } @@ -581,19 +581,19 @@ jsimd_can_fdct_float (void) } GLOBAL(void) -jsimd_fdct_islow (DCTELEM * data) +jsimd_fdct_islow (DCTELEM *data) { jsimd_fdct_islow_altivec(data); } GLOBAL(void) -jsimd_fdct_ifast (DCTELEM * data) +jsimd_fdct_ifast (DCTELEM *data) { jsimd_fdct_ifast_altivec(data); } GLOBAL(void) -jsimd_fdct_float (FAST_FLOAT * data) +jsimd_fdct_float (FAST_FLOAT *data) { } @@ -623,15 +623,15 @@ jsimd_can_quantize_float (void) } GLOBAL(void) -jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace) +jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace) { jsimd_quantize_altivec(coef_block, divisors, workspace); } GLOBAL(void) -jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, - FAST_FLOAT * workspace) +jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, + FAST_FLOAT *workspace) { } @@ -648,14 +648,14 @@ jsimd_can_idct_4x4 (void) } GLOBAL(void) -jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { } GLOBAL(void) -jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -702,7 +702,7 @@ jsimd_can_idct_float (void) } GLOBAL(void) -jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -711,7 +711,7 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -720,7 +720,7 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -733,7 +733,7 @@ jsimd_can_huff_encode_one_block (void) } GLOBAL(JOCTET*) -jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, +jsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { diff --git a/simd/jsimd_x86_64.c b/simd/jsimd_x86_64.c index d17c8638..fa33bea0 100644 --- a/simd/jsimd_x86_64.c +++ b/simd/jsimd_x86_64.c @@ -279,7 +279,7 @@ jsimd_can_h2v1_downsample (void) } GLOBAL(void) -jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { jsimd_h2v2_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor, @@ -288,7 +288,7 @@ jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, +jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY input_data, JSAMPARRAY output_data) { jsimd_h2v1_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor, @@ -332,9 +332,9 @@ jsimd_can_h2v1_upsample (void) GLOBAL(void) jsimd_h2v2_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width, input_data, output_data_ptr); @@ -342,9 +342,9 @@ jsimd_h2v2_upsample (j_decompress_ptr cinfo, GLOBAL(void) jsimd_h2v1_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width, input_data, output_data_ptr); @@ -388,9 +388,9 @@ jsimd_can_h2v1_fancy_upsample (void) GLOBAL(void) jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor, compptr->downsampled_width, input_data, @@ -399,9 +399,9 @@ jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo, GLOBAL(void) jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo, - jpeg_component_info * compptr, + jpeg_component_info *compptr, JSAMPARRAY input_data, - JSAMPARRAY * output_data_ptr) + JSAMPARRAY *output_data_ptr) { jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor, compptr->downsampled_width, input_data, @@ -566,14 +566,14 @@ jsimd_can_convsamp_float (void) GLOBAL(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col, - DCTELEM * workspace) + DCTELEM *workspace) { jsimd_convsamp_sse2(sample_data, start_col, workspace); } GLOBAL(void) jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, - FAST_FLOAT * workspace) + FAST_FLOAT *workspace) { jsimd_convsamp_float_sse2(sample_data, start_col, workspace); } @@ -630,19 +630,19 @@ jsimd_can_fdct_float (void) } GLOBAL(void) -jsimd_fdct_islow (DCTELEM * data) +jsimd_fdct_islow (DCTELEM *data) { jsimd_fdct_islow_sse2(data); } GLOBAL(void) -jsimd_fdct_ifast (DCTELEM * data) +jsimd_fdct_ifast (DCTELEM *data) { jsimd_fdct_ifast_sse2(data); } GLOBAL(void) -jsimd_fdct_float (FAST_FLOAT * data) +jsimd_fdct_float (FAST_FLOAT *data) { jsimd_fdct_float_sse(data); } @@ -686,15 +686,15 @@ jsimd_can_quantize_float (void) } GLOBAL(void) -jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors, - DCTELEM * workspace) +jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors, + DCTELEM *workspace) { jsimd_quantize_sse2(coef_block, divisors, workspace); } GLOBAL(void) -jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, - FAST_FLOAT * workspace) +jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, + FAST_FLOAT *workspace) { jsimd_quantize_float_sse2(coef_block, divisors, workspace); } @@ -746,7 +746,7 @@ jsimd_can_idct_4x4 (void) } GLOBAL(void) -jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -754,7 +754,7 @@ jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -834,7 +834,7 @@ jsimd_can_idct_float (void) } GLOBAL(void) -jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -843,7 +843,7 @@ jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -852,7 +852,7 @@ jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, } GLOBAL(void) -jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, +jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) { @@ -878,7 +878,7 @@ jsimd_can_huff_encode_one_block (void) } GLOBAL(JOCTET*) -jsimd_huff_encode_one_block (void * state, JOCTET *buffer, JCOEFPTR block, +jsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val, c_derived_tbl *dctbl, c_derived_tbl *actbl) { diff --git a/transupp.c b/transupp.c index 64183a93..d1c56c60 100644 --- a/transupp.c +++ b/transupp.c @@ -764,9 +764,9 @@ do_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, */ LOCAL(boolean) -jt_read_integer (const char ** strptr, JDIMENSION * result) +jt_read_integer (const char **strptr, JDIMENSION *result) { - const char * ptr = *strptr; + const char *ptr = *strptr; JDIMENSION val = 0; for (; isdigit(*ptr); ptr++) { @@ -1179,7 +1179,7 @@ transpose_critical_parameters (j_compress_ptr dstinfo) #if JPEG_LIB_VERSION >= 70 LOCAL(void) -adjust_exif_parameters (JOCTET * data, unsigned int length, +adjust_exif_parameters (JOCTET *data, unsigned int length, JDIMENSION new_width, JDIMENSION new_height) { boolean is_motorola; /* Flag for byte order */ diff --git a/transupp.h b/transupp.h index 4be6adee..bf3118a2 100644 --- a/transupp.h +++ b/transupp.h @@ -143,7 +143,7 @@ typedef struct { /* Internal workspace: caller should not touch these */ int num_components; /* # of components in workspace */ - jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */ + jvirt_barray_ptr *workspace_coef_arrays; /* workspace for transformations */ JDIMENSION output_width; /* cropped destination dimensions */ JDIMENSION output_height; JDIMENSION x_crop_offset; /* destination crop offsets measured in iMCUs */ diff --git a/wrbmp.c b/wrbmp.c index 5e307de0..50e469c9 100644 --- a/wrbmp.c +++ b/wrbmp.c @@ -58,7 +58,7 @@ typedef struct { JDIMENSION cur_output_row; /* next row# to write to virtual array */ } bmp_dest_struct; -typedef bmp_dest_struct * bmp_dest_ptr; +typedef bmp_dest_struct *bmp_dest_ptr; /* Forward declarations */ @@ -333,7 +333,7 @@ write_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest, { JSAMPARRAY colormap = cinfo->colormap; int num_colors = cinfo->actual_number_of_colors; - FILE * outfile = dest->pub.output_file; + FILE *outfile = dest->pub.output_file; int i; if (colormap != NULL) { @@ -383,7 +383,7 @@ METHODDEF(void) finish_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) { bmp_dest_ptr dest = (bmp_dest_ptr) dinfo; - register FILE * outfile = dest->pub.output_file; + register FILE *outfile = dest->pub.output_file; JSAMPARRAY image_ptr; register JSAMPROW data_ptr; JDIMENSION row; diff --git a/wrgif.c b/wrgif.c index 53592de5..cc06f1d5 100644 --- a/wrgif.c +++ b/wrgif.c @@ -69,7 +69,7 @@ typedef struct { } gif_dest_struct; -typedef gif_dest_struct * gif_dest_ptr; +typedef gif_dest_struct *gif_dest_ptr; /* Largest value that will fit in N bits */ #define MAXCODE(n_bits) ((1 << (n_bits)) - 1) diff --git a/wrjpgcom.c b/wrjpgcom.c index 8409dd21..cd67afd3 100644 --- a/wrjpgcom.c +++ b/wrjpgcom.c @@ -18,7 +18,7 @@ #include "jinclude.h" /* get auto-config symbols, */ #ifndef HAVE_STDLIB_H /* should declare malloc() */ -extern void * malloc (); +extern void *malloc (); #endif #include /* to declare isupper(), tolower() */ #ifdef USE_SETMODE @@ -66,12 +66,12 @@ extern void * malloc (); * To reuse this code in another application, you might need to change these. */ -static FILE * infile; /* input JPEG file */ +static FILE *infile; /* input JPEG file */ /* Return next input byte, or EOF if no more */ #define NEXTBYTE() getc(infile) -static FILE * outfile; /* output JPEG file */ +static FILE *outfile; /* output JPEG file */ /* Emit an output byte */ #define PUTBYTE(x) putc((x), outfile) @@ -338,7 +338,7 @@ scan_JPEG_header (int keep_COM) /* Command line parsing code */ -static const char * progname; /* program name for error messages */ +static const char *progname; /* program name for error messages */ static void @@ -375,7 +375,7 @@ usage (void) static int -keymatch (char * arg, const char * keyword, int minchars) +keymatch (char *arg, const char *keyword, int minchars) /* Case-insensitive matching of (possibly abbreviated) keyword switches. */ /* keyword is the constant keyword (must be lower case already), */ /* minchars is length of minimum legal abbreviation. */ @@ -407,10 +407,10 @@ int main (int argc, char **argv) { int argn; - char * arg; + char *arg; int keep_COM = 1; - char * comment_arg = NULL; - FILE * comment_file = NULL; + char *comment_arg = NULL; + FILE *comment_file = NULL; unsigned int comment_length = 0; int marker; @@ -544,7 +544,7 @@ main (int argc, char **argv) /* Collect comment text from comment_file or stdin, if necessary */ if (comment_arg == NULL) { - FILE * src_file; + FILE *src_file; int c; comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH); diff --git a/wrppm.c b/wrppm.c index a930c810..7d13e2db 100644 --- a/wrppm.c +++ b/wrppm.c @@ -74,7 +74,7 @@ typedef struct { JDIMENSION samples_per_row; /* JSAMPLEs per output row */ } ppm_dest_struct; -typedef ppm_dest_struct * ppm_dest_ptr; +typedef ppm_dest_struct *ppm_dest_ptr; /* @@ -105,7 +105,7 @@ copy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied) { ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; - register char * bufferptr; + register char *bufferptr; register JSAMPROW ptr; register JDIMENSION col; @@ -128,7 +128,7 @@ put_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied) { ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; - register char * bufferptr; + register char *bufferptr; register int pixval; register JSAMPROW ptr; register JSAMPROW color_map0 = cinfo->colormap[0]; @@ -153,7 +153,7 @@ put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied) { ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; - register char * bufferptr; + register char *bufferptr; register JSAMPROW ptr; register JSAMPROW color_map = cinfo->colormap[0]; register JDIMENSION col; diff --git a/wrrle.c b/wrrle.c index 3e4c24af..cc95b413 100644 --- a/wrrle.c +++ b/wrrle.c @@ -62,7 +62,7 @@ typedef struct { } rle_dest_struct; -typedef rle_dest_struct * rle_dest_ptr; +typedef rle_dest_struct *rle_dest_ptr; /* Forward declarations */ METHODDEF(void) rle_put_pixel_rows @@ -237,7 +237,7 @@ finish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) } else { for (row = cinfo->output_height-1; row >= 0; row--) { rle_row = (rle_pixel **) dest->rle_row; - output_row = * (*cinfo->mem->access_virt_sarray) + output_row = *(*cinfo->mem->access_virt_sarray) ((j_common_ptr) cinfo, dest->image, (JDIMENSION) row, (JDIMENSION) 1, FALSE); red = rle_row[0]; diff --git a/wrtarga.c b/wrtarga.c index 30d71deb..c02b3321 100644 --- a/wrtarga.c +++ b/wrtarga.c @@ -41,7 +41,7 @@ typedef struct { JDIMENSION buffer_width; /* width of one row */ } tga_dest_struct; -typedef tga_dest_struct * tga_dest_ptr; +typedef tga_dest_struct *tga_dest_ptr; LOCAL(void) @@ -96,7 +96,7 @@ put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, { tga_dest_ptr dest = (tga_dest_ptr) dinfo; register JSAMPROW inptr; - register char * outptr; + register char *outptr; register JDIMENSION col; inptr = dest->pub.buffer[0]; @@ -117,7 +117,7 @@ put_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, { tga_dest_ptr dest = (tga_dest_ptr) dinfo; register JSAMPROW inptr; - register char * outptr; + register char *outptr; register JDIMENSION col; inptr = dest->pub.buffer[0]; @@ -140,7 +140,7 @@ put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, { tga_dest_ptr dest = (tga_dest_ptr) dinfo; register JSAMPROW inptr; - register char * outptr; + register char *outptr; register JSAMPROW color_map0 = cinfo->colormap[0]; register JDIMENSION col; From 9100b67a75dc8d8bb6b819ac853037f75bddfdbf Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 19 Feb 2016 09:25:44 -0600 Subject: [PATCH 118/140] Clean up a couple of copyright messages --- jcomapi.c | 2 +- jdmerge.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jcomapi.c b/jcomapi.c index 46ad5dc3..6e5bf3db 100644 --- a/jcomapi.c +++ b/jcomapi.c @@ -2,7 +2,7 @@ * jcomapi.c * * This file was part of the Independent JPEG Group's software: - * Copyright (C) 1994-1997, Thomas G. Lane.0 + * Copyright (C) 1994-1997, Thomas G. Lane. * It was modified by The libjpeg-turbo Project to include only code relevant * to libjpeg-turbo. * For conditions of distribution and use, see the accompanying README.ijg diff --git a/jdmerge.c b/jdmerge.c index 30bc5283..6276dd09 100644 --- a/jdmerge.c +++ b/jdmerge.c @@ -3,8 +3,8 @@ * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. - * Copyright 2009 Pierre Ossman for Cendio AB * libjpeg-turbo Modifications: + * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander. * Copyright (C) 2013, Linaro Limited. * For conditions of distribution and use, see the accompanying README.ijg From e621dfc508e8093852f2294b7e421116ffed1d77 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 19 Feb 2016 10:35:09 -0600 Subject: [PATCH 119/140] More minor code formatting tweaks --- cjpeg.c | 2 +- djpeg.c | 2 +- jcdctmgr.c | 14 +++++++------- jcmaster.c | 2 +- jdarith.c | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cjpeg.c b/cjpeg.c index 0d451930..713224ff 100644 --- a/cjpeg.c +++ b/cjpeg.c @@ -140,7 +140,7 @@ select_file_type (j_compress_ptr cinfo, FILE *infile) static const char *progname; /* program name for error messages */ static char *outfilename; /* for -outfile switch */ -boolean memdst; /* for -memdst switch */ +boolean memdst; /* for -memdst switch */ LOCAL(void) diff --git a/djpeg.c b/djpeg.c index 6de5d2c6..ce83104e 100644 --- a/djpeg.c +++ b/djpeg.c @@ -90,7 +90,7 @@ static IMAGE_FORMATS requested_fmt; static const char *progname; /* program name for error messages */ static char *outfilename; /* for -outfile switch */ -boolean memsrc; /* for -memsrc switch */ +boolean memsrc; /* for -memsrc switch */ boolean strip, skip; JDIMENSION startY, endY; #define INPUT_BUF_SIZE 4096 diff --git a/jcdctmgr.c b/jcdctmgr.c index f3919b9e..aef8517f 100644 --- a/jcdctmgr.c +++ b/jcdctmgr.c @@ -265,8 +265,8 @@ start_pass_fdctmgr (j_compress_ptr cinfo) dtbl = fdct->divisors[qtblno]; for (i = 0; i < DCTSIZE2; i++) { #if BITS_IN_JSAMPLE == 8 - if(!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i]) - && fdct->quantize == jsimd_quantize) + if (!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i]) && + fdct->quantize == jsimd_quantize) fdct->quantize = quantize; #else dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3; @@ -305,11 +305,11 @@ start_pass_fdctmgr (j_compress_ptr cinfo) dtbl = fdct->divisors[qtblno]; for (i = 0; i < DCTSIZE2; i++) { #if BITS_IN_JSAMPLE == 8 - if(!compute_reciprocal( - DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i], - (JLONG) aanscales[i]), - CONST_BITS-3), &dtbl[i]) - && fdct->quantize == jsimd_quantize) + if (!compute_reciprocal( + DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i], + (JLONG) aanscales[i]), + CONST_BITS-3), &dtbl[i]) && + fdct->quantize == jsimd_quantize) fdct->quantize = quantize; #else dtbl[i] = (DCTELEM) diff --git a/jcmaster.c b/jcmaster.c index e715f0b7..d1e1ba7b 100644 --- a/jcmaster.c +++ b/jcmaster.c @@ -603,7 +603,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only) cinfo->num_scans = 1; } - if (cinfo->progressive_mode && !cinfo->arith_code) /* TEMPORARY HACK ??? */ + if (cinfo->progressive_mode && !cinfo->arith_code) /* TEMPORARY HACK ??? */ cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */ /* Initialize my private state */ diff --git a/jdarith.c b/jdarith.c index 905412bb..98d5fad1 100644 --- a/jdarith.c +++ b/jdarith.c @@ -203,13 +203,13 @@ process_restart (j_decompress_ptr cinfo) /* Re-initialize statistics areas */ for (ci = 0; ci < cinfo->comps_in_scan; ci++) { compptr = cinfo->cur_comp_info[ci]; - if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) { + if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) { MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS); /* Reset DC predictions to 0 */ entropy->last_dc_val[ci] = 0; entropy->dc_context[ci] = 0; } - if (! cinfo->progressive_mode || cinfo->Ss) { + if (!cinfo->progressive_mode || cinfo->Ss) { MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS); } } @@ -694,7 +694,7 @@ start_pass (j_decompress_ptr cinfo) /* Allocate & initialize requested statistics areas */ for (ci = 0; ci < cinfo->comps_in_scan; ci++) { compptr = cinfo->cur_comp_info[ci]; - if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) { + if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) { tbl = compptr->dc_tbl_no; if (tbl < 0 || tbl >= NUM_ARITH_TBLS) ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl); @@ -706,7 +706,7 @@ start_pass (j_decompress_ptr cinfo) entropy->last_dc_val[ci] = 0; entropy->dc_context[ci] = 0; } - if (! cinfo->progressive_mode || cinfo->Ss) { + if (!cinfo->progressive_mode || cinfo->Ss) { tbl = compptr->ac_tbl_no; if (tbl < 0 || tbl >= NUM_ARITH_TBLS) ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl); From d4be42360c6c8a89309ffb0cc32041d799deb392 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 19 Feb 2016 10:35:41 -0600 Subject: [PATCH 120/140] usage.txt: Restore accidentally deleted phrase It somehow got lost when merging the jpeg-9+ documentation changes. --- usage.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usage.txt b/usage.txt index 69d4717a..5abda4ed 100644 --- a/usage.txt +++ b/usage.txt @@ -53,7 +53,8 @@ The currently supported image file formats are: PPM (PBMPLUS color format), PGM (PBMPLUS grayscale format), BMP, Targa, and RLE (Utah Raster Toolkit format). (RLE is supported only if the URT library is available, which it isn't on most non-Unix systems.) cjpeg recognizes the input image format -automatically, with the exception of some Targa files. +automatically, with the exception of some Targa files. You have to tell djpeg +which format to generate. JPEG files are in the defacto standard JFIF file format. There are other, less widely used JPEG-based file formats, but we don't support them. From f76c01d0bd0cf0ed69796d67d38c04b3ec6ff55f Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 19 Feb 2016 10:56:13 -0600 Subject: [PATCH 121/140] Use consistent/modern code formatting for dbl ptrs --- jchuff.c | 2 +- jcparam.c | 2 +- jctrans.c | 2 +- jdhuff.c | 2 +- rdrle.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jchuff.c b/jchuff.c index 0462d0da..58acd705 100644 --- a/jchuff.c +++ b/jchuff.c @@ -220,7 +220,7 @@ start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) GLOBAL(void) jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, - c_derived_tbl ** pdtbl) + c_derived_tbl **pdtbl) { JHUFF_TBL *htbl; c_derived_tbl *dtbl; diff --git a/jcparam.c b/jcparam.c index 544127e4..18b2d487 100644 --- a/jcparam.c +++ b/jcparam.c @@ -34,7 +34,7 @@ jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, * are limited to 1..255 for JPEG baseline compatibility. */ { - JQUANT_TBL ** qtblptr; + JQUANT_TBL **qtblptr; int i; long temp; diff --git a/jctrans.c b/jctrans.c index 2c838575..6f16b052 100644 --- a/jctrans.c +++ b/jctrans.c @@ -67,7 +67,7 @@ GLOBAL(void) jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, j_compress_ptr dstinfo) { - JQUANT_TBL ** qtblptr; + JQUANT_TBL **qtblptr; jpeg_component_info *incomp, *outcomp; JQUANT_TBL *c_quant, *slot_quant; int tblno, ci, coefi; diff --git a/jdhuff.c b/jdhuff.c index 02e533e7..338f2a49 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -153,7 +153,7 @@ start_pass_huff_decoder (j_decompress_ptr cinfo) GLOBAL(void) jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, - d_derived_tbl ** pdtbl) + d_derived_tbl **pdtbl) { JHUFF_TBL *htbl; d_derived_tbl *dtbl; diff --git a/rdrle.c b/rdrle.c index e3509e7e..226c5289 100644 --- a/rdrle.c +++ b/rdrle.c @@ -71,7 +71,7 @@ typedef struct _rle_source_struct { jvirt_sarray_ptr image; /* virtual array to hold the image */ JDIMENSION row; /* current row # in the virtual array */ rle_hdr header; /* Input file information */ - rle_pixel** rle_row; /* holds a row returned by rle_getrow() */ + rle_pixel **rle_row; /* holds a row returned by rle_getrow() */ } rle_source_struct; From 5f972324eea069d6bf0ad5c2abd499b79441abcb Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 19 Feb 2016 13:16:56 -0600 Subject: [PATCH 122/140] Build: Make the NASM autoconf variable persistent Previously, if a custom value of this variable was specified when running configure, then that value would be lost if configure was automatically re-run (as a result of changes to configure.ac, for instance.) As a bonus, the NASM variable is now also listed when running 'configure --help', so it is obvious how to override the default NASM command. --- acinclude.m4 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index c59c4b63..2c907620 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -3,8 +3,11 @@ # Check that NASM exists and determine flags AC_DEFUN([AC_PROG_NASM],[ -AC_CHECK_PROGS(NASM, [nasm nasmw yasm]) -test -z "$NASM" && AC_MSG_ERROR([no nasm (Netwide Assembler) found]) +AC_ARG_VAR(NASM, [NASM command (used to build the x86/x86-64 SIMD code)]) +if test "x$NASM" = "x"; then + AC_CHECK_PROGS(NASM, [nasm nasmw yasm]) + test -z "$NASM" && AC_MSG_ERROR([no nasm (Netwide Assembler) found]) +fi AC_MSG_CHECKING([for object file format of host system]) case "$host_os" in From 3ab68cf563f6edc2608c085f5c8b2d5d5c61157e Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 19 Feb 2016 18:32:10 -0600 Subject: [PATCH 123/140] libjpeg API: Partial scanline decompression This, in combination with the existing jpeg_skip_scanlines() function, provides the ability to crop the image both horizontally and vertically while decompressing (certain restrictions apply-- see libjpeg.txt.) This also cleans up the documentation of the line skipping feature and removes the "strip decompression" feature from djpeg, since the new cropping feature is a superset of it. Refer to #34 for discussion. Closes #34 --- CMakeLists.txt | 61 +++++++++---------- Makefile.am | 39 +++++++------ djpeg.1 | 16 ++--- djpeg.c | 123 ++++++++++++++++++++++++--------------- jdapimin.c | 13 ++++- jdapistd.c | 104 +++++++++++++++++++++++++++++++++ jdcoefct.c | 79 ++++++++++++++----------- jdinput.c | 8 ++- jdmaster.c | 36 ++++-------- jdmaster.h | 28 +++++++++ jdsample.c | 20 ++++--- jpegint.h | 10 +++- jpeglib.h | 4 +- jversion.h | 1 + libjpeg.txt | 58 +++++++++++++++--- win/jpeg62-memsrcdst.def | 1 + win/jpeg62.def | 1 + win/jpeg7.def | 1 + win/jpeg8.def | 1 + wrppm.c | 16 +---- wrppm.h | 26 +++++++++ 21 files changed, 448 insertions(+), 198 deletions(-) create mode 100644 jdmaster.h create mode 100644 wrppm.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 91c8ac66..7f190437 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -367,9 +367,9 @@ if(WITH_12BIT) set(MD5_PPM_420M_ISLOW_1_4 35fd59d866e44659edfa3c18db2a3edb) set(MD5_PPM_420M_ISLOW_1_8 ccaed48ac0aedefda5d4abe4013f4ad7) set(MD5_PPM_420_ISLOW_SKIP15_31 86664cd9dc956536409e44e244d20a97) - set(MD5_PPM_420_ISLOW_PROG_STRIP71_132 a5c3706bb2e59bd01786b1181f67f97c) + set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 452a21656115a163029cfba5c04fa76a) set(MD5_PPM_444_ISLOW_SKIP1_6 ef63901f71ef7a75cd78253fc0914f84) - set(MD5_PPM_444_ISLOW_PROG_STRIP13_110 6d228f8d05381d8639f3d078b91b2ee0) + set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 15b173fb5872d9575572fbcc1b05956f) set(MD5_JPEG_CROP cdb35ff4b4519392690ea040c56ea99c) else() set(TESTORIG testorig.jpg) @@ -421,11 +421,11 @@ else() set(MD5_BMP_420M_ISLOW_565D d1be3a3339166255e76fa50a0d70d73e) set(MD5_PPM_420_ISLOW_SKIP15_31 c4c65c1e43d7275cd50328a61e6534f0) set(MD5_PPM_420_ISLOW_ARI_SKIP16_139 087c6b123db16ac00cb88c5b590bb74a) - set(MD5_PPM_420_ISLOW_PROG_STRIP71_132 a7f2ba6ea335f03549888bed66a89fae) - set(MD5_PPM_420_ISLOW_ARI_STRIP4_56 0e5e44a39b94817917a1bac72903246b) + set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 26eb36ccc7d1f0cb80cdabb0ac8b5d99) + set(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 886c6775af22370257122f8b16207e6d) set(MD5_PPM_444_ISLOW_SKIP1_6 5606f86874cf26b8fcee1117a0a436a6) - set(MD5_PPM_444_ISLOW_PROG_STRIP13_110 40b5d9742558dca6229d7332fc2dda07) - set(MD5_PPM_444_ISLOW_ARI_STRIP0_36 9aceb5b9449c900b892a1d2fe39351b4) + set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 db87dc7ce26bcdc7a6b56239ce2b9d6c) + set(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 cb57b32bd6d03e35432362f7bf184b6d) set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d) endif() @@ -764,22 +764,23 @@ foreach(libtype ${TEST_LIBTYPES}) add_test(cjpeg${suffix}-420-islow-prog ${dir}cjpeg${suffix} -dct int -prog -outfile testout_420_islow_prog.jpg ${TESTIMAGES}/testorig.ppm) - add_test(djpeg${suffix}-420-islow-prog-strip71_132 - ${dir}djpeg${suffix} -dct int -strip 71,132 -ppm - -outfile testout_420_islow_strip71,132.ppm testout_420_islow_prog.jpg) - add_test(djpeg${suffix}-420-islow-prog-strip71_132-cmp - ${MD5CMP} ${MD5_PPM_420_ISLOW_PROG_STRIP71_132} - testout_420_islow_strip71,132.ppm) + add_test(djpeg${suffix}-420-islow-prog-crop62x62_71_71 + ${dir}djpeg${suffix} -dct int -crop 62x62+71+71 -ppm + -outfile testout_420_islow_prog_crop62x62,71,71.ppm + testout_420_islow_prog.jpg) + add_test(djpeg${suffix}-420-islow-prog-crop62x62_71_71-cmp + ${MD5CMP} ${MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71} + testout_420_islow_prog_crop62x62,71,71.ppm) # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith if(WITH_ARITH_DEC) - add_test(djpeg${suffix}-420-islow-ari-strip4_56 - ${dir}djpeg${suffix} -dct int -strip 4,56 -ppm - -outfile testout_420_islow_ari_strip4,56.ppm + add_test(djpeg${suffix}-420-islow-ari-crop53x53_4_4 + ${dir}djpeg${suffix} -dct int -crop 53x53+4+4 -ppm + -outfile testout_420_islow_ari_crop53x53,4,4.ppm ${TESTIMAGES}/testimgari.jpg) - add_test(djpeg${suffix}-420-islow-ari-strip4_56-cmp - ${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_STRIP4_56} - testout_420_islow_ari_strip4,56.ppm) + add_test(djpeg${suffix}-420-islow-ari-crop53x53_4_4-cmp + ${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4} + testout_420_islow_ari_crop53x53,4,4.ppm) endif() # Context rows: No Intra-iMCU row: Yes ENT: huff @@ -796,13 +797,13 @@ foreach(libtype ${TEST_LIBTYPES}) add_test(cjpeg${suffix}-444-islow-prog ${dir}cjpeg${suffix} -dct int -prog -sample 1x1 -outfile testout_444_islow_prog.jpg ${TESTIMAGES}/testorig.ppm) - add_test(djpeg${suffix}-444-islow-prog-strip13_110 - ${dir}djpeg${suffix} -dct int -strip 13,110 -ppm - -outfile testout_444_islow_prog_strip13,110.ppm + add_test(djpeg${suffix}-444-islow-prog-crop98x98_13_13 + ${dir}djpeg${suffix} -dct int -crop 98x98+13+13 -ppm + -outfile testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg) - add_test(djpeg${suffix}-444-islow-prog_strip13_110-cmp - ${MD5CMP} ${MD5_PPM_444_ISLOW_PROG_STRIP13_110} - testout_444_islow_prog_strip13,110.ppm) + add_test(djpeg${suffix}-444-islow-prog_crop98x98_13_13-cmp + ${MD5CMP} ${MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13} + testout_444_islow_prog_crop98x98,13,13.ppm) # Context rows: No Intra-iMCU row: No ENT: arith if(WITH_ARITH_ENC) @@ -810,13 +811,13 @@ foreach(libtype ${TEST_LIBTYPES}) ${dir}cjpeg${suffix} -dct int -arithmetic -sample 1x1 -outfile testout_444_islow_ari.jpg ${TESTIMAGES}/testorig.ppm) if(WITH_ARITH_DEC) - add_test(djpeg${suffix}-444-islow-ari-strip0_36 - ${dir}djpeg${suffix} -dct int -strip 0,36 -ppm - -outfile testout_444_islow_ari_strip0,36.ppm + add_test(djpeg${suffix}-444-islow-ari-crop37x37_0_0 + ${dir}djpeg${suffix} -dct int -crop 37x37+0+0 -ppm + -outfile testout_444_islow_ari_crop37x37,0,0.ppm testout_444_islow_ari.jpg) - add_test(djpeg${suffix}-444-islow-ari-strip0_36-cmp - ${MD5CMP} ${MD5_PPM_444_ISLOW_ARI_STRIP0_36} - testout_444_islow_ari_strip0,36.ppm) + add_test(djpeg${suffix}-444-islow-ari-crop37x37_0_0-cmp + ${MD5CMP} ${MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0} + testout_444_islow_ari_crop37x37,0,0.ppm) endif() endif() diff --git a/Makefile.am b/Makefile.am index 68cf8d82..b29edde7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -170,7 +170,8 @@ dist_example_DATA = example.c EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \ sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \ doxygen-extra.css jccolext.c jdcolext.c jdcol565.c jdmrgext.c jdmrg565.c \ - jstdhuff.c jdcoefct.h jdmainct.h jdsample.h md5/CMakeLists.txt + jstdhuff.c jdcoefct.h jdmainct.h jdmaster.h jdsample.h wrppm.h \ + md5/CMakeLists.txt dist-hook: rm -rf `find $(distdir) -name .svn` @@ -213,9 +214,9 @@ MD5_PPM_420M_ISLOW_3_8 = 343d19015531b7bbe746124127244fa8 MD5_PPM_420M_ISLOW_1_4 = 35fd59d866e44659edfa3c18db2a3edb MD5_PPM_420M_ISLOW_1_8 = ccaed48ac0aedefda5d4abe4013f4ad7 MD5_PPM_420_ISLOW_SKIP15_31 = 86664cd9dc956536409e44e244d20a97 -MD5_PPM_420_ISLOW_PROG_STRIP71_132 = a5c3706bb2e59bd01786b1181f67f97c +MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 452a21656115a163029cfba5c04fa76a MD5_PPM_444_ISLOW_SKIP1_6 = ef63901f71ef7a75cd78253fc0914f84 -MD5_PPM_444_ISLOW_PROG_STRIP13_110 = 6d228f8d05381d8639f3d078b91b2ee0 +MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = 15b173fb5872d9575572fbcc1b05956f MD5_JPEG_CROP = cdb35ff4b4519392690ea040c56ea99c else @@ -270,11 +271,11 @@ MD5_BMP_420M_ISLOW_565 = 8dc0185245353cfa32ad97027342216f MD5_BMP_420M_ISLOW_565D =d1be3a3339166255e76fa50a0d70d73e MD5_PPM_420_ISLOW_SKIP15_31 = c4c65c1e43d7275cd50328a61e6534f0 MD5_PPM_420_ISLOW_ARI_SKIP16_139 = 087c6b123db16ac00cb88c5b590bb74a -MD5_PPM_420_ISLOW_PROG_STRIP71_132 = a7f2ba6ea335f03549888bed66a89fae -MD5_PPM_420_ISLOW_ARI_STRIP4_56 = 0e5e44a39b94817917a1bac72903246b +MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 26eb36ccc7d1f0cb80cdabb0ac8b5d99 +MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 = 886c6775af22370257122f8b16207e6d MD5_PPM_444_ISLOW_SKIP1_6 = 5606f86874cf26b8fcee1117a0a436a6 -MD5_PPM_444_ISLOW_PROG_STRIP13_110 = 40b5d9742558dca6229d7332fc2dda07 -MD5_PPM_444_ISLOW_ARI_STRIP0_36 = 9aceb5b9449c900b892a1d2fe39351b4 +MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = db87dc7ce26bcdc7a6b56239ce2b9d6c +MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 = cb57b32bd6d03e35432362f7bf184b6d MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d endif @@ -614,14 +615,14 @@ if WITH_ARITH_DEC endif # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff ./cjpeg -dct int -prog -outfile testout_420_islow_prog.jpg $(srcdir)/testimages/testorig.ppm - ./djpeg -dct int -strip 71,132 -ppm -outfile testout_420_islow_prog_strip71,132.ppm testout_420_islow_prog.jpg - md5/md5cmp $(MD5_PPM_420_ISLOW_PROG_STRIP71_132) testout_420_islow_prog_strip71,132.ppm - rm -f testout_420_islow_prog_strip71,132.ppm testout_420_islow_prog.jpg + ./djpeg -dct int -crop 62x62+71+71 -ppm -outfile testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg + md5/md5cmp $(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71) testout_420_islow_prog_crop62x62,71,71.ppm + rm -f testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith if WITH_ARITH_DEC - ./djpeg -dct int -strip 4,56 -ppm -outfile testout_420_islow_ari_strip4,56.ppm $(srcdir)/testimages/testimgari.jpg - md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_STRIP4_56) testout_420_islow_ari_strip4,56.ppm - rm -f testout_420_islow_ari_strip4,56.ppm + ./djpeg -dct int -crop 53x53+4+4 -ppm -outfile testout_420_islow_ari_crop53x53,4,4.ppm $(srcdir)/testimages/testimgari.jpg + md5/md5cmp $(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4) testout_420_islow_ari_crop53x53,4,4.ppm + rm -f testout_420_islow_ari_crop53x53,4,4.ppm endif # Context rows: No Intra-iMCU row: Yes ENT: huff ./cjpeg -dct int -sample 1x1 -outfile testout_444_islow.jpg $(srcdir)/testimages/testorig.ppm @@ -630,16 +631,16 @@ endif rm -f testout_444_islow_skip1,6.ppm testout_444_islow.jpg # Context rows: No Intra-iMCU row: No ENT: prog huff ./cjpeg -dct int -prog -sample 1x1 -outfile testout_444_islow_prog.jpg $(srcdir)/testimages/testorig.ppm - ./djpeg -dct int -strip 13,110 -ppm -outfile testout_444_islow_prog_strip13,110.ppm testout_444_islow_prog.jpg - md5/md5cmp $(MD5_PPM_444_ISLOW_PROG_STRIP13_110) testout_444_islow_prog_strip13,110.ppm - rm -f testout_444_islow_prog_strip13,110.ppm testout_444_islow_prog.jpg + ./djpeg -dct int -crop 98x98+13+13 -ppm -outfile testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg + md5/md5cmp $(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13) testout_444_islow_prog_crop98x98,13,13.ppm + rm -f testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg # Context rows: No Intra-iMCU row: No ENT: arith if WITH_ARITH_ENC ./cjpeg -dct int -arithmetic -sample 1x1 -outfile testout_444_islow_ari.jpg $(srcdir)/testimages/testorig.ppm if WITH_ARITH_DEC - ./djpeg -dct int -strip 0,36 -ppm -outfile testout_444_islow_ari_strip0,36.ppm testout_444_islow_ari.jpg - md5/md5cmp $(MD5_PPM_444_ISLOW_ARI_STRIP0_36) testout_444_islow_ari_strip0,36.ppm - rm -f testout_444_islow_ari_strip0,36.ppm + ./djpeg -dct int -crop 37x37+0+0 -ppm -outfile testout_444_islow_ari_crop37x37,0,0.ppm testout_444_islow_ari.jpg + md5/md5cmp $(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0) testout_444_islow_ari_crop37x37,0,0.ppm + rm -f testout_444_islow_ari_crop37x37,0,0.ppm endif rm -f testout_444_islow_ari.jpg endif diff --git a/djpeg.1 b/djpeg.1 index 293939bf..7efde43b 100644 --- a/djpeg.1 +++ b/djpeg.1 @@ -1,4 +1,4 @@ -.TH DJPEG 1 "17 February 2016" +.TH DJPEG 1 "18 February 2016" .SH NAME djpeg \- decompress a JPEG file to an image file .SH SYNOPSIS @@ -195,13 +195,15 @@ Load input file into memory before decompressing. This feature was implemented mainly as a way of testing the in-memory source manager (jpeg_mem_src().) .TP .BI \-skip " Y0,Y1" -Decode all rows of the JPEG image except those between Y0 and Y1 (inclusive.) -Note that if decompression scaling is being used, Y0 and Y1 are relative to the -scaled image dimensions. +Decompress all rows of the JPEG image except those between Y0 and Y1 +(inclusive.) Note that if decompression scaling is being used, then Y0 and Y1 +are relative to the scaled image dimensions. .TP -.BI \-strip " Y0,Y1" -Decode only the rows of the JPEG image between Y0 and Y1 (inclusive.) Note -that if decompression scaling is being used, Y0 and Y1 are relative to the +.BI \-crop " WxH+X+Y" +Decompress only a rectangular subregion of the image, starting at point X,Y +with width W and height H. If necessary, X will be shifted left to the nearest +iMCU boundary, and the width will be increased accordingly. Note that if +decompression scaling is being used, then X, Y, W, and H are relative to the scaled image dimensions. .TP .B \-verbose diff --git a/djpeg.c b/djpeg.c index ce83104e..54cd525e 100644 --- a/djpeg.c +++ b/djpeg.c @@ -5,7 +5,7 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 2013 by Guido Vollbeding. * libjpeg-turbo Modifications: - * Copyright (C) 2010-2011, 2013-2015, D. R. Commander. + * Copyright (C) 2010-2011, 2013-2016, D. R. Commander. * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. @@ -31,6 +31,7 @@ #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ #include "jversion.h" /* for version message */ #include "jconfigint.h" +#include "wrppm.h" #include /* to declare isprint() */ @@ -91,8 +92,9 @@ static IMAGE_FORMATS requested_fmt; static const char *progname; /* program name for error messages */ static char *outfilename; /* for -outfile switch */ boolean memsrc; /* for -memsrc switch */ -boolean strip, skip; -JDIMENSION startY, endY; +boolean skip, crop; +JDIMENSION skip_start, skip_end; +JDIMENSION crop_x, crop_y, crop_width, crop_height; #define INPUT_BUF_SIZE 4096 @@ -169,8 +171,8 @@ usage (void) fprintf(stderr, " -memsrc Load input file into memory before decompressing\n"); #endif - fprintf(stderr, " -skip Y0,Y1 Decode all rows except those between Y0 and Y1 (inclusive)\n"); - fprintf(stderr, " -strip Y0,Y1 Decode only rows between Y0 and Y1 (inclusive)\n"); + fprintf(stderr, " -skip Y0,Y1 Decompress all rows except those between Y0 and Y1 (inclusive)\n"); + fprintf(stderr, " -crop WxH+X+Y Decompress only a rectangular subregion of the image\n"); fprintf(stderr, " -verbose or -debug Emit debug output\n"); fprintf(stderr, " -version Print version information and exit\n"); exit(EXIT_FAILURE); @@ -196,8 +198,8 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, requested_fmt = DEFAULT_FMT; /* set default output file format */ outfilename = NULL; memsrc = FALSE; - strip = FALSE; skip = FALSE; + crop = FALSE; cinfo->err->trace_level = 0; /* Scan command line options, adjust parameters */ @@ -378,21 +380,24 @@ parse_switches (j_decompress_ptr cinfo, int argc, char **argv, &cinfo->scale_num, &cinfo->scale_denom) != 2) usage(); - } else if (keymatch(arg, "strip", 2)) { - if (++argn >= argc) - usage(); - if (sscanf(argv[argn], "%d,%d", &startY, &endY) != 2 || startY > endY) - usage(); - strip = TRUE; - - } else if (keymatch(arg, "skip", 2)) { if (++argn >= argc) usage(); - if (sscanf(argv[argn], "%d,%d", &startY, &endY) != 2 || startY > endY) + if (sscanf(argv[argn], "%u,%u", &skip_start, &skip_end) != 2 || + skip_start > skip_end) usage(); skip = TRUE; + } else if (keymatch(arg, "crop", 2)) { + char c; + if (++argn >= argc) + usage(); + if (sscanf(argv[argn], "%u%c%u+%u+%u", &crop_width, &c, &crop_height, + &crop_x, &crop_y) != 5 || + (c != 'X' && c != 'x') || crop_width < 1 || crop_height < 1) + usage(); + crop = TRUE; + } else if (keymatch(arg, "targa", 1)) { /* Targa output format. */ requested_fmt = FMT_TARGA; @@ -658,54 +663,78 @@ main (int argc, char **argv) /* Start decompressor */ (void) jpeg_start_decompress(&cinfo); - /* Strip decode */ - if (strip || skip) { + /* Skip rows */ + if (skip) { JDIMENSION tmp; - /* Check for valid endY. We cannot check this value until after + /* Check for valid skip_end. We cannot check this value until after * jpeg_start_decompress() is called. Note that we have already verified - * that startY <= endY. + * that skip_start <= skip_end. */ - if (endY > cinfo.output_height - 1) { - fprintf(stderr, "%s: strip %d-%d exceeds image height %d\n", progname, - startY, endY, cinfo.output_height); + if (skip_end > cinfo.output_height - 1) { + fprintf(stderr, "%s: skip region exceeds image height %d\n", progname, + cinfo.output_height); exit(EXIT_FAILURE); } /* Write output file header. This is a hack to ensure that the destination - * manager creates an image of the proper size for the partial decode. + * manager creates an output image of the proper size. */ tmp = cinfo.output_height; - cinfo.output_height = endY - startY + 1; - if (skip) - cinfo.output_height = tmp - cinfo.output_height; + cinfo.output_height -= (skip_end - skip_start + 1); (*dest_mgr->start_output) (&cinfo, dest_mgr); cinfo.output_height = tmp; /* Process data */ - if (skip) { - while (cinfo.output_scanline < startY) { - num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, - dest_mgr->buffer_height); - (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); - } - jpeg_skip_scanlines(&cinfo, endY - startY + 1); - while (cinfo.output_scanline < cinfo.output_height) { - num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, - dest_mgr->buffer_height); - (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); - } - } else { - jpeg_skip_scanlines(&cinfo, startY); - while (cinfo.output_scanline <= endY) { - num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, - dest_mgr->buffer_height); - (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); - } - jpeg_skip_scanlines(&cinfo, cinfo.output_height - endY + 1); + while (cinfo.output_scanline < skip_start) { + num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, + dest_mgr->buffer_height); + (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + } + jpeg_skip_scanlines(&cinfo, skip_end - skip_start + 1); + while (cinfo.output_scanline < cinfo.output_height) { + num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, + dest_mgr->buffer_height); + (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); } - /* Normal full image decode */ + /* Decompress a subregion */ + } else if (crop) { + JDIMENSION tmp; + + /* Check for valid crop dimensions. We cannot check these values until + * after jpeg_start_decompress() is called. + */ + if (crop_x + crop_width > cinfo.output_width || + crop_y + crop_height > cinfo.output_height) { + fprintf(stderr, "%s: crop dimensions exceed image dimensions %d x %d\n", + progname, cinfo.output_width, cinfo.output_height); + exit(EXIT_FAILURE); + } + + jpeg_crop_scanline(&cinfo, &crop_x, &crop_width); + ((ppm_dest_ptr) dest_mgr)->buffer_width = cinfo.output_width * + cinfo.out_color_components * + sizeof(JSAMPLE); + + /* Write output file header. This is a hack to ensure that the destination + * manager creates an output image of the proper size. + */ + tmp = cinfo.output_height; + cinfo.output_height = crop_height; + (*dest_mgr->start_output) (&cinfo, dest_mgr); + cinfo.output_height = tmp; + + /* Process data */ + jpeg_skip_scanlines(&cinfo, crop_y); + while (cinfo.output_scanline < crop_y + crop_height) { + num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, + dest_mgr->buffer_height); + (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + } + jpeg_skip_scanlines(&cinfo, cinfo.output_height - crop_y - crop_height); + + /* Normal full-image decompress */ } else { /* Write output file header */ (*dest_mgr->start_output) (&cinfo, dest_mgr); diff --git a/jdapimin.c b/jdapimin.c index 7cb3949d..f80a1466 100644 --- a/jdapimin.c +++ b/jdapimin.c @@ -3,8 +3,8 @@ * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1998, Thomas G. Lane. - * It was modified by The libjpeg-turbo Project to include only code relevant - * to libjpeg-turbo. + * libjpeg-turbo Modifications: + * Copyright (C) 2016, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -22,6 +22,7 @@ #define JPEG_INTERNALS #include "jinclude.h" #include "jpeglib.h" +#include "jdmaster.h" /* @@ -83,6 +84,14 @@ jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) /* OK, I'm ready */ cinfo->global_state = DSTATE_START; + + /* The master struct is used to store extension parameters, so we allocate it + * here. + */ + cinfo->master = (struct jpeg_decomp_master *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + sizeof(my_decomp_master)); + MEMZERO(cinfo->master, sizeof(my_decomp_master)); } diff --git a/jdapistd.c b/jdapistd.c index 2d00b199..06076cb7 100644 --- a/jdapistd.c +++ b/jdapistd.c @@ -140,6 +140,110 @@ output_pass_setup (j_decompress_ptr cinfo) } +/* + * Enable partial scanline decompression + * + * Must be called after jpeg_start_decompress() and before any calls to + * jpeg_read_scanlines() or jpeg_skip_scanlines(). + * + * Refer to libjpeg.txt for more information. + */ + +GLOBAL(void) +jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset, + JDIMENSION *width) +{ + int ci, align, orig_downsampled_width; + JDIMENSION input_xoffset; + boolean reinit_upsampler = FALSE; + jpeg_component_info *compptr; + + if (cinfo->global_state != DSTATE_SCANNING || cinfo->output_scanline != 0) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (!xoffset || !width) + ERREXIT(cinfo, JERR_BAD_CROP_SPEC); + + /* xoffset and width must fall within the output image dimensions. */ + if (*width == 0 || *xoffset + *width > cinfo->output_width) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + + /* No need to do anything if the caller wants the entire width. */ + if (*width == cinfo->output_width) + return; + + /* Ensuring the proper alignment of xoffset is tricky. At minimum, it + * must align with an MCU boundary, because: + * + * (1) The IDCT is performed in blocks, and it is not feasible to modify + * the algorithm so that it can transform partial blocks. + * (2) Because of the SIMD extensions, any input buffer passed to the + * upsampling and color conversion routines must be aligned to the + * SIMD word size (for instance, 128-bit in the case of SSE2.) The + * easiest way to accomplish this without copying data is to ensure + * that upsampling and color conversion begin at the start of the + * first MCU column that will be inverse transformed. + * + * In practice, we actually impose a stricter alignment requirement. We + * require that xoffset be a multiple of the maximum MCU column width of all + * of the components (the "iMCU column width.") This is to simplify the + * single-pass decompression case, allowing us to use the same MCU column + * width for all of the components. + */ + align = cinfo->min_DCT_scaled_size * cinfo->max_h_samp_factor; + + /* Adjust xoffset to the nearest iMCU boundary <= the requested value */ + input_xoffset = *xoffset; + *xoffset = (input_xoffset / align) * align; + + /* Adjust the width so that the right edge of the output image is as + * requested (only the left edge is altered.) It is important that calling + * programs check this value after this function returns, so that they can + * allocate an output buffer with the appropriate size. + */ + *width = *width + input_xoffset - *xoffset; + cinfo->output_width = *width; + + /* Set the first and last iMCU columns that we must decompress. These values + * will be used in single-scan decompressions. + */ + cinfo->master->first_iMCU_col = + (JDIMENSION) (long) (*xoffset) / (long) align; + cinfo->master->last_iMCU_col = + (JDIMENSION) jdiv_round_up((long) (*xoffset + cinfo->output_width), + (long) align) - 1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Set downsampled_width to the new output width. */ + orig_downsampled_width = compptr->downsampled_width; + compptr->downsampled_width = + (JDIMENSION) jdiv_round_up((long) (cinfo->output_width * + compptr->h_samp_factor), + (long) cinfo->max_h_samp_factor); + if (compptr->downsampled_width < 2 && orig_downsampled_width >= 2) + reinit_upsampler = TRUE; + + /* Set the first and last iMCU columns that we must decompress. These + * values will be used in multi-scan decompressions. + */ + cinfo->master->first_MCU_col[ci] = + (JDIMENSION) (long) (*xoffset * compptr->h_samp_factor) / + (long) align; + cinfo->master->last_MCU_col[ci] = + (JDIMENSION) jdiv_round_up((long) ((*xoffset + cinfo->output_width) * + compptr->h_samp_factor), + (long) align) - 1; + } + + if (reinit_upsampler) { + cinfo->master->jinit_upsampler_no_alloc = TRUE; + jinit_upsampler(cinfo); + cinfo->master->jinit_upsampler_no_alloc = FALSE; + } +} + + /* * Read some scanlines of data from the JPEG decompressor. * diff --git a/jdcoefct.c b/jdcoefct.c index b291da93..1a48969b 100644 --- a/jdcoefct.c +++ b/jdcoefct.c @@ -6,6 +6,7 @@ * libjpeg-turbo Modifications: * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2010, 2015-2016, D. R. Commander. + * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -108,38 +109,46 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) coef->MCU_ctr = MCU_col_num; return JPEG_SUSPENDED; } - /* Determine where data should go in output_buf and do the IDCT thing. - * We skip dummy blocks at the right and bottom edges (but blkn gets - * incremented past them!). Note the inner loop relies on having - * allocated the MCU_buffer[] blocks sequentially. + + /* Only perform the IDCT on blocks that are contained within the desired + * cropping region. */ - blkn = 0; /* index of current DCT block within MCU */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Don't bother to IDCT an uninteresting component. */ - if (! compptr->component_needed) { - blkn += compptr->MCU_blocks; - continue; - } - inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index]; - useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width - : compptr->last_col_width; - output_ptr = output_buf[compptr->component_index] + - yoffset * compptr->_DCT_scaled_size; - start_col = MCU_col_num * compptr->MCU_sample_width; - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { - if (cinfo->input_iMCU_row < last_iMCU_row || - yoffset+yindex < compptr->last_row_height) { - output_col = start_col; - for (xindex = 0; xindex < useful_width; xindex++) { - (*inverse_DCT) (cinfo, compptr, - (JCOEFPTR) coef->MCU_buffer[blkn+xindex], - output_ptr, output_col); - output_col += compptr->_DCT_scaled_size; - } + if (MCU_col_num >= cinfo->master->first_iMCU_col && + MCU_col_num <= cinfo->master->last_iMCU_col) { + /* Determine where data should go in output_buf and do the IDCT thing. + * We skip dummy blocks at the right and bottom edges (but blkn gets + * incremented past them!). Note the inner loop relies on having + * allocated the MCU_buffer[] blocks sequentially. + */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) { + blkn += compptr->MCU_blocks; + continue; + } + inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index]; + useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + output_ptr = output_buf[compptr->component_index] + + yoffset * compptr->_DCT_scaled_size; + start_col = (MCU_col_num - cinfo->master->first_iMCU_col) * + compptr->MCU_sample_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (cinfo->input_iMCU_row < last_iMCU_row || + yoffset+yindex < compptr->last_row_height) { + output_col = start_col; + for (xindex = 0; xindex < useful_width; xindex++) { + (*inverse_DCT) (cinfo, compptr, + (JCOEFPTR) coef->MCU_buffer[blkn+xindex], + output_ptr, output_col); + output_col += compptr->_DCT_scaled_size; + } + } + blkn += compptr->MCU_width; + output_ptr += compptr->_DCT_scaled_size; } - blkn += compptr->MCU_width; - output_ptr += compptr->_DCT_scaled_size; } } } @@ -294,9 +303,10 @@ decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) output_ptr = output_buf[ci]; /* Loop over all DCT blocks to be processed. */ for (block_row = 0; block_row < block_rows; block_row++) { - buffer_ptr = buffer[block_row]; + buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci]; output_col = 0; - for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) { + for (block_num = cinfo->master->first_MCU_col[ci]; + block_num <= cinfo->master->last_MCU_col[ci]; block_num++) { (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr, output_ptr, output_col); buffer_ptr++; @@ -482,7 +492,7 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) output_ptr = output_buf[ci]; /* Loop over all DCT blocks to be processed. */ for (block_row = 0; block_row < block_rows; block_row++) { - buffer_ptr = buffer[block_row]; + buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci]; if (first_row && block_row == 0) prev_block_row = buffer_ptr; else @@ -499,7 +509,8 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) DC7 = DC8 = DC9 = (int) next_block_row[0][0]; output_col = 0; last_block_column = compptr->width_in_blocks - 1; - for (block_num = 0; block_num <= last_block_column; block_num++) { + for (block_num = cinfo->master->first_MCU_col[ci]; + block_num <= cinfo->master->last_MCU_col[ci]; block_num++) { /* Fetch current DCT block into workspace so we can modify it. */ jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1); /* Update DC values */ diff --git a/jdinput.c b/jdinput.c index 23c4bf2d..32a6b424 100644 --- a/jdinput.c +++ b/jdinput.c @@ -4,7 +4,8 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: - * Copyright (C) 2010, D. R. Commander. + * Copyright (C) 2010, 2016, D. R. Commander. + * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -105,6 +106,11 @@ initial_setup (j_decompress_ptr cinfo) compptr->height_in_blocks = (JDIMENSION) jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, (long) (cinfo->max_v_samp_factor * DCTSIZE)); + /* Set the first and last MCU columns to decompress from multi-scan images. + * By default, decompress all of the MCU columns. + */ + cinfo->master->first_MCU_col[ci] = 0; + cinfo->master->last_MCU_col[ci] = compptr->width_in_blocks - 1; /* downsampled_width and downsampled_height will also be overridden by * jdmaster.c if we are doing full decompression. The transcoder library * doesn't use these values, but the calling application might. diff --git a/jdmaster.c b/jdmaster.c index 69b4f70c..7908849b 100644 --- a/jdmaster.c +++ b/jdmaster.c @@ -5,8 +5,9 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 2002-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: - * Copyright (C) 2009-2011, D. R. Commander. + * Copyright (C) 2009-2011, 2016, D. R. Commander. * Copyright (C) 2013, Linaro Limited. + * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -20,25 +21,7 @@ #include "jinclude.h" #include "jpeglib.h" #include "jpegcomp.h" - - -/* Private state */ - -typedef struct { - struct jpeg_decomp_master pub; /* public fields */ - - int pass_number; /* # of passes completed */ - - boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ - - /* Saved references to initialized quantizer modules, - * in case we need to switch modes. - */ - struct jpeg_color_quantizer *quantizer_1pass; - struct jpeg_color_quantizer *quantizer_2pass; -} my_decomp_master; - -typedef my_decomp_master *my_master_ptr; +#include "jdmaster.h" /* @@ -579,6 +562,12 @@ master_selection (j_decompress_ptr cinfo) /* Initialize input side of decompressor to consume first scan. */ (*cinfo->inputctl->start_input_pass) (cinfo); + /* Set the first and last iMCU columns to decompress from single-scan images. + * By default, decompress all of the iMCU columns. + */ + cinfo->master->first_iMCU_col = 0; + cinfo->master->last_iMCU_col = cinfo->MCUs_per_row - 1; + #ifdef D_MULTISCAN_FILES_SUPPORTED /* If jpeg_start_decompress will read the whole file, initialize * progress monitoring appropriately. The input step is counted @@ -723,16 +712,13 @@ jpeg_new_colormap (j_decompress_ptr cinfo) GLOBAL(void) jinit_master_decompress (j_decompress_ptr cinfo) { - my_master_ptr master; + my_master_ptr master = (my_master_ptr) cinfo->master; - master = (my_master_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - sizeof(my_decomp_master)); - cinfo->master = (struct jpeg_decomp_master *) master; master->pub.prepare_for_output_pass = prepare_for_output_pass; master->pub.finish_output_pass = finish_output_pass; master->pub.is_dummy_pass = FALSE; + master->pub.jinit_upsampler_no_alloc = FALSE; master_selection(cinfo); } diff --git a/jdmaster.h b/jdmaster.h new file mode 100644 index 00000000..76897e28 --- /dev/null +++ b/jdmaster.h @@ -0,0 +1,28 @@ +/* + * jdmaster.h + * + * This file was part of the Independent JPEG Group's software: + * Copyright (C) 1991-1995, Thomas G. Lane. + * For conditions of distribution and use, see the accompanying README.ijg + * file. + * + * This file contains the master control structure for the JPEG decompressor. + */ + +/* Private state */ + +typedef struct { + struct jpeg_decomp_master pub; /* public fields */ + + int pass_number; /* # of passes completed */ + + boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ + + /* Saved references to initialized quantizer modules, + * in case we need to switch modes. + */ + struct jpeg_color_quantizer *quantizer_1pass; + struct jpeg_color_quantizer *quantizer_2pass; +} my_decomp_master; + +typedef my_decomp_master *my_master_ptr; diff --git a/jdsample.c b/jdsample.c index 0eb56b7a..39b37250 100644 --- a/jdsample.c +++ b/jdsample.c @@ -7,6 +7,7 @@ * Copyright 2009 Pierre Ossman for Cendio AB * Copyright (C) 2010, 2015-2016, D. R. Commander. * Copyright (C) 2014, MIPS Technologies, Inc., California + * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -373,13 +374,16 @@ jinit_upsampler (j_decompress_ptr cinfo) boolean need_buffer, do_fancy; int h_in_group, v_in_group, h_out_group, v_out_group; - upsample = (my_upsample_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - sizeof(my_upsampler)); - cinfo->upsample = (struct jpeg_upsampler *) upsample; - upsample->pub.start_pass = start_pass_upsample; - upsample->pub.upsample = sep_upsample; - upsample->pub.need_context_rows = FALSE; /* until we find out differently */ + if (!cinfo->master->jinit_upsampler_no_alloc) { + upsample = (my_upsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + sizeof(my_upsampler)); + cinfo->upsample = (struct jpeg_upsampler *) upsample; + upsample->pub.start_pass = start_pass_upsample; + upsample->pub.upsample = sep_upsample; + upsample->pub.need_context_rows = FALSE; /* until we find out differently */ + } else + upsample = (my_upsample_ptr) cinfo->upsample; if (cinfo->CCIR601_sampling) /* this isn't supported */ ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); @@ -455,7 +459,7 @@ jinit_upsampler (j_decompress_ptr cinfo) upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); } else ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); - if (need_buffer) { + if (need_buffer && !cinfo->master->jinit_upsampler_no_alloc) { upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) jround_up((long) cinfo->output_width, diff --git a/jpegint.h b/jpegint.h index 1ad07ee4..c3b4320f 100644 --- a/jpegint.h +++ b/jpegint.h @@ -5,7 +5,8 @@ * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 1997-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: - * Copyright (C) 2015, D. R. Commander + * Copyright (C) 2015-2016, D. R. Commander + * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -150,6 +151,13 @@ struct jpeg_decomp_master { /* State variables made visible to other modules */ boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ + + /* Partial decompression variables */ + JDIMENSION first_iMCU_col; + JDIMENSION last_iMCU_col; + JDIMENSION first_MCU_col[MAX_COMPS_IN_SCAN]; + JDIMENSION last_MCU_col[MAX_COMPS_IN_SCAN]; + boolean jinit_upsampler_no_alloc; }; /* Input control module */ diff --git a/jpeglib.h b/jpeglib.h index 01b4c3dc..6c63f582 100644 --- a/jpeglib.h +++ b/jpeglib.h @@ -5,7 +5,7 @@ * Copyright (C) 1991-1998, Thomas G. Lane. * Modified 2002-2009 by Guido Vollbeding. * libjpeg-turbo Modifications: - * Copyright (C) 2009-2011, 2013-2014, D. R. Commander. + * Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ijg * file. @@ -995,6 +995,8 @@ EXTERN(JDIMENSION) jpeg_read_scanlines (j_decompress_ptr cinfo, JDIMENSION max_lines); EXTERN(JDIMENSION) jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines); +EXTERN(void) jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset, + JDIMENSION *width); EXTERN(boolean) jpeg_finish_decompress (j_decompress_ptr cinfo); /* Replaces jpeg_read_scanlines when reading raw downsampled data. */ diff --git a/jversion.h b/jversion.h index b5ca9803..6ce663d8 100644 --- a/jversion.h +++ b/jversion.h @@ -38,6 +38,7 @@ #define JCOPYRIGHT "Copyright (C) 2009-2016 D. R. Commander\n" \ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \ "Copyright (C) 2015-2016 Matthieu Darbois\n" \ + "Copyright (C) 2015 Google, Inc.\n" \ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \ "Copyright (C) 2013 Linaro Limited\n" \ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ diff --git a/libjpeg.txt b/libjpeg.txt index da577ef7..71d37c61 100644 --- a/libjpeg.txt +++ b/libjpeg.txt @@ -3,7 +3,7 @@ USING THE IJG JPEG LIBRARY This file was part of the Independent JPEG Group's software: Copyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding. libjpeg-turbo Modifications: -Copyright (C) 2010, 2014, 2015, D. R. Commander. +Copyright (C) 2010, 2014-2016, D. R. Commander. Copyright (C) 2015, Google, Inc. For conditions of distribution and use, see the accompanying README.ijg file. @@ -730,16 +730,21 @@ jpeg_abort_decompress() or jpeg_abort() if you want to reuse the object. The previous discussion of aborting compression cycles applies here too. -Skipping rows when decompressing --------------------------------- +Partial image decompression +--------------------------- -jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines); +Partial image decompression is convenient for performance-critical applications +that wish to view only a portion of a large JPEG image without decompressing +the whole thing. It it also useful in memory-constrained environments (such as +on mobile devices.) This library provides the following functions to support +partial image decompression: + +1. Skipping rows when decompressing + + jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines); This function provides application programmers with the ability to skip over -multiple rows in the JPEG image, thus decoding only a subset of the image data. -This is convenient for performance-critical applications that wish to view only -a portion of a large JPEG image without decompressing the whole thing. It it -also useful in memory-constrained environments (such as on mobile devices.) +multiple rows in the JPEG image. Suspending data sources are not supported by this function. Calling jpeg_skip_scanlines() with a suspending data source will result in undefined @@ -772,6 +777,43 @@ These issues are especially tricky for cases in which upsampling requires context rows. In the worst case, jpeg_skip_scanlines() will perform similarly to jpeg_read_scanlines() (since it will actually call jpeg_read_scanlines().) +2. Decompressing partial scanlines + + jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset, + JDIMENSION *width) + +This function provides application programmers with the ability to decompress +only a portion of each row in the JPEG image. It must be called after +jpeg_start_decompress() and before any calls to jpeg_read_scanlines() or +jpeg_skip_scanlines(). + +If xoffset and width do not form a valid subset of the image row, then this +function will generate an error. Note that if the output image is scaled, then +xoffset and width are relative to the scaled image dimensions. + +xoffset and width are passed by reference because xoffset must fall on an iMCU +boundary. If it doesn't, then it will be moved left to the nearest iMCU +boundary, and width will be increased accordingly. If the calling program does +not like the adjusted values of xoffset and width, then it can call +jpeg_crop_scanline() again with new values (for instance, if it wants to move +xoffset to the nearest iMCU boundary to the right instead of to the left.) + +After calling this function, cinfo->output_width will be set to the adjusted +width. This value should be used when allocating an output buffer to pass to +jpeg_read_scanlines(). + +The output image from a partial-width decompression will be identical to the +corresponding image region from a full decode, with one exception: The "fancy" +(smooth) h2v2 (4:2:0) and h2v1 (4:2:2) upsampling algorithms fill in the +missing chroma components by averaging the chroma components from neighboring +pixels, except on the right and left edges of the image (where there are no +neighboring pixels.) When performing a partial-width decompression, these +"fancy" upsampling algorithms may treat the left and right edges of the partial +image region as if they are the left and right edges of the image, meaning that +the upsampling algorithm may be simplified. The result is that the pixels on +the left or right edge of the partial image may not be exactly identical to the +corresponding pixels in the original image. + Mechanics of usage: include files, linking, etc ----------------------------------------------- diff --git a/win/jpeg62-memsrcdst.def b/win/jpeg62-memsrcdst.def index 949d2679..6499316a 100755 --- a/win/jpeg62-memsrcdst.def +++ b/win/jpeg62-memsrcdst.def @@ -103,3 +103,4 @@ EXPORTS jpeg_mem_dest @ 102 ; jpeg_mem_src @ 103 ; jpeg_skip_scanlines @ 104 ; + jpeg_crop_scanline @ 105 ; diff --git a/win/jpeg62.def b/win/jpeg62.def index c64df50a..9f30b1a2 100755 --- a/win/jpeg62.def +++ b/win/jpeg62.def @@ -101,3 +101,4 @@ EXPORTS jround_up @ 100 ; jzero_far @ 101 ; jpeg_skip_scanlines @ 102 ; + jpeg_crop_scanline @ 103 ; diff --git a/win/jpeg7.def b/win/jpeg7.def index 8daa35f9..92463c51 100644 --- a/win/jpeg7.def +++ b/win/jpeg7.def @@ -103,3 +103,4 @@ EXPORTS jround_up @ 102 ; jzero_far @ 103 ; jpeg_skip_scanlines @ 104 ; + jpeg_crop_scanline @ 105 ; diff --git a/win/jpeg8.def b/win/jpeg8.def index 01deb69f..19246ac9 100644 --- a/win/jpeg8.def +++ b/win/jpeg8.def @@ -106,3 +106,4 @@ EXPORTS jround_up @ 105 ; jzero_far @ 106 ; jpeg_skip_scanlines @ 107 ; + jpeg_crop_scanline @ 108 ; diff --git a/wrppm.c b/wrppm.c index 7d13e2db..40fbf1fc 100644 --- a/wrppm.c +++ b/wrppm.c @@ -20,6 +20,7 @@ */ #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ +#include "wrppm.h" #ifdef PPM_SUPPORTED @@ -62,21 +63,6 @@ */ -/* Private version of data destination object */ - -typedef struct { - struct djpeg_dest_struct pub; /* public fields */ - - /* Usually these two pointers point to the same place: */ - char *iobuffer; /* fwrite's I/O buffer */ - JSAMPROW pixrow; /* decompressor output buffer */ - size_t buffer_width; /* width of I/O buffer */ - JDIMENSION samples_per_row; /* JSAMPLEs per output row */ -} ppm_dest_struct; - -typedef ppm_dest_struct *ppm_dest_ptr; - - /* * Write some pixel data. * In this module rows_supplied will always be 1. diff --git a/wrppm.h b/wrppm.h new file mode 100644 index 00000000..aa6c5626 --- /dev/null +++ b/wrppm.h @@ -0,0 +1,26 @@ +/* + * wrppm.h + * + * This file was part of the Independent JPEG Group's software: + * Copyright (C) 1994, Thomas G. Lane. + * For conditions of distribution and use, see the accompanying README.ijg + * file. + */ + +#ifdef PPM_SUPPORTED + +/* Private version of data destination object */ + +typedef struct { + struct djpeg_dest_struct pub; /* public fields */ + + /* Usually these two pointers point to the same place: */ + char *iobuffer; /* fwrite's I/O buffer */ + JSAMPROW pixrow; /* decompressor output buffer */ + size_t buffer_width; /* width of I/O buffer */ + JDIMENSION samples_per_row; /* JSAMPLEs per output row */ +} ppm_dest_struct; + +typedef ppm_dest_struct *ppm_dest_ptr; + +#endif From 025c1f66de6487eb604297f38364410411acaf77 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 22 Feb 2016 10:00:19 -0600 Subject: [PATCH 124/140] Fix v7/v8-compatible build Broken by 3ab68cf563f6edc2608c085f5c8b2d5d5c61157e Fixes #60 --- jdapistd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdapistd.c b/jdapistd.c index 06076cb7..37afc844 100644 --- a/jdapistd.c +++ b/jdapistd.c @@ -190,7 +190,7 @@ jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset, * single-pass decompression case, allowing us to use the same MCU column * width for all of the components. */ - align = cinfo->min_DCT_scaled_size * cinfo->max_h_samp_factor; + align = cinfo->_min_DCT_scaled_size * cinfo->max_h_samp_factor; /* Adjust xoffset to the nearest iMCU boundary <= the requested value */ input_xoffset = *xoffset; From 2354810a431c8f7702b55040fe1a7d880973a1b0 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 29 Feb 2016 11:12:44 -0600 Subject: [PATCH 125/140] 1.5 beta1 --- CMakeLists.txt | 2 +- ChangeLog.txt | 4 ++-- configure.ac | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f190437..bfb7661a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ if(POLICY CMP0022) endif() project(libjpeg-turbo C) -set(VERSION 1.4.80) +set(VERSION 1.4.90) if(CYGWIN OR NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8adad4b6..7d1372cb 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,5 @@ -1.5 pre-beta -============ +1.5 beta1 +========= [1] Added full SIMD acceleration for PowerPC platforms using AltiVec VMX (128-bit SIMD) instructions. Although the performance of libjpeg-turbo on diff --git a/configure.ac b/configure.ac index 8ef35c10..d6a3e33e 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.56]) -AC_INIT([libjpeg-turbo], [1.4.80]) +AC_INIT([libjpeg-turbo], [1.4.90]) AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2]) AC_PREFIX_DEFAULT(/opt/libjpeg-turbo) From fa722636bec32eb88b7476e626f71292a5ac27a5 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 29 Feb 2016 12:06:33 -0600 Subject: [PATCH 126/140] ChangeLog: Mention jpeg_crop_scanline() function --- ChangeLog.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 7d1372cb..4062c698 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -8,8 +8,9 @@ to the compiler vs. x86, it was still possible to speed up compression by about 3-4x and decompression by about 2-2.5x (relative to libjpeg v6b) through the use of AltiVec instructions. -[2] Added a new libjpeg API function (jpeg_skip_scanlines()) that can be used -to partially decode a JPEG image. See libjpeg.txt for more details. +[2] Added two new libjpeg API functions (jpeg_skip_scanlines() and +jpeg_crop_scanline()) that can be used to partially decode a JPEG image. See +libjpeg.txt for more details. [3] The TJCompressor and TJDecompressor classes in the TurboJPEG Java API now implement the Closeable interface, so those classes can be used with a From 7c202f76e7fda45c9ab7d7680046c0304a8fb2ad Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 29 Feb 2016 13:18:01 -0600 Subject: [PATCH 127/140] Bump TurboJPEG C API revision to 1.5 The changes relative to 1.4.x are only cosmetic (using const pointers) and should not affect API/ABI compatibility, but our practice is to synchronize the API revision with the most recent release that provides user-visible changes to the API. --- doc/html/annotated.html | 2 +- doc/html/classes.html | 2 +- doc/html/functions.html | 2 +- doc/html/functions_vars.html | 2 +- doc/html/group___turbo_j_p_e_g.html | 2 +- doc/html/index.html | 2 +- doc/html/modules.html | 2 +- doc/html/structtjregion.html | 2 +- doc/html/structtjscalingfactor.html | 2 +- doc/html/structtjtransform.html | 2 +- doxygen.config | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/html/annotated.html b/doc/html/annotated.html index dad0fb16..d0b0e1eb 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doc/html/classes.html b/doc/html/classes.html index 7720c671..275e96d6 100644 --- a/doc/html/classes.html +++ b/doc/html/classes.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doc/html/functions.html b/doc/html/functions.html index b13faed8..31d78f56 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html index cca5603f..8373eace 100644 --- a/doc/html/functions_vars.html +++ b/doc/html/functions_vars.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doc/html/group___turbo_j_p_e_g.html b/doc/html/group___turbo_j_p_e_g.html index 553ec92f..4b8d306e 100644 --- a/doc/html/group___turbo_j_p_e_g.html +++ b/doc/html/group___turbo_j_p_e_g.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doc/html/index.html b/doc/html/index.html index ccaa12e4..3cc1b3e2 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doc/html/modules.html b/doc/html/modules.html index 9b41adbd..8e6f815f 100644 --- a/doc/html/modules.html +++ b/doc/html/modules.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doc/html/structtjregion.html b/doc/html/structtjregion.html index d22c09ed..af2a473f 100644 --- a/doc/html/structtjregion.html +++ b/doc/html/structtjregion.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doc/html/structtjscalingfactor.html b/doc/html/structtjscalingfactor.html index f7b7c84f..3bb50f5f 100644 --- a/doc/html/structtjscalingfactor.html +++ b/doc/html/structtjscalingfactor.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doc/html/structtjtransform.html b/doc/html/structtjtransform.html index 3bfd1291..9fd97f7b 100644 --- a/doc/html/structtjtransform.html +++ b/doc/html/structtjtransform.html @@ -24,7 +24,7 @@
        TurboJPEG -  1.4 +  1.5
        diff --git a/doxygen.config b/doxygen.config index 4ffba681..17231237 100644 --- a/doxygen.config +++ b/doxygen.config @@ -1,5 +1,5 @@ PROJECT_NAME = TurboJPEG -PROJECT_NUMBER = 1.4 +PROJECT_NUMBER = 1.5 OUTPUT_DIRECTORY = doc/ USE_WINDOWS_ENCODING = NO OPTIMIZE_OUTPUT_FOR_C = YES From 056536f6605596d0246fd2b75a1ada2ac03b5bbe Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 29 Feb 2016 17:21:02 -0600 Subject: [PATCH 128/140] Win/x64: Fix improper callee save of xmm8-xmm11 The x86-64 SIMD accelerations for Huffman encoding used incorrect stack math to save xmm8-xmm11 on Windows. This caused TJBench to always report 1 Mpixel/sec for the compression performance, and it likely would have caused other application issues as well. --- simd/jchuff-sse2-64.asm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/simd/jchuff-sse2-64.asm b/simd/jchuff-sse2-64.asm index d22efc36..84eaeebf 100644 --- a/simd/jchuff-sse2-64.asm +++ b/simd/jchuff-sse2-64.asm @@ -196,11 +196,11 @@ EXTN(jsimd_huff_encode_one_block_sse2): lea rsp, [t2] collect_args %ifdef WIN64 - sub rsp, 4*SIZEOF_XMMWORD - movaps XMMWORD [rsp-3*SIZEOF_XMMWORD], xmm8 + movaps XMMWORD [rsp-1*SIZEOF_XMMWORD], xmm8 movaps XMMWORD [rsp-2*SIZEOF_XMMWORD], xmm9 - movaps XMMWORD [rsp-1*SIZEOF_XMMWORD], xmm10 - movaps XMMWORD [rsp-0*SIZEOF_XMMWORD], xmm11 + movaps XMMWORD [rsp-3*SIZEOF_XMMWORD], xmm10 + movaps XMMWORD [rsp-4*SIZEOF_XMMWORD], xmm11 + sub rsp, 4*SIZEOF_XMMWORD %endif push rbx @@ -344,10 +344,10 @@ EXTN(jsimd_huff_encode_one_block_sse2): pop rbx %ifdef WIN64 - movaps xmm8, XMMWORD [rsp-3*SIZEOF_XMMWORD] - movaps xmm9, XMMWORD [rsp-2*SIZEOF_XMMWORD] - movaps xmm10, XMMWORD [rsp-1*SIZEOF_XMMWORD] - movaps xmm11, XMMWORD [rsp-0*SIZEOF_XMMWORD] + movaps xmm11, XMMWORD [rsp+0*SIZEOF_XMMWORD] + movaps xmm10, XMMWORD [rsp+1*SIZEOF_XMMWORD] + movaps xmm9, XMMWORD [rsp+2*SIZEOF_XMMWORD] + movaps xmm8, XMMWORD [rsp+3*SIZEOF_XMMWORD] add rsp, 4*SIZEOF_XMMWORD %endif uncollect_args From 7cb8de4ae0a21257ced2e4f34cb0e884f18b6bd0 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 2 Mar 2016 09:53:11 -0600 Subject: [PATCH 129/140] Java: Fix parallel make with autotools Running 'make -j{jobs}' on a build that was configured with Java (--with-java) would previously cause an error: make: *** No rule to make target `TJExample.class', needed by `turbojpeg.jar'. It seems that parallel make doesn't understand that the files in $(JAVA_CLASSES) are all generated from the same invocation of javac, so it tries to parallelize the building of those files (which of course doesn't work.) This patch instead makes turbojpeg.jar depend on classnoinst.stamp. This effectively creates a synchronization fence, since that file is only created when all of the class files have been built. Fixes #62 --- java/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/Makefile.am b/java/Makefile.am index 475dd3fe..d3fc59c7 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -44,7 +44,7 @@ JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \ all: all-am turbojpeg.jar -turbojpeg.jar: $(JAVA_CLASSES) ${srcdir}/MANIFEST.MF +turbojpeg.jar: classnoinst.stamp ${srcdir}/MANIFEST.MF $(JAR) cfm turbojpeg.jar ${srcdir}/MANIFEST.MF $(JAVA_CLASSES) clean-local: From 622d6678a84795769b406faa8ed5b929276256dc Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 6 Mar 2016 08:34:48 -0600 Subject: [PATCH 130/140] ChangeLog: "1.5 beta1" --> "1.4.90 (1.5 beta1)" (for consistency with other beta release headings) --- ChangeLog.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 68df4c38..29352e4e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -5,8 +5,8 @@ path" of libjpeg-turbo's Huffman decoder to read from uninitialized memory. -1.5 beta1 -========= +1.4.90 (1.5 beta1) +================== [1] Added full SIMD acceleration for PowerPC platforms using AltiVec VMX (128-bit SIMD) instructions. Although the performance of libjpeg-turbo on From 4f58123130e7485e882e26cd6da19bb6eabea490 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 9 Mar 2016 17:23:45 -0600 Subject: [PATCH 131/140] BUILDING.md and README.md: Cosmetic tweaks --- BUILDING.md | 100 +++++++++++++++++++++++++--------------------------- README.md | 22 ++++++------ 2 files changed, 59 insertions(+), 63 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 727d728f..b4da23f2 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -6,9 +6,7 @@ Build Requirements ------------------ - autoconf 2.56 or later - - automake 1.7 or later - - libtool 1.4 or later * If using Xcode 4.3 or later on OS X, autoconf and automake are no longer provided. The easiest way to obtain them is from @@ -28,7 +26,7 @@ Build Requirements easily build and install NASM from a source RPM by downloading one of the SRPMs from - http://www.nasm.us/pub/nasm/releasebuilds + and executing the following as root: @@ -44,9 +42,9 @@ Build Requirements required. Some systems, such as Solaris 10 and later and Red Hat Enterprise Linux 5 and later, have this pre-installed. On OS X 10.5 and 10.6, it will be necessary to install the Java Developer Package, which can be downloaded - from http://developer.apple.com/downloads (Apple ID required.) For other + from (Apple ID required.) For other systems, you can obtain the Oracle Java Development Kit from - http://www.java.com. + . Out-of-Tree Builds @@ -81,38 +79,38 @@ libjpeg-turbo from one of the official release tarballs. This will generate the following files under .libs/: -**libjpeg.a** +**libjpeg.a** Static link library for the libjpeg API -**libjpeg.so.{version}** (Linux, Unix) -**libjpeg.{version}.dylib** (OS X) -**cygjpeg-{version}.dll** (Cygwin) +**libjpeg.so.{version}** (Linux, Unix) +**libjpeg.{version}.dylib** (OS X) +**cygjpeg-{version}.dll** (Cygwin) Shared library for the libjpeg API By default, *{version}* is 62.1.0, 7.1.0, or 8.0.2, depending on whether libjpeg v6b (default), v7, or v8 emulation is enabled. If using Cygwin, *{version}* is 62, 7, or 8. -**libjpeg.so** (Linux, Unix) -**libjpeg.dylib** (OS X) +**libjpeg.so** (Linux, Unix) +**libjpeg.dylib** (OS X) Development symlink for the libjpeg API -**libjpeg.dll.a** (Cygwin) +**libjpeg.dll.a** (Cygwin) Import library for the libjpeg API -**libturbojpeg.a** +**libturbojpeg.a** Static link library for the TurboJPEG API -**libturbojpeg.so.0.1.0** (Linux, Unix) -**libturbojpeg.0.1.0.dylib** (OS X) -**cygturbojpeg-0.dll** (Cygwin) +**libturbojpeg.so.0.1.0** (Linux, Unix) +**libturbojpeg.0.1.0.dylib** (OS X) +**cygturbojpeg-0.dll** (Cygwin) Shared library for the TurboJPEG API -**libturbojpeg.so** (Linux, Unix) -**libturbojpeg.dylib** (OS X) +**libturbojpeg.so** (Linux, Unix) +**libturbojpeg.dylib** (OS X) Development symlink for the TurboJPEG API -**libturbojpeg.dll.a** (Cygwin) +**libturbojpeg.dll.a** (Cygwin) Import library for the TurboJPEG API @@ -325,7 +323,7 @@ Set the following shell variables for simplicity: IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 - *ARMv6 (code will run on all iOS devices, not SIMD-accelerated)* + *ARMv6 (code will run on all iOS devices, not SIMD-accelerated)* [NOTE: Requires Xcode 4.4.x or earlier] IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp" @@ -334,7 +332,7 @@ Set the following shell variables for simplicity: IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon" - *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)* + *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)* [NOTE: Requires Xcode 4.5 or later] IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon" @@ -407,9 +405,9 @@ into a universal library. ### Building libjpeg-turbo for Android -Building libjpeg-turbo for Android platforms requires the Android NDK -(https://developer.android.com/tools/sdk/ndk) and autotools. The following is -a general recipe script that can be modified for your specific needs. +Building libjpeg-turbo for Android platforms requires the +{Android NDK}(https://developer.android.com/tools/sdk/ndk) +and autotools. The following is a general recipe script that can be modified for your specific needs. # Set these variables to suit your needs NDK_PATH={full path to the "ndk" directory-- for example, /opt/android/ndk} @@ -465,16 +463,14 @@ Build Requirements - Microsoft Visual C++ 2005 or later If you don't already have Visual C++, then the easiest way to get it is by - installing the Windows SDK: - - http://msdn.microsoft.com/en-us/windows/bb980924.aspx - + installing the + [Windows SDK](http://msdn.microsoft.com/en-us/windows/bb980924.aspx). The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and everything necessary to build libjpeg-turbo. - * You can also use Microsoft Visual Studio Express Edition, which is a free - download. (NOTE: versions prior to 2012 can only be used to build 32-bit - code.) + * You can also use Microsoft Visual Studio Express/Community Edition, which + is a free download. (NOTE: versions prior to 2012 can only be used to + build 32-bit code.) * If you intend to build libjpeg-turbo from the command line, then add the appropriate compiler and SDK directories to the `INCLUDE`, `LIB`, and `PATH` environment variables. This is generally accomplished by @@ -488,8 +484,8 @@ Build Requirements - MinGW - MinGW-builds (http://sourceforge.net/projects/mingwbuilds/) or - tdm-gcc (http://tdm-gcc.tdragon.net/) recommended if building on a Windows + [MinGW-builds](http://sourceforge.net/projects/mingwbuilds/) or + [tdm-gcc](http://tdm-gcc.tdragon.net/) recommended if building on a Windows machine. Both distributions install a Start Menu link that can be used to launch a command prompt with the appropriate compiler paths automatically set. @@ -498,7 +494,7 @@ Build Requirements a 64-bit build) - If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This - can be downloaded from http://www.java.com. + can be downloaded from . Out-of-Tree Builds @@ -529,22 +525,22 @@ on which version of cl.exe is in the `PATH`. The following files will be generated under *{build_directory}*: -**jpeg-static.lib** +**jpeg-static.lib** Static link library for the libjpeg API -**sharedlib/jpeg{version}.dll** +**sharedlib/jpeg{version}.dll** DLL for the libjpeg API -**sharedlib/jpeg.lib** +**sharedlib/jpeg.lib** Import library for the libjpeg API -**turbojpeg-static.lib** +**turbojpeg-static.lib** Static link library for the TurboJPEG API -**turbojpeg.dll** +**turbojpeg.dll** DLL for the TurboJPEG API -**turbojpeg.lib** +**turbojpeg.lib** Import library for the TurboJPEG API *{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or @@ -571,22 +567,22 @@ build of libjpeg-turbo. This will generate the following files under *{build_directory}*: -**{configuration}/jpeg-static.lib** +**{configuration}/jpeg-static.lib** Static link library for the libjpeg API -**sharedlib/{configuration}/jpeg{version}.dll** +**sharedlib/{configuration}/jpeg{version}.dll** DLL for the libjpeg API -**sharedlib/{configuration}/jpeg.lib** +**sharedlib/{configuration}/jpeg.lib** Import library for the libjpeg API -**{configuration}/turbojpeg-static.lib** +**{configuration}/turbojpeg-static.lib** Static link library for the TurboJPEG API -**{configuration}/turbojpeg.dll** +**{configuration}/turbojpeg.dll** DLL for the TurboJPEG API -**{configuration}/turbojpeg.lib** +**{configuration}/turbojpeg.lib** Import library for the TurboJPEG API *{configuration}* is Debug, Release, RelWithDebInfo, or MinSizeRel, depending @@ -605,22 +601,22 @@ cross-compiling on a Linux/Unix machine, then see "Build Recipes" below. This will generate the following files under *{build_directory}*: -**libjpeg.a** +**libjpeg.a** Static link library for the libjpeg API -**sharedlib/libjpeg-{version}.dll** +**sharedlib/libjpeg-{version}.dll** DLL for the libjpeg API -**sharedlib/libjpeg.dll.a** +**sharedlib/libjpeg.dll.a** Import library for the libjpeg API -**libturbojpeg.a** +**libturbojpeg.a** Static link library for the TurboJPEG API -**libturbojpeg.dll** +**libturbojpeg.dll** DLL for the TurboJPEG API -**libturbojpeg.dll.a** +**libturbojpeg.dll.a** Import library for the TurboJPEG API *{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or diff --git a/README.md b/README.md index ad614ca6..035022c3 100755 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Using libjpeg-turbo libjpeg-turbo includes two APIs that can be used to compress and decompress JPEG images: -- **TurboJPEG API** +- **TurboJPEG API** This API provides an easy-to-use interface for compressing and decompressing JPEG images in memory. It also provides some functionality that would not be straightforward to achieve using the underlying libjpeg API, such as @@ -44,7 +44,7 @@ JPEG images: transforms on an image. The Java interface for libjpeg-turbo is written on top of the TurboJPEG API. -- **libjpeg API** +- **libjpeg API** This is the de facto industry-standard API for compressing and decompressing JPEG images. It is more difficult to use than the TurboJPEG API but also more powerful. The libjpeg API implementation in libjpeg-turbo is both @@ -135,17 +135,17 @@ which aren't. #### Fully supported -- **libjpeg: IDCT scaling extensions in decompressor** +- **libjpeg: IDCT scaling extensions in decompressor** libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8, 1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4 and 1/2 are SIMD-accelerated.) - **libjpeg: Arithmetic coding** -- **libjpeg: In-memory source and destination managers** +- **libjpeg: In-memory source and destination managers** See notes below. -- **cjpeg: Separate quality settings for luminance and chrominance** +- **cjpeg: Separate quality settings for luminance and chrominance** Note that the libpjeg v7+ API was extended to accommodate this feature only for convenience purposes. It has always been possible to implement this feature with libjpeg v6b (see rdswitch.c for an example.) @@ -170,18 +170,18 @@ which aren't. NOTE: As of this writing, extensive research has been conducted into the usefulness of DCT scaling as a means of data reduction and SmartScale as a means of quality improvement. The reader is invited to peruse the research at -http://www.libjpeg-turbo.org/About/SmartScale and draw his/her own conclusions, + and draw his/her own conclusions, but it is the general belief of our project that these features have not demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo. -- **libjpeg: DCT scaling in compressor** +- **libjpeg: DCT scaling in compressor** `cinfo.scale_num` and `cinfo.scale_denom` are silently ignored. There is no technical reason why DCT scaling could not be supported when emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and 8/9 would be available, which is of limited usefulness. -- **libjpeg: SmartScale** +- **libjpeg: SmartScale** `cinfo.block_size` is silently ignored. SmartScale is an extension to the JPEG format that allows for DCT block sizes other than 8x8. Providing support for this new format would be @@ -194,15 +194,15 @@ demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo. interest in providing this feature would be as a means of supporting additional DCT scaling factors. -- **libjpeg: Fancy downsampling in compressor** +- **libjpeg: Fancy downsampling in compressor** `cinfo.do_fancy_downsampling` is silently ignored. This requires the DCT scaling feature, which is not supported. -- **jpegtran: Scaling** +- **jpegtran: Scaling** This requires both the DCT scaling and SmartScale features, which are not supported. -- **Lossless RGB JPEG files** +- **Lossless RGB JPEG files** This requires the SmartScale feature, which is not supported. ### What About libjpeg v9? From e5f280c4c4821d50012de3429a67971cdd72bd7d Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 11 Mar 2016 11:14:28 -0600 Subject: [PATCH 132/140] README.md: Link to BUILDING.md Addresses a concern expressed in #56 and #58. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 035022c3..ca8866e0 100755 --- a/README.md +++ b/README.md @@ -30,6 +30,12 @@ libjpeg-turbo is covered by three compatible BSD-style open source licenses. Refer to [LICENSE.md](LICENSE.md) for a roll-up of license terms. +Building libjpeg-turbo +====================== + +Refer to [BUILDING.md](BUILDING.md) for complete instructions. + + Using libjpeg-turbo =================== From 3f56bd597c874a4bbc4e86a9311952bdf99bbb32 Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 13 Mar 2016 12:36:06 -0500 Subject: [PATCH 133/140] Rename ChangeLog.txt ... in preparation for creating a MarkDown version (Git will not preserve history unless you rename the file prior to modifying it.) --- ChangeLog.txt => ChangeLog.md | 0 Makefile.am | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename ChangeLog.txt => ChangeLog.md (100%) diff --git a/ChangeLog.txt b/ChangeLog.md similarity index 100% rename from ChangeLog.txt rename to ChangeLog.md diff --git a/Makefile.am b/Makefile.am index b29edde7..80f00598 100644 --- a/Makefile.am +++ b/Makefile.am @@ -158,7 +158,7 @@ jcstest_LDADD = libjpeg.la dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 DOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.md \ - ChangeLog.txt + ChangeLog.md dist_doc_DATA = README.ijg README.md libjpeg.txt structure.txt usage.txt \ wizard.txt LICENSE.md From a839a7a9641e527d66fca93ab2a55124271c0425 Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 13 Mar 2016 16:24:48 -0500 Subject: [PATCH 134/140] Markdown version of ChangeLog.txt This will make it easier to crib ChangeLog information into release notes, since both SourceForge and GitHub support MD. --- ChangeLog.md | 619 +++++++++++++++++++++++++++------------------------ 1 file changed, 331 insertions(+), 288 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 29352e4e..4fbcc0a6 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,53 +1,58 @@ 1.5.0 ===== -[1] Fixed an issue whereby a malformed motion-JPEG frame could cause the "fast +### Significant changes relative to 1.5 beta1: + +1. Fixed an issue whereby a malformed motion-JPEG frame could cause the "fast path" of libjpeg-turbo's Huffman decoder to read from uninitialized memory. 1.4.90 (1.5 beta1) ================== -[1] Added full SIMD acceleration for PowerPC platforms using AltiVec VMX +### Significant changes relative to 1.4.2: + +1. Added full SIMD acceleration for PowerPC platforms using AltiVec VMX (128-bit SIMD) instructions. Although the performance of libjpeg-turbo on PowerPC was already good, due to the increased number of registers available to the compiler vs. x86, it was still possible to speed up compression by about 3-4x and decompression by about 2-2.5x (relative to libjpeg v6b) through the use of AltiVec instructions. -[2] Added two new libjpeg API functions (jpeg_skip_scanlines() and -jpeg_crop_scanline()) that can be used to partially decode a JPEG image. See -libjpeg.txt for more details. +2. Added two new libjpeg API functions (`jpeg_skip_scanlines()` and +`jpeg_crop_scanline()`) that can be used to partially decode a JPEG image. See +[libjpeg.txt](libjpeg.txt) for more details. -[3] The TJCompressor and TJDecompressor classes in the TurboJPEG Java API now +3. The TJCompressor and TJDecompressor classes in the TurboJPEG Java API now implement the Closeable interface, so those classes can be used with a try-with-resources statement. -[4] The TurboJPEG Java classes now throw unchecked idiomatic exceptions +4. The TurboJPEG Java classes now throw unchecked idiomatic exceptions (IllegalArgumentException, IllegalStateException) for unrecoverable errors caused by incorrect API usage, and those classes throw a new checked exception type (TJException) for errors that are passed through from the C library. -[5] Source buffers for the TurboJPEG C API functions, as well as the -jpeg_mem_src() function in the libjpeg API, are now declared as const pointers. -This facilitates passing read-only buffers to those functions and ensures the -caller that the source buffer will not be modified. This should not create any -backward API or ABI incompatibilities with prior libjpeg-turbo releases. +5. Source buffers for the TurboJPEG C API functions, as well as the +`jpeg_mem_src()` function in the libjpeg API, are now declared as const +pointers. This facilitates passing read-only buffers to those functions and +ensures the caller that the source buffer will not be modified. This should +not create any backward API or ABI incompatibilities with prior libjpeg-turbo +releases. -[6] The MIPS DSPr2 SIMD code can now be compiled to support either FR=0 or FR=1 +6. The MIPS DSPr2 SIMD code can now be compiled to support either FR=0 or FR=1 FPUs. -[7] Fixed additional negative left shifts and other issues reported by the GCC +7. Fixed additional negative left shifts and other issues reported by the GCC and Clang undefined behavior sanitizers. Most of these issues affected only 32-bit code, and none of them was known to pose a security threat, but removing the warnings makes it easier to detect actual security issues, should they arise in the future. -[8] Removed the unnecessary .arch directive from the ARM64 NEON SIMD code. +8. Removed the unnecessary `.arch` directive from the ARM64 NEON SIMD code. This directive was preventing the code from assembling using the clang integrated assembler. -[9] Fixed a regression caused by 1.4.1[6] that prevented 32-bit and 64-bit +9. Fixed a regression caused by 1.4.1[6] that prevented 32-bit and 64-bit libjpeg-turbo RPMs from being installed simultaneously on recent Red Hat/Fedora distributions. This was due to the addition of a macro in jconfig.h that allows the Huffman codec to determine the word size at compile time. Since @@ -56,62 +61,63 @@ between the i386 and x86_64 RPMs (any differing files, other than executables, are not allowed when 32-bit and 64-bit RPMs are installed simultaneously.) Since the macro is used only internally, it has been moved into jconfigint.h. -[10] The x86-64 SIMD code can now be disabled at run time by setting the -JSIMD_FORCENONE environment variable to 1 (the other SIMD implementations +10. The x86-64 SIMD code can now be disabled at run time by setting the +`JSIMD_FORCENONE` environment variable to `1` (the other SIMD implementations already had this capability.) -[11] Added a new command-line argument to TJBench (-nowrite) that prevents the +11. Added a new command-line argument to TJBench (`-nowrite`) that prevents the benchmark from outputting any images. This removes any potential operating system overhead that might be caused by lazy writes to disk and thus improves the consistency of the performance measurements. -[12] Added SIMD acceleration for Huffman encoding on SSE2-capable x86 and -x86-64 platforms. This speeds up the compression of full-color JPEGs by about -10-15% on average (relative to libjpeg-turbo 1.4.x) when using modern Intel and -AMD CPUs. Additionally, this works around an issue in the clang optimizer that +12. Added SIMD acceleration for Huffman encoding on SSE2-capable x86 and x86-64 +platforms. This speeds up the compression of full-color JPEGs by about 10-15% +on average (relative to libjpeg-turbo 1.4.x) when using modern Intel and AMD +CPUs. Additionally, this works around an issue in the clang optimizer that prevents it (as of this writing) from achieving the same performance as GCC when compiling the C version of the Huffman encoder -(https://llvm.org/bugs/show_bug.cgi?id=16035). For the purposes of benchmarking -or regression testing, SIMD-accelerated Huffman encoding can be disabled by -setting the JSIMD_NOHUFFENC environment variable to 1. +(). For the purposes of +benchmarking or regression testing, SIMD-accelerated Huffman encoding can be +disabled by setting the `JSIMD_NOHUFFENC` environment variable to `1`. -[13] Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used +13. Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used compression algorithms (including the slow integer forward DCT and h2v2 & h2v1 downsampling algorithms, which are not accelerated in the 32-bit NEON implementation.) This speeds up the compression of full-color JPEGs by about 75% on average on a Cavium ThunderX processor and by about 2-2.5x on average on Cortex-A53 and Cortex-A57 cores. -[14] Added SIMD acceleration for Huffman encoding on NEON-capable ARM 32-bit +14. Added SIMD acceleration for Huffman encoding on NEON-capable ARM 32-bit and 64-bit platforms. -For 32-bit code, this speeds up the compression of full-color JPEGs by about -30% on average on a typical iOS device (iPhone 4S, Cortex-A9) and by about 6-7% -on average on a typical Android device (Nexus 5X, Cortex-A53 and Cortex-A57), -relative to libjpeg-turbo 1.4.x. Note that the larger speedup under iOS is due -to the fact that iOS builds use LLVM, which does not optimize the C Huffman -encoder as well as GCC does. + For 32-bit code, this speeds up the compression of full-color JPEGs by +about 30% on average on a typical iOS device (iPhone 4S, Cortex-A9) and by +about 6-7% on average on a typical Android device (Nexus 5X, Cortex-A53 and +Cortex-A57), relative to libjpeg-turbo 1.4.x. Note that the larger speedup +under iOS is due to the fact that iOS builds use LLVM, which does not optimize +the C Huffman encoder as well as GCC does. -For 64-bit code, NEON-accelerated Huffman encoding speeds up the compression of -full-color JPEGs by about 40% on average on a typical iOS device (iPhone 5S, -Apple A7) and by about 7-8% on average on a typical Android device (Nexus 5X, -Cortex-A53 and Cortex-A57), in addition to the speedup described in [13] above. + For 64-bit code, NEON-accelerated Huffman encoding speeds up the +compression of full-color JPEGs by about 40% on average on a typical iOS device +(iPhone 5S, Apple A7) and by about 7-8% on average on a typical Android device +(Nexus 5X, Cortex-A53 and Cortex-A57), in addition to the speedup described in +[13] above. -For the purposes of benchmarking or regression testing, SIMD-accelerated -Huffman encoding can be disabled by setting the JSIMD_NOHUFFENC environment -variable to 1. + For the purposes of benchmarking or regression testing, SIMD-accelerated +Huffman encoding can be disabled by setting the `JSIMD_NOHUFFENC` environment +variable to `1`. -[15] pkg-config (.pc) scripts are now included for both the libjpeg and +15. pkg-config (.pc) scripts are now included for both the libjpeg and TurboJPEG API libraries on Un*x systems. Note that if a project's build system relies on these scripts, then it will not be possible to build that project with libjpeg or with a prior version of libjpeg-turbo. -[16] Optimized the ARM 64-bit (ARMv8) NEON SIMD decompression routines to +16. Optimized the ARM 64-bit (ARMv8) NEON SIMD decompression routines to improve performance on CPUs with in-order pipelines. This speeds up the decompression of full-color JPEGs by nearly 2x on average on a Cavium ThunderX processor and by about 15% on average on a Cortex-A53 core. -[17] Fixed an issue in the accelerated Huffman decoder that could have caused +17. Fixed an issue in the accelerated Huffman decoder that could have caused the decoder to read past the end of the input buffer when a malformed, specially-crafted JPEG image was being decompressed. In prior versions of libjpeg-turbo, the accelerated Huffman decoder was invoked (in most cases) only @@ -120,41 +126,43 @@ to construct a JPEG image in which a single Huffman block is over 430 bytes long, so this version of libjpeg-turbo activates the accelerated Huffman decoder only if there are > 512 bytes of data in the input buffer. -[18] Fixed a memory leak in tjunittest encountered when running the program -with the -yuv option. +18. Fixed a memory leak in tjunittest encountered when running the program +with the `-yuv` option. 1.4.2 ===== -[1] Fixed an issue whereby cjpeg would segfault if a Windows bitmap with a +### Significant changes relative to 1.4.1: + +1. Fixed an issue whereby cjpeg would segfault if a Windows bitmap with a negative width or height was used as an input image (Windows bitmaps can have a negative height if they are stored in top-down order, but such files are rare and not supported by libjpeg-turbo.) -[2] Fixed an issue whereby, under certain circumstances, libjpeg-turbo would +2. Fixed an issue whereby, under certain circumstances, libjpeg-turbo would incorrectly encode certain JPEG images when quality=100 and the fast integer -forward DCT were used. This was known to cause 'make test' to fail when the -library was built with '-march=haswell' on x86 systems. +forward DCT were used. This was known to cause `make test` to fail when the +library was built with `-march=haswell` on x86 systems. -[3] Fixed an issue whereby libjpeg-turbo would crash when built with the latest +3. Fixed an issue whereby libjpeg-turbo would crash when built with the latest & greatest development version of the Clang/LLVM compiler. This was caused by an x86-64 ABI conformance issue in some of libjpeg-turbo's 64-bit SSE2 SIMD -routines. Those routines were incorrectly using a 64-bit mov instruction to +routines. Those routines were incorrectly using a 64-bit `mov` instruction to transfer a 32-bit JDIMENSION argument, whereas the x86-64 ABI allows the upper (unused) 32 bits of a 32-bit argument's register to be undefined. The new Clang/LLVM optimizer uses load combining to transfer multiple adjacent 32-bit structure members into a single 64-bit register, and this exposed the ABI conformance issue. -[4] Fixed a bug in the MIPS DSPr2 4:2:0 "plain" (non-fancy and non-merged) +4. Fixed a bug in the MIPS DSPr2 4:2:0 "plain" (non-fancy and non-merged) upsampling routine that caused a buffer overflow (and subsequent segfault) when decompressing a 4:2:0 JPEG image whose scaled output width was less than 16 pixels. The "plain" upsampling routines are normally only used when decompressing a non-YCbCr JPEG image, but they are also used when decompressing a JPEG image whose scaled output height is 1. -[5] Fixed various negative left shifts and other issues reported by the GCC and +5. Fixed various negative left shifts and other issues reported by the GCC and Clang undefined behavior sanitizers. None of these was known to pose a security threat, but removing the warnings makes it easier to detect actual security issues, should they arise in the future. @@ -163,59 +171,62 @@ security issues, should they arise in the future. 1.4.1 ===== -[1] tjbench now properly handles CMYK/YCCK JPEG files. Passing an argument of --cmyk (instead of, for instance, -rgb) will cause tjbench to internally convert -the source bitmap to CMYK prior to compression, to generate YCCK JPEG files, -and to internally convert the decompressed CMYK pixels back to RGB after +### Significant changes relative to 1.4.0: + +1. tjbench now properly handles CMYK/YCCK JPEG files. Passing an argument of +`-cmyk` (instead of, for instance, `-rgb`) will cause tjbench to internally +convert the source bitmap to CMYK prior to compression, to generate YCCK JPEG +files, and to internally convert the decompressed CMYK pixels back to RGB after decompression (the latter is done automatically if a CMYK or YCCK JPEG is passed to tjbench as a source image.) The CMYK<->RGB conversion operation is not benchmarked. NOTE: The quick & dirty CMYK<->RGB conversions that tjbench uses are suitable for testing only. Proper conversion between CMYK and RGB requires a color management system. -[2] 'make test' now performs additional bitwise regression tests using tjbench, +2. `make test` now performs additional bitwise regression tests using tjbench, mainly for the purpose of testing compression from/decompression to a subregion of a larger image buffer. -[3] 'make test' no longer tests the regression of the floating point DCT/IDCT +3. `make test` no longer tests the regression of the floating point DCT/IDCT by default, since the results of those tests can vary if the algorithms in question are not implemented using SIMD instructions on a particular platform. -See the comments in Makefile.am for information on how to re-enable the tests -and to specify an expected result for them based on the particulars of your -platform. +See the comments in [Makefile.am](Makefile.am) for information on how to +re-enable the tests and to specify an expected result for them based on the +particulars of your platform. -[4] The NULL color conversion routines have been significantly optimized, +4. The NULL color conversion routines have been significantly optimized, which speeds up the compression of RGB and CMYK JPEGs by 5-20% when using 64-bit code and 0-3% when using 32-bit code, and the decompression of those images by 10-30% when using 64-bit code and 3-12% when using 32-bit code. -[5] Fixed an "illegal instruction" error that occurred when djpeg from a -SIMD-enabled libjpeg-turbo MIPS build was executed with the -nosmooth option on -a MIPS machine that lacked DSPr2 support. The MIPS SIMD routines for h2v1 and -h2v2 merged upsampling were not properly checking for the existence of DSPr2. +5. Fixed an "illegal instruction" error that occurred when djpeg from a +SIMD-enabled libjpeg-turbo MIPS build was executed with the `-nosmooth` option +on a MIPS machine that lacked DSPr2 support. The MIPS SIMD routines for h2v1 +and h2v2 merged upsampling were not properly checking for the existence of +DSPr2. -[6] Performance has been improved significantly on 64-bit non-Linux and +6. Performance has been improved significantly on 64-bit non-Linux and non-Windows platforms (generally 10-20% faster compression and 5-10% faster decompression.) Due to an oversight, the 64-bit version of the accelerated Huffman codec was not being compiled in when libjpeg-turbo was built on platforms other than Windows or Linux. Oops. -[7] Fixed an extremely rare bug in the Huffman encoder that caused 64-bit +7. Fixed an extremely rare bug in the Huffman encoder that caused 64-bit builds of libjpeg-turbo to incorrectly encode a few specific test images when quality=98, an optimized Huffman table, and the slow integer forward DCT were used. -[8] The Windows (CMake) build system now supports building only static or only -shared libraries. This is accomplished by adding either -DENABLE_STATIC=0 or --DENABLE_SHARED=0 to the CMake command line. +8. The Windows (CMake) build system now supports building only static or only +shared libraries. This is accomplished by adding either `-DENABLE_STATIC=0` or +`-DENABLE_SHARED=0` to the CMake command line. -[9] TurboJPEG API functions will now return an error code if a warning is +9. TurboJPEG API functions will now return an error code if a warning is triggered in the underlying libjpeg API. For instance, if a JPEG file is corrupt, the TurboJPEG decompression functions will attempt to decompress as much of the image as possible, but those functions will now return -1 to indicate that the decompression was not entirely successful. -[10] Fixed a bug in the MIPS DSPr2 4:2:2 fancy upsampling routine that caused a +10. Fixed a bug in the MIPS DSPr2 4:2:2 fancy upsampling routine that caused a buffer overflow (and subsequent segfault) when decompressing a 4:2:2 JPEG image in which the right-most MCU was 5 or 6 pixels wide. @@ -223,41 +234,43 @@ in which the right-most MCU was 5 or 6 pixels wide. 1.4.0 ===== -[1] Fixed a build issue on OS X PowerPC platforms (md5cmp failed to build -because OS X does not provide the le32toh() and htole32() functions.) +### Significant changes relative to 1.4 beta1: -[2] The non-SIMD RGB565 color conversion code did not work correctly on big +1. Fixed a build issue on OS X PowerPC platforms (md5cmp failed to build +because OS X does not provide the `le32toh()` and `htole32()` functions.) + +2. The non-SIMD RGB565 color conversion code did not work correctly on big endian machines. This has been fixed. -[3] Fixed an issue in tjPlaneSizeYUV() whereby it would erroneously return 1 -instead of -1 if componentID was > 0 and subsamp was TJSAMP_GRAY. +3. Fixed an issue in `tjPlaneSizeYUV()` whereby it would erroneously return 1 +instead of -1 if `componentID` was > 0 and `subsamp` was `TJSAMP_GRAY`. -[3] Fixed an issue in tjBufSizeYUV2() whereby it would erroneously return 0 -instead of -1 if width was < 1. +3. Fixed an issue in `tjBufSizeYUV2()` whereby it would erroneously return 0 +instead of -1 if `width` was < 1. -[5] The Huffman encoder now uses clz and bsr instructions for bit counting on -ARM64 platforms (see 1.4 beta1 [5].) +5. The Huffman encoder now uses `clz` and `bsr` instructions for bit counting +on ARM64 platforms (see 1.4 beta1[5].) -[6] The close() method in the TJCompressor and TJDecompressor Java classes is -now idempotent. Previously, that method would call the native tjDestroy() +6. The `close()` method in the TJCompressor and TJDecompressor Java classes is +now idempotent. Previously, that method would call the native `tjDestroy()` function even if the TurboJPEG instance had already been destroyed. This -caused an exception to be thrown during finalization, if the close() method had -already been called. The exception was caught, but it was still an expensive -operation. +caused an exception to be thrown during finalization, if the `close()` method +had already been called. The exception was caught, but it was still an +expensive operation. -[7] The TurboJPEG API previously generated an error ("Could not determine -subsampling type for JPEG image") when attempting to decompress grayscale JPEG +7. The TurboJPEG API previously generated an error (`Could not determine +subsampling type for JPEG image`) when attempting to decompress grayscale JPEG images that were compressed with a sampling factor other than 1 (for instance, -with 'cjpeg -grayscale -sample 2x2'). Subsampling technically has no meaning +with `cjpeg -grayscale -sample 2x2`). Subsampling technically has no meaning with grayscale JPEGs, and thus the horizontal and vertical sampling factors for such images are ignored by the decompressor. However, the TurboJPEG API was being too rigid and was expecting the sampling factors to be equal to 1 before it treated the image as a grayscale JPEG. -[8] cjpeg, djpeg, and jpegtran now accept an argument of -version, which will +8. cjpeg, djpeg, and jpegtran now accept an argument of `-version`, which will print the library version and exit. -[9] Referring to 1.4 beta1 [15], another extremely rare circumstance was +9. Referring to 1.4 beta1[15], another extremely rare circumstance was discovered under which the Huffman encoder's local buffer can be overrun when a buffered destination manager is being used and an extremely-high-frequency block (basically junk image data) is being encoded. @@ -269,23 +282,23 @@ order), the Huffman encoder can produce encoded blocks that approach double the size of the unencoded blocks. Thus, the Huffman local buffer was increased to 256 bytes, which should prevent any such issue from re-occurring in the future. -[10] The new tjPlaneSizeYUV(), tjPlaneWidth(), and tjPlaneHeight() functions -were not actually usable on any platform except OS X and Windows, because -those functions were not included in the libturbojpeg mapfile. This has been -fixed. +10. The new `tjPlaneSizeYUV()`, `tjPlaneWidth()`, and `tjPlaneHeight()` +functions were not actually usable on any platform except OS X and Windows, +because those functions were not included in the libturbojpeg mapfile. This +has been fixed. -[11] Restored the JPP(), JMETHOD(), and FAR macros in the libjpeg-turbo header -files. The JPP() and JMETHOD() macros were originally implemented in libjpeg -as a way of supporting non-ANSI compilers that lacked support for prototype -parameters. libjpeg-turbo has never supported such compilers, but some -software packages still use the macros to define their own prototypes. +11. Restored the `JPP()`, `JMETHOD()`, and `FAR` macros in the libjpeg-turbo +header files. The `JPP()` and `JMETHOD()` macros were originally implemented +in libjpeg as a way of supporting non-ANSI compilers that lacked support for +prototype parameters. libjpeg-turbo has never supported such compilers, but +some software packages still use the macros to define their own prototypes. Similarly, libjpeg-turbo has never supported MS-DOS and other platforms that -have far symbols, but some software packages still use the FAR macro. A pretty -good argument can be made that this is a bad practice on the part of the +have far symbols, but some software packages still use the `FAR` macro. A +pretty good argument can be made that this is a bad practice on the part of the software in question, but since this affects more than one package, it's just easier to fix it here. -[12] Fixed issues that were preventing the ARM 64-bit SIMD code from compiling +12. Fixed issues that were preventing the ARM 64-bit SIMD code from compiling for iOS, and included an ARMv8 architecture in all of the binaries installed by the "official" libjpeg-turbo SDK for OS X. @@ -293,36 +306,39 @@ the "official" libjpeg-turbo SDK for OS X. 1.3.90 (1.4 beta1) ================== -[1] New features in the TurboJPEG API: --- YUV planar images can now be generated with an arbitrary line padding +### Significant changes relative to 1.3.1: + +1. New features in the TurboJPEG API: + - YUV planar images can now be generated with an arbitrary line padding (previously only 4-byte padding, which was compatible with X Video, was supported.) --- The decompress-to-YUV function has been extended to support image scaling. --- JPEG images can now be compressed from YUV planar source images. --- YUV planar images can now be decoded into RGB or grayscale images. --- 4:1:1 subsampling is now supported. This is mainly included for + - The decompress-to-YUV function has been extended to support image +scaling. + - JPEG images can now be compressed from YUV planar source images. + - YUV planar images can now be decoded into RGB or grayscale images. + - 4:1:1 subsampling is now supported. This is mainly included for compatibility, since 4:1:1 is not fully accelerated in libjpeg-turbo and has no significant advantages relative to 4:2:0. --- CMYK images are now supported. This feature allows CMYK source images to be -compressed to YCCK JPEGs and YCCK or CMYK JPEGs to be decompressed to CMYK -destination images. Conversion between CMYK/YCCK and RGB or YUV images is not -supported. Such conversion requires a color management system and is thus out -of scope for a codec library. --- The handling of YUV images in the Java API has been significantly refactored -and should now be much more intuitive. --- The Java API now supports encoding a YUV image from an arbitrary position in -a large image buffer. --- All of the YUV functions now have a corresponding function that operates on -separate image planes instead of a unified image buffer. This allows for + - CMYK images are now supported. This feature allows CMYK source images +to be compressed to YCCK JPEGs and YCCK or CMYK JPEGs to be decompressed to +CMYK destination images. Conversion between CMYK/YCCK and RGB or YUV images is +not supported. Such conversion requires a color management system and is thus +out of scope for a codec library. + - The handling of YUV images in the Java API has been significantly +refactored and should now be much more intuitive. + - The Java API now supports encoding a YUV image from an arbitrary +position in a large image buffer. + - All of the YUV functions now have a corresponding function that operates +on separate image planes instead of a unified image buffer. This allows for compressing/decoding from or decompressing/encoding to a subregion of a larger YUV image. It also allows for handling YUV formats that swap the order of the U and V planes. -[2] Added SIMD acceleration for DSPr2-capable MIPS platforms. This speeds up +2. Added SIMD acceleration for DSPr2-capable MIPS platforms. This speeds up the compression of full-color JPEGs by 70-80% on such platforms and decompression by 25-35%. -[3] If an application attempts to decompress a Huffman-coded JPEG image whose +3. If an application attempts to decompress a Huffman-coded JPEG image whose header does not contain Huffman tables, libjpeg-turbo will now insert the default Huffman tables. In order to save space, many motion JPEG video frames are encoded without the default Huffman tables, so these frames can now be @@ -330,14 +346,14 @@ successfully decompressed by libjpeg-turbo without additional work on the part of the application. An application can still override the Huffman tables, for instance to re-use tables from a previous frame of the same video. -[4] The Mac packaging system now uses pkgbuild and productbuild rather than +4. The Mac packaging system now uses pkgbuild and productbuild rather than PackageMaker (which is obsolete and no longer supported.) This means that OS X 10.6 "Snow Leopard" or later must be used when packaging libjpeg-turbo, although the packages produced can be installed on OS X 10.5 "Leopard" or later. OS X 10.4 "Tiger" is no longer supported. -[5] The Huffman encoder now uses clz and bsr instructions for bit counting on -ARM platforms rather than a lookup table. This reduces the memory footprint +5. The Huffman encoder now uses `clz` and `bsr` instructions for bit counting +on ARM platforms rather than a lookup table. This reduces the memory footprint by 64k, which may be important for some mobile applications. Out of four Android devices that were tested, two demonstrated a small overall performance loss (~3-4% on average) with ARMv6 code and a small gain (also ~3-4%) with @@ -345,13 +361,13 @@ ARMv7 code when enabling this new feature, but the other two devices demonstrated a significant overall performance gain with both ARMv6 and ARMv7 code (~10-20%) when enabling the feature. Actual mileage may vary. -[6] Worked around an issue with Visual C++ 2010 and later that caused incorrect +6. Worked around an issue with Visual C++ 2010 and later that caused incorrect pixels to be generated when decompressing a JPEG image to a 256-color bitmap, if compiler optimization was enabled when libjpeg-turbo was built. This caused the regression tests to fail when doing a release build under Visual C++ 2010 and later. -[7] Improved the accuracy and performance of the non-SIMD implementation of the +7. Improved the accuracy and performance of the non-SIMD implementation of the floating point inverse DCT (using code borrowed from libjpeg v8a and later.) The accuracy of this implementation now matches the accuracy of the SSE/SSE2 implementation. Note, however, that the floating point DCT/IDCT algorithms are @@ -359,39 +375,39 @@ mainly a legacy feature. They generally do not produce significantly better accuracy than the slow integer DCT/IDCT algorithms, and they are quite a bit slower. -[8] Added a new output colorspace (JCS_RGB565) to the libjpeg API that allows +8. Added a new output colorspace (`JCS_RGB565`) to the libjpeg API that allows for decompressing JPEG images into RGB565 (16-bit) pixels. If dithering is not used, then this code path is SIMD-accelerated on ARM platforms. -[9] Numerous obsolete features, such as support for non-ANSI compilers and +9. Numerous obsolete features, such as support for non-ANSI compilers and support for the MS-DOS memory model, were removed from the libjpeg code, greatly improving its readability and making it easier to maintain and extend. -[10] Fixed a segfault that occurred when calling output_message() with msg_code -set to JMSG_COPYRIGHT. +10. Fixed a segfault that occurred when calling `output_message()` with +`msg_code` set to `JMSG_COPYRIGHT`. -[11] Fixed an issue whereby wrjpgcom was allowing comments longer than 65k +11. Fixed an issue whereby wrjpgcom was allowing comments longer than 65k characters to be passed on the command line, which was causing it to generate incorrect JPEG files. -[12] Fixed a bug in the build system that was causing the Windows version of +12. Fixed a bug in the build system that was causing the Windows version of wrjpgcom to be built using the rdjpgcom source code. -[13] Restored 12-bit-per-component JPEG support. A 12-bit version of -libjpeg-turbo can now be built by passing an argument of --with-12bit to -configure (Unix) or -DWITH_12BIT=1 to cmake (Windows.) 12-bit JPEG support is -included only for convenience. Enabling this feature disables all of the +13. Restored 12-bit-per-component JPEG support. A 12-bit version of +libjpeg-turbo can now be built by passing an argument of `--with-12bit` to +configure (Unix) or `-DWITH_12BIT=1` to cmake (Windows.) 12-bit JPEG support +is included only for convenience. Enabling this feature disables all of the performance features in libjpeg-turbo, as well as arithmetic coding and the TurboJPEG API. The resulting library still contains the other libjpeg-turbo features (such as the colorspace extensions), but in general, it performs no faster than libjpeg v6b. -[14] Added ARM 64-bit SIMD acceleration for the YCC-to-RGB color conversion +14. Added ARM 64-bit SIMD acceleration for the YCC-to-RGB color conversion and IDCT algorithms (both are used during JPEG decompression.) For unknown reasons (probably related to clang), this code cannot currently be compiled for iOS. -[15] Fixed an extremely rare bug that could cause the Huffman encoder's local +15. Fixed an extremely rare bug that could cause the Huffman encoder's local buffer to overrun when a very high-frequency MCU is compressed using quality 100 and no subsampling, and when the JPEG output buffer is being dynamically resized by the destination manager. This issue was so rare that, even with a @@ -399,11 +415,11 @@ test program specifically designed to make the bug occur (by injecting random high-frequency YUV data into the compressor), it was reproducible only once in about every 25 million iterations. -[16] Fixed an oversight in the TurboJPEG C wrapper: if any of the JPEG +16. Fixed an oversight in the TurboJPEG C wrapper: if any of the JPEG compression functions was called repeatedly with the same automatically-allocated destination buffer, then TurboJPEG would erroneously -assume that the jpegSize parameter was equal to the size of the buffer, when in -fact that parameter was probably equal to the size of the most recently +assume that the `jpegSize` parameter was equal to the size of the buffer, when +in fact that parameter was probably equal to the size of the most recently compressed JPEG image. If the size of the previous JPEG image was not as large as the current JPEG image, then TurboJPEG would unnecessarily reallocate the destination buffer. @@ -412,38 +428,40 @@ destination buffer. 1.3.1 ===== -[1] On Un*x systems, 'make install' now installs the libjpeg-turbo libraries +### Significant changes relative to 1.3.0: + +1. On Un*x systems, `make install` now installs the libjpeg-turbo libraries into /opt/libjpeg-turbo/lib32 by default on any 32-bit system, not just x86, and into /opt/libjpeg-turbo/lib64 by default on any 64-bit system, not just -x86-64. You can override this by overriding either the 'prefix' or 'libdir' +x86-64. You can override this by overriding either the `prefix` or `libdir` configure variables. -[2] The Windows installer now places a copy of the TurboJPEG DLLs in the same +2. The Windows installer now places a copy of the TurboJPEG DLLs in the same directory as the rest of the libjpeg-turbo binaries. This was mainly done to support TurboVNC 1.3, which bundles the DLLs in its Windows installation. When using a 32-bit version of CMake on 64-bit Windows, it is impossible to access the c:\WINDOWS\system32 directory, which made it impossible for the TurboVNC build scripts to bundle the 64-bit TurboJPEG DLL. -[3] Fixed a bug whereby attempting to encode a progressive JPEG with arithmetic -entropy coding (by passing arguments of -progressive -arithmetic to cjpeg or -jpegtran, for instance) would result in an error, "Requested feature was -omitted at compile time". +3. Fixed a bug whereby attempting to encode a progressive JPEG with arithmetic +entropy coding (by passing arguments of `-progressive -arithmetic` to cjpeg or +jpegtran, for instance) would result in an error, `Requested feature was +omitted at compile time`. -[4] Fixed a couple of issues whereby malformed JPEG images would cause +4. Fixed a couple of issues whereby malformed JPEG images would cause libjpeg-turbo to use uninitialized memory during decompression. -[5] Fixed an error ("Buffer passed to JPEG library is too small") that occurred +5. Fixed an error (`Buffer passed to JPEG library is too small`) that occurred when calling the TurboJPEG YUV encoding function with a very small (< 5x5) source image, and added a unit test to check for this error. -[6] The Java classes should now build properly under Visual Studio 2010 and +6. The Java classes should now build properly under Visual Studio 2010 and later. -[7] Fixed an issue that prevented SRPMs generated using the in-tree packaging +7. Fixed an issue that prevented SRPMs generated using the in-tree packaging tools from being rebuilt on certain newer Linux distributions. -[8] Numerous minor fixes to eliminate compilation and build/packaging system +8. Numerous minor fixes to eliminate compilation and build/packaging system warnings, fix cosmetic issues, improve documentation clarity, and other general source cleanup. @@ -451,97 +469,101 @@ source cleanup. 1.3.0 ===== -[1] 'make test' now works properly on FreeBSD, and it no longer requires the +### Significant changes relative to 1.3 beta1: + +1. `make test` now works properly on FreeBSD, and it no longer requires the md5sum executable to be present on other Un*x platforms. -[2] Overhauled the packaging system: --- To avoid conflict with vendor-supplied libjpeg-turbo packages, the +2. Overhauled the packaging system: + - To avoid conflict with vendor-supplied libjpeg-turbo packages, the official RPMs and DEBs for libjpeg-turbo have been renamed to "libjpeg-turbo-official". --- The TurboJPEG libraries are now located under /opt/libjpeg-turbo in the + - The TurboJPEG libraries are now located under /opt/libjpeg-turbo in the official Linux and Mac packages, to avoid conflict with vendor-supplied packages and also to streamline the packaging system. --- Release packages are now created with the directory structure defined -by the configure variables "prefix", "bindir", "libdir", etc. (Un*x) or by the -CMAKE_INSTALL_PREFIX variable (Windows.) The exception is that the docs are -always located under the system default documentation directory on Un*x and Mac -systems, and on Windows, the TurboJPEG DLL is always located in the Windows + - Release packages are now created with the directory structure defined +by the configure variables `prefix`, `bindir`, `libdir`, etc. (Un\*x) or by the +`CMAKE_INSTALL_PREFIX` variable (Windows.) The exception is that the docs are +always located under the system default documentation directory on Un\*x and +Mac systems, and on Windows, the TurboJPEG DLL is always located in the Windows system directory. --- To avoid confusion, official libjpeg-turbo packages on Linux/Unix platforms -(except for Mac) will always install the 32-bit libraries in + - To avoid confusion, official libjpeg-turbo packages on Linux/Unix +platforms (except for Mac) will always install the 32-bit libraries in /opt/libjpeg-turbo/lib32 and the 64-bit libraries in /opt/libjpeg-turbo/lib64. --- Fixed an issue whereby, in some cases, the libjpeg-turbo executables on Un*x -systems were not properly linking with the shared libraries installed by the -same package. --- Fixed an issue whereby building the "installer" target on Windows when -WITH_JAVA=1 would fail if the TurboJPEG JAR had not been previously built. --- Building the "install" target on Windows now installs files into the same -places that the installer does. + - Fixed an issue whereby, in some cases, the libjpeg-turbo executables on +Un*x systems were not properly linking with the shared libraries installed by +the same package. + - Fixed an issue whereby building the "installer" target on Windows when +`WITH_JAVA=1` would fail if the TurboJPEG JAR had not been previously built. + - Building the "install" target on Windows now installs files into the +same places that the installer does. -[3] Fixed a Huffman encoder bug that prevented I/O suspension from working +3. Fixed a Huffman encoder bug that prevented I/O suspension from working properly. 1.2.90 (1.3 beta1) ================== -[1] Added support for additional scaling factors (3/8, 5/8, 3/4, 7/8, 9/8, 5/4, +### Significant changes relative to 1.2.1: + +1. Added support for additional scaling factors (3/8, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2) when decompressing. Note that the IDCT will not be SIMD-accelerated when using any of these new scaling factors. -[2] The TurboJPEG dynamic library is now versioned. It was not strictly +2. The TurboJPEG dynamic library is now versioned. It was not strictly necessary to do so, because TurboJPEG uses versioned symbols, and if a function changes in an ABI-incompatible way, that function is renamed and a legacy function is provided to maintain backward compatibility. However, certain Linux distro maintainers have a policy against accepting any library that isn't versioned. -[3] Extended the TurboJPEG Java API so that it can be used to compress a JPEG +3. Extended the TurboJPEG Java API so that it can be used to compress a JPEG image from and decompress a JPEG image to an arbitrary position in a large image buffer. -[4] The tjDecompressToYUV() function now supports the TJFLAG_FASTDCT flag. +4. The `tjDecompressToYUV()` function now supports the `TJFLAG_FASTDCT` flag. -[5] The 32-bit supplementary package for amd64 Debian systems now provides +5. The 32-bit supplementary package for amd64 Debian systems now provides symlinks in /usr/lib/i386-linux-gnu for the TurboJPEG libraries in /usr/lib32. This allows those libraries to be used on MultiArch-compatible systems (such as Ubuntu 11 and later) without setting the linker path. -[6] The TurboJPEG Java wrapper should now find the JNI library on Mac systems -without having to pass -Djava.library.path=/usr/lib to java. +6. The TurboJPEG Java wrapper should now find the JNI library on Mac systems +without having to pass `-Djava.library.path=/usr/lib` to java. -[7] TJBench has been ported to Java to provide a convenient way of validating +7. TJBench has been ported to Java to provide a convenient way of validating the performance of the TurboJPEG Java API. It can be run with -'java -cp turbojpeg.jar TJBench'. +`java -cp turbojpeg.jar TJBench`. -[8] cjpeg can now be used to generate JPEG files with the RGB colorspace +8. cjpeg can now be used to generate JPEG files with the RGB colorspace (feature ported from jpeg-8d.) -[9] The width and height in the -crop argument passed to jpegtran can now be -suffixed with "f" to indicate that, when the upper left corner of the cropping +9. The width and height in the `-crop` argument passed to jpegtran can now be +suffixed with `f` to indicate that, when the upper left corner of the cropping region is automatically moved to the nearest iMCU boundary, the bottom right corner should be moved by the same amount. In other words, this feature causes jpegtran to strictly honor the specified width/height rather than the specified bottom right corner (feature ported from jpeg-8d.) -[10] JPEG files using the RGB colorspace can now be decompressed into grayscale +10. JPEG files using the RGB colorspace can now be decompressed into grayscale images (feature ported from jpeg-8d.) -[11] Fixed a regression caused by 1.2.1[7] whereby the build would fail with +11. Fixed a regression caused by 1.2.1[7] whereby the build would fail with multiple "Mismatch in operand sizes" errors when attempting to build the x86 SIMD code with NASM 0.98. -[12] The in-memory source/destination managers (jpeg_mem_src() and -jpeg_mem_dest()) are now included by default when building libjpeg-turbo with +12. The in-memory source/destination managers (`jpeg_mem_src()` and +`jpeg_mem_dest()`) are now included by default when building libjpeg-turbo with libjpeg v6b or v7 emulation, so that programs can take advantage of these functions without requiring the use of the backward-incompatible libjpeg v8 ABI. The "age number" of the libjpeg-turbo library on Un*x systems has been incremented by 1 to reflect this. You can disable this feature with a configure/CMake switch in order to retain strict API/ABI compatibility with the libjpeg v6b or v7 API/ABI (or with previous versions of libjpeg-turbo.) See -README.md for more details. +[README.md](README.md) for more details. -[13] Added ARMv7s architecture to libjpeg.a and libturbojpeg.a in the official +13. Added ARMv7s architecture to libjpeg.a and libturbojpeg.a in the official libjpeg-turbo binary package for OS X, so that those libraries can be used to build applications that leverage the faster CPUs in the iPhone 5 and iPad 4. @@ -549,82 +571,86 @@ build applications that leverage the faster CPUs in the iPhone 5 and iPad 4. 1.2.1 ===== -[1] Creating or decoding a JPEG file that uses the RGB colorspace should now +### Significant changes relative to 1.2.0: + +1. Creating or decoding a JPEG file that uses the RGB colorspace should now properly work when the input or output colorspace is one of the libjpeg-turbo colorspace extensions. -[2] When libjpeg-turbo was built without SIMD support and merged (non-fancy) +2. When libjpeg-turbo was built without SIMD support and merged (non-fancy) upsampling was used along with an alpha-enabled colorspace during decompression, the unused byte of the decompressed pixels was not being set to 0xFF. This has been fixed. TJUnitTest has also been extended to test for the correct behavior of the colorspace extensions when merged upsampling is used. -[3] Fixed a bug whereby the libjpeg-turbo SSE2 SIMD code would not preserve the +3. Fixed a bug whereby the libjpeg-turbo SSE2 SIMD code would not preserve the upper 64 bits of xmm6 and xmm7 on Win64 platforms, which violated the Win64 calling conventions. -[4] Fixed a regression caused by 1.2.0[6] whereby decompressing corrupt JPEG +4. Fixed a regression caused by 1.2.0[6] whereby decompressing corrupt JPEG images (specifically, images in which the component count was erroneously set to a large value) would cause libjpeg-turbo to segfault. -[5] Worked around a severe performance issue with "Bobcat" (AMD Embedded APU) -processors. The MASKMOVDQU instruction, which was used by the libjpeg-turbo +5. Worked around a severe performance issue with "Bobcat" (AMD Embedded APU) +processors. The `MASKMOVDQU` instruction, which was used by the libjpeg-turbo SSE2 SIMD code, is apparently implemented in microcode on AMD processors, and it is painfully slow on Bobcat processors in particular. Eliminating the use of this instruction improved performance by an order of magnitude on Bobcat processors and by a small amount (typically 5%) on AMD desktop processors. -[6] Added SIMD acceleration for performing 4:2:2 upsampling on NEON-capable ARM +6. Added SIMD acceleration for performing 4:2:2 upsampling on NEON-capable ARM platforms. This speeds up the decompression of 4:2:2 JPEGs by 20-25% on such platforms. -[7] Fixed a regression caused by 1.2.0[2] whereby, on Linux/x86 platforms +7. Fixed a regression caused by 1.2.0[2] whereby, on Linux/x86 platforms running the 32-bit SSE2 SIMD code in libjpeg-turbo, decompressing a 4:2:0 or 4:2:2 JPEG image into a 32-bit (RGBX, BGRX, etc.) buffer without using fancy upsampling would produce several incorrect columns of pixels at the right-hand side of the output image if each row in the output image was not evenly divisible by 16 bytes. -[8] Fixed an issue whereby attempting to build the SIMD extensions with Xcode +8. Fixed an issue whereby attempting to build the SIMD extensions with Xcode 4.3 on OS X platforms would cause NASM to return numerous errors of the form "'%define' expects a macro identifier". -[9] Added flags to the TurboJPEG API that allow the caller to force the use of +9. Added flags to the TurboJPEG API that allow the caller to force the use of either the fast or the accurate DCT/IDCT algorithms in the underlying codec. 1.2.0 ===== -[1] Fixed build issue with YASM on Unix systems (the libjpeg-turbo build system +### Significant changes relative to 1.2 beta1: + +1. Fixed build issue with YASM on Unix systems (the libjpeg-turbo build system was not adding the current directory to the assembler include path, so YASM was not able to find jsimdcfg.inc.) -[2] Fixed out-of-bounds read in SSE2 SIMD code that occurred when decompressing +2. Fixed out-of-bounds read in SSE2 SIMD code that occurred when decompressing a JPEG image to a bitmap buffer whose size was not a multiple of 16 bytes. This was more of an annoyance than an actual bug, since it did not cause any actual run-time problems, but the issue showed up when running libjpeg-turbo in -valgrind. See http://crbug.com/72399 for more information. +valgrind. See for more information. -[3] Added a compile-time macro (LIBJPEG_TURBO_VERSION) that can be used to +3. Added a compile-time macro (`LIBJPEG_TURBO_VERSION`) that can be used to check the version of libjpeg-turbo against which an application was compiled. -[4] Added new RGBA/BGRA/ABGR/ARGB colorspace extension constants (libjpeg API) +4. Added new RGBA/BGRA/ABGR/ARGB colorspace extension constants (libjpeg API) and pixel formats (TurboJPEG API), which allow applications to specify that, when decompressing to a 4-component RGB buffer, the unused byte should be set to 0xFF so that it can be interpreted as an opaque alpha channel. -[5] Fixed regression issue whereby DevIL failed to build against libjpeg-turbo -because libjpeg-turbo's distributed version of jconfig.h contained an INLINE +5. Fixed regression issue whereby DevIL failed to build against libjpeg-turbo +because libjpeg-turbo's distributed version of jconfig.h contained an `INLINE` macro, which conflicted with a similar macro in DevIL. This macro is used only internally when building libjpeg-turbo, so it was moved into config.h. -[6] libjpeg-turbo will now correctly decompress erroneous CMYK/YCCK JPEGs whose +6. libjpeg-turbo will now correctly decompress erroneous CMYK/YCCK JPEGs whose K component is assigned a component ID of 1 instead of 4. Although these files are in violation of the spec, other JPEG implementations handle them correctly. -[7] Added ARMv6 and ARMv7 architectures to libjpeg.a and libturbojpeg.a in +7. Added ARMv6 and ARMv7 architectures to libjpeg.a and libturbojpeg.a in the official libjpeg-turbo binary package for OS X, so that those libraries can be used to build both OS X and iOS applications. @@ -632,55 +658,57 @@ be used to build both OS X and iOS applications. 1.1.90 (1.2 beta1) ================== -[1] Added a Java wrapper for the TurboJPEG API. See java/README for more -details. +### Significant changes relative to 1.1.1: -[2] The TurboJPEG API can now be used to scale down images during +1. Added a Java wrapper for the TurboJPEG API. See [java/README](java/README) +for more details. + +2. The TurboJPEG API can now be used to scale down images during decompression. -[3] Added SIMD routines for RGB-to-grayscale color conversion, which +3. Added SIMD routines for RGB-to-grayscale color conversion, which significantly improves the performance of grayscale JPEG compression from an RGB source image. -[4] Improved the performance of the C color conversion routines, which are used +4. Improved the performance of the C color conversion routines, which are used on platforms for which SIMD acceleration is not available. -[5] Added a function to the TurboJPEG API that performs lossless transforms. +5. Added a function to the TurboJPEG API that performs lossless transforms. This function is implemented using the same back end as jpegtran, but it performs transcoding entirely in memory and allows multiple transforms and/or crop operations to be batched together, so the source coefficients only need to be read once. This is useful when generating image tiles from a single source JPEG. -[6] Added tests for the new TurboJPEG scaled decompression and lossless +6. Added tests for the new TurboJPEG scaled decompression and lossless transform features to tjbench (the TurboJPEG benchmark, formerly called "jpgtest".) -[7] Added support for 4:4:0 (transposed 4:2:2) subsampling in TurboJPEG, which +7. Added support for 4:4:0 (transposed 4:2:2) subsampling in TurboJPEG, which was necessary in order for it to read 4:2:2 JPEG files that had been losslessly transposed or rotated 90 degrees. -[8] All legacy VirtualGL code has been re-factored, and this has allowed +8. All legacy VirtualGL code has been re-factored, and this has allowed libjpeg-turbo, in its entirety, to be re-licensed under a BSD-style license. -[9] libjpeg-turbo can now be built with YASM. +9. libjpeg-turbo can now be built with YASM. -[10] Added SIMD acceleration for ARM Linux and iOS platforms that support +10. Added SIMD acceleration for ARM Linux and iOS platforms that support NEON instructions. -[11] Refactored the TurboJPEG C API and documented it using Doxygen. The +11. Refactored the TurboJPEG C API and documented it using Doxygen. The TurboJPEG 1.2 API uses pixel formats to define the size and component order of the uncompressed source/destination images, and it includes a more efficient -version of TJBUFSIZE() that computes a worst-case JPEG size based on the level -of chrominance subsampling. The refactored implementation of the TurboJPEG API -now uses the libjpeg memory source and destination managers, which allows the -TurboJPEG compressor to grow the JPEG buffer as necessary. +version of `TJBUFSIZE()` that computes a worst-case JPEG size based on the +level of chrominance subsampling. The refactored implementation of the +TurboJPEG API now uses the libjpeg memory source and destination managers, +which allows the TurboJPEG compressor to grow the JPEG buffer as necessary. -[12] Eliminated errors in the output of jpegtran on Windows that occurred when +12. Eliminated errors in the output of jpegtran on Windows that occurred when the application was invoked using I/O redirection -(jpegtran output.jpg). +(`jpegtran output.jpg`.) -[13] The inclusion of libjpeg v7 and v8 emulation as well as arithmetic coding +13. The inclusion of libjpeg v7 and v8 emulation as well as arithmetic coding support in libjpeg-turbo v1.1.0 introduced several new error constants in jerror.h, and these were mistakenly enabled for all emulation modes, causing the error enum in libjpeg-turbo to sometimes have different values than the @@ -689,65 +717,69 @@ problems with rare applications that took specific action based on a particular error value. The fix was to include the new error constants conditionally based on whether libjpeg v7 or v8 emulation was enabled. -[14] Fixed an issue whereby Windows applications that used libjpeg-turbo would +14. Fixed an issue whereby Windows applications that used libjpeg-turbo would fail to compile if the Windows system headers were included before jpeglib.h. This issue was caused by a conflict in the definition of the INT32 type. -[15] Fixed 32-bit supplementary package for amd64 Debian systems, which was +15. Fixed 32-bit supplementary package for amd64 Debian systems, which was broken by enhancements to the packaging system in 1.1. -[16] When decompressing a JPEG image using an output colorspace of -JCS_EXT_RGBX, JCS_EXT_BGRX, JCS_EXT_XBGR, or JCS_EXT_XRGB, libjpeg-turbo will -now set the unused byte to 0xFF, which allows applications to interpret that -byte as an alpha channel (0xFF = opaque). +16. When decompressing a JPEG image using an output colorspace of +`JCS_EXT_RGBX`, `JCS_EXT_BGRX`, `JCS_EXT_XBGR`, or `JCS_EXT_XRGB`, +libjpeg-turbo will now set the unused byte to 0xFF, which allows applications +to interpret that byte as an alpha channel (0xFF = opaque). 1.1.1 ===== -[1] Fixed a 1-pixel error in row 0, column 21 of the luminance plane generated -by tjEncodeYUV(). +### Significant changes relative to 1.1.0: -[2] libjpeg-turbo's accelerated Huffman decoder previously ignored unexpected +1. Fixed a 1-pixel error in row 0, column 21 of the luminance plane generated +by `tjEncodeYUV()`. + +2. libjpeg-turbo's accelerated Huffman decoder previously ignored unexpected markers found in the middle of the JPEG data stream during decompression. It will now hand off decoding of a particular block to the unaccelerated Huffman decoder if an unexpected marker is found, so that the unaccelerated Huffman decoder can generate an appropriate warning. -[3] Older versions of MinGW64 prefixed symbol names with underscores by +3. Older versions of MinGW64 prefixed symbol names with underscores by default, which differed from the behavior of 64-bit Visual C++. MinGW64 1.0 has adopted the behavior of 64-bit Visual C++ as the default, so to accommodate this, the libjpeg-turbo SIMD function names are no longer prefixed with an underscore when building with MinGW64. This means that, when building libjpeg-turbo with older versions of MinGW64, you will now have to add --fno-leading-underscore to the CFLAGS. +`-fno-leading-underscore` to the `CFLAGS`. -[4] Fixed a regression bug in the NSIS script that caused the Windows installer +4. Fixed a regression bug in the NSIS script that caused the Windows installer build to fail when using the Visual Studio IDE. -[5] Fixed a bug in jpeg_read_coefficients() whereby it would not initialize -cinfo->image_width and cinfo->image_height if libjpeg v7 or v8 emulation was -enabled. This specifically caused the jpegoptim program to fail if it was +5. Fixed a bug in `jpeg_read_coefficients()` whereby it would not initialize +`cinfo->image_width` and `cinfo->image_height` if libjpeg v7 or v8 emulation +was enabled. This specifically caused the jpegoptim program to fail if it was linked against a version of libjpeg-turbo that was built with libjpeg v7 or v8 emulation. -[6] Eliminated excessive I/O overhead that occurred when reading BMP files in +6. Eliminated excessive I/O overhead that occurred when reading BMP files in cjpeg. -[7] Eliminated errors in the output of cjpeg on Windows that occurred when the -application was invoked using I/O redirection (cjpeg output.jpg). +7. Eliminated errors in the output of cjpeg on Windows that occurred when the +application was invoked using I/O redirection (`cjpeg output.jpg`.) 1.1.0 ===== -[1] The algorithm used by the SIMD quantization function cannot produce correct +### Significant changes relative to 1.1 beta1: + +1. The algorithm used by the SIMD quantization function cannot produce correct results when the JPEG quality is >= 98 and the fast integer forward DCT is used. Thus, the non-SIMD quantization function is now used for those cases, and libjpeg-turbo should now produce identical output to libjpeg v6b in all cases. -[2] Despite the above, the fast integer forward DCT still degrades somewhat for +2. Despite the above, the fast integer forward DCT still degrades somewhat for JPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically use the slow integer forward DCT when generating JPEG images of quality 96 or greater. This reduces compression performance by as much as 15% for these @@ -755,110 +787,121 @@ high-quality images but is necessary to ensure that the images are perceptually lossless. It also ensures that the library can avoid the performance pitfall created by [1]. -[3] Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler. +3. Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler. -[4] Fixed visual artifacts in grayscale JPEG compression caused by a typo in +4. Fixed visual artifacts in grayscale JPEG compression caused by a typo in the RGB-to-luminance lookup tables. -[5] The Windows distribution packages now include the libjpeg run-time programs +5. The Windows distribution packages now include the libjpeg run-time programs (cjpeg, etc.) -[6] All packages now include jpgtest. +6. All packages now include jpgtest. -[7] The TurboJPEG dynamic library now uses versioned symbols. +7. The TurboJPEG dynamic library now uses versioned symbols. -[8] Added two new TurboJPEG API functions, tjEncodeYUV() and -tjDecompressToYUV(), to replace the somewhat hackish TJ_YUV flag. +8. Added two new TurboJPEG API functions, `tjEncodeYUV()` and +`tjDecompressToYUV()`, to replace the somewhat hackish `TJ_YUV` flag. 1.0.90 (1.1 beta1) ================== -[1] Added emulation of the libjpeg v7 and v8 APIs and ABIs. See -README.md for more details. This feature was sponsored by CamTrace SAS. +### Significant changes relative to 1.0.1: -[2] Created a new CMake-based build system for the Visual C++ and MinGW builds. +1. Added emulation of the libjpeg v7 and v8 APIs and ABIs. See +[README.md](README.md) for more details. This feature was sponsored by +CamTrace SAS. -[3] Grayscale bitmaps can now be compressed from/decompressed to using the +2. Created a new CMake-based build system for the Visual C++ and MinGW builds. + +3. Grayscale bitmaps can now be compressed from/decompressed to using the TurboJPEG API. -[4] jpgtest can now be used to test decompression performance with existing +4. jpgtest can now be used to test decompression performance with existing JPEG images. -[5] If the default install prefix (/opt/libjpeg-turbo) is used, then -'make install' now creates /opt/libjpeg-turbo/lib32 and +5. If the default install prefix (/opt/libjpeg-turbo) is used, then +`make install` now creates /opt/libjpeg-turbo/lib32 and /opt/libjpeg-turbo/lib64 sym links to duplicate the behavior of the binary packages. -[6] All symbols in the libjpeg-turbo dynamic library are now versioned, even +6. All symbols in the libjpeg-turbo dynamic library are now versioned, even when the library is built with libjpeg v6b emulation. -[7] Added arithmetic encoding and decoding support (can be disabled with +7. Added arithmetic encoding and decoding support (can be disabled with configure or CMake options) -[8] Added a TJ_YUV flag to the TurboJPEG API, which causes both the compressor +8. Added a `TJ_YUV` flag to the TurboJPEG API, which causes both the compressor and decompressor to output planar YUV images. -[9] Added an extended version of tjDecompressHeader() to the TurboJPEG API, +9. Added an extended version of `tjDecompressHeader()` to the TurboJPEG API, which allows the caller to determine the type of subsampling used in a JPEG image. -[10] Added further protections against invalid Huffman codes. +10. Added further protections against invalid Huffman codes. 1.0.1 ===== -[1] The Huffman decoder will now handle erroneous Huffman codes (for instance, +### Significant changes relative to 1.0.0: + +1. The Huffman decoder will now handle erroneous Huffman codes (for instance, from a corrupt JPEG image.) Previously, these would cause libjpeg-turbo to crash under certain circumstances. -[2] Fixed typo in SIMD dispatch routines that was causing 4:2:2 upsampling to +2. Fixed typo in SIMD dispatch routines that was causing 4:2:2 upsampling to be used instead of 4:2:0 when decompressing JPEG images using SSE2 code. -[3] configure script will now automatically determine whether the -INCOMPLETE_TYPES_BROKEN macro should be defined. +3. The configure script will now automatically determine whether the +`INCOMPLETE_TYPES_BROKEN` macro should be defined. 1.0.0 ===== -[1] 2983700: Further FreeBSD build tweaks (no longer necessary to specify ---host when configuring on a 64-bit system) +### Significant changes relative to 0.0.93: -[2] Created symlinks in the Unix/Linux packages so that the TurboJPEG +1. 2983700: Further FreeBSD build tweaks (no longer necessary to specify +`--host` when configuring on a 64-bit system) + +2. Created symlinks in the Unix/Linux packages so that the TurboJPEG include file can always be found in /opt/libjpeg-turbo/include, the 32-bit static libraries can always be found in /opt/libjpeg-turbo/lib32, and the 64-bit static libraries can always be found in /opt/libjpeg-turbo/lib64. -[3] The Unix/Linux distribution packages now include the libjpeg run-time +3. The Unix/Linux distribution packages now include the libjpeg run-time programs (cjpeg, etc.) and man pages. -[4] Created a 32-bit supplementary package for amd64 Debian systems, which +4. Created a 32-bit supplementary package for amd64 Debian systems, which contains just the 32-bit libjpeg-turbo libraries. -[5] Moved the libraries from */lib32 to */lib in the i386 Debian package. +5. Moved the libraries from */lib32 to */lib in the i386 Debian package. -[6] Include distribution package for Cygwin +6. Include distribution package for Cygwin -[7] No longer necessary to specify --without-simd on non-x86 architectures, and -unit tests now work on those architectures. +7. No longer necessary to specify `--without-simd` on non-x86 architectures, +and unit tests now work on those architectures. 0.0.93 ====== -[1] 2982659, Fixed x86-64 build on FreeBSD systems +### Significant changes since 0.0.91: -[2] 2988188: Added support for Windows 64-bit systems +1. 2982659: Fixed x86-64 build on FreeBSD systems + +2. 2988188: Added support for Windows 64-bit systems 0.0.91 ====== -[1] Added documentation to .deb packages +### Significant changes relative to 0.0.90: -[2] 2968313: Fixed data corruption issues when decompressing large JPEG images +1. Added documentation to .deb packages + +2. 2968313: Fixed data corruption issues when decompressing large JPEG images and/or using buffered I/O with the libjpeg-turbo decompressor From 742fb37dde4235d6c2c17d15c423ea9d259c4ef7 Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 13 Mar 2016 18:28:14 -0500 Subject: [PATCH 135/140] change.log: Refer users to ChangeLog.md change.log is included only to document the changes that we have merged from libjpeg. --- change.log | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/change.log b/change.log index 563648a1..f090d778 100644 --- a/change.log +++ b/change.log @@ -1,5 +1,7 @@ -NOTE: This file was modified by The libjpeg-turbo Project to include only -information relevant to libjpeg-turbo. +libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project +to include only information relevant to libjpeg-turbo. It is included only for +reference. Please see ChangeLog.md for information specific to libjpeg-turbo. + CHANGE LOG for Independent JPEG Group's JPEG software From 1385f8b2811d0b21363ddf3c3d5040c4461aa354 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 14 Mar 2016 13:32:00 -0500 Subject: [PATCH 136/140] ChangeLog.md: Improve readability of plain text --- ChangeLog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 4fbcc0a6..0c45c67c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -309,6 +309,7 @@ the "official" libjpeg-turbo SDK for OS X. ### Significant changes relative to 1.3.1: 1. New features in the TurboJPEG API: + - YUV planar images can now be generated with an arbitrary line padding (previously only 4-byte padding, which was compatible with X Video, was supported.) @@ -475,6 +476,7 @@ source cleanup. md5sum executable to be present on other Un*x platforms. 2. Overhauled the packaging system: + - To avoid conflict with vendor-supplied libjpeg-turbo packages, the official RPMs and DEBs for libjpeg-turbo have been renamed to "libjpeg-turbo-official". From 28d1a1300c6be7fc8614ed827eb56cd97cf84e76 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 14 Apr 2016 14:12:46 -0500 Subject: [PATCH 137/140] BUILDING.md: Fix confusing Windows build reqs Indent "... OR ..." to make it clear that the choice is between Visual C++ and MinGW, not Visual C++ and MinGW + NASM. Move NASM to the top of the list to make that even more clear. Make it clear that nasm.exe should be in the PATH. Addresses concerns raised in #70 --- BUILDING.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index b4da23f2..f127918e 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -460,6 +460,10 @@ Build Requirements - [CMake](http://www.cmake.org) v2.8.8 or later +- [NASM](http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for + a 64-bit build) + * nasm.exe should be in your `PATH`. + - Microsoft Visual C++ 2005 or later If you don't already have Visual C++, then the easiest way to get it is by @@ -480,7 +484,7 @@ Build Requirements SDK. You can pass optional arguments to `SetEnv.cmd` to specify a 32-bit or 64-bit build environment. -... OR ... + ... OR ... - MinGW @@ -490,9 +494,6 @@ Build Requirements launch a command prompt with the appropriate compiler paths automatically set. -- [NASM](http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for - a 64-bit build) - - If building the TurboJPEG Java wrapper, JDK 1.5 or later is required. This can be downloaded from . From 2628c562bc74c177fd3965618dfee15204d4af5b Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 14 Apr 2016 14:19:19 -0500 Subject: [PATCH 138/140] BUILDING.md: Fix "... OR ..." indentation again GitHub doesn't render indented text the same as my local MarkDown viewer (MacDown), so it's necessary to indent "... OR ..." by 3 spaces so both will display it on the same indentation level as "Visual C++ 2005 or later" and "MinGW". --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index f127918e..04ce30c9 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -484,7 +484,7 @@ Build Requirements SDK. You can pass optional arguments to `SetEnv.cmd` to specify a 32-bit or 64-bit build environment. - ... OR ... + ... OR ... - MinGW From dec79952d6fe534b2b6cc0ab88238564c17e78dc Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 20 Apr 2016 11:27:42 -0500 Subject: [PATCH 139/140] Catch libjpeg errors in tjDecompressToYUV2() Even though tjDecompressToYUV2() is mostly just a wrapper for tjDecompressToYUVPlanes(), tjDecompressToYUV2() still calls jpeg_read_header(), so it needs to properly set up the libjpeg error handler prior to making this call. Otherwise, under very esoteric (and arguably incorrect) use cases, a program can call tjDecompressToYUV2() without first checking the JPEG header using tjDecompressHeader3(), and if the header is corrupt, tjDecompressToYUV2() will abort without triggering an error. Fixes #72 --- ChangeLog.md | 7 +++++++ turbojpeg.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 826f898b..7e40f76f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -19,6 +19,13 @@ included a similar fix for ASCII PPM/PGM files. Note that these issues were not security bugs, since they were confined to the cjpeg program and did not affect any of the libjpeg-turbo libraries. +4. Fixed an issue whereby attempting to decompress a JPEG file with a corrupt +header using the `tjDecompressToYUV2()` function would cause the function to +abort without returning an error. This only occurred if `tjDecompressToYUV2()` +was called prior to calling `tjDecompressHeader3()`, or if the return value +from `tjDecompressHeader3()` was ignored (both cases represent incorrect usage +of the TurboJPEG API.) + 1.4.90 (1.5 beta1) ================== diff --git a/turbojpeg.c b/turbojpeg.c index f51df789..421b5f8d 100644 --- a/turbojpeg.c +++ b/turbojpeg.c @@ -1892,6 +1892,12 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle, || !isPow2(pad) || height<0) _throw("tjDecompressToYUV2(): Invalid argument"); + if(setjmp(this->jerr.setjmp_buffer)) + { + /* If we get here, the JPEG code has signaled an error. */ + return -1; + } + jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize); jpeg_read_header(dinfo, TRUE); jpegSubsamp=getSubsamp(dinfo); From 1959e28b495003fd43e343b9de14426a9b2b4cab Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 21 Apr 2016 10:22:36 -0500 Subject: [PATCH 140/140] Increase severity of tjDecompressToYUV2() bug desc Actually, what happened was that the longjmp() call within my_error_exit() acted on the previous value of myerr->setjmp_buffer, which was probably set in a previous TurboJPEG function, such as tjInitDecompress(). Thus, when a libjpeg error was triggered within the body of tjDecompressToYUV2(), the PC jumped to the error handler of the previous TurboJPEG function, and this usually caused stack corruption in the calling program (because the signature and return type of the previous TurboJPEG function probably wasn't the same.) --- ChangeLog.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 7e40f76f..99ab5956 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -21,10 +21,11 @@ affect any of the libjpeg-turbo libraries. 4. Fixed an issue whereby attempting to decompress a JPEG file with a corrupt header using the `tjDecompressToYUV2()` function would cause the function to -abort without returning an error. This only occurred if `tjDecompressToYUV2()` -was called prior to calling `tjDecompressHeader3()`, or if the return value -from `tjDecompressHeader3()` was ignored (both cases represent incorrect usage -of the TurboJPEG API.) +abort without returning an error and, under certain circumstances, corrupt the +stack. This only occurred if `tjDecompressToYUV2()` was called prior to +calling `tjDecompressHeader3()`, or if the return value from +`tjDecompressHeader3()` was ignored (both cases represent incorrect usage of +the TurboJPEG API.) 1.4.90 (1.5 beta1)